From 7505e88db66798b2b8fcdff2d92a7136cd826b5b Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Thu, 9 Sep 2010 02:26:30 +0200 Subject: Upgrading to IUP 3.2 - and cleaning up. --- iup/srclua5/image.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'iup/srclua5/image.lua') diff --git a/iup/srclua5/image.lua b/iup/srclua5/image.lua index 3a82063..dffd8bd 100755 --- a/iup/srclua5/image.lua +++ b/iup/srclua5/image.lua @@ -19,26 +19,26 @@ static int Image (lua_State * L) int i, j; /* get the number of lines */ - h = luaL_getn(L, 1); + h = iuplua_getn(L, 1); /* get the number of columns of the first line */ - lua_pushnumber(L, 1); + lua_pushinteger(L, 1); lua_gettable(L, 1); - w = luaL_getn(L, -1); + w = iuplua_getn(L, -1); lua_pop(L, 1); pixels = (unsigned char *) malloc (h*w); for (i=1; i<=h; i++) { - lua_pushnumber(L, i); + lua_pushinteger(L, i); lua_gettable(L, 1); for (j=1; j<=w; j++) { int idx = (i-1)*w+(j-1); - lua_pushnumber(L, j); + lua_pushinteger(L, j); lua_gettable(L, -2); - pixels[idx] = (unsigned char)lua_tonumber(L, -1); + pixels[idx] = (unsigned char)lua_tointeger(L, -1); lua_pop(L, 1); } lua_pop(L, 1); @@ -47,7 +47,7 @@ static int Image (lua_State * L) ih = IupImage(w,h,pixels); free(pixels); - num_colors = luaL_getn(L, 2); + num_colors = iuplua_getn(L, 2); num_colors = num_colors>255? 255: num_colors; for(c=1; c<=num_colors; c++) { @@ -65,7 +65,7 @@ static int Image (lua_State * L) ih = IupImage(w, h, pixels); free(pixels); - num_colors = luaL_getn(L, 4); + num_colors = iuplua_getn(L, 4); num_colors = num_colors>256? 256: num_colors; for(c=1; c<=num_colors; c++) { -- cgit v1.2.3