Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/frontend/StarMainInterface.cpp
diff options
context:
space:
mode:
authorKai Blaschke <kai.blaschke@kb-dev.net>2024-02-19 23:29:39 +0100
committerKai Blaschke <kai.blaschke@kb-dev.net>2024-02-19 23:44:59 +0100
commitd0099a6d790b66f21e4e266e569d64fb82fb0a81 (patch)
tree69174faa3f95079e5e33e00970d161c9b3f02048 /source/frontend/StarMainInterface.cpp
parent42fc1d6714036a2814f1e6ab293eaa0009320ef4 (diff)
Fixed some uninitialized members
May have caused undefined behavior in few cases, as most of the fixed members were used before being initialized.
Diffstat (limited to 'source/frontend/StarMainInterface.cpp')
-rw-r--r--source/frontend/StarMainInterface.cpp30
1 files changed, 9 insertions, 21 deletions
diff --git a/source/frontend/StarMainInterface.cpp b/source/frontend/StarMainInterface.cpp
index a0ed3ae..b7c93d1 100644
--- a/source/frontend/StarMainInterface.cpp
+++ b/source/frontend/StarMainInterface.cpp
@@ -65,24 +65,14 @@ GuiMessage::GuiMessage() : message(), cooldown(), springState() {}
GuiMessage::GuiMessage(String const& message, float cooldown, float spring)
: message(message), cooldown(cooldown), springState(spring) {}
-MainInterface::MainInterface(UniverseClientPtr client, WorldPainterPtr painter, CinematicPtr cinematicOverlay) {
- m_state = Running;
-
- m_guiContext = GuiContext::singletonPtr();
-
- m_client = client;
- m_worldPainter = painter;
- m_cinematicOverlay = cinematicOverlay;
-
- m_disableHud = false;
-
- m_cursorScreenPos = Vec2I();
- m_state = Running;
-
- m_config = MainInterfaceConfig::loadFromAssets();
-
- m_containerInteractor = make_shared<ContainerInteractor>();
-
+MainInterface::MainInterface(UniverseClientPtr client, WorldPainterPtr painter, CinematicPtr cinematicOverlay)
+ : m_guiContext(GuiContext::singletonPtr())
+ , m_config(MainInterfaceConfig::loadFromAssets())
+ , m_client(std::move(client))
+ , m_worldPainter(std::move(painter))
+ , m_cinematicOverlay(std::move(cinematicOverlay))
+ , m_containerInteractor(make_shared<ContainerInteractor>())
+{
GuiReader itemSlotReader;
m_cursorItem = convert<ItemSlotWidget>(itemSlotReader.makeSingle("cursorItemSlot", m_config->cursorItemSlot));
@@ -90,9 +80,7 @@ MainInterface::MainInterface(UniverseClientPtr client, WorldPainterPtr painter,
m_debugSpatialClearTimer = GameTimer(m_config->debugSpatialClearTime);
m_debugMapClearTimer = GameTimer(m_config->debugMapClearTime);
- m_debugTextRect = RectF::null();
- m_lastMouseoverTarget = NullEntityId;
m_stickyTargetingTimer = GameTimer(m_config->monsterHealthBarTime);
m_inventoryWindow = make_shared<InventoryPane>(this, m_client->mainPlayer(), m_containerInteractor);
@@ -183,7 +171,7 @@ MainInterface::MainInterface(UniverseClientPtr client, WorldPainterPtr painter,
m_paneManager.registerPane(MainInterfacePanes::PlanetText, PaneLayer::Hud, planetName);
m_nameplatePainter = make_shared<NameplatePainter>();
- m_questIndicatorPainter = make_shared<QuestIndicatorPainter>(client);
+ m_questIndicatorPainter = make_shared<QuestIndicatorPainter>(m_client);
m_chatBubbleManager = make_shared<ChatBubbleManager>();
m_paneManager.displayRegisteredPane(MainInterfacePanes::ActionBar);