[Scummvm-cvs-logs] scummvm master -> 7b34c681588ba615368e85da9366c354f73a3800

Strangerke Strangerke at scummvm.org
Wed May 1 23:21:55 CEST 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7b34c68158 HOPKINS: Remove a hack for T421 animation, rework playAnim2() to accept an alternate animation file name


Commit: 7b34c681588ba615368e85da9366c354f73a3800
    https://github.com/scummvm/scummvm/commit/7b34c681588ba615368e85da9366c354f73a3800
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-05-01T14:20:36-07:00

Commit Message:
HOPKINS: Remove a hack for T421 animation, rework playAnim2() to accept an alternate animation file name

Changed paths:
    engines/hopkins/anim.cpp
    engines/hopkins/anim.h
    engines/hopkins/hopkins.cpp
    engines/hopkins/script.cpp



diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp
index 8dab9f7..2ec9cec 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 724ff15..bf9b55a 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 97c4210..7835d37 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 b72eb47..1324afe 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;






More information about the Scummvm-git-logs mailing list