aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2012-11-11 21:37:04 +0100
committerStrangerke2012-11-11 21:37:04 +0100
commitcab8c1da606b9aaacdf77d62b27f1564b9a95413 (patch)
treedf371bc92cf4e4f97a0732c08251f41ea9971e27
parentec012d7242c6ab54c1fd04fb269807b6c148a71a (diff)
downloadscummvm-rg350-cab8c1da606b9aaacdf77d62b27f1564b9a95413.tar.gz
scummvm-rg350-cab8c1da606b9aaacdf77d62b27f1564b9a95413.tar.bz2
scummvm-rg350-cab8c1da606b9aaacdf77d62b27f1564b9a95413.zip
HOPKINS: Implement OCEAN()
-rw-r--r--engines/hopkins/globals.cpp2
-rw-r--r--engines/hopkins/globals.h2
-rw-r--r--engines/hopkins/hopkins.cpp108
-rw-r--r--engines/hopkins/hopkins.h2
4 files changed, 113 insertions, 1 deletions
diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp
index 75b3bbabca..8cfa830c4d 100644
--- a/engines/hopkins/globals.cpp
+++ b/engines/hopkins/globals.cpp
@@ -193,6 +193,8 @@ Globals::Globals() {
memset(Credit, 0, 12000);
Credit_step = 0;
+ OCEAN_SENS = 0;
+
// Initialise pointers
ICONE = NULL;
BUF_ZONE = NULL;
diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h
index 2c04c9fcc2..17c78ca883 100644
--- a/engines/hopkins/globals.h
+++ b/engines/hopkins/globals.h
@@ -461,6 +461,8 @@ public:
char Credit[12000];
int Credit_step;
+ int OCEAN_SENS;
+
Globals();
~Globals();
void setParent(HopkinsEngine *vm);
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index cd6ee1d5bd..a901484290 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -2437,8 +2437,114 @@ void HopkinsEngine::Credits() {
_eventsManager.souris_flag = true;
}
+void HopkinsEngine::BTOCEAN() {
+ warning("STUB - BTOCEAN()");
+}
+
+void HopkinsEngine::OCEAN_HOME() {
+ warning("STUB - OCEAN_HOME()");
+}
+
void HopkinsEngine::OCEAN(int16 a1, Common::String a2, Common::String a3, int16 a4, int16 a5, int16 a6, int16 a7, int16 a8, int16 a9) {
- warning("STUB - OCEAN()");
+ warning("OCEAN()");
+
+ _globals.PLAN_FLAG = false;
+ _graphicsManager.NOFADE = false;
+ _globals.NOMARCHE = false;
+ _globals.SORTIE = 0;
+ _globals.AFFLI = false;
+ _globals.AFFIVBL = true;
+ _globals.DESACTIVE_INVENT = true;
+ _soundManager.WSOUND(a9);
+ _fileManager.CONSTRUIT_SYSTEM("VAISSEAU.SPR");
+ _fileManager.CHARGE_FICHIER2(_globals.NFICHIER, _globals.PERSO);
+ if (a2.size())
+ _graphicsManager.LOAD_IMAGE(a2);
+ if (a1 == 77)
+ goto LABEL_53;
+ if (a1 != 84 && a1 != 91)
+ _objectsManager.INILINK("ocean");
+ if (a1 == 77)
+LABEL_53:
+ _objectsManager.INILINK("IM77");
+ if (a1 == 84)
+ _objectsManager.INILINK("IM84");
+ if (a1 == 91)
+ _objectsManager.INILINK("IM91");
+ if (!a5)
+ _objectsManager.ZONE_OFF(1);
+ if (!a6)
+ _objectsManager.ZONE_OFF(2);
+ if (!a7)
+ _objectsManager.ZONE_OFF(3);
+ if (!a8)
+ _objectsManager.ZONE_OFF(4);
+ if (!_globals.OCEAN_SENS)
+ _globals.OCEAN_SENS = a4;
+ if (_globals.OCEAN_SENS == 5) {
+ _objectsManager.PERX = 236;
+ _objectsManager.PERI = 9;
+ }
+ if (_globals.OCEAN_SENS == 1) {
+ _objectsManager.PERX = 236;
+ _objectsManager.PERI = 27;
+ }
+ if (_globals.OCEAN_SENS == 7) {
+ _objectsManager.PERX = 415;
+ _objectsManager.PERI = 18;
+ }
+ if (_globals.OCEAN_SENS == 3) {
+ _objectsManager.PERX = -20;
+ _objectsManager.PERI = 0;
+ }
+ _objectsManager.SPRITE(_globals.PERSO, _objectsManager.PERX, 110, 0, _objectsManager.PERI, 0, 0, 0, 0);
+ _graphicsManager.SETCOLOR3(252, 100, 100, 100);
+ _graphicsManager.SETCOLOR3(253, 100, 100, 100);
+ _graphicsManager.SETCOLOR3(251, 100, 100, 100);
+ _graphicsManager.SETCOLOR3(254, 0, 0, 0);
+ _objectsManager.SPRITE_ON(0);
+ _globals.chemin = (int16 *)g_PTRNUL;
+ _eventsManager.MOUSE_ON();
+ _eventsManager.CHANGE_MOUSE(4);
+
+ int cpt = 0;
+ do {
+ _eventsManager.VBL();
+ ++cpt;
+ } while (cpt <= 4);
+
+ if (!_graphicsManager.NOFADE)
+ _graphicsManager.FADE_INW();
+ _graphicsManager.NOFADE = false;
+ _globals.iRegul = 1;
+
+ bool loopCond = false;
+ do {
+ int mouseButton = _eventsManager.BMOUSE();
+ if (mouseButton && mouseButton == 1)
+ BTOCEAN();
+ _objectsManager.VERIFZONE();
+ OCEAN_HOME();
+ _eventsManager.VBL();
+ if (_globals.SORTIE)
+ loopCond = true;
+ } while (!loopCond);
+
+ if (_globals.SORTIE == 1)
+ _globals.SORTIE = a5;
+ if (_globals.SORTIE == 2)
+ _globals.SORTIE = a6;
+ if (_globals.SORTIE == 3)
+ _globals.SORTIE = a7;
+ if (_globals.SORTIE == 4)
+ _globals.SORTIE = a8;
+ _graphicsManager.FADE_OUTW();
+ _objectsManager.SPRITE_OFF(0);
+ _globals.AFFLI = false;
+ _objectsManager.CLEAR_ECRAN();
+ _fileManager.CONSTRUIT_SYSTEM("PERSO.SPR");
+ _fileManager.CHARGE_FICHIER2(_globals.NFICHIER, _globals.PERSO);
+ _globals.PERSO_TYPE = 0;
}
void HopkinsEngine::syncSoundSettings() {
diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h
index 62f3ee6765..1042c4d22a 100644
--- a/engines/hopkins/hopkins.h
+++ b/engines/hopkins/hopkins.h
@@ -97,6 +97,8 @@ private:
void JOUE_FIN();
void AVION();
int PWBASE();
+ void BTOCEAN();
+ void OCEAN_HOME();
void OCEAN(int16 a1, Common::String a2, Common::String a3, int16 a4, int16 a5, int16 a6, int16 a7, int16 a8, int16 a9);
void Charge_Credits();
void CREDIT_AFFICHE(int a1, int a2, char a3);