summaryrefslogtreecommitdiff
path: root/src/story_gui.cpp
diff options
context:
space:
mode:
authorJonathan G Rennison <j.g.rennison@gmail.com>2020-05-27 21:09:31 +0100
committerNiels Martin Hansen <nielsm@indvikleren.dk>2020-05-27 22:22:56 +0200
commitf11cd8f2d07b69eeedb5c3d3dc7c9ade37151707 (patch)
tree4268b30d7550b52848bc1e75c02ae435239f5ad4 /src/story_gui.cpp
parent71e9c2a71b286fc7fc282398faee86eab401a047 (diff)
downloadopenttd-f11cd8f2d07b69eeedb5c3d3dc7c9ade37151707.tar.xz
Fix: Compilation warnings in story_gui and script_story_page
See: #7896
Diffstat (limited to 'src/story_gui.cpp')
-rw-r--r--src/story_gui.cpp8
1 files changed, 2 insertions, 6 deletions
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();