aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins
diff options
context:
space:
mode:
authorStrangerke2012-12-30 14:28:24 +0100
committerStrangerke2012-12-30 14:28:24 +0100
commitaedb1609c6a1bbcadf57fe402f0cd621351c51bb (patch)
tree56d7aac7292540cddd4ca05b548b8a89d573be28 /engines/hopkins
parent583204603bef7e713bc1ee9ea0efbde347c65e44 (diff)
downloadscummvm-rg350-aedb1609c6a1bbcadf57fe402f0cd621351c51bb.tar.gz
scummvm-rg350-aedb1609c6a1bbcadf57fe402f0cd621351c51bb.tar.bz2
scummvm-rg350-aedb1609c6a1bbcadf57fe402f0cd621351c51bb.zip
HOPKINS: Remove redrawAnim() and all associated code
Diffstat (limited to 'engines/hopkins')
-rw-r--r--engines/hopkins/anim.cpp85
-rw-r--r--engines/hopkins/anim.h1
-rw-r--r--engines/hopkins/globals.cpp71
-rw-r--r--engines/hopkins/globals.h2
-rw-r--r--engines/hopkins/objects.cpp2
5 files changed, 42 insertions, 119 deletions
diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp
index 5c02b21b91..ad967087f3 100644
--- a/engines/hopkins/anim.cpp
+++ b/engines/hopkins/anim.cpp
@@ -298,8 +298,6 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint
for (;;) {
if (_vm->_eventsManager._escKeyFl)
goto LABEL_114;
- if (redrawAnim())
- break;
_vm->_eventsManager.refreshEvents();
if (_vm->_eventsManager._rateCounter >= a2)
goto LABEL_48;
@@ -333,7 +331,6 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint
_vm->_graphicsManager.clearScreen();
_vm->_graphicsManager.m_scroll16(_vm->_graphicsManager._vesaBuffer, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
-LABEL_112:
_vm->_graphicsManager.unlockScreen();
_vm->_eventsManager.VBL();
_vm->_graphicsManager.FADE_INS();
@@ -377,38 +374,6 @@ LABEL_88:
if (v5 == -1) {
if (_vm->_globals.iRegul == 1) {
while (!_vm->_eventsManager._escKeyFl) {
- if (redrawAnim()) {
- if (_vm->_graphicsManager._skipVideoLockFl)
- goto LABEL_114;
- if (v8 == 1)
- ptr = _vm->_globals.freeMemory(ptr);
- _vm->_globals.freeMemory(v13);
- f.close();
-
- _vm->_saveLoadManager.load("TEMP.SCR", _vm->_graphicsManager._vesaScreen);
- g_system->getSavefileManager()->removeSavefile("TEMP.SCR");
-
- memcpy(_vm->_graphicsManager._palette, _vm->_graphicsManager._oldPalette, 769);
- _vm->_graphicsManager.clearPalette();
- _vm->_graphicsManager.lockScreen();
- _vm->_graphicsManager.clearScreen();
- _vm->_graphicsManager.unlockScreen();
- _vm->_graphicsManager.SCROLL = v11;
- _vm->_graphicsManager.scrollScreen(v11);
- if (_vm->_graphicsManager.DOUBLE_ECRAN) {
- _vm->_graphicsManager.SCANLINE(1280);
- _vm->_graphicsManager.max_x = 1280;
- _vm->_graphicsManager.lockScreen();
- _vm->_graphicsManager.m_scroll16(_vm->_graphicsManager._vesaBuffer, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
- } else {
- _vm->_graphicsManager.SCANLINE(SCREEN_WIDTH * 2);
- _vm->_graphicsManager.max_x = SCREEN_WIDTH;
- _vm->_graphicsManager.lockScreen();
- _vm->_graphicsManager.clearScreen();
- _vm->_graphicsManager.m_scroll16(_vm->_graphicsManager._vesaBuffer, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
- }
- goto LABEL_112;
- }
_vm->_eventsManager.refreshEvents();
_vm->_soundManager.VERIF_SOUND();
if (_vm->_eventsManager._rateCounter >= a4)
@@ -419,38 +384,6 @@ LABEL_88:
}
}
while (!_vm->_eventsManager._escKeyFl) {
- if (redrawAnim()) {
- if (_vm->_graphicsManager._skipVideoLockFl)
- break;
- if (v8 == 1)
- ptr = _vm->_globals.freeMemory(ptr);
- _vm->_globals.freeMemory(v13);
- f.close();
-
- _vm->_saveLoadManager.load("TEMP.SCR", _vm->_graphicsManager._vesaScreen);
- g_system->getSavefileManager()->removeSavefile("TEMP.SCR");
-
- memcpy(_vm->_graphicsManager._palette, _vm->_graphicsManager._oldPalette, 769);
- _vm->_graphicsManager.clearPalette();
- _vm->_graphicsManager.lockScreen();
- _vm->_graphicsManager.clearScreen();
- _vm->_graphicsManager.unlockScreen();
- _vm->_graphicsManager.SCROLL = v11;
- _vm->_graphicsManager.scrollScreen(v11);
- if (_vm->_graphicsManager.DOUBLE_ECRAN) {
- _vm->_graphicsManager.SCANLINE(1280);
- _vm->_graphicsManager.max_x = 1280;
- _vm->_graphicsManager.lockScreen();
- _vm->_graphicsManager.m_scroll16(_vm->_graphicsManager._vesaBuffer, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
- } else {
- _vm->_graphicsManager.SCANLINE(SCREEN_WIDTH * 2);
- _vm->_graphicsManager.max_x = SCREEN_WIDTH;
- _vm->_graphicsManager.lockScreen();
- _vm->_graphicsManager.clearScreen();
- _vm->_graphicsManager.m_scroll16(_vm->_graphicsManager._vesaBuffer, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
- }
- goto LABEL_112;
- }
_vm->_eventsManager.refreshEvents();
_vm->_soundManager.VERIF_SOUND();
if (_vm->_eventsManager._rateCounter >= a3)
@@ -533,10 +466,6 @@ LABEL_114:
_vm->_graphicsManager.DD_VBL();
}
-bool AnimationManager::redrawAnim() {
- return false;
-}
-
/**
* Load Animation
*/
@@ -1013,14 +942,11 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u
while (!_vm->shouldQuit()) {
if (_vm->_eventsManager._escKeyFl)
goto LABEL_54;
- if (redrawAnim())
- break;
_vm->_eventsManager.refreshEvents();
_vm->_soundManager.VERIF_SOUND();
if (_vm->_eventsManager._rateCounter >= rate1)
goto LABEL_23;
}
-LABEL_48:
if (_vm->_graphicsManager._skipVideoLockFl)
goto LABEL_54;
if (v7 == 1)
@@ -1064,15 +990,14 @@ LABEL_44:
if (v4) {
if (_vm->_globals.iRegul == 1) {
while (!_vm->_eventsManager._escKeyFl) {
- if (redrawAnim())
- goto LABEL_48;
_vm->_eventsManager.refreshEvents();
_vm->_soundManager.VERIF_SOUND();
- if (_vm->_eventsManager._rateCounter >= rate3)
- goto LABEL_53;
+ if (_vm->_eventsManager._rateCounter >= rate3) {
+ _vm->_eventsManager._rateCounter = 0;
+ break;
+ }
}
} else {
-LABEL_53:
_vm->_eventsManager._rateCounter = 0;
}
goto LABEL_54;
@@ -1080,8 +1005,6 @@ LABEL_53:
}
while (!_vm->_eventsManager._escKeyFl) {
_vm->_eventsManager.refreshEvents();
- if (redrawAnim())
- goto LABEL_48;
if (_vm->_eventsManager._rateCounter >= rate2)
goto LABEL_33;
}
diff --git a/engines/hopkins/anim.h b/engines/hopkins/anim.h
index 1c7c97b89f..181a0cf327 100644
--- a/engines/hopkins/anim.h
+++ b/engines/hopkins/anim.h
@@ -46,7 +46,6 @@ public:
void playAnim(const Common::String &filename, uint32 rate, uint32 rate2, uint32 rate3);
void playAnim2(const Common::String &filename, uint32 a2, uint32 a3, uint32 a4);
- bool redrawAnim();
void loadAnim(const Common::String &animName);
void clearAnim();
void searchAnim(const byte *data, int animIndex, int count);
diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp
index d3eeaf8071..bc22e42fb5 100644
--- a/engines/hopkins/globals.cpp
+++ b/engines/hopkins/globals.cpp
@@ -82,10 +82,10 @@ Globals::Globals() {
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)
+ for (int i = 0; i < 30; ++i) {
Common::fill((byte *)&_lockedAnims[i], (byte *)&_lockedAnims[i] + sizeof(LockAnimItem), 0);
- for (int i = 0; i < 30; ++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)
@@ -225,7 +225,7 @@ Globals::Globals() {
NOMARCHE = false;
NO_VISU = false;
_optionDialogFl = false;
- CACHEFLAG = false;
+ _cacheFl = false;
NOPARLE = false;
couleur_40 = 50;
@@ -521,16 +521,16 @@ void Globals::RESET_CACHE() {
Cache[idx].field14 = 0;
}
- CACHEFLAG = false;
+ _cacheFl = false;
}
void Globals::CACHE_ON() {
- CACHEFLAG = true;
+ _cacheFl = true;
}
// TODO: Find why some calls have a parameter value
void Globals::CACHE_OFF(int v1) {
- CACHEFLAG = false;
+ _cacheFl = false;
}
void Globals::CACHE_SUB(int idx) {
@@ -556,37 +556,38 @@ void Globals::loadCache(const Common::String &file) {
_vm->_fileManager.constructFilename(HOPLINK, v16);
- if (f.exists(_curFilename)) {
- spriteData = _vm->_fileManager.loadFile(_curFilename);
- CACHE_BANQUE[1] = spriteData;
- int v15 = 60;
- for (int i = 0; i <= 21; i++) {
- int v11 = (int16)READ_LE_UINT16((uint16 *)ptr + v15);
- int v4 = (int16)READ_LE_UINT16((uint16 *)ptr + v15 + 1);
- int v5 = (int16)READ_LE_UINT16((uint16 *)ptr + v15 + 2);
- int v6 = i;
- Cache[v6].field14 = (int16)READ_LE_UINT16((uint16 *)ptr + v15 + 4);
- Cache[v6]._spriteIndex = v11;
- Cache[v6]._x = v4;
- Cache[v6]._y = v5;
- if (spriteData == g_PTRNUL) {
- Cache[i].fieldA = 0;
- } else {
- int v8 = _vm->_objectsManager.getWidth(spriteData, v11);
- int v9 = _vm->_objectsManager.getHeight(spriteData, v11);
- Cache[i]._spriteData = spriteData;
- Cache[i]._width = v8;
- Cache[i]._height = v9;
- Cache[i].fieldA = 1;
- }
-
- if ( !Cache[i]._x && !Cache[i]._y && !Cache[i]._spriteIndex)
- Cache[i].fieldA = 0;
- v15 += 5;
+ if (!f.exists(_curFilename))
+ return;
+
+ spriteData = _vm->_fileManager.loadFile(_curFilename);
+ CACHE_BANQUE[1] = spriteData;
+ int v15 = 60;
+ for (int i = 0; i <= 21; i++) {
+ int v11 = (int16)READ_LE_UINT16((uint16 *)ptr + v15);
+ int v4 = (int16)READ_LE_UINT16((uint16 *)ptr + v15 + 1);
+ int v5 = (int16)READ_LE_UINT16((uint16 *)ptr + v15 + 2);
+ int v6 = i;
+ Cache[v6].field14 = (int16)READ_LE_UINT16((uint16 *)ptr + v15 + 4);
+ Cache[v6]._spriteIndex = v11;
+ Cache[v6]._x = v4;
+ Cache[v6]._y = v5;
+ if (spriteData == g_PTRNUL) {
+ Cache[i].fieldA = 0;
+ } else {
+ int v8 = _vm->_objectsManager.getWidth(spriteData, v11);
+ int v9 = _vm->_objectsManager.getHeight(spriteData, v11);
+ Cache[i]._spriteData = spriteData;
+ Cache[i]._width = v8;
+ Cache[i]._height = v9;
+ Cache[i].fieldA = 1;
}
- CACHE_ON();
- v2 = ptr;
+
+ if ( !Cache[i]._x && !Cache[i]._y && !Cache[i]._spriteIndex)
+ Cache[i].fieldA = 0;
+ v15 += 5;
}
+ CACHE_ON();
+ v2 = ptr;
freeMemory(v2);
}
diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h
index db51f8aa73..af039bdf1f 100644
--- a/engines/hopkins/globals.h
+++ b/engines/hopkins/globals.h
@@ -427,7 +427,7 @@ public:
bool AFFLI; // CHECKME: Useless variable?
bool AFFIVBL; // CHECKME: Useless variable?
int NOT_VERIF;
- bool CACHEFLAG;
+ bool _cacheFl;
bool NOPARLE;
bool PLAN_FLAG;
bool NECESSAIRE;
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp
index 04bfee6b09..81b68c8207 100644
--- a/engines/hopkins/objects.cpp
+++ b/engines/hopkins/objects.cpp
@@ -398,7 +398,7 @@ void ObjectsManager::displaySprite() {
}
}
- if (_vm->_globals.CACHEFLAG)
+ if (_vm->_globals._cacheFl)
VERIFCACHE();
}