aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2019-07-02 23:24:35 +0200
committerEugene Sandulenko2019-09-03 17:17:08 +0200
commit41c1353edc7800af5bec95c082e594429b28301e (patch)
tree29494137975dc956f0a901c6cda94514ba09b1b0
parent6ffe0217097b07198952c7751b00f72aa83453d4 (diff)
downloadscummvm-rg350-41c1353edc7800af5bec95c082e594429b28301e.tar.gz
scummvm-rg350-41c1353edc7800af5bec95c082e594429b28301e.tar.bz2
scummvm-rg350-41c1353edc7800af5bec95c082e594429b28301e.zip
HDB: More portable struct initializers
-rw-r--r--engines/hdb/ai.h46
-rw-r--r--engines/hdb/gfx.h2
-rw-r--r--engines/hdb/map.h6
-rw-r--r--engines/hdb/window.h23
4 files changed, 61 insertions, 16 deletions
diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h
index bf6503fb05..f2259ba5d0 100644
--- a/engines/hdb/ai.h
+++ b/engines/hdb/ai.h
@@ -446,7 +446,13 @@ struct AIEntity {
uint16 moverightFrames;
Tile *moverightGfx[kMaxAnimFrames];
- AIEntity() : luaFuncInit(""), luaFuncAction(""), luaFuncUse(""), entityName(""), printedName("") {
+ AIEntity() {
+ luaFuncInit[0] = 0;
+ luaFuncAction[0] = 0;
+ luaFuncUse[0] = 0;
+ entityName[0] = 0;
+ printedName[0] = 0;
+
type = AI_NONE;
state = STATE_NONE;
dir = DIR_NONE;
@@ -585,7 +591,12 @@ struct DlvEnt {
char id[32];
- DlvEnt() : itemTextName(""), itemGfxName(""), itemGfx(NULL), destTextName(""), destGfxName(""), destGfx(NULL) {}
+ DlvEnt() : itemGfx(NULL), destGfx(NULL) {
+ itemTextName[0] = 0;
+ itemGfxName[0] = 0;
+ destTextName[0] = 0;
+ destGfxName[0] = 0;
+ }
};
struct Waypoint {
@@ -601,7 +612,11 @@ struct LuaT {
char luaFuncAction[32];
char luaFuncUse[32];
- LuaT() : x(0), y(0), value1(0), value2(0), luaFuncInit(""), luaFuncAction(""), luaFuncUse("") {}
+ LuaT() : x(0), y(0), value1(0), value2(0) {
+ luaFuncInit[0] = 0;
+ luaFuncAction[0] = 0;
+ luaFuncUse[0] = 0;
+ }
};
struct ActionInfo {
@@ -611,7 +626,11 @@ struct ActionInfo {
char luaFuncUse[32];
char entityName[32];
- ActionInfo() : x1(0), y1(0), x2(0), y2(0), luaFuncInit(""), luaFuncUse(""), entityName("") {}
+ ActionInfo() : x1(0), y1(0), x2(0), y2(0) {
+ luaFuncInit[0] = 0;
+ luaFuncUse[0] = 0;
+ entityName[0] = 0;
+ }
};
struct TeleInfo {
@@ -625,7 +644,10 @@ struct TeleInfo {
char luaFuncUse1[32];
char luaFuncUse2[32];
- TeleInfo() : x1(0), y1(0), x2(0), y2(0), dir1(DIR_NONE), dir2(DIR_NONE), level1(0), level2(0), usable1(0), usable2(0), anim1(0), anim2(0), luaFuncUse1(""), luaFuncUse2("") {}
+ TeleInfo() : x1(0), y1(0), x2(0), y2(0), dir1(DIR_NONE), dir2(DIR_NONE), level1(0), level2(0), usable1(0), usable2(0), anim1(0), anim2(0) {
+ luaFuncUse1[0] = 0;
+ luaFuncUse2[0] = 0;
+ }
};
struct SingleTele {
@@ -642,7 +664,11 @@ struct AutoAction {
char luaFuncUse[32];
char entityName[32];
- AutoAction() : x(0), y(0), activated(false), luaFuncInit(""), luaFuncUse(""), entityName("") {}
+ AutoAction() : x(0), y(0), activated(false) {
+ luaFuncInit[0] = 0;
+ luaFuncUse[0] = 0;
+ entityName[0] = 0;
+ }
};
struct ArrowPath {
@@ -665,7 +691,11 @@ struct Trigger {
char luaFuncInit[32];
char luaFuncUse[32];
- Trigger() : id(""), x(0), y(0), value1(0), value2(0), luaFuncInit(""), luaFuncUse("") {}
+ Trigger() : x(0), y(0), value1(0), value2(0) {
+ id[0] = 0;
+ luaFuncInit[0] = 0;
+ luaFuncUse[0] = 0;
+ }
};
struct CallbackDef {
@@ -706,7 +736,7 @@ struct CineBlit {
const char *id;
bool masked;
- CineBlit() : x(0), y(0), pic(NULL), name(""), id(""), masked(false) {}
+ CineBlit() : x(0), y(0), pic(NULL), name(NULL), id(NULL), masked(false) {}
};
#define onEvenTile(x, y) ( !(x & 31) && !(y & 31) )
diff --git a/engines/hdb/gfx.h b/engines/hdb/gfx.h
index 964af02841..d369edc040 100644
--- a/engines/hdb/gfx.h
+++ b/engines/hdb/gfx.h
@@ -66,7 +66,7 @@ struct GfxCache {
uint32 size;
int16 loaded;
- GfxCache() : name(""), tileGfx(NULL), size(0), loaded(0) {}
+ GfxCache() : tileGfx(NULL), size(0), loaded(0) { name[0] = 0; }
};
struct FontInfo {
diff --git a/engines/hdb/map.h b/engines/hdb/map.h
index 151bef94d4..fcbd82ea06 100644
--- a/engines/hdb/map.h
+++ b/engines/hdb/map.h
@@ -46,7 +46,11 @@ struct MSMIcon {
uint16 level; // which floor level entity is on
uint16 value1, value2;
- MSMIcon(): icon(0), x(0), y(0), funcInit(""), funcAction(""), funcUse(""), dir(0), level(0), value1(0), value2(0) {}
+ MSMIcon(): icon(0), x(0), y(0), dir(0), level(0), value1(0), value2(0) {
+ funcInit[0] = 0;
+ funcAction[0] = 0;
+ funcUse[0] = 0;
+ }
};
struct Foreground {
diff --git a/engines/hdb/window.h b/engines/hdb/window.h
index b74f5eedd7..f2175d4296 100644
--- a/engines/hdb/window.h
+++ b/engines/hdb/window.h
@@ -59,9 +59,13 @@ struct DialogInfo {
int el, er, et, eb; // saves the text edges
char luaMore[64]; // the name of the function to call after clicking the MORE button
- DialogInfo() : title(""), tileIndex(0), string(""), active(false), x(0), y(0),
+ DialogInfo() : tileIndex(0), active(false), x(0), y(0),
width(0), height(0), titleWidth(0), gfx(NULL), more(0), el(0), er(0), et(0),
- eb(0), luaMore("") {}
+ eb(0) {
+ title[0] = 0;
+ string[0] = 0;
+ luaMore[0] = 0;
+ }
};
struct DialogChoiceInfo {
@@ -81,11 +85,14 @@ struct DialogChoiceInfo {
int numChoices; // how many choices possible
char choices[10][64]; // ptrs to choice text
- DialogChoiceInfo() : title(""), text(""), func(""), active(false), x(0), y(0),
+ DialogChoiceInfo() : active(false), x(0), y(0),
width(0), height(0), textHeight(0), titleWidth(0), el(0), er(0), et(0),
eb(0), timeout(0), selection(0), numChoices(0) {
+ title[0] = 0;
+ text[0] = 0;
+ func[0] = 0;
for (int i = 0; i < 10; i++)
- strcpy(choices[i], "");
+ choices[i][0] = 0;
}
};
@@ -96,7 +103,9 @@ struct MessageInfo {
int x, y;
int width, height;
- MessageInfo() : active(false), title(""), timer(0), x(0), y(0), width(0), height(0) {}
+ MessageInfo() : active(false), timer(0), x(0), y(0), width(0), height(0) {
+ title[0] = 0;
+ }
};
struct InvWinInfo {
@@ -125,7 +134,9 @@ struct TOut {
int x, y;
uint32 timer;
- TOut() : text(""), x(0), y(0), timer(0) {}
+ TOut() : x(0), y(0), timer(0) {
+ text[0] = 0;
+ }
};
class Window {