Skip to content

Commit

Permalink
HOPKINS: Remove one more variable from AnimationManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Mar 23, 2013
1 parent c49cbf3 commit a6a8f1a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 30 deletions.
9 changes: 4 additions & 5 deletions engines/hopkins/anim.cpp
Expand Up @@ -38,7 +38,6 @@ namespace Hopkins {
AnimationManager::AnimationManager(HopkinsEngine *vm) {
_vm = vm;
_clearAnimationFl = false;
NO_COUL = false;
}

/**
Expand Down Expand Up @@ -605,13 +604,13 @@ 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, bool skipSeqFl) {
void AnimationManager::playSequence(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3, bool skipEscFl, bool skipSeqFl, bool noColFl) {
if (_vm->shouldQuit())
return;

bool hasScreenCopy = false;
_vm->_eventsManager->_mouseFl = false;
if (!NO_COUL) {
if (!noColFl) {
_vm->_eventsManager->refreshScreenAndEvents();

if (_vm->_graphicsManager->_lineNbr == SCREEN_WIDTH)
Expand Down Expand Up @@ -678,7 +677,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
} while (_vm->_eventsManager->_rateCounter < rate1);
}
} else {
if (NO_COUL)
if (noColFl)
_vm->_graphicsManager->fadeInDefaultLength(screenP);
_vm->_eventsManager->_rateCounter = 0;
_vm->_eventsManager->_escKeyFl = false;
Expand Down Expand Up @@ -764,7 +763,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
_vm->_graphicsManager->_skipVideoLockFl = false;
f.close();

if (!NO_COUL) {
if (!noColFl) {
_vm->_saveLoadManager->load("TEMP.SCR", _vm->_graphicsManager->_vesaScreen);
g_system->getSavefileManager()->removeSavefile("TEMP.SCR");

Expand Down
3 changes: 1 addition & 2 deletions engines/hopkins/anim.h
Expand Up @@ -41,15 +41,14 @@ class AnimationManager {

public:
bool _clearAnimationFl;
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, 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, bool skipSeqFl = false);
void playSequence(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3, bool skipEscFl, bool skipSeqFl, bool noColFl = false);
void playSequence2(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3, bool skipSeqFl = false);
};

Expand Down
4 changes: 1 addition & 3 deletions engines/hopkins/hopkins.cpp
Expand Up @@ -2032,10 +2032,8 @@ void HopkinsEngine::playUnderwaterBaseCutscene() {
_soundManager->playSound(26);
_globals->iRegul = 1;
_globals->_disableInventFl = true;
_animationManager->NO_COUL = true;
_graphicsManager->FADE_LINUX = 2;
_animationManager->playSequence("abase.seq", 50, 15, 50);
_animationManager->NO_COUL = false;
_animationManager->playSequence("abase.seq", 50, 15, 50, false, false, true);
_graphicsManager->loadImage("IM92");
_animationManager->loadAnim("ANIM92");
_graphicsManager->displayAllBob();
Expand Down
2 changes: 1 addition & 1 deletion engines/hopkins/objects.cpp
Expand Up @@ -3696,7 +3696,7 @@ void ObjectsManager::PERSONAGE(const Common::String &backgroundFile, const Commo
_vm->_eventsManager->refreshScreenAndEvents();
_vm->_graphicsManager->fadeInLong();
if (_vm->_globals->_screenId == 61) {
_vm->_animationManager->playSequence("OUVRE.SEQ", 10, 4, 10);
_vm->_animationManager->playSequence("OUVRE.SEQ", 10, 4, 10, false, false);
stopBobAnimation(3);
_vm->_globals->_checkDistanceFl = true;
_oldCharacterPosX = getSpriteX(0);
Expand Down
34 changes: 15 additions & 19 deletions engines/hopkins/script.cpp
Expand Up @@ -714,7 +714,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_soundManager->loadSample(2, "SOUND42.WAV");
_vm->_soundManager->loadSample(3, "SOUND41.WAV");
_vm->_soundManager->_specialSoundNum = 17;
_vm->_animationManager->playSequence("grenade.SEQ", 1, 32, 100);
_vm->_animationManager->playSequence("grenade.SEQ", 1, 32, 100, false, false);
_vm->_soundManager->_specialSoundNum = 0;
_vm->_graphicsManager->FADE_LINUX = 2;
_vm->_animationManager->playAnim("CREVE17.ANM", 24, 24, 200);
Expand Down Expand Up @@ -1292,11 +1292,10 @@ int ScriptManager::handleOpcode(byte *dataP) {
case 90:
_vm->_soundManager->playSoundFile("SOUND52.WAV");
if (!_vm->_globals->_saveData->_data[svField186]) {
_vm->_animationManager->playSequence("CIB5A.SEQ", 1, 12, 1);
_vm->_animationManager->playSequence("CIB5A.SEQ", 1, 12, 1, false, false);
_vm->_graphicsManager->fastDisplay(_vm->_globals->SPRITE_ECRAN, 155, 29, 0);
}
if (_vm->_globals->_saveData->_data[svField186] == 1) {
_vm->_animationManager->playSequence("CIB5C.SEQ", 1, 12, 1);
} else if (_vm->_globals->_saveData->_data[svField186] == 1) {
_vm->_animationManager->playSequence("CIB5C.SEQ", 1, 12, 1, false, false);
_vm->_graphicsManager->fastDisplay(_vm->_globals->SPRITE_ECRAN, 155, 29, 0);
_vm->_graphicsManager->fastDisplay(_vm->_globals->SPRITE_ECRAN, 329, 87, 2);
}
Expand All @@ -1305,11 +1304,10 @@ int ScriptManager::handleOpcode(byte *dataP) {
case 91:
_vm->_soundManager->playSoundFile("SOUND52.WAV");
if (!_vm->_globals->_saveData->_data[svField186]) {
_vm->_animationManager->playSequence("CIB5B.SEQ", 1, 12, 1);
_vm->_animationManager->playSequence("CIB5B.SEQ", 1, 12, 1, false, false);
_vm->_graphicsManager->fastDisplay(_vm->_globals->SPRITE_ECRAN, 155, 29, 5);
}
if (_vm->_globals->_saveData->_data[svField186] == 1) {
_vm->_animationManager->playSequence("CIB5D.SEQ", 1, 12, 1);
} else if (_vm->_globals->_saveData->_data[svField186] == 1) {
_vm->_animationManager->playSequence("CIB5D.SEQ", 1, 12, 1, false, false);
_vm->_graphicsManager->fastDisplay(_vm->_globals->SPRITE_ECRAN, 155, 29, 5);
_vm->_graphicsManager->fastDisplay(_vm->_globals->SPRITE_ECRAN, 283, 160, 6);
}
Expand All @@ -1318,11 +1316,10 @@ int ScriptManager::handleOpcode(byte *dataP) {
case 92:
_vm->_soundManager->playSoundFile("SOUND52.WAV");
if (!_vm->_globals->_saveData->_data[svField184]) {
_vm->_animationManager->playSequence("CIB6A.SEQ", 1, 12, 1);
_vm->_animationManager->playSequence("CIB6A.SEQ", 1, 12, 1, false, false);
_vm->_graphicsManager->fastDisplay(_vm->_globals->SPRITE_ECRAN, 155, 29, 0);
}
if (_vm->_globals->_saveData->_data[svField184] == 1) {
_vm->_animationManager->playSequence("CIB6C.SEQ", 1, 12, 1);
} else if (_vm->_globals->_saveData->_data[svField184] == 1) {
_vm->_animationManager->playSequence("CIB6C.SEQ", 1, 12, 1, false, false);
_vm->_graphicsManager->fastDisplay(_vm->_globals->SPRITE_ECRAN, 155, 29, 0);
_vm->_graphicsManager->fastDisplay(_vm->_globals->SPRITE_ECRAN, 293, 139, 3);
}
Expand All @@ -1331,11 +1328,10 @@ int ScriptManager::handleOpcode(byte *dataP) {
case 93:
_vm->_soundManager->playSoundFile("SOUND52.WAV");
if (!_vm->_globals->_saveData->_data[svField184]) {
_vm->_animationManager->playSequence("CIB6B.SEQ", 1, 12, 1);
_vm->_animationManager->playSequence("CIB6B.SEQ", 1, 12, 1, false, false);
_vm->_graphicsManager->fastDisplay(_vm->_globals->SPRITE_ECRAN, 155, 29, 5);
}
if (_vm->_globals->_saveData->_data[svField184] == 1) {
_vm->_animationManager->playSequence("CIB6D.SEQ", 1, 12, 1);
} else if (_vm->_globals->_saveData->_data[svField184] == 1) {
_vm->_animationManager->playSequence("CIB6D.SEQ", 1, 12, 1, false, false);
_vm->_graphicsManager->fastDisplay(_vm->_globals->SPRITE_ECRAN, 155, 29, 5);
_vm->_graphicsManager->fastDisplay(_vm->_globals->SPRITE_ECRAN, 283, 161, 8);
}
Expand Down Expand Up @@ -1872,7 +1868,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_globals->_disableInventFl = true;
if (_vm->_globals->_saveData->_data[svLastPrevScreenId] != _vm->_globals->_saveData->_data[svField401]) {
_vm->_soundManager->_specialSoundNum = 208;
_vm->_animationManager->playSequence("SORT.SEQ", 10, 4, 10, true);
_vm->_animationManager->playSequence("SORT.SEQ", 10, 4, 10, true, false);
_vm->_soundManager->_specialSoundNum = 0;
}
_vm->_globals->_checkDistanceFl = true;
Expand Down Expand Up @@ -1986,7 +1982,7 @@ int ScriptManager::handleOpcode(byte *dataP) {

case 229:
_vm->_soundManager->_specialSoundNum = 229;
_vm->_animationManager->playSequence("MUR.SEQ", 1, 12, 1);
_vm->_animationManager->playSequence("MUR.SEQ", 1, 12, 1, false, false);
_vm->_soundManager->_specialSoundNum = 0;
_vm->_graphicsManager->fastDisplay(_vm->_globals->SPRITE_ECRAN, 340, 157, 2);
break;
Expand Down

0 comments on commit a6a8f1a

Please sign in to comment.