aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2012-10-07 00:02:02 +1000
committerPaul Gilbert2012-10-07 00:02:02 +1000
commit2b592038df8c81e27ccca1bddca9c5dec1dd742c (patch)
tree9d0852657478baec3c23278339cdc3c18cf30b7a
parentcc8bfc8429d5ca34f34336616657f488bfa25517 (diff)
downloadscummvm-rg350-2b592038df8c81e27ccca1bddca9c5dec1dd742c.tar.gz
scummvm-rg350-2b592038df8c81e27ccca1bddca9c5dec1dd742c.tar.bz2
scummvm-rg350-2b592038df8c81e27ccca1bddca9c5dec1dd742c.zip
HOPKINS: Implemented further initialisation
-rw-r--r--engines/hopkins/globals.cpp72
-rw-r--r--engines/hopkins/globals.h40
-rw-r--r--engines/hopkins/objects.cpp51
-rw-r--r--engines/hopkins/objects.h2
4 files changed, 144 insertions, 21 deletions
diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp
index 899cc842f1..e973e5c2bd 100644
--- a/engines/hopkins/globals.cpp
+++ b/engines/hopkins/globals.cpp
@@ -31,6 +31,50 @@
namespace Hopkins {
Globals::Globals() {
+ // Initialise array properties
+ for (int i = 0; i < 6; ++i)
+ CACHE_BANQUE[i] = PTRNUL;
+ for (int i = 0; i < 106; ++i)
+ Common::fill((byte *)&ZONEP[i], (byte *)&ZONEP[i] + sizeof(ZonePItem), 0);
+ for (int i = 0; i < 100; ++i)
+ Common::fill((byte *)&CarreZone[i], (byte *)&CarreZone[i] + sizeof(CarreZoneItem), 0);
+ for (int i = 0; i < 35; ++i)
+ Common::fill((byte *)&Bqe_Anim[i], (byte *)&Bqe_Anim[i] + sizeof(BqeAnimItem), 0);
+ for (int i = 0; i < 8; ++i)
+ Common::fill((byte *)&Bank[i], (byte *)&Bank[i] + sizeof(BankItem), 0);
+ for (int i = 0; i < 36; ++i)
+ Common::fill((byte *)&Bob[i], (byte *)&Bob[i] + sizeof(BobItem), 0);
+ for (int i = 0; i < 6; ++i)
+ Common::fill((byte *)&Liste[i], (byte *)&Liste[i] + sizeof(ListeItem), 0);
+ for (int i = 0; i < 35; ++i)
+ Common::fill((byte *)&Liste2[i], (byte *)&Liste2[i] + sizeof(Liste2Item), 0);
+ for (int i = 0; i < 30; ++i)
+ Common::fill((byte *)&BL_ANIM[i], (byte *)&BL_ANIM[i] + sizeof(BlAnimItem), 0);
+ for (int i = 0; i < 35; ++i)
+ Common::fill((byte *)&VBob[i], (byte *)&VBob[i] + sizeof(VBobItem), 0);
+ for (int i = 0; i < 300; ++i)
+ Common::fill((byte *)&ObjetW[i], (byte *)&ObjetW[i] + sizeof(ObjetWItem), 0);
+ for (int i = 0; i < 250; ++i)
+ Common::fill((byte *)&BLOC[i], (byte *)&BLOC[i] + sizeof(BlocItem), 0);
+ 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] = 0;
+ }
+ for (int i = 0; i < 500; ++i)
+ STAILLE[i] = 0;
+ for (int i = 0; i < 32002; ++i)
+ super_parcours[i] = 0;
+ for (int i = 0; i < 2100; ++i)
+ Param[i] = 0;
+ for (int i = 0; i < 70; ++i)
+ Common::fill((byte *)&Hopkins[i], (byte *)&Hopkins[i] + sizeof(HopkinsItem), 0);
+
+ // Initialise fields
FR = 0;
SVGA = 2;
internet = 1;
@@ -46,6 +90,7 @@ Globals::Globals() {
lOldItCounter = 0;
g_old_anim = 0;
g_old_sens = 0;
+ g_old_sens2 = 0;
police_l = police_h = 0;
TETE = NULL;
texte_long = 0;
@@ -64,6 +109,7 @@ Globals::Globals() {
iRegul = 0;
SORTIE = 0;
PLANX = PLANY = 0;
+ PLANI = 0;
PERSO = 0;
PASSWORD = 0;
ECRAN = 0;
@@ -83,7 +129,19 @@ Globals::Globals() {
opt_txt = 0;
opt_anm = 0;
NBTRI = 0;
+ AFFLI = 0;
+ AFFIVBL = 0;
+ NOT_VERIF = 0;
AFFINVEN = 0;
+ PERSO_TYPE = 0;
+ GOACTION = 0;
+ NECESSAIRE = 0;
+ Compteur = 0;
+ ACTION_SENS = 0;
+ ACTION_SENS = 0;
+ SegmentEnCours = 0;
+ STOP_BUG = 0;
+ MAX_COMPTE = 0;
// Initialise pointers
ICONE = NULL;
@@ -135,6 +193,20 @@ Globals::Globals() {
OPTION_FLAG = false;
CACHEFLAG = false;
NOPARLE = false;
+
+ // Reset indexed variables
+ force_to_data_0 = 0;
+ oldzone_46 = 0;
+ old_x1_65 = 0;
+ old_y1_66 = 0;
+ old_x2_67 = 0;
+ old_y2_68 = 0;
+ old_zone_68 = 0;
+ old_z_69 = 0;
+ old_x_69 = 0;
+ old_y_70 = 0;
+ compteur_71 = 0;
+ zozo_73 = 0;
}
Globals::~Globals() {
diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h
index 3bbaa2c9f4..81cb05184f 100644
--- a/engines/hopkins/globals.h
+++ b/engines/hopkins/globals.h
@@ -285,6 +285,26 @@ class Globals {
private:
HopkinsEngine *_vm;
public:
+ byte *CACHE_BANQUE[6];
+ ZonePItem ZONEP[106];
+ CarreZoneItem CarreZone[101];
+ BqeAnimItem Bqe_Anim[35];
+ BankItem Bank[8];
+ BobItem Bob[36];
+ ListeItem Liste[6];
+ Liste2Item Liste2[35];
+ BlAnimItem BL_ANIM[30];
+ VBobItem VBob[35];
+ ObjetWItem ObjetW[300];
+ BlocItem BLOC[250];
+ CacheItem Cache[25];
+ SegmentItem Segment[101];
+ int BOBZONE[105];
+ bool BOBZONE_FLAG[105];
+ int STAILLE[500];
+ int16 super_parcours[32002];
+ int Param[2100];
+ HopkinsItem Hopkins[70];
int FR;
int SVGA;
int internet;
@@ -329,26 +349,6 @@ public:
byte *TETE;
byte *ICONE;
byte *BUF_ZONE;
- byte *CACHE_BANQUE[6];
- ZonePItem ZONEP[106];
- CarreZoneItem CarreZone[101];
- BqeAnimItem Bqe_Anim[35];
- BankItem Bank[8];
- BobItem Bob[36];
- ListeItem Liste[6];
- Liste2Item Liste2[35];
- BlAnimItem BL_ANIM[30];
- VBobItem VBob[35];
- ObjetWItem ObjetW[300];
- BlocItem BLOC[250];
- CacheItem Cache[25];
- SegmentItem Segment[101];
- int BOBZONE[105];
- bool BOBZONE_FLAG[105];
- int STAILLE[500];
- int16 super_parcours[32002];
- int Param[2100];
- HopkinsItem Hopkins[70];
byte *Winventaire;
byte *texte_tmp;
int texte_long;
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp
index 3d2f625679..ab427fc2bc 100644
--- a/engines/hopkins/objects.cpp
+++ b/engines/hopkins/objects.cpp
@@ -34,6 +34,10 @@
namespace Hopkins {
ObjectsManager::ObjectsManager() {
+ for (int i = 0; i < 6; ++i) {
+ Common::fill((byte *)&Sprite[i], (byte *)&Sprite[i] + sizeof(SpriteItem), 0);
+ }
+
PRIORITY = 0;
inventairex = inventairey = 0;
inventairel = inventaireh = 0;
@@ -41,15 +45,62 @@ ObjectsManager::ObjectsManager() {
cadx = cady = cadi = 0;
SL_X = SL_Y = 0;
I_old_x = I_old_y = 0;
+ g_old_x = g_old_y = 0;
FLAG_VISIBLE_EFFACE = 0;
+ Winventaire = NULL;
inventaire2 = PTRNUL;
SL_SPR = PTRNUL;
SL_SPR2 = PTRNUL;
+ sprite_ptr = PTRNUL;
+ S_old_spr = PTRNUL;
PERSO_ON = false;
SL_FLAG = false;
+ SL_MODE = false;
FLAG_VISIBLE = false;
DESACTIVE_INVENT = false;
+ DESACTIVE_CURSOR = 0;
BOBTOUS = false;
+ INVENTFLAG = false;
+ KEY_INVENT = 0;
+ my_anim = 0;
+ GOACTION = 0;
+ NUMZONE = 0;
+ ARRET_PERSO_FLAG = 0;
+ ARRET_PERSO_NUM = 0;
+ FORCEZONE = 0;
+ CHANGEVERBE = 0;
+ verbe = 0;
+ Vold_taille = 0;
+ SPEED_FLAG = false;
+ SPEED_X = SPEED_Y = 0;
+ SPEED_IMAGE = 0;
+ SPEED_PTR = PTRNUL;
+ DERLIGNE = 0;
+ g_old_sens = 0;
+ A_ANIM = 0;
+ MA_ANIM = 0;
+ MA_ANIM1 = 0;
+ A_DEPA = 0;
+ MAX_DEPA = 0;
+ MAX_DEPA1 = 0;
+ VIRE_INVENT = 0;
+ AFFINVEN = 0;
+ TRAVAILOBJET = 0;
+ CH_TETE = 0;
+ T_RECTIF = 0;
+ DESACTIVE = 0;
+ DEUXPERSO = 0;
+ PERX, PERY = 0;
+ PERI = 0;
+ RECALL = 0;
+ PTAILLE = 0;
+ PEROFX = 0;
+ PEROFY = 0;
+ OBSSEUL = 0;
+ NVVERBE = 0;
+ NVZONE = 0;
+ S_old_ani = 0;
+ S_old_ret = 0;
}
void ObjectsManager::setParent(HopkinsEngine *vm) {
diff --git a/engines/hopkins/objects.h b/engines/hopkins/objects.h
index 075a9dfc88..e12949b2e2 100644
--- a/engines/hopkins/objects.h
+++ b/engines/hopkins/objects.h
@@ -61,6 +61,7 @@ private:
HopkinsEngine *_vm;
public:
+ SpriteItem Sprite[6];
int PRIORITY;
int inventairex, inventairey;
int inventairel, inventaireh;
@@ -83,7 +84,6 @@ public:
bool DESACTIVE_INVENT;
int DESACTIVE_CURSOR;
bool BOBTOUS;
- SpriteItem Sprite[6];
bool INVENTFLAG;
int KEY_INVENT;
int my_anim;