mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-07 11:27:44 +00:00
HOPKINS: Get rid of NO_SEQ in AnimationManager
This commit is contained in:
parent
df751fc80b
commit
c49cbf3747
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user