diff options
| author | Johannes Schickel | 2005-12-20 12:42:22 +0000 | 
|---|---|---|
| committer | Johannes Schickel | 2005-12-20 12:42:22 +0000 | 
| commit | df493c63c4a0ffc66aa8576dae80a914c344606b (patch) | |
| tree | cffd92f632d6f2c7e8ceb4e6dc16c1f87c8db0e8 | |
| parent | f241049961e4758894a0d1abefce6a225956f7d8 (diff) | |
| download | scummvm-rg350-df493c63c4a0ffc66aa8576dae80a914c344606b.tar.gz scummvm-rg350-df493c63c4a0ffc66aa8576dae80a914c344606b.tar.bz2 scummvm-rg350-df493c63c4a0ffc66aa8576dae80a914c344606b.zip | |
Implemented cmd_makeAmuletAppear.
svn-id: r19815
| -rw-r--r-- | kyra/kyra.h | 3 | ||||
| -rw-r--r-- | kyra/script_v1.cpp | 36 | ||||
| -rw-r--r-- | kyra/staticres.cpp | 12 | 
3 files changed, 45 insertions, 6 deletions
| diff --git a/kyra/kyra.h b/kyra/kyra.h index fa82b1f4c3..5b6896f742 100644 --- a/kyra/kyra.h +++ b/kyra/kyra.h @@ -711,6 +711,8 @@ protected:  	int _roomTableSize;	  	char **_roomFilenameTable;  	int _roomFilenameTableSize; +	 +	uint8 *_amuleteAnim;  	Timer _timers[34];  	uint32 _timerNextRun;	 @@ -724,7 +726,6 @@ protected:  	static const uint16 _amuletX[];  	static const uint16 _amuletY[]; -  };  } // End of namespace Kyra diff --git a/kyra/script_v1.cpp b/kyra/script_v1.cpp index bae0bcd2c5..9d2db0ce96 100644 --- a/kyra/script_v1.cpp +++ b/kyra/script_v1.cpp @@ -1326,7 +1326,41 @@ int KyraEngine::cmd_drinkPotionAnimation(ScriptState *script) {  }  int KyraEngine::cmd_makeAmuletAppear(ScriptState *script) { -	warning("STUB: cmd_makeAmuletAppear"); +	debug(3, "cmd_makeAmuletAppear(0x%X) ()", script); +	WSAMovieV1 *amulet = wsa_open("AMULET.WSA", 1, 0); +	if (amulet) { +		assert(_amuleteAnim); +		_screen->hideMouse(); +		// snd_kyraPlaySound(0x70); +		uint32 nextTime = 0; +		for (int i = 0; _amuleteAnim[i] != 0xFF; ++i) { +			nextTime = _system->getMillis() + 5 * _tickLength; +			 +			uint8 code = _amuleteAnim[i]; +			if (code == 3 || code == 7) { +				// snd_kyraPlaySound(0x71); +			} +			 +			if (code == 5) { +				// snd_kyraPlaySound(0x72); +			} +			 +			if (code == 14) { +				// snd_kyraPlaySound(0x73); +			} +			 +			wsa_play(amulet, code, 224, 152, 0); +			_updateScreen = true; +			 +			while (_system->getMillis() < nextTime) { +				_sprites->updateSceneAnims(); +				updateAllObjectShapes(); +			} +		} +		_screen->showMouse(); +	} +	wsa_close(amulet); +	setGameFlag(0x2D);  	return 0;  } diff --git a/kyra/staticres.cpp b/kyra/staticres.cpp index d6e19a323b..1f5afdff97 100644 --- a/kyra/staticres.cpp +++ b/kyra/staticres.cpp @@ -26,7 +26,7 @@  namespace Kyra { -#define RESFILE_VERSION 4 +#define RESFILE_VERSION 5  #define GAME_FLAGS (GF_FLOPPY | GF_TALKIE | GF_DEMO | GF_AUDIOCD)  #define LANGUAGE_FLAGS (GF_ENGLISH | GF_FRENCH | GF_GERMAN | GF_SPANISH | GF_LNGUNK) @@ -194,6 +194,8 @@ void KyraEngine::res_loadResources(int type) {  		res_loadLangTable("PLACED.", &resFile, (byte***)&_placedList, &_placedList_Size, loadNativeLanguage);  		res_loadLangTable("DROPPED.", &resFile, (byte***)&_droppedList, &_droppedList_Size, loadNativeLanguage);  		res_loadLangTable("NODROP.", &resFile, (byte***)&_noDropList, &_noDropList_Size, loadNativeLanguage); +		 +		loadRawFile(resFile, "AMULETEANIM.SEQ", _amuleteAnim);  	}  #undef loadRooms @@ -299,6 +301,9 @@ void KyraEngine::res_unloadResources(int type) {  		delete [] _noDropList;  		_noDropList_Size = 0;  		_noDropList = 0; +		 +		delete [] _amuleteAnim; +		_amuleteAnim = 0;  	}  } @@ -627,7 +632,6 @@ const int8 KyraEngine::_addYPosTable[] = {  	 0, -2, -2, -2,  0,  2,  2,  2  }; -const uint16 KyraEngine::_amuletX[] = {231, 275, 253, 253}; -const uint16 KyraEngine::_amuletY[] = {170, 170, 159, 181}; - +const uint16 KyraEngine::_amuletX[] = { 231, 275, 253, 253 }; +const uint16 KyraEngine::_amuletY[] = { 170, 170, 159, 181 };  } // End of namespace Kyra | 
