diff --git a/stepmania/src/ScreenDimensions.cpp b/stepmania/src/ScreenDimensions.cpp index fd31a2d4e0..d05dda1709 100644 --- a/stepmania/src/ScreenDimensions.cpp +++ b/stepmania/src/ScreenDimensions.cpp @@ -21,7 +21,7 @@ ThemeMetric THEME_SCREEN_HEIGHT("Common","ScreenHeight"); */ #define THEME_NATIVE_ASPECT (THEME_SCREEN_WIDTH/THEME_SCREEN_HEIGHT) -static float ScreenAspectRatio() +float ScreenAspectRatio() { float fAspect = PREFSMAN->m_fDisplayAspectRatio; if( fAspect == ASPECT_AUTO ) @@ -37,6 +37,11 @@ static float ScreenAspectRatio() return fAspect; } +float ThemeAspectRatio() +{ + return THEME_NATIVE_ASPECT; +} + float ScreenWidth() { float fAspect = ScreenAspectRatio(); diff --git a/stepmania/src/ScreenDimensions.h b/stepmania/src/ScreenDimensions.h index ac5673189e..74a8b88422 100644 --- a/stepmania/src/ScreenDimensions.h +++ b/stepmania/src/ScreenDimensions.h @@ -8,6 +8,8 @@ #define SCREEN_WIDTH ScreenWidth() #define SCREEN_HEIGHT ScreenHeight() +float ScreenAspectRatio(); +float ThemeAspectRatio(); float ScreenWidth(); float ScreenHeight(); diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index cde7efa545..767dbad255 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -944,6 +944,8 @@ public: static int GetPathG( T* p, lua_State *L ) { lua_pushstring(L, p->GetPathG(SArg(1),SArg(2)) ); return 1; } static int GetPathB( T* p, lua_State *L ) { lua_pushstring(L, p->GetPathB(SArg(1),SArg(2)) ); return 1; } static int GetPathS( T* p, lua_State *L ) { lua_pushstring(L, p->GetPathS(SArg(1),SArg(2)) ); return 1; } + static int GetScreenAspectRatio( T* p, lua_State *L ) { lua_pushnumber( L, ScreenAspectRatio() ); return 1; } + static int GetThemeAspectRatio( T* p, lua_State *L ) { lua_pushnumber( L, ThemeAspectRatio() ); return 1; } static void Register(lua_State *L) { @@ -951,6 +953,8 @@ public: ADD_METHOD( GetPathG ); ADD_METHOD( GetPathB ); ADD_METHOD( GetPathS ); + ADD_METHOD( GetScreenAspectRatio ); + ADD_METHOD( GetThemeAspectRatio ); Luna::Register( L );