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

Method SetTheme

CrySoundSystem/MusicSystem.cpp:494–514  ·  view source on GitHub ↗

set the current theme by pointer to descriptor */

Source from the content-addressed store, hash-verified

492/* set the current theme by pointer to descriptor
493*/
494bool CMusicSystem::SetTheme(SMusicTheme *pNewTheme, bool bOverride)
495{
496 CSmartCriticalSection SmartCriticalSection(m_CS);
497 if (pNewTheme==m_pCurrTheme)
498 return true; // do nothing since we're already in the requested theme
499 if (!((m_pCurrTheme==m_pNextTheme) || (pNewTheme))) // only switch to the new theme if there was no switch in this frame yet OR the new theme is NOT null
500 return true;
501 if (pNewTheme)
502 LogMsg("[MusicSystem] Setting theme to %s", pNewTheme->sName.c_str());
503 else
504 LogMsg("[MusicSystem] Setting theme to NULL");
505 if (bOverride)
506 {
507 m_pThemeOverride=pNewTheme;
508 m_pNextTheme=m_pCurrTheme;
509 }else
510 {
511 m_pNextTheme=pNewTheme;
512 }
513 return true;
514}
515
516/* set the current theme by name
517*/

Callers 4

OnPlayMethod · 0.45
NewThemeMethod · 0.45
LoadFromLuaMethod · 0.45
SetMusicThemeMethod · 0.45

Calls 4

SetThemeFunction · 0.85
c_strMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected