fix song backgrounds, probably other things

This commit is contained in:
Glenn Maynard
2004-11-11 22:31:55 +00:00
parent 215a1ba9fb
commit e0ef0da9e9
2 changed files with 9 additions and 2 deletions
+4
View File
@@ -152,6 +152,10 @@ void Lua::UpdateGlobals()
ASSERT( L );
/* Important: eplicitly refresh cached metrics that we use. */
SCREEN_WIDTH.Read();
SCREEN_HEIGHT.Read();
lua_pushnumber( L, SCREEN_WIDTH );
lua_setglobal( L, "SCREEN_WIDTH" );
lua_pushnumber( L, SCREEN_HEIGHT );
+5 -2
View File
@@ -290,10 +290,13 @@ void ThemeManager::SwitchThemeAndLanguage( const CString &sThemeName, const CStr
if ( SCREENMAN != NULL )
SCREENMAN->ThemeChanged();
/* Lua globals can use metrics which are cached, and vice versa. Update Lua
* globals first; it's Lua's job to explicitly update cached metrics that it
* uses. */
Lua::UpdateGlobals();
// reload subscribers
FOREACH( IThemeMetric*, *g_pvpSubscribers, p ) (*p)->Read();
Lua::UpdateGlobals();
}
CString ThemeManager::GetThemeDirFromName( const CString &sThemeName )