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

summaryrefslogtreecommitdiff
path: root/source/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'source/frontend')
-rw-r--r--source/frontend/StarCinematic.cpp5
-rw-r--r--source/frontend/StarCinematic.hpp32
-rw-r--r--source/frontend/StarMainInterface.cpp30
-rw-r--r--source/frontend/StarMainInterface.hpp20
4 files changed, 37 insertions, 50 deletions
diff --git a/source/frontend/StarCinematic.cpp b/source/frontend/StarCinematic.cpp
index 40fc8d1..7b095a6 100644
--- a/source/frontend/StarCinematic.cpp
+++ b/source/frontend/StarCinematic.cpp
@@ -12,7 +12,6 @@ const float vWidth = 960.0f;
const float vHeight = 540.0f;
Cinematic::Cinematic() {
- m_completionTime = 0;
m_completable = false;
m_suppressInput = false;
}
@@ -342,7 +341,7 @@ float Cinematic::currentTimecode() const {
Cinematic::PanelValues Cinematic::determinePanelValues(PanelPtr panel, float timecode) {
if (panel->endTime != 0) {
if (timecode > panel->endTime) {
- Cinematic::PanelValues result;
+ Cinematic::PanelValues result{};
result.alpha = 0;
return result;
}
@@ -350,7 +349,7 @@ Cinematic::PanelValues Cinematic::determinePanelValues(PanelPtr panel, float tim
if (panel->startTime != 0) {
if (timecode < panel->startTime) {
- Cinematic::PanelValues result;
+ Cinematic::PanelValues result{};
result.alpha = 0;
return result;
} else {
diff --git a/source/frontend/StarCinematic.hpp b/source/frontend/StarCinematic.hpp
index 96f40e7..a86523a 100644
--- a/source/frontend/StarCinematic.hpp
+++ b/source/frontend/StarCinematic.hpp
@@ -109,33 +109,33 @@ private:
// these include the time for background fades so they may not reflect the completion timecode
Clock m_timer;
- float m_completionTime;
+ float m_completionTime{};
Maybe<Vec4B> m_backgroundColor;
- float m_backgroundFadeTime;
+ float m_backgroundFadeTime{};
- float m_cameraZoom;
- Vec2F m_cameraPan;
+ float m_cameraZoom{1.0f};
+ Vec2F m_cameraPan{};
- float m_drawableScale;
- Vec2F m_drawableTranslation;
- Vec2F m_windowSize;
- RectI m_scissorRect;
+ float m_drawableScale{1.0f};
+ Vec2F m_drawableTranslation{};
+ Vec2F m_windowSize{};
+ RectI m_scissorRect{};
- bool m_scissor;
- bool m_letterbox;
+ bool m_scissor{true};
+ bool m_letterbox{true};
PlayerPtr m_player;
- Vec2F m_offset;
+ Vec2F m_offset{};
- bool m_skippable;
- bool m_suppressInput;
+ bool m_skippable{true};
+ bool m_suppressInput{false};
- bool m_muteSfx;
- bool m_muteMusic;
+ bool m_muteSfx{false};
+ bool m_muteMusic{false};
- bool m_completable;
+ bool m_completable{false};
};
}
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);
diff --git a/source/frontend/StarMainInterface.hpp b/source/frontend/StarMainInterface.hpp
index adba4e6..91a63ab 100644
--- a/source/frontend/StarMainInterface.hpp
+++ b/source/frontend/StarMainInterface.hpp
@@ -154,11 +154,11 @@ private:
void displayScriptPane(ScriptPanePtr& scriptPane, EntityId sourceEntity);
- GuiContext* m_guiContext;
+ GuiContext* m_guiContext{nullptr};
MainInterfaceConfigConstPtr m_config;
InterfaceCursor m_cursor;
- RunningState m_state;
+ RunningState m_state{Running};
UniverseClientPtr m_client;
WorldPainterPtr m_worldPainter;
@@ -192,7 +192,7 @@ private:
WirePanePtr m_wireInterface;
ActionBarPtr m_actionBar;
- Vec2I m_cursorScreenPos;
+ Vec2I m_cursorScreenPos{};
ItemSlotWidgetPtr m_cursorItem;
Maybe<String> m_cursorTooltip;
@@ -201,29 +201,29 @@ private:
GameTimer m_debugSpatialClearTimer;
GameTimer m_debugMapClearTimer;
- RectF m_debugTextRect;
+ RectF m_debugTextRect{RectF::null()};
NameplatePainterPtr m_nameplatePainter;
QuestIndicatorPainterPtr m_questIndicatorPainter;
ChatBubbleManagerPtr m_chatBubbleManager;
- bool m_disableHud;
+ bool m_disableHud{false};
String m_lastCommand;
LinkedList<GuiMessagePtr> m_messages;
HashMap<ItemDescriptor, std::pair<size_t, GuiMessagePtr>> m_itemDropMessages;
- unsigned m_messageOverflow;
+ unsigned m_messageOverflow{};
GuiMessagePtr m_overflowMessage;
List<pair<String, RpcPromiseKeeper<P2PJoinRequestReply>>> m_queuedJoinRequests;
- EntityId m_lastMouseoverTarget;
+ EntityId m_lastMouseoverTarget{NullEntityId};
GameTimer m_stickyTargetingTimer;
- int m_portraitScale;
+ int m_portraitScale{};
- EntityId m_specialDamageBarTarget;
- float m_specialDamageBarValue;
+ EntityId m_specialDamageBarTarget{NullEntityId};
+ float m_specialDamageBarValue{};
ContainerInteractorPtr m_containerInteractor;
};