expose aspect ratios
This commit is contained in:
@@ -21,7 +21,7 @@ ThemeMetric<float> 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();
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#define SCREEN_WIDTH ScreenWidth()
|
||||
#define SCREEN_HEIGHT ScreenHeight()
|
||||
float ScreenAspectRatio();
|
||||
float ThemeAspectRatio();
|
||||
float ScreenWidth();
|
||||
float ScreenHeight();
|
||||
|
||||
|
||||
@@ -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<T>::Register( L );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user