diff options
author | Strangerke | 2013-01-02 16:04:15 +0100 |
---|---|---|
committer | Strangerke | 2013-01-02 16:04:15 +0100 |
commit | 7c88b9c54e8e5f45132b6211f2ef5c0268f1f532 (patch) | |
tree | 25c0c87f4000a4f9c111f3be0b1c4d5721fac301 /engines | |
parent | 74d1e3e0137bfdc49936054999c2b3bd9d011e8a (diff) | |
download | scummvm-rg350-7c88b9c54e8e5f45132b6211f2ef5c0268f1f532.tar.gz scummvm-rg350-7c88b9c54e8e5f45132b6211f2ef5c0268f1f532.tar.bz2 scummvm-rg350-7c88b9c54e8e5f45132b6211f2ef5c0268f1f532.zip |
HOPKINS: Silence some GCC warning (thanks to eriktorbjorn)
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hopkins/anim.cpp | 18 | ||||
-rw-r--r-- | engines/hopkins/font.cpp | 2 | ||||
-rw-r--r-- | engines/hopkins/globals.cpp | 6 | ||||
-rw-r--r-- | engines/hopkins/lines.cpp | 3 | ||||
-rw-r--r-- | engines/hopkins/objects.cpp | 73 | ||||
-rw-r--r-- | engines/hopkins/saveload.cpp | 23 | ||||
-rw-r--r-- | engines/hopkins/script.cpp | 1 | ||||
-rw-r--r-- | engines/hopkins/talk.cpp | 7 |
8 files changed, 59 insertions, 74 deletions
diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp index 36466a2090..1a7f29c965 100644 --- a/engines/hopkins/anim.cpp +++ b/engines/hopkins/anim.cpp @@ -218,10 +218,10 @@ EXIT: void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint32 a3, uint32 a4) { int v5; int v8; - byte *ptr; - int v11; - byte *v12; - byte *v13; + byte *ptr = NULL; + int oldScrollVal; + byte *v12 = NULL; + byte *v13 = NULL; int v15; size_t nbytes; byte buf[6]; @@ -264,7 +264,7 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint f.read(v12, nbytes); _vm->_graphicsManager.clearPalette(); - v11 = _vm->_graphicsManager.SCROLL; + oldScrollVal = _vm->_graphicsManager.SCROLL; _vm->_graphicsManager.SCANLINE(SCREEN_WIDTH); _vm->_graphicsManager.scrollScreen(0); _vm->_graphicsManager.lockScreen(); @@ -317,8 +317,8 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint _vm->_graphicsManager.lockScreen(); _vm->_graphicsManager.clearScreen(); _vm->_graphicsManager.unlockScreen(); - _vm->_graphicsManager.SCROLL = v11; - _vm->_graphicsManager.scrollScreen(v11); + _vm->_graphicsManager.SCROLL = oldScrollVal; + _vm->_graphicsManager.scrollScreen(oldScrollVal); if (_vm->_graphicsManager._largeScreenFl) { _vm->_graphicsManager.SCANLINE(1280); _vm->_graphicsManager.max_x = 1280; @@ -447,8 +447,8 @@ LABEL_114: _vm->_graphicsManager.lockScreen(); _vm->_graphicsManager.clearScreen(); _vm->_graphicsManager.unlockScreen(); - _vm->_graphicsManager.SCROLL = v11; - _vm->_graphicsManager.scrollScreen(v11); + _vm->_graphicsManager.SCROLL = oldScrollVal; + _vm->_graphicsManager.scrollScreen(oldScrollVal); if (_vm->_graphicsManager._largeScreenFl) { _vm->_graphicsManager.SCANLINE(1280); _vm->_graphicsManager.max_x = 1280; diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp index 069c9dc714..4d0aa14dfe 100644 --- a/engines/hopkins/font.cpp +++ b/engines/hopkins/font.cpp @@ -134,7 +134,6 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in Common::File f; int v73 = xp; - int v70 = yp; if (idx < 0) error("Bad number for text"); _vm->_globals.police_l = 11; @@ -367,7 +366,6 @@ LABEL_57: int v28 = _vm->_eventsManager._startPos.x + 315 - v27; v73 = _vm->_eventsManager._startPos.x + 315 - v27; _text[idx]._pos.y = 50; - v70 = 50; posY = 50; posX = v28; } diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp index becb8a2767..a8385f34a9 100644 --- a/engines/hopkins/globals.cpp +++ b/engines/hopkins/globals.cpp @@ -192,7 +192,8 @@ Globals::Globals() { // Initialise pointers ICONE = NULL; BUF_ZONE = NULL; - CACHE_BANQUE[6] = NULL; + for (int idx = 0; idx < 6; ++idx) + CACHE_BANQUE[idx] = NULL; texte_tmp = NULL; SPRITE_ECRAN = NULL; _saveData = NULL; @@ -246,7 +247,8 @@ Globals::~Globals() { freeMemory(TETE); freeMemory(police); freeMemory(BUF_ZONE); - freeMemory(CACHE_BANQUE[6]); + for (int idx = 0; idx < 6; ++idx) + CACHE_BANQUE[idx] = freeMemory(CACHE_BANQUE[idx]); freeMemory(texte_tmp); freeMemory(SPRITE_ECRAN); freeMemory((byte *)_saveData); diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp index 78096fcf38..c3a3d617cb 100644 --- a/engines/hopkins/lines.cpp +++ b/engines/hopkins/lines.cpp @@ -310,8 +310,9 @@ void LinesManager::AJOUTE_LIGNE(int idx, int a2, int a3, int a4, int a5, int a6, Ligne[idx].field6 = 2; Ligne[idx].field8 = 6; } - // This copndition is impossible to meet! + // This condition is impossible to meet! // Code present in the Linux and BeOS executables + // CHECKME: maybe it should be checking negative values? if (v11 == -1 && v37 <= 249 && v37 > 1000) { Ligne[idx].field6 = 8; Ligne[idx].field8 = 4; diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index 8cc859be78..549f131f9b 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -732,7 +732,7 @@ void ObjectsManager::CALCUL_BOB(int idx) { if (deltaY >= 0) { deltaY = _vm->_graphicsManager.zoomIn(deltaY, v21); } else { - int deltaY = deltaX; + deltaY = deltaX; if (deltaX < 0) deltaY = -deltaX; deltaY = -_vm->_graphicsManager.zoomIn(deltaY, v21); @@ -2965,7 +2965,6 @@ int16 *ObjectsManager::PARC_VOITURE(int a1, int a2, int a3, int a4) { int v73; int v74; int v75; - int v76[10]; int v77[10]; int v82[10]; int v87[10]; @@ -3098,43 +3097,40 @@ int16 *ObjectsManager::PARC_VOITURE(int a1, int a2, int a3, int a4) { v87[v24] = -1; v82[v24] = 0; v77[v24] = 1300; - v76[v24] = 1300; } if (_vm->_linesManager.colision2_ligne(a1, a2, &v82[1], &v87[1], 0, _lastLine)) { v69 = v87[1]; v68 = v82[1]; - } else { - if (_vm->_linesManager.colision2_ligne(a1, a2, &v82[1], &v87[1], 0, _vm->_linesManager._linesNumb)) { - v27 = 0; - for (;;) { - v28 = _vm->_globals.essai2[v27]; - v29 = _vm->_globals.essai2[v27 + 1]; - v66 = _vm->_globals.essai2[v27 + 2]; - v27 += 4; - if (_vm->_linesManager.colision2_ligne(v28, v29, &v82[1], &v87[1], 0, _lastLine)) - break; - v32 = v67; - _vm->_globals.super_parcours[v32] = v28; - _vm->_globals.super_parcours[v32 + 1] = v29; - _vm->_globals.super_parcours[v32 + 2] = v66; - _vm->_globals.super_parcours[v32 + 3] = 0; - - v33 = _vm->_globals.essai0; - _vm->_globals.essai0[v32] = v28; - v33[v32 + 1] = v29; - v33[v32 + 2] = v66; - v33[v32 + 3] = 0; - v67 += 4; - if (v28 == -1) - goto LABEL_90; - } - v69 = v87[1]; - v68 = v82[1]; - } else { - v69 = 1; - v68 = 1; - v67 = 0; + } else if (_vm->_linesManager.colision2_ligne(a1, a2, &v82[1], &v87[1], 0, _vm->_linesManager._linesNumb)) { + v27 = 0; + for (;;) { + v28 = _vm->_globals.essai2[v27]; + v29 = _vm->_globals.essai2[v27 + 1]; + v66 = _vm->_globals.essai2[v27 + 2]; + v27 += 4; + if (_vm->_linesManager.colision2_ligne(v28, v29, &v82[1], &v87[1], 0, _lastLine)) + break; + v32 = v67; + _vm->_globals.super_parcours[v32] = v28; + _vm->_globals.super_parcours[v32 + 1] = v29; + _vm->_globals.super_parcours[v32 + 2] = v66; + _vm->_globals.super_parcours[v32 + 3] = 0; + + v33 = _vm->_globals.essai0; + _vm->_globals.essai0[v32] = v28; + v33[v32 + 1] = v29; + v33[v32 + 2] = v66; + v33[v32 + 3] = 0; + v67 += 4; + if (v28 == -1) + goto LABEL_90; } + v69 = v87[1]; + v68 = v82[1]; + } else { + v69 = 1; + v68 = 1; + v67 = 0; } LABEL_90: if (v69 < v73) { @@ -3760,7 +3756,7 @@ void ObjectsManager::OPTI_OBJET() { } if (data[0] != 'I' || data[1] != 'N' || data[2] != 'I') - error("File %s is not an INI file"); + error("File %s is not an INI file", file.c_str()); bool v7 = false; do { @@ -4233,8 +4229,6 @@ int ObjectsManager::BOBA(int idx) { } void ObjectsManager::INILINK(const Common::String &file) { - int v1; - int v2; int v8; int v9; int v10; @@ -4260,9 +4254,6 @@ void ObjectsManager::INILINK(const Common::String &file) { Common::String filename, filename2; Common::File f; - v1 = 0; - v2 = 0; - filename = file + ".LNK"; ptr = _vm->_fileManager.searchCat(filename, 3); nbytes = _vm->_globals._catalogSize; @@ -4976,7 +4967,7 @@ void ObjectsManager::handleForest(int screenId, int minX, int maxX, int minY, in } void ObjectsManager::lockAnimX(int idx, int a2) { - _vm->_globals._lockedAnims[idx]._enableFl; + _vm->_globals._lockedAnims[idx]._enableFl = true; _vm->_globals._lockedAnims[idx]._posX = a2; } diff --git a/engines/hopkins/saveload.cpp b/engines/hopkins/saveload.cpp index dafde79dc5..bed7a0d6b6 100644 --- a/engines/hopkins/saveload.cpp +++ b/engines/hopkins/saveload.cpp @@ -147,43 +147,42 @@ Common::Error SaveLoadManager::saveGame(int slot, const Common::String &saveName _vm->_globals._saveData->_inventory[i] = _vm->_globals._inventory[i]; /* Create the savegame */ - Common::OutSaveFile *saveFile = g_system->getSavefileManager()->openForSaving( - _vm->generateSaveName(slot)); - if (!saveFile) + Common::OutSaveFile *savefile = g_system->getSavefileManager()->openForSaving(_vm->generateSaveName(slot)); + if (!savefile) return Common::kCreatingFileFailed; // Set up the serializer - Common::Serializer serializer(NULL, saveFile); + Common::Serializer serializer(NULL, savefile); // Write out the savegame header hopkinsSavegameHeader header; header._saveName = saveName; header._version = HOPKINS_SAVEGAME_VERSION; - writeSavegameHeader(saveFile, header); + writeSavegameHeader(savefile, header); // Write out the savegame data syncSavegameData(serializer); // Save file complete - saveFile->finalize(); - delete saveFile; + savefile->finalize(); + delete savefile; return Common::kNoError; } Common::Error SaveLoadManager::loadGame(int slot) { // Try and open the save file for reading - Common::InSaveFile *saveFile = g_system->getSavefileManager()->openForLoading( + Common::InSaveFile *savefile = g_system->getSavefileManager()->openForLoading( _vm->generateSaveName(slot)); - if (!saveFile) + if (!savefile) return Common::kReadingFailed; // Set up the serializer - Common::Serializer serializer(saveFile, NULL); + Common::Serializer serializer(savefile, NULL); // Read in the savegame header hopkinsSavegameHeader header; - readSavegameHeader(saveFile, header); + readSavegameHeader(savefile, header); if (header._thumbnail) header._thumbnail->free(); delete header._thumbnail; @@ -192,7 +191,7 @@ Common::Error SaveLoadManager::loadGame(int slot) { syncSavegameData(serializer); // Loading save file complete - delete saveFile; + delete savefile; // Unpack the inventory for (int i = 0; i < 35; ++i) diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp index 1add672380..ced66cd628 100644 --- a/engines/hopkins/script.cpp +++ b/engines/hopkins/script.cpp @@ -2375,7 +2375,6 @@ int ScriptManager::handleOpcode(byte *dataP) { case 607: if (!_vm->_globals._internetFl) { memcpy(_vm->_graphicsManager._oldPalette, _vm->_graphicsManager._palette, 769); - _vm->_graphicsManager._oldPalette[769]; _vm->_animationManager.playAnim2("PLAN.ANM", 50, 10, 800); } _vm->_globals.NBBLOC = 0; diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp index 1a1778913e..c321b82334 100644 --- a/engines/hopkins/talk.cpp +++ b/engines/hopkins/talk.cpp @@ -358,7 +358,6 @@ int TalkManager::DIALOGUE_REP(int idx) { int v1; int v2; byte *v3; - int i; int v6; int v7; byte *v8; @@ -383,13 +382,12 @@ int TalkManager::DIALOGUE_REP(int idx) { v1 = 0; v2 = 0; v3 = _characterBuffer + 110; - for (i = idx; (int16)READ_LE_UINT16(v3) != idx; v3 = _characterBuffer + 20 * v1 + 110) { + for (; (int16)READ_LE_UINT16(v3) != idx; v3 = _characterBuffer + 20 * v1 + 110) { ++v1; if ((int16)READ_LE_UINT16((uint16 *)_characterBuffer + 42) < v1) v2 = 1; if (v2 == 1) return -1; -// HIWORD(i) = HIWORD(BUFFERPERSO); } if (v2 == 1) return -1; @@ -397,7 +395,6 @@ int TalkManager::DIALOGUE_REP(int idx) { v22 = (int16)READ_LE_UINT16((uint16 *)v3 + 1); v25 = (int16)READ_LE_UINT16((uint16 *)v3 + 2); v24 = (int16)READ_LE_UINT16((uint16 *)v3 + 3); - i = (int16)READ_LE_UINT16((uint16 *)v3 + 4); v23 = (int16)READ_LE_UINT16((uint16 *)v3 + 4); PLIGNE1 = (int16)READ_LE_UINT16((uint16 *)v3 + 5); PLIGNE2 = (int16)READ_LE_UINT16((uint16 *)v3 + 6); @@ -453,7 +450,6 @@ int TalkManager::DIALOGUE_REP(int idx) { if (_vm->_eventsManager._mouseButton || _vm->_eventsManager._curMouseButton) v14 = v6; if (_vm->_eventsManager.getMouseButton()) { - i = 5; tmpVal = v6 / 5; if (tmpVal < 0) tmpVal = -tmpVal; @@ -1070,7 +1066,6 @@ void TalkManager::REPONSE2(int a1, int a2) { } void TalkManager::OBJET_VIVANT(const Common::String &a2) { - int v5; byte *v11; Common::String s; Common::String v20; |