diff options
author | Strangerke | 2013-02-19 21:12:57 +0100 |
---|---|---|
committer | Strangerke | 2013-02-19 21:12:57 +0100 |
commit | 213914c04538ce636007a1cd895f56ee56db3aca (patch) | |
tree | f2a509a4ceb712bafa875ae51175a017d4bf40e3 /engines/hopkins | |
parent | 0f786d83a2a23b7bc1d3789fa5d06facb68f6465 (diff) | |
download | scummvm-rg350-213914c04538ce636007a1cd895f56ee56db3aca.tar.gz scummvm-rg350-213914c04538ce636007a1cd895f56ee56db3aca.tar.bz2 scummvm-rg350-213914c04538ce636007a1cd895f56ee56db3aca.zip |
HOPKINS: Some renaming in Globals
Diffstat (limited to 'engines/hopkins')
-rw-r--r-- | engines/hopkins/globals.cpp | 14 | ||||
-rw-r--r-- | engines/hopkins/globals.h | 10 | ||||
-rw-r--r-- | engines/hopkins/hopkins.cpp | 50 | ||||
-rw-r--r-- | engines/hopkins/lines.cpp | 10 | ||||
-rw-r--r-- | engines/hopkins/objects.cpp | 22 | ||||
-rw-r--r-- | engines/hopkins/script.cpp | 4 |
6 files changed, 55 insertions, 55 deletions
diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp index f08dd59db6..340b40ed46 100644 --- a/engines/hopkins/globals.cpp +++ b/engines/hopkins/globals.cpp @@ -126,15 +126,15 @@ Globals::Globals() { _menuDisplayType = 0; _sortedDisplayCount = 0; NOT_VERIF = false; - PERSO_TYPE = 0; + _characterType = 0; GOACTION = false; Compteur = 0; _actionDirection = DIR_NONE; - Credit_bx = -1; - Credit_bx1 = -1; - Credit_by = -1; - Credit_by1 = -1; + _creditsStartX = -1; + _creditsEndX = -1; + _creditsStartY = -1; + _creditsEndY = -1; _creditsPosY = 0; _creditsLineNumb = 0; memset(_creditsItem, 0, 12000); @@ -269,10 +269,10 @@ void Globals::clearAll() { } void Globals::loadCharacterData() { - assert(PERSO_TYPE >= 0 && PERSO_TYPE <= 2); + assert(_characterType >= 0 && _characterType <= 2); const int *srcList[] = { HOPKINS_PERSO_0, HOPKINS_PERSO_1, HOPKINS_PERSO_2 }; - const int *srcP = srcList[PERSO_TYPE]; + const int *srcP = srcList[_characterType]; for (int idx = 0; idx < 240 / 4; ++idx) { Hopkins[idx].field0 = *srcP++; diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h index 7e063bf38c..241beb5a8e 100644 --- a/engines/hopkins/globals.h +++ b/engines/hopkins/globals.h @@ -269,6 +269,7 @@ public: int _sortedDisplayCount; int _oldMouseZoneId; int _oldMouseX, _oldMouseY; + int _characterType; uint _speed; byte *_answerBuffer; Sauvegarde *_saveData; @@ -280,10 +281,10 @@ public: int _creditsLineNumb; int _creditsStep; int _creditsPosY; - int Credit_bx; - int Credit_bx1; - int Credit_by; - int Credit_by1; + int _creditsStartX; + int _creditsEndX; + int _creditsStartY; + int _creditsEndY; int _menuSpeed; int _menuSoundOff; @@ -310,7 +311,6 @@ public: BqeAnimItem Bqe_Anim[35]; byte *SPRITE_ECRAN; byte *PERSO; - int PERSO_TYPE; bool NOT_VERIF; ObjetWItem ObjetW[300]; int NUM_FICHIER_OBJ; diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index 1a4d497ef3..ded9be606d 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -150,7 +150,7 @@ bool HopkinsEngine::runWin95Demo() { _graphicsManager.fadeOutLong(); _globals.iRegul = 1; _globals.PERSO = _fileManager.loadFile("PERSO.SPR"); - _globals.PERSO_TYPE = 0; + _globals._characterType = 0; _objectsManager._mapCarPosX = _objectsManager._mapCarPosY = 0; memset(_globals._saveData, 0, 2000); _globals._exitId = 0; @@ -440,7 +440,7 @@ bool HopkinsEngine::runLinuxDemo() { _globals.iRegul = 0; _globals.PERSO = _fileManager.loadFile("PERSO.SPR"); - _globals.PERSO_TYPE = 0; + _globals._characterType = 0; _objectsManager._mapCarPosX = _objectsManager._mapCarPosY = 0; memset(_globals._saveData, 0, 2000); _globals._exitId = 0; @@ -798,7 +798,7 @@ bool HopkinsEngine::runFull() { } _globals.iRegul = 0; _globals.PERSO = _fileManager.loadFile("PERSO.SPR"); - _globals.PERSO_TYPE = 0; + _globals._characterType = 0; _objectsManager._mapCarPosX = _objectsManager._mapCarPosY = 0; memset(_globals._saveData, 0, 2000); @@ -1517,7 +1517,7 @@ bool HopkinsEngine::runFull() { //_globals._exitId = WBASE(); // Handles the 3D Doom level (Windows) _soundManager.stopSound(); _globals.PERSO = _fileManager.loadFile("PERSO.SPR"); - _globals.PERSO_TYPE = 0; + _globals._characterType = 0; _globals.iRegul = 0; _graphicsManager._lineNbr = SCREEN_WIDTH; break; @@ -2189,7 +2189,7 @@ void HopkinsEngine::playEnding() { _globals._exitId = 300; } _globals.PERSO = _fileManager.loadFile("PERSO.SPR"); - _globals.PERSO_TYPE = 0; + _globals._characterType = 0; _globals.iRegul = 0; } @@ -2434,20 +2434,20 @@ void HopkinsEngine::displayCredits(int startPosY, byte *buffer, char colour) { int startPosX = 320 - strWidth / 2; int endPosX = strWidth + startPosX; int endPosY = startPosY + 12; - if ((_globals.Credit_bx == -1) && (_globals.Credit_bx1 == -1) && (_globals.Credit_by == -1) && (_globals.Credit_by1 == -1)) { - _globals.Credit_bx = startPosX; - _globals.Credit_bx1 = endPosX; - _globals.Credit_by = startPosY; - _globals.Credit_by1 = endPosY; + if ((_globals._creditsStartX == -1) && (_globals._creditsEndX == -1) && (_globals._creditsStartY == -1) && (_globals._creditsEndY == -1)) { + _globals._creditsStartX = startPosX; + _globals._creditsEndX = endPosX; + _globals._creditsStartY = startPosY; + _globals._creditsEndY = endPosY; } - if (startPosX < _globals.Credit_bx) - _globals.Credit_bx = startPosX; - if (endPosX > _globals.Credit_bx1) - _globals.Credit_bx1 = endPosX; - if (_globals.Credit_by > startPosY) - _globals.Credit_by = startPosY; - if (endPosY > _globals.Credit_by1) - _globals.Credit_by1 = endPosY; + if (startPosX < _globals._creditsStartX) + _globals._creditsStartX = startPosX; + if (endPosX > _globals._creditsEndX) + _globals._creditsEndX = endPosX; + if (_globals._creditsStartY > startPosY) + _globals._creditsStartY = startPosY; + if (endPosY > _globals._creditsEndY) + _globals._creditsEndY = endPosY; bufPtr = buffer; for (;;) { @@ -2469,7 +2469,7 @@ void HopkinsEngine::displayCredits() { _soundManager.playSound(28); _eventsManager._mouseFl = false; _globals.iRegul = 3; - _globals.Credit_bx = _globals.Credit_bx1 = _globals.Credit_by = _globals.Credit_by1 = -1; + _globals._creditsStartX = _globals._creditsEndX = _globals._creditsStartY = _globals._creditsEndY = -1; int soundId = 28; do { for (int i = 0; i < _globals._creditsLineNumb; ++i) { @@ -2500,7 +2500,7 @@ void HopkinsEngine::displayCredits() { } } --_globals._creditsPosY; - if (_globals.Credit_bx != -1 || _globals.Credit_bx1 != -1 || _globals.Credit_by != -1 || _globals.Credit_by1 != -1) { + if (_globals._creditsStartX != -1 || _globals._creditsEndX != -1 || _globals._creditsStartY != -1 || _globals._creditsEndY != -1) { _eventsManager.VBL(); _graphicsManager.copySurface(_graphicsManager._vesaScreen, 60, 50, 520, 380, _graphicsManager._vesaBuffer, 60, 50); } else { @@ -2513,10 +2513,10 @@ void HopkinsEngine::displayCredits() { soundId = 28; _soundManager.playSound(soundId); } - _globals.Credit_bx = -1; - _globals.Credit_bx1 = -1; - _globals.Credit_by = -1; - _globals.Credit_by1 = -1; + _globals._creditsStartX = -1; + _globals._creditsEndX = -1; + _globals._creditsStartY = -1; + _globals._creditsEndY = -1; } while ((_eventsManager.getMouseButton() != 1) && (!g_system->getEventManager()->shouldQuit())); _graphicsManager.fadeOutLong(); _globals.iRegul = 1; @@ -2829,7 +2829,7 @@ void HopkinsEngine::OCEAN(int16 curExitId, Common::String backgroundFilename, Di _objectsManager.removeSprite(0); _objectsManager.clearScreen(); _globals.PERSO = _fileManager.loadFile("PERSO.SPR"); - _globals.PERSO_TYPE = 0; + _globals._characterType = 0; } void HopkinsEngine::syncSoundSettings() { diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp index bedf5db73f..f63b4a2adc 100644 --- a/engines/hopkins/lines.cpp +++ b/engines/hopkins/lines.cpp @@ -2497,7 +2497,7 @@ int LinesManager::TEST_LIGNE(int paramX, int paramY, int *a3, int *foundLineIdx, int posY = lineData[2 * (lineDataEndIdx - 1) + 1]; if (Ligne[idx]._directionRouteInc == DIR_DOWN || Ligne[idx]._directionRouteInc == DIR_UP) posY += 2; - if (Ligne[idx]._directionRouteInc == DIR_RIGHT || Ligne[idx]._directionRouteDec == 7) + if (Ligne[idx]._directionRouteInc == DIR_RIGHT || Ligne[idx]._directionRouteDec == DIR_LEFT) posX += 2; if (!checkCollisionLine(posX, posY, &collDataIdx, &collLineIdx, 0, _lastLine)) error("Error in test line"); @@ -2511,7 +2511,7 @@ int LinesManager::TEST_LIGNE(int paramX, int paramY, int *a3, int *foundLineIdx, int posY = lineData[1]; if (Ligne[idx]._directionRouteInc == DIR_DOWN || Ligne[idx]._directionRouteInc == DIR_UP) posY -= 2; - if (Ligne[idx]._directionRouteInc == DIR_RIGHT || Ligne[idx]._directionRouteDec == 7) + if (Ligne[idx]._directionRouteInc == DIR_RIGHT || Ligne[idx]._directionRouteDec == DIR_LEFT) posX -= 2; if (!checkCollisionLine(posX, posY, &collDataIdx, &collLineIdx, 0, _lastLine)) error("Error in test line"); @@ -2524,18 +2524,18 @@ int LinesManager::TEST_LIGNE(int paramX, int paramY, int *a3, int *foundLineIdx, } int LinesManager::CALC_PROPRE(int idx) { - int retVal = 25; int size = _vm->_globals._spriteSize[idx]; - if (_vm->_globals.PERSO_TYPE == 1) { + if (_vm->_globals._characterType == 1) { if (size < 0) size = -size; size = 20 * (5 * size - 100) / -80; - } else if (_vm->_globals.PERSO_TYPE == 2) { + } else if (_vm->_globals._characterType == 2) { if (size < 0) size = -size; size = 20 * (5 * size - 165) / -67; } + int retVal = 25; if (size < 0) retVal = _vm->_graphicsManager.zoomOut(25, -size); else if (size > 0) diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index 0507d723ca..575c34caa7 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -2130,7 +2130,7 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha loc = &_vm->_globals._saveData->_realHopkins; _vm->_globals.PERSO = _vm->_fileManager.loadFile("PERSO.SPR"); - _vm->_globals.PERSO_TYPE = 0; + _vm->_globals._characterType = 0; addStaticSprite(_vm->_globals.PERSO, loc->_pos, 0, 64, loc->_zoomFactor, false, 34, 190); animateSprite(0); _vm->_globals.loadCharacterData(); @@ -2155,7 +2155,7 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha loc = &_vm->_globals._saveData->_samantha; _vm->_globals.PERSO = _vm->_fileManager.loadFile("PSAMAN.SPR"); - _vm->_globals.PERSO_TYPE = 2; + _vm->_globals._characterType = 2; addStaticSprite(_vm->_globals.PERSO, loc->_pos, 0, 64, loc->_zoomFactor, false, 20, 127); animateSprite(0); _vm->_globals.loadCharacterData(); @@ -2218,9 +2218,9 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha // Check Size void ObjectsManager::computeAndSetSpriteSize() { int size = _vm->_globals._spriteSize[getSpriteY(0)]; - if (_vm->_globals.PERSO_TYPE == 1) { + if (_vm->_globals._characterType == 1) { size = 20 * (5 * abs(size) - 100) / -80; - } else if (_vm->_globals.PERSO_TYPE == 2) { + } else if (_vm->_globals._characterType == 2) { size = 20 * (5 * abs(size) - 165) / -67; } setSpriteZoom(0, size); @@ -3799,24 +3799,24 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm _vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(251, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0); - if (_vm->_globals.PERSO_TYPE) { + if (_vm->_globals._characterType) { if (!_vm->_globals._saveData->_data[svField122] && !_vm->_globals._saveData->_data[svField356]) { _vm->_globals.PERSO = _vm->_fileManager.loadFile("PERSO.SPR"); - _vm->_globals.PERSO_TYPE = 0; + _vm->_globals._characterType = 0; } } - if (!_vm->_globals.PERSO_TYPE) { + if (!_vm->_globals._characterType) { if (_vm->_globals._saveData->_data[svField122] == 1) { _vm->_globals.PERSO = _vm->_fileManager.loadFile("HOPFEM.SPR"); - _vm->_globals.PERSO_TYPE = 1; + _vm->_globals._characterType = 1; } } - if (_vm->_globals.PERSO_TYPE != 2 && _vm->_globals._saveData->_data[svField356] == 1) { + if (_vm->_globals._characterType != 2 && _vm->_globals._saveData->_data[svField356] == 1) { _vm->_globals.PERSO = _vm->_fileManager.loadFile("PSAMAN.SPR"); - _vm->_globals.PERSO_TYPE = 2; + _vm->_globals._characterType = 2; } _vm->_globals.loadCharacterData(); - switch (_vm->_globals.PERSO_TYPE) { + switch (_vm->_globals._characterType) { case 0: addStaticSprite(_vm->_globals.PERSO, _characterPos, 0, _startSpriteIndex, 0, false, 34, 190); break; diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp index cf2b61c8bf..ea0c728c49 100644 --- a/engines/hopkins/script.cpp +++ b/engines/hopkins/script.cpp @@ -926,7 +926,7 @@ int ScriptManager::handleOpcode(byte *dataP) { case 56: _vm->_globals.PERSO = _vm->_fileManager.loadFile("HOPFEM.SPR"); - _vm->_globals.PERSO_TYPE = 1; + _vm->_globals._characterType = 1; _vm->_globals._saveData->_data[svField122] = 1; _vm->_globals.loadCharacterData(); _vm->_objectsManager._sprite[0].field12 = 28; @@ -936,7 +936,7 @@ int ScriptManager::handleOpcode(byte *dataP) { case 57: _vm->_globals.PERSO = _vm->_fileManager.loadFile("PERSO.SPR"); - _vm->_globals.PERSO_TYPE = 0; + _vm->_globals._characterType = 0; _vm->_globals._saveData->_data[svField122] = 0; _vm->_globals.loadCharacterData(); _vm->_objectsManager._sprite[0].field12 = 34; |