Skip to content

Commit

Permalink
HOPKINS: Implemented more stubbed object manager methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Oct 3, 2012
1 parent b06cabe commit bc863bd
Show file tree
Hide file tree
Showing 11 changed files with 1,065 additions and 354 deletions.
15 changes: 0 additions & 15 deletions engines/hopkins/anim.cpp
Expand Up @@ -293,21 +293,6 @@ bool AnimationManager::REDRAW_ANIM() {
return false;
}

void AnimationManager::BOBANIM_ON(int idx) {
if (GLOBALS.Bob[idx].field16) {
GLOBALS.Bob[idx].field16 = 0;
GLOBALS.Bob[idx].field10 = 5;
GLOBALS.Bob[idx].fieldC = 250;
GLOBALS.Bob[idx].field12 = 0;
GLOBALS.Bob[idx].field14 = 0;
}
}

void AnimationManager::BOBANIM_OFF(int idx) {
GLOBALS.Bob[idx].field16 = 1;

}

void AnimationManager::CHARGE_ANIM(const Common::String &animName) {
byte v20[15];
char header[10];
Expand Down
2 changes: 0 additions & 2 deletions engines/hopkins/anim.h
Expand Up @@ -46,8 +46,6 @@ class AnimationManager {
void PLAY_ANM(const Common::String &filename, uint32 rate, uint32 rate2, uint32 rate3);
void PLAY_ANM2(const Common::String &filename, int a2, int a3, int a4);
bool REDRAW_ANIM();
void BOBANIM_ON(int idx);
void BOBANIM_OFF(int idx);
void CHARGE_ANIM(const Common::String &animName);
void CLEAR_ANIM();
void RECHERCHE_ANIM(const byte *data, int idx, int nbytes);
Expand Down
9 changes: 7 additions & 2 deletions engines/hopkins/globals.h
Expand Up @@ -220,10 +220,12 @@ enum SauvegardeOffset {
, svField95
, svField121
, svField122
, svField132
, svField133
, svField170
, svField171
, svField172
, svField173
, svField176
, svField180
, svField181
Expand All @@ -243,7 +245,9 @@ enum SauvegardeOffset {
, svField228
, svField253
, svField231
, svField261
, svField270
, svField333
, svField338
, svField339
, svField340
Expand Down Expand Up @@ -360,7 +364,7 @@ class Globals {
int largeur_boite;
byte *INVENTAIRE_OBJET;
int hauteur_boite;
bool GESTE_FLAG;
int GESTE_FLAG;
byte *FORETSPR;
int FORET;
byte *COUCOU;
Expand Down Expand Up @@ -418,8 +422,9 @@ class Globals {
int NECESSAIRE;
int Compteur;
int ACTION_SENS;
int STOP_BUG;
int SegmentEnCours;
int STOP_BUG;
bool NO_OFFSET;

int force_to_data_0;
int oldzone_46;
Expand Down
4 changes: 4 additions & 0 deletions engines/hopkins/graphics.cpp
Expand Up @@ -2403,4 +2403,8 @@ void GraphicsManager::NB_SCREEN() {
DD_VBL();
}

void GraphicsManager::SHOW_PALETTE() {
warning("TODO: SHOW_PALETTE");
}

} // End of namespace Hopkins
1 change: 1 addition & 0 deletions engines/hopkins/graphics.h
Expand Up @@ -177,6 +177,7 @@ class GraphicsManager {
void INI_ECRAN2(const Common::String &file);
void OPTI_INI(const Common::String &file, int a2);
void NB_SCREEN();
void SHOW_PALETTE();
};

} // End of namespace Hopkins
Expand Down
32 changes: 16 additions & 16 deletions engines/hopkins/hopkins.cpp
Expand Up @@ -666,8 +666,8 @@ void HopkinsEngine::INTRORUN() {
_animationManager.CHARGE_ANIM("INTRO2");
_graphicsManager.VISU_ALL();
_soundManager.WSOUND(23);
_animationManager.BOBANIM_OFF(3);
_animationManager.BOBANIM_OFF(5);
_objectsManager.BOBANIM_OFF(3);
_objectsManager.BOBANIM_OFF(5);
_graphicsManager.ofscroll = 0;
_graphicsManager.SETCOLOR3(252, 100, 100, 100);
_graphicsManager.SETCOLOR3(253, 100, 100, 100);
Expand All @@ -687,9 +687,9 @@ void HopkinsEngine::INTRORUN() {
for (i = 0; i < 200 / _globals.vitesse; ++i)
_eventsManager.VBL();

_animationManager.BOBANIM_ON(3);
_objectsManager.BOBANIM_ON(3);
_soundManager.VOICE_MIX(5, 3);
_animationManager.BOBANIM_OFF(3);
_objectsManager.BOBANIM_OFF(3);
_eventsManager.VBL();
memcpy(&paletteData2, _graphicsManager.Palette, 796);
v21 = *(uint16 *)&_graphicsManager.Palette[796];
Expand All @@ -708,9 +708,9 @@ void HopkinsEngine::INTRORUN() {
_animationManager.CHARGE_ANIM("INTRO2");
_graphicsManager.VISU_ALL();
_soundManager.WSOUND(23);
_animationManager.BOBANIM_OFF(3);
_animationManager.BOBANIM_OFF(5);
_animationManager.BOBANIM_OFF(1);
_objectsManager.BOBANIM_OFF(3);
_objectsManager.BOBANIM_OFF(5);
_objectsManager.BOBANIM_OFF(1);
_graphicsManager.ofscroll = 0;
_graphicsManager.SETCOLOR3(252, 100, 100, 100);
_graphicsManager.SETCOLOR3(253, 100, 100, 100);
Expand All @@ -731,11 +731,11 @@ void HopkinsEngine::INTRORUN() {

while (!_eventsManager.ESC_KEY) {
if (v9 == 12) {
_animationManager.BOBANIM_ON(3);
_objectsManager.BOBANIM_ON(3);
_eventsManager.VBL();
_soundManager.VOICE_MIX(6, 3);
_eventsManager.VBL();
_animationManager.BOBANIM_OFF(3);
_objectsManager.BOBANIM_OFF(3);
}

Common::copy(&paletteData2[0], &paletteData2[PALETTE_BLOCK_SIZE], &_graphicsManager.Palette[0]);
Expand Down Expand Up @@ -777,13 +777,13 @@ void HopkinsEngine::INTRORUN() {
for (j = 1; j < 100 / _globals.vitesse; ++j)
_eventsManager.VBL();

_animationManager.BOBANIM_ON(3);
_objectsManager.BOBANIM_ON(3);
_soundManager.VOICE_MIX(7, 3);
_animationManager.BOBANIM_OFF(3);
_objectsManager.BOBANIM_OFF(3);

for (k = 1; k < 60 / _globals.vitesse; ++k)
_eventsManager.VBL();
_animationManager.BOBANIM_ON(5);
_objectsManager.BOBANIM_ON(5);
for (l = 0; l < 20 / _globals.vitesse; ++l)
_eventsManager.VBL();

Expand All @@ -792,9 +792,9 @@ void HopkinsEngine::INTRORUN() {

for (m = 0; m < 50 / _globals.vitesse; ++m) {
if (m == 30 / _globals.vitesse) {
_animationManager.BOBANIM_ON(3);
_objectsManager.BOBANIM_ON(3);
_soundManager.VOICE_MIX(8, 3);
_animationManager.BOBANIM_OFF(3);
_objectsManager.BOBANIM_OFF(3);
}

_eventsManager.VBL();
Expand Down Expand Up @@ -880,7 +880,7 @@ void HopkinsEngine::BOOM() {
_graphicsManager.LOAD_IMAGE("IM15");
_animationManager.CHARGE_ANIM("ANIM15");
_graphicsManager.VISU_ALL();
_animationManager.BOBANIM_OFF(7);
_objectsManager.BOBANIM_OFF(7);
_globals.BPP_NOAFF = 1;

for (int idx = 0; idx < 5; ++idx) {
Expand All @@ -898,7 +898,7 @@ void HopkinsEngine::BOOM() {
_globals.NOPARLE = true;
_talkManager.PARLER_PERSO2("vire.pe2");
_globals.NOPARLE = false;
_animationManager.BOBANIM_ON(7);
_objectsManager.BOBANIM_ON(7);

for (int idx = 0; idx < 100; ++idx) {
_eventsManager.VBL();
Expand Down
94 changes: 81 additions & 13 deletions engines/hopkins/lines.cpp
Expand Up @@ -39,6 +39,74 @@ void LinesManager::CLEAR_ZONE() {
next_ligne = 0;
}

int LinesManager::ZONE_OBJET(int a1, int a2) {
int v2;

v2 = 0;
if ((uint)(a2 - 120) <= 0x21u)
v2 = OPTI_ZONE(a1, 1, 0);
if ((uint)(a2 - 154) <= 0x25u)
v2 = OPTI_ZONE(a1, 7, 0);
if ((uint)(a2 - 192) <= 0x25u)
v2 = OPTI_ZONE(a1, 13, 0);
if ((uint)(a2 - 230) <= 0x25u)
v2 = OPTI_ZONE(a1, 19, 0);
if ((uint)(a2 - 268) <= 0x25u)
v2 = OPTI_ZONE(a1, 25, 1);
if ((uint)(a2 - 268) <= 0x14u && a1 >= _vm->_graphicsManager.ofscroll + 424 && a1 <= _vm->_graphicsManager.ofscroll + 478)
v2 = 30;
if ((uint)(a2 - 290) <= 0x10u && a1 >= _vm->_graphicsManager.ofscroll + 424 && a1 <= _vm->_graphicsManager.ofscroll + 478)
v2 = 31;
if (a1 < _vm->_graphicsManager.ofscroll + 152 || a1 > _vm->_graphicsManager.ofscroll + 484)
v2 = 32;
if ((uint)(a2 - 114) > 0xC0u)
v2 = 32;
return v2;
}

int LinesManager::OPTI_ZONE(int a1, int a2, int a3) {
int v3;
signed int v4;

v3 = a2;
v4 = 0;
if (a1 >= _vm->_graphicsManager.ofscroll + 158 && a1 <= _vm->_graphicsManager.ofscroll + 208)
v4 = 1;
if (!v4) {
if (a1 >= _vm->_graphicsManager.ofscroll + 208 && a1 <= _vm->_graphicsManager.ofscroll + 266) {
v3 = a2 + 1;
v4 = 1;
}
if (!v4) {
if (a1 >= _vm->_graphicsManager.ofscroll + 266 && a1 <= _vm->_graphicsManager.ofscroll + 320) {
v3 += 2;
v4 = 1;
}
if (!v4) {
if (a1 >= _vm->_graphicsManager.ofscroll + 320 && a1 <= _vm->_graphicsManager.ofscroll + 370) {
v3 += 3;
v4 = 1;
}
if (!v4) {
if (a1 >= _vm->_graphicsManager.ofscroll + 370 && a1 <= _vm->_graphicsManager.ofscroll + 424) {
v3 += 4;
v4 = 1;
}
if (!v4) {
if (!a3 && a1 >= _vm->_graphicsManager.ofscroll + 424 && a1 <= _vm->_graphicsManager.ofscroll + 478) {
v3 += 5;
v4 = 1;
}
if (!v4)
v3 = 0;
}
}
}
}
}
return v3;
}

void LinesManager::RETIRE_LIGNE_ZONE(int idx) {
if (idx > 400)
error("Attempting to add a line obstacle > MAX_LIGNE.");
Expand Down Expand Up @@ -858,21 +926,21 @@ int LinesManager::MIRACLE(int a1, int a2, int a3, int a4, int a5) {
int v31;
int v32;
int v33;
int v35;
int v36;
int v35 = 0;
int v36 = 0;
int v37;
int v38;
int v39;
int v40;
int v41;
int v42;
int v43;
int v44;
int v45;
int v46;
int v47;
int v48;
int v49;
int v42 = 0;
int v43 = 0;
int v44 = 0;
int v45 = 0;
int v46 = 0;
int v47 = 0;
int v48 = 0;
int v49 = 0;
int v50;
int v51;

Expand Down Expand Up @@ -2473,7 +2541,7 @@ int LinesManager::PARC_PERS(int a1, int a2, int a3, int a4, int a5, int a6, int
int v123;
int v124;
int v125;
int v126;
int v126 = 0;
int v127;
int v128;
int v129;
Expand All @@ -2493,7 +2561,7 @@ int LinesManager::PARC_PERS(int a1, int a2, int a3, int a4, int a5, int a6, int
int v143;
int v144;
int v145;
int colResult;
int colResult = 0;

v7 = a1;
v90 = a2;
Expand Down Expand Up @@ -3279,7 +3347,7 @@ int LinesManager::SMOOTH_MOVE(int a1, int a2, int a3, int a4, int a5, int a6) {
int v46;
int v47;
int v48;
int v49;
int v49 = 0;
int v50;
int v51;
int v52;
Expand Down
2 changes: 2 additions & 0 deletions engines/hopkins/lines.h
Expand Up @@ -71,6 +71,8 @@ class LinesManager {
void setParent(HopkinsEngine *vm);

void CLEAR_ZONE();
int ZONE_OBJET(int a1, int a2);
int OPTI_ZONE(int a1, int a2, int a3);
void RETIRE_LIGNE_ZONE(int idx);
void AJOUTE_LIGNE_ZONE(int idx, int a2, int a3, int a4, int a5, int a6);
void RESET_OBSTACLE();
Expand Down

0 comments on commit bc863bd

Please sign in to comment.