summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2012-12-25 22:10:43 +0000
committerpeter1138 <peter1138@openttd.org>2012-12-25 22:10:43 +0000
commit1ef4f7712dec1142a4ff35f8a59f649a5643156c (patch)
treefea1ad652b7950220c60eb0914224214e82d942b
parent629efeedb42aab1d679ac0723a1342b03c05af73 (diff)
downloadopenttd-1ef4f7712dec1142a4ff35f8a59f649a5643156c.tar.xz
(svn r24853) -Fix: Extend widget data member to 32 bits so that sprite IDs >= 2^16 can be used.
-rw-r--r--src/newgrf_gui.cpp2
-rw-r--r--src/widget.cpp4
-rw-r--r--src/widget_type.h6
3 files changed, 6 insertions, 6 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index e052cc19c..11896a57d 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -1212,7 +1212,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback {
has_missing |= c->status == GCS_NOT_FOUND;
has_compatible |= HasBit(c->flags, GCF_COMPATIBLE);
}
- uint16 widget_data;
+ uint32 widget_data;
StringID tool_tip;
if (has_missing || has_compatible) {
widget_data = STR_NEWGRF_SETTINGS_FIND_MISSING_CONTENT_BUTTON;
diff --git a/src/widget.cpp b/src/widget.cpp
index df001815b..6ebb5b17b 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -822,7 +822,7 @@ void NWidgetResizeBase::AssignSizePosition(SizingType sizing, uint x, uint y, ui
* @param widget_data Data component of the widget. @see Widget::data
* @param tool_tip Tool tip of the widget. @see Widget::tootips
*/
-NWidgetCore::NWidgetCore(WidgetType tp, Colours colour, uint fill_x, uint fill_y, uint16 widget_data, StringID tool_tip) : NWidgetResizeBase(tp, fill_x, fill_y)
+NWidgetCore::NWidgetCore(WidgetType tp, Colours colour, uint fill_x, uint fill_y, uint32 widget_data, StringID tool_tip) : NWidgetResizeBase(tp, fill_x, fill_y)
{
this->colour = colour;
this->index = -1;
@@ -846,7 +846,7 @@ void NWidgetCore::SetIndex(int index)
* @param widget_data Data to use.
* @param tool_tip Tool tip string to use.
*/
-void NWidgetCore::SetDataTip(uint16 widget_data, StringID tool_tip)
+void NWidgetCore::SetDataTip(uint32 widget_data, StringID tool_tip)
{
this->widget_data = widget_data;
this->tool_tip = tool_tip;
diff --git a/src/widget_type.h b/src/widget_type.h
index 6d267e1b5..495c5267d 100644
--- a/src/widget_type.h
+++ b/src/widget_type.h
@@ -281,10 +281,10 @@ DECLARE_ENUM_AS_BIT_SET(NWidgetDisplay)
*/
class NWidgetCore : public NWidgetResizeBase {
public:
- NWidgetCore(WidgetType tp, Colours colour, uint fill_x, uint fill_y, uint16 widget_data, StringID tool_tip);
+ NWidgetCore(WidgetType tp, Colours colour, uint fill_x, uint fill_y, uint32 widget_data, StringID tool_tip);
void SetIndex(int index);
- void SetDataTip(uint16 widget_data, StringID tool_tip);
+ void SetDataTip(uint32 widget_data, StringID tool_tip);
inline void SetLowered(bool lowered);
inline bool IsLowered() const;
@@ -300,7 +300,7 @@ public:
NWidgetDisplay disp_flags; ///< Flags that affect display and interaction with the widget.
Colours colour; ///< Colour of this widget.
int index; ///< Index of the nested widget in the widget array of the window (\c -1 means 'not used').
- uint16 widget_data; ///< Data of the widget. @see Widget::data
+ uint32 widget_data; ///< Data of the widget. @see Widget::data
StringID tool_tip; ///< Tooltip of the widget. @see Widget::tootips
int scrollbar_index; ///< Index of an attached scrollbar.
TextColour highlight_colour; ///< Colour of highlight.