Skip to content

Commit

Permalink
HOPKINS: Remove a hack for T421 animation, rework playAnim2() to acce…
Browse files Browse the repository at this point in the history
…pt an alternate animation file name
  • Loading branch information
Strangerke committed May 1, 2013
1 parent a11f579 commit 7b34c68
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
8 changes: 5 additions & 3 deletions engines/hopkins/anim.cpp
Expand Up @@ -196,7 +196,7 @@ void AnimationManager::playAnim(const Common::String &hiresName, const Common::S
/**
* Play Animation, type 2
*/
void AnimationManager::playAnim2(const Common::String &filename, uint32 rate1, uint32 rate2, uint32 rate3) {
void AnimationManager::playAnim2(const Common::String &hiresName, const Common::String &lowresName, uint32 rate1, uint32 rate2, uint32 rate3) {
int oldScrollPosX = 0;
byte *screenP = NULL;
Common::File f;
Expand All @@ -215,8 +215,10 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 rate1, u
_vm->_graphicsMan->_scrollOffset = 0;

screenP = _vm->_graphicsMan->_backBuffer;
if (!f.open(filename))
error("Error opening file - %s", filename.c_str());
if (!f.open(hiresName)) {
if (!f.open(lowresName))
error("Error opening files: %s - %s", hiresName.c_str(), lowresName.c_str());
}

f.skip(6);
f.read(_vm->_graphicsMan->_palette, 800);
Expand Down
2 changes: 1 addition & 1 deletion engines/hopkins/anim.h
Expand Up @@ -65,7 +65,7 @@ class AnimationManager {
void loadAnim(const Common::String &animName);
void clearAnim();
void playAnim(const Common::String &hiresName, const Common::String &lowresName, uint32 rate1, uint32 rate2, uint32 rate3, bool skipSeqFl = false);
void playAnim2(const Common::String &filename, uint32 rate1, uint32 rate2, uint32 rate3);
void playAnim2(const Common::String &hiresName, const Common::String &lowresName, uint32 rate1, uint32 rate2, uint32 rate3);
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
2 changes: 1 addition & 1 deletion engines/hopkins/hopkins.cpp
Expand Up @@ -2141,7 +2141,7 @@ void HopkinsEngine::playEnding() {
} else {
_soundMan->_specialSoundNum = 200;
_soundMan->_skipRefreshFl = true;
_animMan->playAnim2("BERM.ANM", 100, 24, 300);
_animMan->playAnim2("BERM.ANM", "BERM.ANM", 100, 24, 300);
_objectsMan->stopBobAnimation(7);
_objectsMan->setBobAnimation(8);
_globals->_introSpeechOffFl = true;
Expand Down
7 changes: 2 additions & 5 deletions engines/hopkins/script.cpp
Expand Up @@ -1398,10 +1398,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
_vm->_globals->_introSpeechOffFl = true;
_vm->_talkMan->startAnimatedCharacterDialogue("tourist1.pe2");
_vm->_globals->_introSpeechOffFl = false;
if (_vm->_fileIO->fileExists("T421A.ANM"))
_vm->_animMan->playAnim2("T421A.ANM", 100, 14, 500);
else
_vm->_animMan->playAnim2("T421.ANM", 100, 14, 500);
_vm->_animMan->playAnim2("T421A.ANM", "T421.ANM", 100, 14, 500);
_vm->_events->refreshScreenAndEvents();
_vm->_events->refreshScreenAndEvents();
_vm->_events->refreshScreenAndEvents();
Expand Down Expand Up @@ -2403,7 +2400,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
// Display bomb plan
if (!_vm->getIsDemo()) {
memcpy(_vm->_graphicsMan->_oldPalette, _vm->_graphicsMan->_palette, 769);
_vm->_animMan->playAnim2("PLAN.ANM", 50, 10, 800);
_vm->_animMan->playAnim2("PLAN.ANM", "PLAN.ANM", 50, 10, 800);
}
_vm->_graphicsMan->resetDirtyRects();
break;
Expand Down

0 comments on commit 7b34c68

Please sign in to comment.