aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2013-05-01 23:20:36 +0200
committerStrangerke2013-05-01 23:20:36 +0200
commit7b34c681588ba615368e85da9366c354f73a3800 (patch)
treea15cb2e28860adeeaa5fc6b5e607901c08ec3101 /engines
parenta11f579a3f1690cf55c5402b8453fbaef6dd16fb (diff)
downloadscummvm-rg350-7b34c681588ba615368e85da9366c354f73a3800.tar.gz
scummvm-rg350-7b34c681588ba615368e85da9366c354f73a3800.tar.bz2
scummvm-rg350-7b34c681588ba615368e85da9366c354f73a3800.zip
HOPKINS: Remove a hack for T421 animation, rework playAnim2() to accept an alternate animation file name
Diffstat (limited to 'engines')
-rw-r--r--engines/hopkins/anim.cpp8
-rw-r--r--engines/hopkins/anim.h2
-rw-r--r--engines/hopkins/hopkins.cpp2
-rw-r--r--engines/hopkins/script.cpp7
4 files changed, 9 insertions, 10 deletions
diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp
index 8dab9f7e58..2ec9cec009 100644
--- a/engines/hopkins/anim.cpp
+++ b/engines/hopkins/anim.cpp
@@ -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;
@@ -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);
diff --git a/engines/hopkins/anim.h b/engines/hopkins/anim.h
index 724ff15e00..bf9b55aaae 100644
--- a/engines/hopkins/anim.h
+++ b/engines/hopkins/anim.h
@@ -65,7 +65,7 @@ public:
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);
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index 97c4210302..7835d3784e 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -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;
diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp
index b72eb47bf2..1324afef68 100644
--- a/engines/hopkins/script.cpp
+++ b/engines/hopkins/script.cpp
@@ -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();
@@ -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;