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:
AJ Kelly
2010-05-13 12:01:44 -05:00
parent 4cf7e1ec3c
commit f429711dd5
+18
View File
@@ -968,6 +968,24 @@ extern const char *const version_time;
LuaFunction( VersionDate, (RString) version_date );
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 )
{
return SCALE( x, l1, h1, l2, h2 );