diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lua5/cdlua5.c | 11 | ||||
-rw-r--r-- | src/lua5/cdlua5_canvas.c | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/lua5/cdlua5.c b/src/lua5/cdlua5.c index 7b7b617..bff00df 100644 --- a/src/lua5/cdlua5.c +++ b/src/lua5/cdlua5.c @@ -900,7 +900,7 @@ static int cdlua5_version(lua_State *L) \***************************************************************************/ static int cdlua5_registercallback(lua_State *L) { - int cb_i, func_lock; + int cb_i, func_lock, ret = CD_ERROR; cdluaCallback* cdCB; cdluaContext* cdlua_ctx; @@ -926,7 +926,7 @@ static int cdlua5_registercallback(lua_State *L) cdCB->lock = func_lock; if (func_lock == -1) { - cdContextRegisterCallback(cdlua_ctx->ctx(), cb_i, NULL); + ret = cdContextRegisterCallback(cdlua_ctx->ctx(), cb_i, NULL); } } else @@ -934,10 +934,11 @@ static int cdlua5_registercallback(lua_State *L) if (func_lock != -1) { cdContextRegisterCallback(cdlua_ctx->ctx(), cb_i, (cdCallback)cdCB->func); - cdCB->lock = func_lock; + ret = cdCB->lock = func_lock; } } - return 0; + lua_pushnumber(L, ret); + return 1; } @@ -1257,7 +1258,7 @@ static int cdlua5_getscreensize(lua_State *L) \***************************************************************************/ static int cdlua5_usecontextplus(lua_State *L) { - lua_pushnumber(L, cdUseContextPlus(luaL_checkint(L, 1))); + lua_pushboolean(L, cdUseContextPlus(lua_toboolean(L, 1))); return 1; } diff --git a/src/lua5/cdlua5_canvas.c b/src/lua5/cdlua5_canvas.c index d04f76f..eeecc6d 100644 --- a/src/lua5/cdlua5_canvas.c +++ b/src/lua5/cdlua5_canvas.c @@ -712,7 +712,7 @@ static int cdlua5_regioncombinemode(lua_State *L) \***************************************************************************/ static int cdlua5_pointinregion(lua_State *L) { - lua_pushnumber(L, cdCanvasIsPointInRegion(cdlua_checkcanvas(L, 1), luaL_checkint(L, 2), luaL_checkint(L, 3))); + lua_pushboolean(L, cdCanvasIsPointInRegion(cdlua_checkcanvas(L, 1), luaL_checkint(L, 2), luaL_checkint(L, 3))); return 1; } @@ -721,7 +721,7 @@ static int cdlua5_pointinregion(lua_State *L) \***************************************************************************/ static int wdlua5_pointinregion(lua_State *L) { - lua_pushnumber(L, wdCanvasIsPointInRegion(cdlua_checkcanvas(L, 1), luaL_checknumber(L, 2), luaL_checknumber(L, 3))); + lua_pushboolean(L, wdCanvasIsPointInRegion(cdlua_checkcanvas(L, 1), luaL_checknumber(L, 2), luaL_checknumber(L, 3))); return 1; } |