diff options
author | Max Lingua | 2014-01-18 20:11:33 -0500 |
---|---|---|
committer | Max Lingua | 2014-01-19 00:51:02 -0500 |
commit | 001e3f76587cc52817db87a232c955aca281d5b9 (patch) | |
tree | 0e8961bba21f92576afd0c97e3692326fb30cb8e /engines | |
parent | d211d579a2666f39e9af79b2f4d39e289167e948 (diff) | |
download | scummvm-rg350-001e3f76587cc52817db87a232c955aca281d5b9.tar.gz scummvm-rg350-001e3f76587cc52817db87a232c955aca281d5b9.tar.bz2 scummvm-rg350-001e3f76587cc52817db87a232c955aca281d5b9.zip |
PS2: modified sword25 loslib.cpp to support PS2
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sword25/util/lua/loslib.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/engines/sword25/util/lua/loslib.cpp b/engines/sword25/util/lua/loslib.cpp index 25bfa2d1b5..055dfdf19e 100644 --- a/engines/sword25/util/lua/loslib.cpp +++ b/engines/sword25/util/lua/loslib.cpp @@ -113,6 +113,9 @@ static int getfield (lua_State *L, const char *key, int d) { static int os_date (lua_State *L) { + #ifdef __PLAYSTATION2__ // missing: gmtime & strftime + lua_pushnil(L); + #else const char *s = luaL_optstring(L, 1, "%c"); // FIXME: Rewrite the code below to use OSystem::getTimeAndDate // Alternatively, remove it, if sword25 does not use it. @@ -160,6 +163,7 @@ static int os_date (lua_State *L) { } luaL_pushresult(&b); } + #endif return 1; } @@ -167,6 +171,9 @@ static int os_date (lua_State *L) { static int os_time (lua_State *L) { // FIXME: Rewrite the code below to use OSystem::getTimeAndDate. // Alternatively, remove it, if sword25 does not use it. + #ifdef __PLAYSTATION2__ // missing: mktime + lua_pushnil(L); + #else time_t t; if (lua_isnoneornil(L, 1)) /* called without args? */ t = time(NULL); /* get current time */ @@ -187,6 +194,7 @@ static int os_time (lua_State *L) { lua_pushnil(L); else lua_pushnumber(L, (lua_Number)t); + #endif return 1; } @@ -195,8 +203,10 @@ static int os_difftime (lua_State *L) { // FIXME: difftime is not portable, unfortunately. // So we either have to replace this code, or just remove it, // depending on whether sword25 actually uses it. + #ifndef __PLAYSTATION2__ // missing: difftime lua_pushnumber(L, difftime((time_t)(luaL_checknumber(L, 1)), (time_t)(luaL_optnumber(L, 2, 0)))); + #endif return 1; } |