diff options
author | Jonathan G Rennison <j.g.rennison@gmail.com> | 2020-05-27 21:09:31 +0100 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2020-05-27 22:22:56 +0200 |
commit | f11cd8f2d07b69eeedb5c3d3dc7c9ade37151707 (patch) | |
tree | 4268b30d7550b52848bc1e75c02ae435239f5ad4 | |
parent | 71e9c2a71b286fc7fc282398faee86eab401a047 (diff) | |
download | openttd-f11cd8f2d07b69eeedb5c3d3dc7c9ade37151707.tar.xz |
Fix: Compilation warnings in story_gui and script_story_page
See: #7896
-rw-r--r-- | src/script/api/script_story_page.cpp | 8 | ||||
-rw-r--r-- | src/story_gui.cpp | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/script/api/script_story_page.cpp b/src/script/api/script_story_page.cpp index 39ae3d53f..8fda69e6f 100644 --- a/src/script/api/script_story_page.cpp +++ b/src/script/api/script_story_page.cpp @@ -83,6 +83,10 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) case SPET_BUTTON_VEHICLE: refid = reference; break; + case SPET_TEXT: + break; + default: + NOT_REACHED(); } if (!ScriptObject::DoCommand(reftile, @@ -124,6 +128,10 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) case SPET_BUTTON_VEHICLE: refid = reference; break; + case SPET_TEXT: + break; + default: + NOT_REACHED(); } return ScriptObject::DoCommand(reftile, diff --git a/src/story_gui.cpp b/src/story_gui.cpp index 96c411fe9..2de96a1a5 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -459,7 +459,7 @@ protected: } } /* Position element in main column */ - LayoutCacheElement ce{ pe }; + LayoutCacheElement ce{ pe, {} }; ce.bounds.left = left_offset; ce.bounds.right = max_width - right_offset; ce.bounds.top = main_y; @@ -479,7 +479,7 @@ protected: std::vector<size_t> &cur_floats = (fl == ElementFloat::Left) ? left_floats : right_floats; /* Position element */ cur_width = max(cur_width, this->GetPageElementFloatWidth(*pe)); - LayoutCacheElement ce{ pe }; + LayoutCacheElement ce{ pe, {} }; ce.bounds.left = (fl == ElementFloat::Left) ? 0 : (max_width - cur_width); ce.bounds.right = (fl == ElementFloat::Left) ? cur_width : max_width; ce.bounds.top = cur_y; @@ -745,11 +745,7 @@ public: case SPET_BUTTON_PUSH: case SPET_BUTTON_TILE: case SPET_BUTTON_VEHICLE: { - const int height = FONT_HEIGHT_NORMAL; const int tmargin = WD_BEVEL_TOP + WD_FRAMETEXT_TOP; - const int bmargin = WD_BEVEL_BOTTOM + WD_FRAMETEXT_BOTTOM; - const int width = ce.bounds.right - ce.bounds.left; - const int hmargin = width / 5; const FrameFlags frame = this->active_button_id == ce.pe->index ? FR_LOWERED : FR_NONE; const Colours bgcolour = StoryPageButtonData{ ce.pe->referenced_id }.GetColour(); |