set the current theme by pointer to descriptor */
| 492 | /* set the current theme by pointer to descriptor |
| 493 | */ |
| 494 | bool 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 | */ |
no test coverage detected