aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/kyra/gui_v3.cpp14
-rw-r--r--engines/kyra/items_v3.cpp22
-rw-r--r--engines/kyra/kyra.h4
-rw-r--r--engines/kyra/kyra_v1.h2
-rw-r--r--engines/kyra/kyra_v2.cpp5
-rw-r--r--engines/kyra/kyra_v2.h2
-rw-r--r--engines/kyra/kyra_v3.cpp16
-rw-r--r--engines/kyra/kyra_v3.h6
-rw-r--r--engines/kyra/saveload_v3.cpp6
-rw-r--r--engines/kyra/scene_v3.cpp4
-rw-r--r--engines/kyra/script_v3.cpp10
-rw-r--r--engines/kyra/sequences_v3.cpp10
-rw-r--r--engines/kyra/sound.cpp4
-rw-r--r--engines/kyra/sound_v1.cpp4
14 files changed, 53 insertions, 56 deletions
diff --git a/engines/kyra/gui_v3.cpp b/engines/kyra/gui_v3.cpp
index 9e5546763a..51cd3bbc9a 100644
--- a/engines/kyra/gui_v3.cpp
+++ b/engines/kyra/gui_v3.cpp
@@ -443,7 +443,7 @@ int KyraEngine_v3::buttonInventory(Button *button) {
_screen->hideMouse();
clearInventorySlot(slot, 0);
- playSoundEffect(0x0B, 0xC8);
+ snd_playSoundEffect(0x0B, 0xC8);
setMouseCursor(slotItem);
updateItemCommand(slotItem, (_lang == 1) ? getItemCommandStringPickUp(slotItem) : 0, 0xFF);
_itemInHand = slotItem;
@@ -458,7 +458,7 @@ int KyraEngine_v3::buttonInventory(Button *button) {
if (itemInventoryMagic(_itemInHand, slot))
return 0;
- playSoundEffect(0x0B, 0xC8);
+ snd_playSoundEffect(0x0B, 0xC8);
_screen->hideMouse();
clearInventorySlot(slot, 0);
@@ -469,7 +469,7 @@ int KyraEngine_v3::buttonInventory(Button *button) {
_itemInHand = slotItem;
_screen->showMouse();
} else {
- playSoundEffect(0x0C, 0xC8);
+ snd_playSoundEffect(0x0C, 0xC8);
_screen->hideMouse();
drawInventorySlot(0, _itemInHand, slot);
_screen->setMouseCursor(0, 0, getShapePtr(0));
@@ -485,7 +485,7 @@ int KyraEngine_v3::buttonInventory(Button *button) {
int KyraEngine_v3::buttonMoodChange(Button *button) {
if (queryGameFlag(0x219)) {
- playSoundEffect(0x0D, 0xC8);
+ snd_playSoundEffect(0x0D, 0xC8);
return 0;
}
@@ -504,7 +504,7 @@ int KyraEngine_v3::buttonMoodChange(Button *button) {
_screen->hideMouse();
setGameFlag(3);
- playSoundEffect(0x2E, 0xC8);
+ snd_playSoundEffect(0x2E, 0xC8);
while (_invWsaFrame != frameTable[_malcolmsMood]) {
uint32 endTime = _system->getMillis() + 2 * _tickLength;
@@ -578,7 +578,7 @@ int KyraEngine_v3::buttonJesterStaff(Button *button) {
if (_itemInHand == 27) {
_screen->hideMouse();
removeHandItem();
- playSoundEffect(0x0C, 0xC8);
+ snd_playSoundEffect(0x0C, 0xC8);
drawJestersStaff(1, 0);
updateItemCommand(27, 2, 0xFF);
setGameFlag(0x97);
@@ -586,7 +586,7 @@ int KyraEngine_v3::buttonJesterStaff(Button *button) {
} else if (_itemInHand == -1) {
if (queryGameFlag(0x97)) {
_screen->hideMouse();
- playSoundEffect(0x0B, 0xC8);
+ snd_playSoundEffect(0x0B, 0xC8);
setHandItem(27);
drawJestersStaff(0, 0);
updateItemCommand(27, 0, 0xFF);
diff --git a/engines/kyra/items_v3.cpp b/engines/kyra/items_v3.cpp
index 1cbdf2ab40..d428debda6 100644
--- a/engines/kyra/items_v3.cpp
+++ b/engines/kyra/items_v3.cpp
@@ -190,7 +190,7 @@ bool KyraEngine_v3::dropItem(int unk1, uint16 item, int x, int y, int unk2) {
if (processItemDrop(_mainCharacter.sceneId, item, x, y, unk1, unk2))
return true;
- playSoundEffect(13, 200);
+ snd_playSoundEffect(13, 200);
if (countAllItems() >= 50) {
removeTrashItems();
@@ -202,7 +202,7 @@ bool KyraEngine_v3::dropItem(int unk1, uint16 item, int x, int y, int unk2) {
}
if (!_chatText)
- playSoundEffect(13, 200);
+ snd_playSoundEffect(13, 200);
return false;
}
@@ -320,7 +320,7 @@ void KyraEngine_v3::itemDropDown(int startX, int startY, int dstX, int dstY, int
_itemList[itemSlot].y = dstY;
_itemList[itemSlot].id = item;
_itemList[itemSlot].sceneId = _mainCharacter.sceneId;
- playSoundEffect(0x0C, 0xC8);
+ snd_playSoundEffect(0x0C, 0xC8);
addItemToAnimList(itemSlot);
} else {
uint8 *itemShape = getShapePtr(item + 248);
@@ -349,7 +349,7 @@ void KyraEngine_v3::itemDropDown(int startX, int startY, int dstX, int dstY, int
restoreGfxRect32x32(curX, curY-16);
if (dstX != dstY || (dstY - startY > 16)) {
- playSoundEffect(0x11, 0xC8);
+ snd_playSoundEffect(0x11, 0xC8);
speed = MAX(speed, 6);
int speedX = ((dstX - startX) << 4) / speed;
int origSpeed = speed;
@@ -389,7 +389,7 @@ void KyraEngine_v3::itemDropDown(int startX, int startY, int dstX, int dstY, int
_itemList[itemSlot].y = dstY;
_itemList[itemSlot].id = item;
_itemList[itemSlot].sceneId = _mainCharacter.sceneId;
- playSoundEffect(0x0C, 0xC8);
+ snd_playSoundEffect(0x0C, 0xC8);
addItemToAnimList(itemSlot);
_screen->showMouse();
}
@@ -417,7 +417,7 @@ void KyraEngine_v3::exchangeMouseItem(int itemPos, int runScript) {
_itemInHand = itemId;
addItemToAnimList(itemPos);
- playSoundEffect(0x0B, 0xC8);
+ snd_playSoundEffect(0x0B, 0xC8);
setMouseCursor(_itemInHand);
int str2 = 0;
@@ -445,7 +445,7 @@ bool KyraEngine_v3::pickUpItem(int x, int y, int runScript) {
deleteItemAnimEntry(itemPos);
int itemId = _itemList[itemPos].id;
_itemList[itemPos].id = 0xFFFF;
- playSoundEffect(0x0B, 0xC8);
+ snd_playSoundEffect(0x0B, 0xC8);
setMouseCursor(itemId);
int itemString = 0;
@@ -495,7 +495,7 @@ bool KyraEngine_v3::itemListMagic(int handItem, int itemSlot) {
assert(animObjIndex != -1);
_screen->hideMouse();
- playSoundEffect(0x93, 0xC8);
+ snd_playSoundEffect(0x93, 0xC8);
for (int i = 109; i <= 141; ++i) {
_animObjects[animObjIndex].shapeIndex = i+248;
_animObjects[animObjIndex].needRefresh = true;
@@ -529,7 +529,7 @@ bool KyraEngine_v3::itemListMagic(int handItem, int itemSlot) {
uint8 resItem = _itemMagicTable[i+2];
uint8 newItem = _itemMagicTable[i+3];
- playSoundEffect(0x0F, 0xC8);
+ snd_playSoundEffect(0x0F, 0xC8);
_itemList[itemSlot].id = (resItem == 0xFF) ? 0xFFFF : resItem;
@@ -567,7 +567,7 @@ bool KyraEngine_v3::itemInventoryMagic(int handItem, int invSlot) {
return true;
} else if ((handItem == 6 || handItem == 7) && item == 2) {
_screen->hideMouse();
- playSoundEffect(0x93, 0xC8);
+ snd_playSoundEffect(0x93, 0xC8);
for (int i = 109; i <= 141; ++i) {
_mainCharacter.inventory[invSlot] = i;
_screen->drawShape(2, getShapePtr(invSlot+422), 0, 144, 0, 0);
@@ -590,7 +590,7 @@ bool KyraEngine_v3::itemInventoryMagic(int handItem, int invSlot) {
uint8 resItem = _itemMagicTable[i+2];
uint8 newItem = _itemMagicTable[i+3];
- playSoundEffect(0x0F, 0xC8);
+ snd_playSoundEffect(0x0F, 0xC8);
_mainCharacter.inventory[invSlot] = (resItem == 0xFF) ? 0xFFFF : resItem;
diff --git a/engines/kyra/kyra.h b/engines/kyra/kyra.h
index 0fee9e4e3e..8bd7b69f63 100644
--- a/engines/kyra/kyra.h
+++ b/engines/kyra/kyra.h
@@ -125,8 +125,6 @@ public:
uint32 tickLength() const { return _tickLength; }
- virtual Movie *createWSAMovie() = 0;
-
Common::RandomSource _rnd;
// input
@@ -157,7 +155,7 @@ public:
// sound
virtual void snd_playTheme(int file, int track);
- virtual void snd_playSoundEffect(int id);
+ virtual void snd_playSoundEffect(int id, int volume=0xFF);
virtual void snd_playWanderScoreViaMap(int command, int restart);
virtual void snd_playVoiceFile(int id) = 0;
virtual bool snd_voiceIsPlaying();
diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h
index 3fa089e0d5..4adaf21838 100644
--- a/engines/kyra/kyra_v1.h
+++ b/engines/kyra/kyra_v1.h
@@ -202,7 +202,7 @@ public:
void readSettings();
void writeSettings();
- void snd_playSoundEffect(int track);
+ void snd_playSoundEffect(int track, int volume=0xFF);
void snd_playWanderScoreViaMap(int command, int restart);
virtual void snd_playVoiceFile(int id);
void snd_voiceWaitForFinish(bool ingame = true);
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp
index 26c6753031..d9b3e896ff 100644
--- a/engines/kyra/kyra_v2.cpp
+++ b/engines/kyra/kyra_v2.cpp
@@ -1838,8 +1838,8 @@ void KyraEngine_v2::playVoice(int high, int low) {
snd_playVoiceFile(vocFile);
}
-void KyraEngine_v2::snd_playSoundEffect(int track) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v2::snd_playSoundEffect(%d)", track);
+void KyraEngine_v2::snd_playSoundEffect(int track, int volume) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v2::snd_playSoundEffect(%d, %d)", track, volume);
if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
if (track == 10)
@@ -1857,7 +1857,6 @@ void KyraEngine_v2::snd_playSoundEffect(int track) {
else if (_flags.platform == Common::kPlatformPC)
// TODO ?? Maybe there is a way to let users select whether they want
// voc, midi or adl sfx (even though it makes no sense to choose anything but voc).
- // For now this is used as a fallback only (if no voc file exists).
KyraEngine::snd_playSoundEffect(track);
}
diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h
index 7a7aec803f..50bd05666d 100644
--- a/engines/kyra/kyra_v2.h
+++ b/engines/kyra/kyra_v2.h
@@ -842,7 +842,7 @@ protected:
void snd_loadSoundFile(int id);
void playVoice(int high, int low);
- void snd_playSoundEffect(int track);
+ void snd_playSoundEffect(int track, int volume=0xFF);
// timer
void timerFadeOutMessage(int);
diff --git a/engines/kyra/kyra_v3.cpp b/engines/kyra/kyra_v3.cpp
index 11e4410e2f..35a391a52e 100644
--- a/engines/kyra/kyra_v3.cpp
+++ b/engines/kyra/kyra_v3.cpp
@@ -383,8 +383,8 @@ void KyraEngine_v3::playMenuAudioFile() {
_musicSoundChannel = _soundDigital->playSound(_menuAudioFile, 0xFF, Audio::Mixer::kMusicSoundType);
}
-void KyraEngine_v3::playMusicTrack(int track, int force) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::playMusicTrack(%d, %d)", track, force);
+void KyraEngine_v3::snd_playWanderScoreViaMap(int track, int force) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v3::snd_playWanderScoreViaMap(%d, %d)", track, force);
// XXX byte_3C87C compare
@@ -434,7 +434,7 @@ int KyraEngine_v3::musicUpdate(int forceRestart) {
if (_musicSoundChannel >= 0) {
if (!_soundDigital->isPlaying(_musicSoundChannel)) {
if (_lastMusicCommand != -1)
- playMusicTrack(_lastMusicCommand, 1);
+ snd_playWanderScoreViaMap(_lastMusicCommand, 1);
}
}
lock = 0;
@@ -453,8 +453,8 @@ void KyraEngine_v3::fadeOutMusic(int ticks) {
}
}
-void KyraEngine_v3::playSoundEffect(int item, int volume) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::playSoundEffect(%d, %d)", item, volume);
+void KyraEngine_v3::snd_playSoundEffect(int item, int volume) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v3::snd_playSoundEffect(%d, %d)", item, volume);
if (_sfxFileMap[item*2+0] != 0xFF) {
char filename[16];
snprintf(filename, 16, "%s.AUD", _sfxFileList[_sfxFileMap[item*2+0]]);
@@ -497,7 +497,7 @@ void KyraEngine_v3::playStudioSFX(const char *str) {
if (str[strSize] != '?' && str[strSize] != '!')
return;
- playSoundEffect(_curStudioSFX++, 128);
+ snd_playSoundEffect(_curStudioSFX++, 128);
if (_curStudioSFX > 291)
_curStudioSFX = 283;
@@ -1045,7 +1045,7 @@ void KyraEngine_v3::handleInput(int x, int y) {
return;
if (_unk3 == -3) {
- playSoundEffect(0x0D, 0x80);
+ snd_playSoundEffect(0x0D, 0x80);
return;
}
@@ -1619,7 +1619,7 @@ void KyraEngine_v3::scoreIncrease(int count, const char *str) {
_screen->updateScreen();
delay(20, true);
- playSoundEffect(0x0E, 0xC8);
+ snd_playSoundEffect(0x0E, 0xC8);
drawOld = 0;
}
diff --git a/engines/kyra/kyra_v3.h b/engines/kyra/kyra_v3.h
index 852227ac6a..0fddbeb666 100644
--- a/engines/kyra/kyra_v3.h
+++ b/engines/kyra/kyra_v3.h
@@ -123,13 +123,13 @@ private:
static const char *_soundList[];
static const int _soundListSize;
- void playMusicTrack(int track, int force);
+ void snd_playWanderScoreViaMap(int track, int force);
void stopMusicTrack();
int musicUpdate(int forceRestart);
void fadeOutMusic(int ticks);
- void playSoundEffect(int item, int volume);
+ void snd_playSoundEffect(int item, int volume);
static const uint8 _sfxFileMap[];
static const int _sfxFileMapSize;
@@ -769,7 +769,7 @@ private:
int o3_getShapeFlag1(ScriptState *script);
int o3_setMalcolmPos(ScriptState *script);
int o3_stopMusic(ScriptState *script);
- int o3_playMusicTrack(ScriptState *script);
+ int o3_playWanderScoreViaMap(ScriptState *script);
int o3_playSoundEffect(ScriptState *script);
int o3_getScore(ScriptState *script);
int o3_blockOutRegion(ScriptState *script);
diff --git a/engines/kyra/saveload_v3.cpp b/engines/kyra/saveload_v3.cpp
index 130f814a7f..4d975c2a67 100644
--- a/engines/kyra/saveload_v3.cpp
+++ b/engines/kyra/saveload_v3.cpp
@@ -126,7 +126,7 @@ void KyraEngine_v3::loadGame(const char *fileName) {
Common::InSaveFile *saveFile = openSaveForReading(fileName, header);
if (!saveFile) {
showMessageFromCCode(17, 0xB3, 0);
- playSoundEffect(0x0D, 0xC8);
+ snd_playSoundEffect(0x0D, 0xC8);
return;
}
@@ -242,9 +242,9 @@ void KyraEngine_v3::loadGame(const char *fileName) {
setHandItem(_itemInHand);
if (_lastMusicCommand >= 0 && !_unkSceneScreenFlag1)
- playMusicTrack(_lastMusicCommand, 1);
+ snd_playWanderScoreViaMap(_lastMusicCommand, 1);
else if (_lastMusicCommand == -1)
- playMusicTrack(28, 1);
+ snd_playWanderScoreViaMap(28, 1);
while (!_screen->isMouseVisible())
_screen->showMouse();
diff --git a/engines/kyra/scene_v3.cpp b/engines/kyra/scene_v3.cpp
index d75bb2b8f2..37a439ddce 100644
--- a/engines/kyra/scene_v3.cpp
+++ b/engines/kyra/scene_v3.cpp
@@ -282,9 +282,9 @@ void KyraEngine_v3::enterNewSceneUnk1(int facing, int unk1, int unk2) {
initSceneAnims(unk2);
if (_mainCharacter.sceneId == 9 && !_soundDigital->isPlaying(_musicSoundChannel))
- playMusicTrack(_sceneList[_mainCharacter.sceneId].sound, 0);
+ snd_playWanderScoreViaMap(_sceneList[_mainCharacter.sceneId].sound, 0);
if (!unk2)
- playMusicTrack(_sceneList[_mainCharacter.sceneId].sound, 0);
+ snd_playWanderScoreViaMap(_sceneList[_mainCharacter.sceneId].sound, 0);
if (unk1 && !unk2 && _mainCharacter.animFrame != 87)
moveCharacter(facing, x, y);
diff --git a/engines/kyra/script_v3.cpp b/engines/kyra/script_v3.cpp
index a2f5c28978..c15a49b89a 100644
--- a/engines/kyra/script_v3.cpp
+++ b/engines/kyra/script_v3.cpp
@@ -885,15 +885,15 @@ int KyraEngine_v3::o3_stopMusic(ScriptState *script) {
return 0;
}
-int KyraEngine_v3::o3_playMusicTrack(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_playMusicTrack(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- playMusicTrack(stackPos(0), stackPos(1));
+int KyraEngine_v3::o3_playWanderScoreViaMap(ScriptState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_playWanderScoreViaMap(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ snd_playWanderScoreViaMap(stackPos(0), stackPos(1));
return 0;
}
int KyraEngine_v3::o3_playSoundEffect(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_playSoundEffect(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- playSoundEffect(stackPos(0), stackPos(1));
+ snd_playSoundEffect(stackPos(0), stackPos(1));
return 0;
}
@@ -1552,7 +1552,7 @@ void KyraEngine_v3::setupOpcodeTable() {
Opcode(o3_setMalcolmPos);
Opcode(o3_stopMusic);
// 0x58
- Opcode(o3_playMusicTrack);
+ Opcode(o3_playWanderScoreViaMap);
Opcode(o3_playSoundEffect);
Opcode(o3_getScore);
OpcodeUnImpl();
diff --git a/engines/kyra/sequences_v3.cpp b/engines/kyra/sequences_v3.cpp
index c2c25537b4..827d48d7ac 100644
--- a/engines/kyra/sequences_v3.cpp
+++ b/engines/kyra/sequences_v3.cpp
@@ -68,7 +68,7 @@ void KyraEngine_v3::showBadConscience() {
setupSceneAnimObject(0x0E, 9, 0, 187, -1, -1, -1, -1, 0, 0, 0, -1, animFilenames[anim]);
for (uint i = 0; i <= _badConscienceFrameTable[_badConscienceAnim]; ++i) {
if (i == 8)
- playSoundEffect(0x1B, 0xC8);
+ snd_playSoundEffect(0x1B, 0xC8);
updateSceneAnim(0x0E, i);
delay(3*_tickLength, true);
}
@@ -98,7 +98,7 @@ void KyraEngine_v3::hideBadConscience() {
_badConscienceShown = false;
for (int frame = _badConscienceFrameTable[_badConscienceAnim+8]; frame >= 0; --frame) {
if (frame == 15)
- playSoundEffect(0x31, 0xC8);
+ snd_playSoundEffect(0x31, 0xC8);
updateSceneAnim(0x0E, frame);
delay(1*_tickLength, true);
}
@@ -142,7 +142,7 @@ void KyraEngine_v3::showGoodConscience() {
setupSceneAnimObject(0x0F, 9, 0, 187, -1, -1, -1, -1, 0, 0, 0, -1, animFilenames[anim]);
for (uint i = 0; i <= _goodConscienceFrameTable[_goodConscienceAnim]; ++i) {
if (i == 10)
- playSoundEffect(0x7F, 0xC8);
+ snd_playSoundEffect(0x7F, 0xC8);
updateSceneAnim(0x0F, i);
delay(2*_tickLength, true);
}
@@ -172,7 +172,7 @@ void KyraEngine_v3::hideGoodConscience() {
_goodConscienceShown = false;
for (int frame = _goodConscienceFrameTable[_goodConscienceAnim+5]; frame >= 0; --frame) {
if (frame == 17)
- playSoundEffect(0x31, 0xC8);
+ snd_playSoundEffect(0x31, 0xC8);
updateSceneAnim(0x0F, frame);
delay(1*_tickLength, true);
}
@@ -246,7 +246,7 @@ void KyraEngine_v3::eelScript() {
setGameFlag(0xD1);
- playSoundEffect(0x2A, 0xC8);
+ snd_playSoundEffect(0x2A, 0xC8);
setGameFlag(0x171);
diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp
index 694ea14404..887e9c7267 100644
--- a/engines/kyra/sound.cpp
+++ b/engines/kyra/sound.cpp
@@ -478,8 +478,8 @@ void KyraEngine::snd_playTheme(int file, int track) {
_sound->playTrack(track);
}
-void KyraEngine::snd_playSoundEffect(int track) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine::snd_playSoundEffect(%d)", track);
+void KyraEngine::snd_playSoundEffect(int track, int volume) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine::snd_playSoundEffect(%d, %d)", track, volume);
_sound->playSoundEffect(track);
}
diff --git a/engines/kyra/sound_v1.cpp b/engines/kyra/sound_v1.cpp
index 9cb135983d..8293eb7508 100644
--- a/engines/kyra/sound_v1.cpp
+++ b/engines/kyra/sound_v1.cpp
@@ -28,8 +28,8 @@
namespace Kyra {
-void KyraEngine_v1::snd_playSoundEffect(int track) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v1::snd_playSoundEffect(%d)", track);
+void KyraEngine_v1::snd_playSoundEffect(int track, int volume) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v1::snd_playSoundEffect(%d, %d)", track, volume);
if ((_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) && track == 49) {
snd_playWanderScoreViaMap(56, 1);
return;