HDB: Fix compilation on Amiga

This commit is contained in:
Eugene Sandulenko 2019-09-03 21:07:51 +02:00
parent 8ec8b5fc7d
commit a7e30d0e7f
4 changed files with 20 additions and 13 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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) {}

View file

@ -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);