summaryrefslogtreecommitdiff
path: root/src/lua5
diff options
context:
space:
mode:
authorscuri <scuri>2009-08-05 18:44:49 +0000
committerscuri <scuri>2009-08-05 18:44:49 +0000
commit4eb6a7ae0fa0fa11c7e538b948af1417764d4134 (patch)
treea250d2807e85c463ec52eee34d90e9239ec1a384 /src/lua5
parente2b3655c339d18b91cc3c824b04fe7a57d51bdfe (diff)
*** empty log message ***
Diffstat (limited to 'src/lua5')
-rw-r--r--src/lua5/cdlua5.c11
-rw-r--r--src/lua5/cdlua5_canvas.c4
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;
}