Cleanup. No need to have a lookup table for something that can be expressed

by simple arithmetics.

svn-id: r15615
This commit is contained in:
Torbjörn Andersson 2004-10-19 18:11:50 +00:00
parent 82b6902b56
commit 20e57d8bd5
2 changed files with 5 additions and 58 deletions

View File

@ -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

View File

@ -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();