aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2019-09-03 21:07:51 +0200
committerEugene Sandulenko2019-09-03 21:08:13 +0200
commita7e30d0e7f62aad9aceadd674f1b51146f20958d (patch)
treef9d34dbf466428dd456c19b4371a85695c1410d7
parent8ec8b5fc7d60df0f57883dd819d3db0f6626d8d2 (diff)
downloadscummvm-rg350-a7e30d0e7f62aad9aceadd674f1b51146f20958d.tar.gz
scummvm-rg350-a7e30d0e7f62aad9aceadd674f1b51146f20958d.tar.bz2
scummvm-rg350-a7e30d0e7f62aad9aceadd674f1b51146f20958d.zip
HDB: Fix compilation on Amiga
-rw-r--r--engines/hdb/menu.cpp4
-rw-r--r--engines/hdb/saveload.cpp2
-rw-r--r--engines/hdb/sound.h10
-rw-r--r--engines/hdb/window.cpp17
4 files changed, 20 insertions, 13 deletions
diff --git a/engines/hdb/menu.cpp b/engines/hdb/menu.cpp
index 8e20653cdf..4a4bea7d49 100644
--- a/engines/hdb/menu.cpp
+++ b/engines/hdb/menu.cpp
@@ -1285,7 +1285,9 @@ void Menu::fillSavegameSlots() {
Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(saveGameFile);
if (!in) {
- memset(&_saveGames[i], 0, sizeof(Save));
+ _saveGames[i].seconds = 0;
+ _saveGames[i].saveID[0] = 0;
+ _saveGames[i].mapName[0] = 0;
} else {
Graphics::skipThumbnail(*in);
diff --git a/engines/hdb/saveload.cpp b/engines/hdb/saveload.cpp
index acf1092577..64cd3e7b2e 100644
--- a/engines/hdb/saveload.cpp
+++ b/engines/hdb/saveload.cpp
@@ -65,7 +65,7 @@ Common::Error HDBGame::saveGameState(int slot, const Common::String &desc) {
Graphics::saveThumbnail(*out);
- memset(&_saveHeader, 0, sizeof(Save));
+ _saveHeader.fileSlot = 0;
strcpy(_saveHeader.saveID, saveFileName.c_str());
_saveHeader.seconds = _timeSeconds + (_timePlayed / 1000);
strcpy(_saveHeader.mapName, _inMapName);
diff --git a/engines/hdb/sound.h b/engines/hdb/sound.h
index 4d2e6eea86..d49b522487 100644
--- a/engines/hdb/sound.h
+++ b/engines/hdb/sound.h
@@ -1446,11 +1446,11 @@ enum SndType {
};
struct SoundCache {
- SndMem loaded; // -1 = freeable; in memory, 0 = not cached, 1 = cached
- int32 size; // size of sound
- const char *name; // filename / MSD name
- const char *luaName; // name used by Lua for i.d.
- SndType ext; // 0 = Uninitialized, -1 = WAV, 1 = MP3
+ SndMem loaded; // -1 = freeable; in memory, 0 = not cached, 1 = cached
+ int size; // size of sound
+ const char *name; // filename / MSD name
+ const char *luaName; // name used by Lua for i.d.
+ SndType ext; // 0 = Uninitialized, -1 = WAV, 1 = MP3
byte *data;
SoundCache() : loaded(SNDMEM_NOTCACHED), size(0), name(nullptr), luaName(nullptr), ext(SNDTYPE_NONE), data(nullptr) {}
diff --git a/engines/hdb/window.cpp b/engines/hdb/window.cpp
index 044347ce08..0f89c364a5 100644
--- a/engines/hdb/window.cpp
+++ b/engines/hdb/window.cpp
@@ -574,7 +574,9 @@ void Window::openDialog(const char *title, int tileIndex, const char *string, in
if (_dialogInfo.active)
return;
- memset(&_dialogInfo, 0, sizeof(_dialogInfo));
+ _dialogInfo.gfx = NULL;
+ _dialogInfo.el = _dialogInfo.er = _dialogInfo.et = _dialogInfo.eb = 0;
+ _dialogInfo.luaMore[0] = 0;
_dialogInfo.tileIndex = tileIndex;
strcpy(_dialogInfo.title, title);
@@ -791,18 +793,21 @@ void Window::setDialogDelay(int delay) {
void Window::openDialogChoice(const char *title, const char *text, const char *func, int numChoices, const char *choices[10]) {
int width, height, titleWidth, titleHeight;
- int e1, e2, e3, e4, i;
+ int e1, e2, e3, e4;
if (_dialogInfo.active)
return;
- memset(&_dialogChoiceInfo, 0, sizeof(_dialogChoiceInfo));
+ _dialogChoiceInfo.el = _dialogChoiceInfo.er = _dialogChoiceInfo.et = _dialogChoiceInfo.eb = 0;
+ for (int i = 0; i < 10; i++)
+ _dialogChoiceInfo.choices[i][0] = 0;
+
strcpy(_dialogChoiceInfo.title, title);
strcpy(_dialogChoiceInfo.text, text);
strcpy(_dialogChoiceInfo.func, func);
_dialogChoiceInfo.numChoices = numChoices;
- for (i = 0; i < numChoices; i++)
+ for (int i = 0; i < numChoices; i++)
strcpy(_dialogChoiceInfo.choices[i], choices[i]);
_dialogChoiceInfo.active = true;
@@ -811,7 +816,7 @@ void Window::openDialogChoice(const char *title, const char *text, const char *f
g_hdb->_gfx->getDimensions(text, &width, &height);
g_hdb->_gfx->getDimensions(title, &titleWidth, &titleHeight);
- for (i = 0; i < 10; i++)
+ for (int i = 0; i < 10; i++)
if (choices[i]) {
int w, h;
g_hdb->_gfx->getDimensions(choices[i], &w, &h);
@@ -948,7 +953,7 @@ void Window::openMessageBar(const char *title, int time) {
return;
}
- memset(&_msgInfo, 0, sizeof(_msgInfo));
+ _msgInfo.y = 0;
_msgInfo.timer = (time * kGameFPS);
strcpy(_msgInfo.title, title);