Skip to content

Commit

Permalink
HOPKINS: Move some more members to LinesManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Jan 27, 2013
1 parent a50c05f commit b9f9b2c
Show file tree
Hide file tree
Showing 9 changed files with 419 additions and 415 deletions.
2 changes: 1 addition & 1 deletion engines/hopkins/dialogs.cpp
Expand Up @@ -399,7 +399,7 @@ void DialogsManager::showInventory() {
break;

_vm->_scriptManager.TRAVAILOBJET = true;
_vm->_globals._saveData->_data[svField3] = _vm->_globals._curObjectIndex;
_vm->_globals._saveData->_data[svField3] = _vm->_objectsManager._curObjectIndex;
_vm->_globals._saveData->_data[svField8] = _vm->_globals._inventory[newInventoryItem];
_vm->_globals._saveData->_data[svField9] = _vm->_eventsManager._mouseCursorId;
_vm->_objectsManager.OPTI_OBJET();
Expand Down
11 changes: 3 additions & 8 deletions engines/hopkins/globals.cpp
Expand Up @@ -91,8 +91,6 @@ Globals::Globals() {
for (int i = 0; i < 25; ++i)
Common::fill((byte *)&Cache[i], (byte *)&Cache[i] + sizeof(CacheItem), 0);

for (int i = 0; i < 101; ++i)
Common::fill((byte *)&Segment[i], (byte *)&Segment[i] + sizeof(SegmentItem), 0);
for (int i = 0; i < 105; ++i) {
BOBZONE[i] = 0;
BOBZONE_FLAG[i] = false;
Expand All @@ -118,7 +116,6 @@ Globals::Globals() {
_lastDirection = 0;
police_l = police_h = 0;
TETE = NULL;
_curObjectIndex = 0;
NUM_FICHIER_OBJ = 0;
nbrligne = 0;
_boxWidth = 0;
Expand Down Expand Up @@ -150,7 +147,6 @@ Globals::Globals() {
Compteur = 0;
_actionDirection = 0;
_actionDirection = 0;
SegmentEnCours = 0;

Credit_bx = -1;
Credit_bx1 = -1;
Expand Down Expand Up @@ -178,7 +174,6 @@ Globals::Globals() {
_inventoryObject = NULL;
_forestSprite = NULL;
_answerBuffer = g_PTRNUL;
_route = (int16 *)g_PTRNUL;
ADR_FICHIER_OBJ = NULL;
police = NULL;
PERSO = NULL;
Expand Down Expand Up @@ -296,7 +291,7 @@ void Globals::clearAll() {
_answerBuffer = g_PTRNUL;
SPRITE_ECRAN = g_PTRNUL;
_saveData = (Sauvegarde *)g_PTRNUL;
_curObjectIndex = 0;
_vm->_objectsManager._curObjectIndex = 0;

for (int idx = 0; idx < 105; ++idx) {
ZONEP[idx]._destX = 0;
Expand All @@ -308,7 +303,7 @@ void Globals::clearAll() {
_vm->_linesManager.essai1 = (int16 *)g_PTRNUL;
_vm->_linesManager.essai2 = (int16 *)g_PTRNUL;
_vm->_linesManager.BufLig = (int16 *)g_PTRNUL;
_route = (int16 *)g_PTRNUL;
_vm->_linesManager._route = (int16 *)g_PTRNUL;

for (int idx = 0; idx < MAX_LINES; ++idx) {
_vm->_linesManager.Ligne[idx]._lineDataEndIdx = 0;
Expand All @@ -324,7 +319,7 @@ void Globals::clearAll() {
}

for (int idx = 0; idx < 100; ++idx) {
_vm->_objectsManager.CarreZone[idx]._enabledFl = 0;
_vm->_linesManager.CarreZone[idx]._enabledFl = 0;
}

BUFFERTAPE = allocMemory(85000);
Expand Down
10 changes: 0 additions & 10 deletions engines/hopkins/globals.h
Expand Up @@ -161,12 +161,6 @@ struct CacheItem {
int field14;
};

struct SegmentItem {
int field0; // Useless variable
int field2;
int field4;
};

struct HopkinsItem {
int field0;
int field2;
Expand Down Expand Up @@ -297,7 +291,6 @@ class Globals {
ObjetWItem ObjetW[300];
BlocItem BLOC[250];
CacheItem Cache[25];
SegmentItem Segment[101];
int BOBZONE[105];
bool BOBZONE_FLAG[105];
int _spriteSize[500];
Expand Down Expand Up @@ -325,7 +318,6 @@ class Globals {
byte *BUFFERTAPE;
byte *inventaire2;
byte *GESTE;
int _curObjectIndex;
int NUM_FICHIER_OBJ;
int nbrligne; // Useless variable?
int _boxWidth;
Expand All @@ -334,7 +326,6 @@ class Globals {
byte *_forestSprite;
bool _forestFl;
byte *_answerBuffer;
int16 *_route;
byte *ADR_FICHIER_OBJ;
byte *PERSO;
int _objectWidth, _objectHeight;
Expand Down Expand Up @@ -368,7 +359,6 @@ class Globals {
bool GOACTION;
int Compteur;
int _actionDirection;
int SegmentEnCours;
int couleur_40;

int _hotspotTextColor;
Expand Down
4 changes: 2 additions & 2 deletions engines/hopkins/hopkins.cpp
Expand Up @@ -2098,7 +2098,7 @@ void HopkinsEngine::playEnding() {
_globals.PLAN_FLAG = false;
_globals.iRegul = 1;
_soundManager.WSOUND(26);
_globals._route = (int16 *)g_PTRNUL;
_linesManager._route = (int16 *)g_PTRNUL;
_globals.NOMARCHE = true;
_globals._exitId = 0;
_soundManager.loadSample(1, "SOUND90.WAV");
Expand Down Expand Up @@ -2782,7 +2782,7 @@ void HopkinsEngine::OCEAN(int16 curExitId, Common::String backgroundFilename, in
_graphicsManager.SETCOLOR3(251, 100, 100, 100);
_graphicsManager.SETCOLOR3(254, 0, 0, 0);
_objectsManager.animateSprite(0);
_globals._route = (int16 *)g_PTRNUL;
_linesManager._route = (int16 *)g_PTRNUL;
_eventsManager.mouseOn();
_eventsManager.changeMouseCursor(4);

Expand Down

0 comments on commit b9f9b2c

Please sign in to comment.