1
0
Fork 0

(svn r26973) [1.4] -Backport from trunk:

- Fix: Image widgets stored 32bit SpriteID in uint16 (r26971)
- Fix: Compilation on HAIKU (r26922)
- Fix: Crash when enabling 'Full animation' if multiplayer chat text is on screen [FS#6096] (r26919)
- Fix: Height computation of game script text in town GUI did not consider margins [FS#6119] (r26859)
release/1.4
frosch 2014-10-06 20:14:44 +00:00
parent 628b52921f
commit ee3f8c3ef2
5 changed files with 9 additions and 6 deletions

View File

@ -18,6 +18,7 @@
#include "transparency.h" #include "transparency.h"
#include "blitter/factory.hpp" #include "blitter/factory.hpp"
#include "video/video_driver.hpp" #include "video/video_driver.hpp"
#include "window_func.h"
/* The type of set we're replacing */ /* The type of set we're replacing */
#define SET_TYPE "graphics" #define SET_TYPE "graphics"
@ -297,6 +298,7 @@ void CheckBlitter()
ClearFontCache(); ClearFontCache();
GfxClearSpriteCache(); GfxClearSpriteCache();
ReInitAllWindows();
} }
/** Initialise and load all the sprites. */ /** Initialise and load all the sprites. */

View File

@ -21,6 +21,7 @@
#include <unistd.h> #include <unistd.h>
#define _GNU_SOURCE #define _GNU_SOURCE
#define TROUBLED_INTS #define TROUBLED_INTS
#include <strings.h>
#elif defined(__NDS__) #elif defined(__NDS__)
#include <nds/jtypes.h> #include <nds/jtypes.h>
#define TROUBLED_INTS #define TROUBLED_INTS

View File

@ -404,7 +404,7 @@ public:
if (this->town->text != NULL) { if (this->town->text != NULL) {
SetDParamStr(0, this->town->text); SetDParamStr(0, this->town->text);
DrawStringMultiLine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_LEFT, y += FONT_HEIGHT_NORMAL, UINT16_MAX, STR_JUST_RAW_STRING, TC_BLACK); DrawStringMultiLine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y += FONT_HEIGHT_NORMAL, UINT16_MAX, STR_JUST_RAW_STRING, TC_BLACK);
} }
} }
@ -482,7 +482,7 @@ public:
if (this->town->text != NULL) { if (this->town->text != NULL) {
SetDParamStr(0, this->town->text); SetDParamStr(0, this->town->text);
aimed_height += GetStringHeight(STR_JUST_RAW_STRING, width); aimed_height += GetStringHeight(STR_JUST_RAW_STRING, width - WD_FRAMERECT_LEFT - WD_FRAMERECT_RIGHT);
} }
return aimed_height; return aimed_height;

View File

@ -2094,7 +2094,7 @@ Dimension NWidgetLeaf::dropdown_dimension = {0, 0};
* @param data Data of the widget. * @param data Data of the widget.
* @param tip Tooltip of the widget. * @param tip Tooltip of the widget.
*/ */
NWidgetLeaf::NWidgetLeaf(WidgetType tp, Colours colour, int index, uint16 data, StringID tip) : NWidgetCore(tp, colour, 1, 1, data, tip) NWidgetLeaf::NWidgetLeaf(WidgetType tp, Colours colour, int index, uint32 data, StringID tip) : NWidgetCore(tp, colour, 1, 1, data, tip)
{ {
assert(index >= 0 || tp == WWT_LABEL || tp == WWT_TEXT || tp == WWT_CAPTION || tp == WWT_RESIZEBOX || tp == WWT_SHADEBOX || tp == WWT_DEFSIZEBOX || tp == WWT_DEBUGBOX || tp == WWT_STICKYBOX || tp == WWT_CLOSEBOX); assert(index >= 0 || tp == WWT_LABEL || tp == WWT_TEXT || tp == WWT_CAPTION || tp == WWT_RESIZEBOX || tp == WWT_SHADEBOX || tp == WWT_DEFSIZEBOX || tp == WWT_DEBUGBOX || tp == WWT_STICKYBOX || tp == WWT_CLOSEBOX);
if (index >= 0) this->SetIndex(index); if (index >= 0) this->SetIndex(index);

View File

@ -769,7 +769,7 @@ private:
*/ */
class NWidgetLeaf : public NWidgetCore { class NWidgetLeaf : public NWidgetCore {
public: public:
NWidgetLeaf(WidgetType tp, Colours colour, int index, uint16 data, StringID tip); NWidgetLeaf(WidgetType tp, Colours colour, int index, uint32 data, StringID tip);
/* virtual */ void SetupSmallestSize(Window *w, bool init_array); /* virtual */ void SetupSmallestSize(Window *w, bool init_array);
/* virtual */ void Draw(const Window *w); /* virtual */ void Draw(const Window *w);
@ -856,7 +856,7 @@ static inline uint ComputeMaxSize(uint base, uint max_space, uint step)
* @ingroup NestedWidgetParts * @ingroup NestedWidgetParts
*/ */
struct NWidgetPartDataTip { struct NWidgetPartDataTip {
uint16 data; ///< Data value of the widget. uint32 data; ///< Data value of the widget.
StringID tooltip; ///< Tooltip of the widget. StringID tooltip; ///< Tooltip of the widget.
}; };
@ -1011,7 +1011,7 @@ static inline NWidgetPart EndContainer()
* @param tip Tooltip of the widget. * @param tip Tooltip of the widget.
* @ingroup NestedWidgetParts * @ingroup NestedWidgetParts
*/ */
static inline NWidgetPart SetDataTip(uint16 data, StringID tip) static inline NWidgetPart SetDataTip(uint32 data, StringID tip)
{ {
NWidgetPart part; NWidgetPart part;