aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins
diff options
context:
space:
mode:
Diffstat (limited to 'engines/hopkins')
-rw-r--r--engines/hopkins/globals.cpp3
-rw-r--r--engines/hopkins/globals.h7
-rw-r--r--engines/hopkins/hopkins.cpp6
-rw-r--r--engines/hopkins/objects.cpp16
-rw-r--r--engines/hopkins/saveload.cpp14
5 files changed, 21 insertions, 25 deletions
diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp
index f16f54abbc..b4a6d7953d 100644
--- a/engines/hopkins/globals.cpp
+++ b/engines/hopkins/globals.cpp
@@ -135,8 +135,7 @@ Globals::Globals() {
_catalogSize = 0;
iRegul = 0;
_exitId = 0;
- PLANX = PLANY = 0;
- PLANI = 0;
+ _mapCarPosX = _mapCarPosY = 0;
PERSO = 0;
_screenId = 0;
_prevScreenId = 0;
diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h
index 2aacfbbb5e..dce74b14e0 100644
--- a/engines/hopkins/globals.h
+++ b/engines/hopkins/globals.h
@@ -284,8 +284,8 @@ struct Sauvegarde {
CharacterLocation _realHopkins;
CharacterLocation _samantha;
int16 _inventory[35]; // Originally at offset 1300 of data array
- int16 PLANX;
- int16 PLANY;
+ int16 _mapCarPosX;
+ int16 _mapCarPosY;
};
struct CreditItem {
@@ -372,8 +372,7 @@ public:
uint32 _catalogSize;
int iRegul;
int _exitId;
- int PLANX, PLANY;
- int PLANI;
+ int _mapCarPosX, _mapCarPosY;
int _screenId;
int _prevScreenId;
int Max_Propre;
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index a04081705b..1097b31b40 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -179,7 +179,7 @@ bool HopkinsEngine::runWin95Demo() {
_globals.iRegul = 1;
_globals.PERSO = _fileManager.loadFile("PERSO.SPR");
_globals.PERSO_TYPE = 0;
- _globals.PLANX = _globals.PLANY = 0;
+ _globals._mapCarPosX = _globals._mapCarPosY = 0;
memset(_globals._saveData, 0, 2000);
_globals._exitId = 0;
@@ -473,7 +473,7 @@ bool HopkinsEngine::runLinuxDemo() {
_globals.iRegul = 0;
_globals.PERSO = _fileManager.loadFile("PERSO.SPR");
_globals.PERSO_TYPE = 0;
- _globals.PLANX = _globals.PLANY = 0;
+ _globals._mapCarPosX = _globals._mapCarPosY = 0;
memset(_globals._saveData, 0, 2000);
_globals._exitId = 0;
@@ -831,7 +831,7 @@ bool HopkinsEngine::runFull() {
_globals.iRegul = 0;
_globals.PERSO = _fileManager.loadFile("PERSO.SPR");
_globals.PERSO_TYPE = 0;
- _globals.PLANX = _globals.PLANY = 0;
+ _globals._mapCarPosX = _globals._mapCarPosY = 0;
memset(_globals._saveData, 0, 2000);
_globals._exitId = 0;
for (;;) {
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp
index 7ca01203ef..3dbe129705 100644
--- a/engines/hopkins/objects.cpp
+++ b/engines/hopkins/objects.cpp
@@ -2192,13 +2192,12 @@ void ObjectsManager::PLAN_BETA() {
_vm->_globals.CACHE_OFF(20);
_vm->_globals.CACHE_ON();
- if (!_vm->_globals.PLANX && !_vm->_globals.PLANY) {
- _vm->_globals.PLANX = 900;
- _vm->_globals.PLANY = 319;
- _vm->_globals.PLANI = 1;
+ if (!_vm->_globals._mapCarPosX && !_vm->_globals._mapCarPosY) {
+ _vm->_globals._mapCarPosX = 900;
+ _vm->_globals._mapCarPosY = 319;
}
- addStaticSprite(_spritePtr, Common::Point(_vm->_globals.PLANX, _vm->_globals.PLANY), 0, _vm->_globals.PLANI, 0, 0, 5, 5);
- _vm->_eventsManager.setMouseXY(_vm->_globals.PLANX, _vm->_globals.PLANY);
+ addStaticSprite(_spritePtr, Common::Point(_vm->_globals._mapCarPosX, _vm->_globals._mapCarPosY), 0, 1, 0, 0, 5, 5);
+ _vm->_eventsManager.setMouseXY(_vm->_globals._mapCarPosX, _vm->_globals._mapCarPosY);
my_anim = 0;
_vm->_eventsManager.mouseOn();
_vm->_graphicsManager.scrollScreen(getSpriteX(0) - 320);
@@ -2256,9 +2255,8 @@ void ObjectsManager::PLAN_BETA() {
_vm->_graphicsManager.fadeOutLong();
_vm->_globals.iRegul = 0;
_vm->_graphicsManager._noFadingFl = false;
- _vm->_globals.PLANX = getSpriteX(0);
- _vm->_globals.PLANY = getSpriteY(0);
- _vm->_globals.PLANI = 1;
+ _vm->_globals._mapCarPosX = getSpriteX(0);
+ _vm->_globals._mapCarPosY = getSpriteY(0);
removeSprite(0);
_spritePtr = _vm->_globals.freeMemory(_spritePtr);
clearScreen();
diff --git a/engines/hopkins/saveload.cpp b/engines/hopkins/saveload.cpp
index 179145d20d..35d52005bb 100644
--- a/engines/hopkins/saveload.cpp
+++ b/engines/hopkins/saveload.cpp
@@ -146,8 +146,8 @@ Common::Error SaveLoadManager::saveGame(int slot, const Common::String &saveName
for (int i = 0; i < 35; ++i)
_vm->_globals._saveData->_inventory[i] = _vm->_globals._inventory[i];
- _vm->_globals._saveData->PLANX = _vm->_globals.PLANX;
- _vm->_globals._saveData->PLANY = _vm->_globals.PLANY;
+ _vm->_globals._saveData->_mapCarPosX = _vm->_globals._mapCarPosX;
+ _vm->_globals._saveData->_mapCarPosY = _vm->_globals._mapCarPosY;
/* Create the savegame */
Common::OutSaveFile *savefile = g_system->getSavefileManager()->openForSaving(_vm->generateSaveName(slot));
@@ -205,8 +205,8 @@ Common::Error SaveLoadManager::loadGame(int slot) {
_vm->_globals._exitId = _vm->_globals._saveData->data[svField5];
_vm->_globals._saveData->data[svField6] = 0;
_vm->_globals._screenId = 0;
- _vm->_globals.PLANX = _vm->_globals._saveData->PLANX;
- _vm->_globals.PLANY = _vm->_globals._saveData->PLANY;
+ _vm->_globals._mapCarPosX = _vm->_globals._saveData->_mapCarPosX;
+ _vm->_globals._mapCarPosY = _vm->_globals._saveData->_mapCarPosY;
return Common::kNoError;
}
@@ -266,10 +266,10 @@ void SaveLoadManager::syncSavegameData(Common::Serializer &s, int version) {
s.syncAsSint16LE(_vm->_globals._saveData->_inventory[i]);
if (version > 1) {
- s.syncAsSint16LE(_vm->_globals._saveData->PLANX);
- s.syncAsSint16LE(_vm->_globals._saveData->PLANY);
+ s.syncAsSint16LE(_vm->_globals._saveData->_mapCarPosX);
+ s.syncAsSint16LE(_vm->_globals._saveData->_mapCarPosY);
} else {
- _vm->_globals._saveData->PLANX = _vm->_globals._saveData->PLANY = 0;
+ _vm->_globals._saveData->_mapCarPosX = _vm->_globals._saveData->_mapCarPosY = 0;
}
}