Skip to content

Commit

Permalink
reshade: prefer make_shared over shared_pointer(new X)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoyvwac authored and misyltoad committed Apr 15, 2024
1 parent f88723f commit b16cf1b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/reshade_effect_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,55 +494,55 @@ static std::vector<std::shared_ptr<ReshadeUniform>> createReshadeUniforms(const
auto sourceAnnotation = std::find_if(uniform.annotations.begin(), uniform.annotations.end(), [](const auto& a) { return a.name == "source"; });
if (sourceAnnotation == uniform.annotations.end())
{
uniforms.push_back(std::shared_ptr<ReshadeUniform>(new DataUniform(uniform)));
uniforms.push_back(std::make_shared<DataUniform>(uniform));
continue;
}
else
{
auto& source = sourceAnnotation->value.string_data;
if (source == "frametime")
{
uniforms.push_back(std::shared_ptr<ReshadeUniform>(new FrameTimeUniform(uniform)));
uniforms.push_back(std::make_shared<FrameTimeUniform>(uniform));
}
else if (source == "framecount")
{
uniforms.push_back(std::shared_ptr<ReshadeUniform>(new FrameCountUniform(uniform)));
uniforms.push_back(std::make_shared<FrameCountUniform>(uniform));
}
else if (source == "date")
{
uniforms.push_back(std::shared_ptr<ReshadeUniform>(new DateUniform(uniform)));
uniforms.push_back(std::make_shared<DateUniform>(uniform));
}
else if (source == "timer")
{
uniforms.push_back(std::shared_ptr<ReshadeUniform>(new TimerUniform(uniform)));
uniforms.push_back(std::make_shared<TimerUniform>(uniform));
}
else if (source == "pingpong")
{
uniforms.push_back(std::shared_ptr<ReshadeUniform>(new PingPongUniform(uniform)));
uniforms.push_back(std::make_shared<PingPongUniform>(uniform));
}
else if (source == "random")
{
uniforms.push_back(std::shared_ptr<ReshadeUniform>(new RandomUniform(uniform)));
uniforms.push_back(std::make_shared<RandomUniform>(uniform));
}
else if (source == "key")
{
uniforms.push_back(std::shared_ptr<ReshadeUniform>(new KeyUniform(uniform)));
uniforms.push_back(std::make_shared<KeyUniform>(uniform));
}
else if (source == "mousebutton")
{
uniforms.push_back(std::shared_ptr<ReshadeUniform>(new MouseButtonUniform(uniform)));
uniforms.push_back(std::make_shared<MouseButtonUniform>(uniform));
}
else if (source == "mousepoint")
{
uniforms.push_back(std::shared_ptr<ReshadeUniform>(new MousePointUniform(uniform)));
uniforms.push_back(std::make_shared<MousePointUniform>(uniform));
}
else if (source == "mousedelta")
{
uniforms.push_back(std::shared_ptr<ReshadeUniform>(new MouseDeltaUniform(uniform)));
uniforms.push_back(std::make_shared<MouseDeltaUniform>(uniform));
}
else if (source == "bufready_depth")
{
uniforms.push_back(std::shared_ptr<ReshadeUniform>(new DepthUniform(uniform)));
uniforms.push_back(std::make_shared<DepthUniform>(uniform));
}
else
{
Expand Down

0 comments on commit b16cf1b

Please sign in to comment.