mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-10 12:36:45 +03:00
Register SetAmbientTrack and PlayAudioTrack. Make PlayAudioTrack static, pass its string arg by reference-to-const, and let it use the loop bool passed in instead of the one stored in global state.
Improve some text formatting in the header.
This commit is contained in:
parent
9386993bcd
commit
33dcd85a06
2 changed files with 13 additions and 10 deletions
|
@ -18,6 +18,9 @@ extern bool const WarningsAsErrors = true;
|
|||
|
||||
GameScript::GameScript(sol::state* lua) : LuaHandler{ lua }
|
||||
{
|
||||
m_lua->set_function("SetAmbientTrack", &GameScript::SetAmbientTrack);
|
||||
m_lua->set_function("PlayAudioTrack", &GameScript::PlayAudioTrack);
|
||||
|
||||
GameScriptItemInfo::Register(m_lua);
|
||||
GameScriptPosition::Register(m_lua);
|
||||
GameScriptRotation::Register(m_lua);
|
||||
|
@ -224,9 +227,9 @@ std::unique_ptr<GameScriptItemInfo> GameScript::GetItemByName(std::string name)
|
|||
return std::make_unique<GameScriptItemInfo>(m_itemsMapName[name]);
|
||||
}
|
||||
|
||||
void GameScript::PlayAudioTrack(std::string trackName, bool looped)
|
||||
void GameScript::PlayAudioTrack(std::string const & trackName, bool looped)
|
||||
{
|
||||
S_CDPlay(trackName, g_AudioTracks[trackName].looped);
|
||||
S_CDPlay(trackName, looped);
|
||||
}
|
||||
|
||||
void GameScript::PlaySoundEffect(int id, GameScriptPosition p, int flags)
|
||||
|
|
|
@ -81,10 +81,10 @@ public:
|
|||
void ResetVariables();
|
||||
|
||||
// Sound
|
||||
void PlayAudioTrack(std::string trackName, bool looped);
|
||||
static void PlayAudioTrack(std::string const & trackName, bool looped);
|
||||
void PlaySoundEffect(int id, GameScriptPosition pos, int flags);
|
||||
void PlaySoundEffect(int id, int flags);
|
||||
void SetAmbientTrack(std::string const & trackName);
|
||||
static void SetAmbientTrack(std::string const & trackName);
|
||||
|
||||
// Special FX
|
||||
void AddLightningArc(GameScriptPosition src, GameScriptPosition dest, GameScriptColor color, int lifetime, int amplitude, int beamWidth, int segments, int flags);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue