aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2013-03-23 09:06:27 +0100
committerStrangerke2013-03-23 09:06:27 +0100
commitc49cbf3747ea642d4f47419c81648e9dce21def1 (patch)
tree3383d7d4cbbbd093c6ed7d906057dfbfba004946 /engines
parentdf751fc80b5b37a672ef041b62cf74ac9dbd28c8 (diff)
downloadscummvm-rg350-c49cbf3747ea642d4f47419c81648e9dce21def1.tar.gz
scummvm-rg350-c49cbf3747ea642d4f47419c81648e9dce21def1.tar.bz2
scummvm-rg350-c49cbf3747ea642d4f47419c81648e9dce21def1.zip
HOPKINS: Get rid of NO_SEQ in AnimationManager
Diffstat (limited to 'engines')
-rw-r--r--engines/hopkins/anim.cpp38
-rw-r--r--engines/hopkins/anim.h7
-rw-r--r--engines/hopkins/hopkins.cpp1
-rw-r--r--engines/hopkins/objects.cpp4
-rw-r--r--engines/hopkins/script.cpp20
5 files changed, 25 insertions, 45 deletions
diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp
index 99648a1fdd..e6278eff74 100644
--- a/engines/hopkins/anim.cpp
+++ b/engines/hopkins/anim.cpp
@@ -38,7 +38,6 @@ namespace Hopkins {
AnimationManager::AnimationManager(HopkinsEngine *vm) {
_vm = vm;
_clearAnimationFl = false;
- NO_SEQ = false;
NO_COUL = false;
}
@@ -49,7 +48,7 @@ AnimationManager::AnimationManager(HopkinsEngine *vm) {
* @param rate2 Delay amount between animation frames
* @param rate3 Delay amount after animation finishes
*/
-void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, uint32 rate2, uint32 rate3) {
+void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, uint32 rate2, uint32 rate3, bool skipSeqFl) {
byte *screenCopy = NULL;
Common::File f;
@@ -89,7 +88,7 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui
screenCopy = _vm->_globals->allocMemory(307200);
memcpy(screenCopy, screenP, 307200);
}
- if (NO_SEQ) {
+ if (skipSeqFl) {
if (hasScreenCopy)
memcpy(screenCopy, _vm->_graphicsManager->_vesaBuffer, 307200);
_vm->_graphicsManager->setPaletteVGA256(_vm->_graphicsManager->_palette);
@@ -275,23 +274,18 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 rate1, u
screenCopy = _vm->_globals->allocMemory(307200);
memcpy(screenCopy, screenP, 307200);
}
- if (NO_SEQ) {
- if (hasScreenCopy)
- memcpy(screenCopy, _vm->_graphicsManager->_vesaBuffer, 307200);
- _vm->_graphicsManager->setPaletteVGA256(_vm->_graphicsManager->_palette);
- } else {
- _vm->_graphicsManager->setPaletteVGA256(_vm->_graphicsManager->_palette);
- _vm->_graphicsManager->lockScreen();
- if (hasScreenCopy)
- _vm->_graphicsManager->m_scroll16A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
- else
- _vm->_graphicsManager->m_scroll16(screenP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
- _vm->_graphicsManager->unlockScreen();
+ _vm->_graphicsManager->setPaletteVGA256(_vm->_graphicsManager->_palette);
+ _vm->_graphicsManager->lockScreen();
+ if (hasScreenCopy)
+ _vm->_graphicsManager->m_scroll16A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
+ else
+ _vm->_graphicsManager->m_scroll16(screenP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
+
+ _vm->_graphicsManager->unlockScreen();
+ _vm->_graphicsManager->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
+ _vm->_graphicsManager->updateScreen();
- _vm->_graphicsManager->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
- _vm->_graphicsManager->updateScreen();
- }
_vm->_eventsManager->_rateCounter = 0;
_vm->_eventsManager->_escKeyFl = false;
_vm->_soundManager->loadAnimSound();
@@ -611,7 +605,7 @@ void AnimationManager::searchAnim(const byte *data, int animIndex, int bufSize)
/**
* Play sequence
*/
-void AnimationManager::playSequence(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3, bool skipEscFl) {
+void AnimationManager::playSequence(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3, bool skipEscFl, bool skipSeqFl) {
if (_vm->shouldQuit())
return;
@@ -645,7 +639,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
screenCopy = _vm->_globals->allocMemory(307200);
memcpy(screenCopy, screenP, 307200);
}
- if (NO_SEQ) {
+ if (skipSeqFl) {
if (hasScreenCopy)
memcpy(screenCopy, _vm->_graphicsManager->_vesaBuffer, 307200);
if (!_vm->getIsDemo()) {
@@ -783,7 +777,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
/**
* Play Sequence type 2
*/
-void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3) {
+void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3, bool skipSeqFl) {
byte *screenCopy = NULL;
byte *screenP;
int frameNumber;
@@ -812,7 +806,7 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u
screenCopy = _vm->_globals->allocMemory(307200);
memcpy((void *)screenCopy, screenP, 307200);
}
- if (NO_SEQ) {
+ if (skipSeqFl) {
if (multiScreenFl) {
assert(screenCopy != NULL);
memcpy((void *)screenCopy, _vm->_graphicsManager->_vesaBuffer, 307200);
diff --git a/engines/hopkins/anim.h b/engines/hopkins/anim.h
index 3b3a010c01..5e94c38ddb 100644
--- a/engines/hopkins/anim.h
+++ b/engines/hopkins/anim.h
@@ -41,17 +41,16 @@ private:
public:
bool _clearAnimationFl;
- bool NO_SEQ;
bool NO_COUL;
AnimationManager(HopkinsEngine *vm);
void loadAnim(const Common::String &animName);
void clearAnim();
- void playAnim(const Common::String &filename, uint32 rate1, uint32 rate2, uint32 rate3);
+ void playAnim(const Common::String &filename, uint32 rate1, uint32 rate2, uint32 rate3, bool skipSeqFl = false);
void playAnim2(const Common::String &filename, uint32 rate1, uint32 rate2, uint32 rate3);
- void playSequence(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3, bool skipEscFl = false);
- void playSequence2(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3);
+ void playSequence(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3, bool skipEscFl = false, bool skipSeqFl = false);
+ void playSequence2(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3, bool skipSeqFl = false);
};
} // End of namespace Hopkins
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index a45e757c5f..2057613a04 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -2029,7 +2029,6 @@ void HopkinsEngine::playUnderwaterBaseCutscene() {
_graphicsManager->clearScreen();
_graphicsManager->unlockScreen();
_graphicsManager->clearPalette();
- _animationManager->NO_SEQ = false;
_soundManager->playSound(26);
_globals->iRegul = 1;
_globals->_disableInventFl = true;
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp
index 0ceacdd77a..0f8814ffef 100644
--- a/engines/hopkins/objects.cpp
+++ b/engines/hopkins/objects.cpp
@@ -2587,10 +2587,8 @@ void ObjectsManager::handleSpecialGames() {
_vm->_graphicsManager->NB_SCREEN(true);
_vm->_soundManager->_specialSoundNum = 198;
PERSO_ON = true;
- _vm->_animationManager->NO_SEQ = true;
_vm->_animationManager->_clearAnimationFl = false;
- _vm->_animationManager->playAnim("otage.ANM", 1, 24, 500);
- _vm->_animationManager->NO_SEQ = false;
+ _vm->_animationManager->playAnim("otage.ANM", 1, 24, 500, true);
_vm->_soundManager->_specialSoundNum = 0;
_vm->_graphicsManager->NB_SCREEN(false);
diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp
index 3bc153a865..1d5b214b8f 100644
--- a/engines/hopkins/script.cpp
+++ b/engines/hopkins/script.cpp
@@ -1933,9 +1933,8 @@ int ScriptManager::handleOpcode(byte *dataP) {
}
case 210:
- _vm->_animationManager->NO_SEQ = true;
_vm->_soundManager->_specialSoundNum = 210;
- _vm->_animationManager->playSequence2("SECRET1.SEQ", 1, 12, 1);
+ _vm->_animationManager->playSequence2("SECRET1.SEQ", 1, 12, 1, true);
_vm->_soundManager->_specialSoundNum = 0;
_vm->_graphicsManager->fastDisplay(_vm->_globals->SPRITE_ECRAN, 192, 152, 0);
_vm->_objectsManager->setBobAnimation(9);
@@ -1943,7 +1942,6 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_objectsManager->loadLinkFile("IM73a");
_vm->_objectsManager->OBSSEUL = false;
_vm->_globals->enableHiding();
- _vm->_animationManager->NO_SEQ = false;
_vm->_globals->setHidingUseCount(0);
_vm->_globals->setHidingUseCount(1);
_vm->_graphicsManager->SETCOLOR4(252, 100, 100, 100);
@@ -1955,11 +1953,9 @@ int ScriptManager::handleOpcode(byte *dataP) {
case 211:
_vm->_objectsManager->removeSprite(0);
_vm->_globals->disableHiding();
- _vm->_animationManager->NO_SEQ = true;
_vm->_soundManager->_specialSoundNum = 211;
- _vm->_animationManager->playSequence("SECRET2.SEQ", 1, 12, 100);
+ _vm->_animationManager->playSequence("SECRET2.SEQ", 1, 12, 100, false, true);
_vm->_soundManager->_specialSoundNum = 0;
- _vm->_animationManager->NO_SEQ = false;
_vm->_graphicsManager->_noFadingFl = true;
_vm->_graphicsManager->fadeOutLong();
@@ -2272,9 +2268,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
// Resurrect Samantha's clone
case 242: {
_vm->_soundManager->playSoundFile("SOUND87.WAV");
- _vm->_animationManager->NO_SEQ = true;
- _vm->_animationManager->playSequence("RESUF.SEQ", 1, 24, 1);
- _vm->_animationManager->NO_SEQ = false;
+ _vm->_animationManager->playSequence("RESUF.SEQ", 1, 24, 1, false, true);
CharacterLocation *samantha = &_vm->_globals->_saveData->_samantha;
samantha->_pos.x = 404;
@@ -2297,9 +2291,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
case 243:
_vm->_soundManager->playSoundFile("SOUND88.WAV");
if (_vm->_globals->_saveData->_data[svField341] == 2) {
- _vm->_animationManager->NO_SEQ = true;
- _vm->_animationManager->playSequence("RESU.SEQ", 2, 24, 2);
- _vm->_animationManager->NO_SEQ = false;
+ _vm->_animationManager->playSequence("RESU.SEQ", 2, 24, 2, false, true);
} else {
_vm->_objectsManager->OPTI_ONE(7, 0, 14, 0);
}
@@ -2319,9 +2311,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_objectsManager->OPTI_ONE(6, 0, 15, 0);
_vm->_objectsManager->PERSO_ON = true;
_vm->_graphicsManager->NB_SCREEN(true);
- _vm->_animationManager->NO_SEQ = true;
- _vm->_animationManager->playSequence2("TUNNEL.SEQ", 1, 18, 20);
- _vm->_animationManager->NO_SEQ = false;
+ _vm->_animationManager->playSequence2("TUNNEL.SEQ", 1, 18, 20, true);
_vm->_graphicsManager->_noFadingFl = true;
_vm->_graphicsManager->fadeOutLong();
_vm->_objectsManager->PERSO_ON = false;