1 |
/* |
/* |
2 |
** Lua binding: px |
** Lua binding: px |
3 |
** Generated automatically by tolua 4.0a on Thu Oct 31 20:48:41 2002. |
** Generated automatically by tolua 4.0a on Sat Jan 25 10:24:19 2003. |
4 |
*/ |
*/ |
5 |
|
|
6 |
#include "tolua.h" |
#include "tolua.h" |
332 |
return toluaI_px_px_Drawable_blit00(tolua_S); |
return toluaI_px_px_Drawable_blit00(tolua_S); |
333 |
} |
} |
334 |
|
|
|
/* method: set_pixel of class Drawable */ |
|
|
static int toluaI_px_px_Drawable_set_pixel00(lua_State* tolua_S) |
|
|
{ |
|
|
if ( |
|
|
!tolua_istype(tolua_S,1,tolua_tag(tolua_S,"Drawable"),0) || |
|
|
!tolua_istype(tolua_S,2,LUA_TNUMBER,0) || |
|
|
!tolua_istype(tolua_S,3,LUA_TNUMBER,0) || |
|
|
!tolua_istype(tolua_S,4,LUA_TNUMBER,0) || |
|
|
!tolua_isnoobj(tolua_S,5) |
|
|
) |
|
|
goto tolua_lerror; |
|
|
else |
|
|
{ |
|
|
Drawable* self = (Drawable*) tolua_getusertype(tolua_S,1,0); |
|
|
int x = ((int) tolua_getnumber(tolua_S,2,0)); |
|
|
int y = ((int) tolua_getnumber(tolua_S,3,0)); |
|
|
Uint32 color = ((Uint32) tolua_getnumber(tolua_S,4,0)); |
|
|
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'set_pixel'"); |
|
|
{ |
|
|
self->set_pixel(x,y,color); |
|
|
} |
|
|
} |
|
|
return 0; |
|
|
tolua_lerror: |
|
|
tolua_error(tolua_S,"#ferror in function 'set_pixel'."); |
|
|
return 0; |
|
|
} |
|
|
|
|
|
/* method: set_pixels of class Drawable */ |
|
|
static int toluaI_px_px_Drawable_set_pixels00(lua_State* tolua_S) |
|
|
{ |
|
|
if ( |
|
|
!tolua_istype(tolua_S,1,tolua_tag(tolua_S,"Drawable"),0) || |
|
|
!tolua_istype(tolua_S,2,LUA_TNUMBER,0) || |
|
|
!tolua_istype(tolua_S,3,LUA_TTABLE,0) || |
|
|
!tolua_istype(tolua_S,4,LUA_TTABLE,0) || |
|
|
!tolua_istype(tolua_S,5,LUA_TNUMBER,0) || |
|
|
!tolua_isnoobj(tolua_S,6) |
|
|
) |
|
|
goto tolua_lerror; |
|
|
else |
|
|
{ |
|
|
Drawable* self = (Drawable*) tolua_getusertype(tolua_S,1,0); |
|
|
int n = ((int) tolua_getnumber(tolua_S,2,0)); |
|
|
int* x = (int*) malloc(n*sizeof(int)); |
|
|
int* y = (int*) malloc(n*sizeof(int)); |
|
|
Uint32 color = ((Uint32) tolua_getnumber(tolua_S,5,0)); |
|
|
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'set_pixels'"); |
|
|
{ |
|
|
if (!tolua_arrayistype(tolua_S,3,LUA_TNUMBER,n,0)) |
|
|
goto tolua_lerror; |
|
|
else |
|
|
{ |
|
|
int i; |
|
|
for(i=0; i<n;i++) |
|
|
x[i] = ((int) tolua_getfieldnumber(tolua_S,3,i+1,0)); |
|
|
} |
|
|
} |
|
|
{ |
|
|
if (!tolua_arrayistype(tolua_S,4,LUA_TNUMBER,n,0)) |
|
|
goto tolua_lerror; |
|
|
else |
|
|
{ |
|
|
int i; |
|
|
for(i=0; i<n;i++) |
|
|
y[i] = ((int) tolua_getfieldnumber(tolua_S,4,i+1,0)); |
|
|
} |
|
|
} |
|
|
{ |
|
|
self->set_pixels(n,x,y,color); |
|
|
} |
|
|
{ |
|
|
int i; |
|
|
for(i=0; i<n;i++) |
|
|
tolua_pushfieldnumber(tolua_S,3,i+1,(double) x[i]); |
|
|
} |
|
|
{ |
|
|
int i; |
|
|
for(i=0; i<n;i++) |
|
|
tolua_pushfieldnumber(tolua_S,4,i+1,(double) y[i]); |
|
|
} |
|
|
free(x); |
|
|
free(y); |
|
|
} |
|
|
return 0; |
|
|
tolua_lerror: |
|
|
tolua_error(tolua_S,"#ferror in function 'set_pixels'."); |
|
|
return 0; |
|
|
} |
|
|
|
|
335 |
/* method: hline of class Drawable */ |
/* method: hline of class Drawable */ |
336 |
static int toluaI_px_px_Drawable_hline00(lua_State* tolua_S) |
static int toluaI_px_px_Drawable_hline00(lua_State* tolua_S) |
337 |
{ |
{ |
921 |
tolua_function(tolua_S,"Drawable","map_color",toluaI_px_px_Drawable_map_color00); |
tolua_function(tolua_S,"Drawable","map_color",toluaI_px_px_Drawable_map_color00); |
922 |
tolua_function(tolua_S,"Drawable","blit",toluaI_px_px_Drawable_blit00); |
tolua_function(tolua_S,"Drawable","blit",toluaI_px_px_Drawable_blit00); |
923 |
tolua_function(tolua_S,"Drawable","blit",toluaI_px_px_Drawable_blit01); |
tolua_function(tolua_S,"Drawable","blit",toluaI_px_px_Drawable_blit01); |
|
tolua_function(tolua_S,"Drawable","set_pixel",toluaI_px_px_Drawable_set_pixel00); |
|
|
tolua_function(tolua_S,"Drawable","set_pixels",toluaI_px_px_Drawable_set_pixels00); |
|
924 |
tolua_function(tolua_S,"Drawable","hline",toluaI_px_px_Drawable_hline00); |
tolua_function(tolua_S,"Drawable","hline",toluaI_px_px_Drawable_hline00); |
925 |
tolua_function(tolua_S,"Drawable","vline",toluaI_px_px_Drawable_vline00); |
tolua_function(tolua_S,"Drawable","vline",toluaI_px_px_Drawable_vline00); |
926 |
tolua_function(tolua_S,"Drawable","box",toluaI_px_px_Drawable_box00); |
tolua_function(tolua_S,"Drawable","box",toluaI_px_px_Drawable_box00); |