aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/util
diff options
context:
space:
mode:
authorEugene Sandulenko2014-04-28 21:20:42 +0300
committerEugene Sandulenko2014-04-28 21:20:42 +0300
commitc3ffbd884a2d917aede6020c4ae1ee4a13d7f861 (patch)
treeeef69449accc9a020cf1be49703a0dd698340c11 /engines/sword25/util
parent3d5dee897ef785e3f0c48ae3d857181f314700d1 (diff)
parent4592e0b586829fade4a5c800672849e693a0d151 (diff)
downloadscummvm-rg350-c3ffbd884a2d917aede6020c4ae1ee4a13d7f861.tar.gz
scummvm-rg350-c3ffbd884a2d917aede6020c4ae1ee4a13d7f861.tar.bz2
scummvm-rg350-c3ffbd884a2d917aede6020c4ae1ee4a13d7f861.zip
Merge pull request #426 from sunmax/master
PS2: Pull request to master for latest PS2 code
Diffstat (limited to 'engines/sword25/util')
-rw-r--r--engines/sword25/util/lua/loslib.cpp10
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;
}