mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-11 13:45:25 +00:00
EMI: Implement opcode PlaySound
This commit is contained in:
parent
a979958479
commit
faa0c3430a
@ -111,6 +111,7 @@ protected:
|
||||
DECLARE_LUA_OPCODE(FreeSound);
|
||||
DECLARE_LUA_OPCODE(PlayLoadedSound);
|
||||
DECLARE_LUA_OPCODE(StopSound);
|
||||
DECLARE_LUA_OPCODE(PlaySound);
|
||||
DECLARE_LUA_OPCODE(GetSoundVolume);
|
||||
DECLARE_LUA_OPCODE(SetSoundVolume);
|
||||
DECLARE_LUA_OPCODE(PlaySoundFrom);
|
||||
|
@ -246,6 +246,22 @@ void Lua_V2::StopSound() {
|
||||
}
|
||||
}
|
||||
|
||||
void Lua_V2::PlaySound() {
|
||||
lua_Object strObj = lua_getparam(1);
|
||||
//FIXME: get the second param
|
||||
lua_getparam(2);
|
||||
|
||||
if (!lua_isstring(strObj))
|
||||
return;
|
||||
|
||||
const char *str = lua_getstring(strObj);
|
||||
|
||||
AIFFTrack *track = new AIFFTrack(Audio::Mixer::kSFXSoundType);
|
||||
Common::SeekableReadStream *stream = g_resourceloader->openNewStreamFile(str);
|
||||
track->openSound(str, stream);
|
||||
track->play();
|
||||
}
|
||||
|
||||
void Lua_V2::ImSetMusicVol() {
|
||||
// This only seems to be used in the demo.
|
||||
lua_Object volumeObj = lua_getparam(1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user