[client,sdl] use std::make_shared

This commit is contained in:
Armin Novak
2026-02-10 14:32:07 +01:00
parent f8d85ac201
commit 6f6ab57eb7
2 changed files with 3 additions and 3 deletions

View File

@@ -25,7 +25,7 @@ bool SdlButtonList::populate(std::shared_ptr<SDL_Renderer>& renderer,
const size_t curOffsetX = offsetX + x * (static_cast<size_t>(width) + hpadding);
const SDL_FRect rect = { static_cast<float>(curOffsetX), static_cast<float>(offsetY),
static_cast<float>(width), static_cast<float>(height) };
std::shared_ptr<SdlButton> button(new SdlButton(renderer, labels[x], ids[x], rect));
auto button = std::make_shared<SdlButton>(renderer, labels[x], ids[x], rect);
_list.emplace_back(button);
}
return true;

View File

@@ -50,8 +50,8 @@ SdlInputWidgetPairList::SdlInputWidgetPairList(const std::string& title,
{
for (size_t x = 0; x < labels.size(); x++)
{
std::shared_ptr<SdlInputWidgetPair> widget(new SdlInputWidgetPair(
_renderer, labels[x], initial[x], flags[x], x, widget_width, widget_heigth));
auto widget = std::make_shared<SdlInputWidgetPair>(
_renderer, labels[x], initial[x], flags[x], x, widget_width, widget_heigth);
m_list.emplace_back(widget);
}