Add GetOSName() binding. Returns a string representing the current OS (untested on everything but Windows, should work for everything but BSD, for which I forget the switch off the top of my head)
This commit is contained in:
@@ -968,6 +968,24 @@ extern const char *const version_time;
|
|||||||
LuaFunction( VersionDate, (RString) version_date );
|
LuaFunction( VersionDate, (RString) version_date );
|
||||||
LuaFunction( VersionTime, (RString) version_time );
|
LuaFunction( VersionTime, (RString) version_time );
|
||||||
|
|
||||||
|
static RString GetOSName()
|
||||||
|
{
|
||||||
|
RString system;
|
||||||
|
#if defined(XBOX)
|
||||||
|
system = "Xbox";
|
||||||
|
#elif defined(WIN32) && !defined(XBOX)
|
||||||
|
system = "Windows";
|
||||||
|
#elif defined(LINUX)
|
||||||
|
system = "Linux";
|
||||||
|
#elif defined(DARWIN)
|
||||||
|
system = "Mac";
|
||||||
|
#else
|
||||||
|
system = "Unknown";
|
||||||
|
#endif
|
||||||
|
return system;
|
||||||
|
}
|
||||||
|
LuaFunction( GetOSName, GetOSName() );
|
||||||
|
|
||||||
static float scale( float x, float l1, float h1, float l2, float h2 )
|
static float scale( float x, float l1, float h1, float l2, float h2 )
|
||||||
{
|
{
|
||||||
return SCALE( x, l1, h1, l2, h2 );
|
return SCALE( x, l1, h1, l2, h2 );
|
||||||
|
|||||||
Reference in New Issue
Block a user