MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / LoadMusicDataFromLUA

Method LoadMusicDataFromLUA

CrySoundSystem/MusicSystem.cpp:392–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390
391
392bool CMusicSystem::LoadMusicDataFromLUA(IScriptSystem* pScriptSystem, const char *pszFilename)
393{
394 SMusicData *pMusicData=new SMusicData();
395 pScriptSystem->SetGlobalToNull("DynamicMusic");
396 if (!pScriptSystem->ExecuteFile(pszFilename, true, true))
397 return false;
398 _SmartScriptObject pObj(pScriptSystem, true);
399 if (!pScriptSystem->GetGlobalValue("DynamicMusic", pObj))
400 return false;
401 CMusicLoadSink LoadSink(pMusicData, pScriptSystem, &pObj);
402 pObj->Dump(&LoadSink);
403 pScriptSystem->SetGlobalToNull("DynamicMusic");
404 if (!SetData(pMusicData))
405 return false;
406 return true;
407}
408
409
410void CMusicSystem::ReleaseData()

Callers

nothing calls this directly

Calls 4

SetGlobalToNullMethod · 0.80
ExecuteFileMethod · 0.80
GetGlobalValueMethod · 0.80
DumpMethod · 0.45

Tested by

no test coverage detected