diff options
| author | Torbjörn Andersson | 2004-10-19 18:11:50 +0000 | 
|---|---|---|
| committer | Torbjörn Andersson | 2004-10-19 18:11:50 +0000 | 
| commit | 20e57d8bd59e906264d2dbf285638a86a761a933 (patch) | |
| tree | 8e44dd97a89a7fdf5308eb6de1c1f72ec48bca8e | |
| parent | 82b6902b5661b6b9832d39ae33627bc964cccf34 (diff) | |
| download | scummvm-rg350-20e57d8bd59e906264d2dbf285638a86a761a933.tar.gz scummvm-rg350-20e57d8bd59e906264d2dbf285638a86a761a933.tar.bz2 scummvm-rg350-20e57d8bd59e906264d2dbf285638a86a761a933.zip | |
Cleanup. No need to have a lookup table for something that can be expressed
by simple arithmetics.
svn-id: r15615
| -rw-r--r-- | saga/resnames.h | 30 | ||||
| -rw-r--r-- | saga/sfuncs.cpp | 33 | 
2 files changed, 5 insertions, 58 deletions
| diff --git a/saga/resnames.h b/saga/resnames.h index ceea4ff14a..3922267255 100644 --- a/saga/resnames.h +++ b/saga/resnames.h @@ -102,36 +102,12 @@ namespace Saga {  #define CAVE_VOICE_12 12  #define CAVE_VOICE_13 13 -// TODO: I have no idea why the music IDs start at 9 and the sound IDs at 14. -//       We should probably just renumber them. -  // MUSIC  #define MUSIC_1 9  #define MUSIC_2 10 -#define MUSIC_3 11 -#define MUSIC_4 12 -#define MUSIC_5 13 -#define MUSIC_6 14 -#define MUSIC_7 15 -#define MUSIC_8 16 -#define MUSIC_9 17 -#define MUSIC_10 18 -#define MUSIC_11 19 -#define MUSIC_12 20 -#define MUSIC_13 21 -#define MUSIC_14 22 -#define MUSIC_15 23 -#define MUSIC_16 24 -#define MUSIC_17 25 -#define MUSIC_18 26 -#define MUSIC_19 27 -#define MUSIC_20 28 -#define MUSIC_21 29 -#define MUSIC_22 30 -#define MUSIC_23 31 -#define MUSIC_24 32 -#define MUSIC_25 33 -#define MUSIC_26 34 + +// TODO: If the sound effects are numbered sequentially, we don't really need +//       these constants. But for now they might be useful for debugging.  // SOUND EFFECTS diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp index 1bbc36b063..674d3a0f82 100644 --- a/saga/sfuncs.cpp +++ b/saga/sfuncs.cpp @@ -721,41 +721,12 @@ int Script::SF_getActorY(R_SCRIPTFUNC_PARAMS) {  	return R_SUCCESS;  } -static int musicTable[] = { -	MUSIC_1, -	MUSIC_2, -	MUSIC_3, -	MUSIC_4, -	MUSIC_5, -	MUSIC_6, -	MUSIC_7, -	MUSIC_8, -	MUSIC_9, -	MUSIC_10, -	MUSIC_11, -	MUSIC_12, -	MUSIC_13, -	MUSIC_14, -	MUSIC_15, -	MUSIC_16, -	MUSIC_17, -	MUSIC_18, -	MUSIC_19, -	MUSIC_20, -	MUSIC_21, -	MUSIC_22, -	MUSIC_23, -	MUSIC_24, -	MUSIC_25, -	MUSIC_26 -}; -  // Script function #63 (0x3F)  int Script::SF_playMusic(R_SCRIPTFUNC_PARAMS) {  	SDataWord_T param = thread->pop(); -	if (/* param >= 0 && */ param < ARRAYSIZE(musicTable)) -		_vm->_music->play(musicTable[param]); +	if (param >= 9 && param <= 34) +		_vm->_music->play(param);  	else  		_vm->_music->stop(); | 
