/* ** Lua binding: display ** Generated automatically by tolua++-1.0.92 on Sun Dec 13 15:12:49 2009. */ #ifndef __cplusplus #include "stdlib.h" #endif #include "string.h" #include "tolua++.h" /* Exported function */ TOLUA_API int tolua_display_open (lua_State* tolua_S); #include "display.hh" #include "d_models.hh" using namespace display; using ecl::Rect; using ecl::Surface; /* function to register type */ static void tolua_reg_types (lua_State* tolua_S) { tolua_usertype(tolua_S,"Rect"); tolua_usertype(tolua_S,"Surface"); } /* function: GetSurface */ #ifndef TOLUA_DISABLE_tolua_display_GetSurface00 static int tolua_display_GetSurface00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( !tolua_isstring(tolua_S,1,0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { const char* name = ((const char*) tolua_tostring(tolua_S,1,0)); { Surface* tolua_ret = (Surface*) GetSurface(name); tolua_pushusertype(tolua_S,(void*)tolua_ret,"Surface"); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: tolua_error(tolua_S,"#ferror in function 'GetSurface'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE /* function: CropSurface */ #ifndef TOLUA_DISABLE_tolua_display_CropSurface00 static int tolua_display_CropSurface00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( !tolua_isusertype(tolua_S,1,"const Surface",0,&tolua_err) || !tolua_isusertype(tolua_S,2,"Rect",0,&tolua_err) || !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else #endif { const Surface* s = ((const Surface*) tolua_tousertype(tolua_S,1,0)); Rect r = *((Rect*) tolua_tousertype(tolua_S,2,0)); { Surface* tolua_ret = (Surface*) CropSurface(s,r); tolua_pushusertype(tolua_S,(void*)tolua_ret,"Surface"); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: tolua_error(tolua_S,"#ferror in function 'CropSurface'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE /* function: DefineImageModel */ #ifndef TOLUA_DISABLE_tolua_display_DefineImageModel00 static int tolua_display_DefineImageModel00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( !tolua_isstring(tolua_S,1,0,&tolua_err) || !tolua_isusertype(tolua_S,2,"Surface",0,&tolua_err) || !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else #endif { const char* name = ((const char*) tolua_tostring(tolua_S,1,0)); Surface* s = ((Surface*) tolua_tousertype(tolua_S,2,0)); { DefineImageModel(name,s); } } return 0; #ifndef TOLUA_RELEASE tolua_lerror: tolua_error(tolua_S,"#ferror in function 'DefineImageModel'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE /* function: SetFollowMode */ #ifndef TOLUA_DISABLE_tolua_display_display_SetFollowMode00 static int tolua_display_display_SetFollowMode00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( !tolua_isnumber(tolua_S,1,0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { FollowMode m = ((FollowMode) (int) tolua_tonumber(tolua_S,1,0)); { SetFollowMode(m); } } return 0; #ifndef TOLUA_RELEASE tolua_lerror: tolua_error(tolua_S,"#ferror in function 'SetFollowMode'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE /* function: SetScrollBoundary */ #ifndef TOLUA_DISABLE_tolua_display_display_SetScrollBoundary00 static int tolua_display_display_SetScrollBoundary00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( !tolua_isnumber(tolua_S,1,0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { double boundary = ((double) tolua_tonumber(tolua_S,1,0)); { SetScrollBoundary(boundary); } } return 0; #ifndef TOLUA_RELEASE tolua_lerror: tolua_error(tolua_S,"#ferror in function 'SetScrollBoundary'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE /* function: ResizeGameArea */ #ifndef TOLUA_DISABLE_tolua_display_display_ResizeGameArea00 static int tolua_display_display_ResizeGameArea00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( !tolua_isnumber(tolua_S,1,0,&tolua_err) || !tolua_isnumber(tolua_S,2,0,&tolua_err) || !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else #endif { int w = ((int) tolua_tonumber(tolua_S,1,0)); int h = ((int) tolua_tonumber(tolua_S,2,0)); { ResizeGameArea(w,h); } } return 0; #ifndef TOLUA_RELEASE tolua_lerror: tolua_error(tolua_S,"#ferror in function 'ResizeGameArea'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE /* function: DefineImage */ #ifndef TOLUA_DISABLE_tolua_display_display_DefineImage00 static int tolua_display_display_DefineImage00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( !tolua_isstring(tolua_S,1,0,&tolua_err) || !tolua_isstring(tolua_S,2,0,&tolua_err) || !tolua_isnumber(tolua_S,3,0,&tolua_err) || !tolua_isnumber(tolua_S,4,0,&tolua_err) || !tolua_isnumber(tolua_S,5,1,&tolua_err) || !tolua_isnoobj(tolua_S,6,&tolua_err) ) goto tolua_lerror; else #endif { const char* name = ((const char*) tolua_tostring(tolua_S,1,0)); const char* fname = ((const char*) tolua_tostring(tolua_S,2,0)); int xoff = ((int) tolua_tonumber(tolua_S,3,0)); int yoff = ((int) tolua_tonumber(tolua_S,4,0)); int padding = ((int) tolua_tonumber(tolua_S,5,0)); { int tolua_ret = (int) DefineImage(name,fname,xoff,yoff,padding); tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: tolua_error(tolua_S,"#ferror in function 'DefineImage'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE /* function: DefineSubImage */ #ifndef TOLUA_DISABLE_tolua_display_display_DefineSubImage00 static int tolua_display_display_DefineSubImage00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( !tolua_isstring(tolua_S,1,0,&tolua_err) || !tolua_isstring(tolua_S,2,0,&tolua_err) || !tolua_isnumber(tolua_S,3,0,&tolua_err) || !tolua_isnumber(tolua_S,4,0,&tolua_err) || !tolua_isusertype(tolua_S,5,"Rect",0,&tolua_err) || !tolua_isnoobj(tolua_S,6,&tolua_err) ) goto tolua_lerror; else #endif { const char* name = ((const char*) tolua_tostring(tolua_S,1,0)); const char* fname = ((const char*) tolua_tostring(tolua_S,2,0)); int xoff = ((int) tolua_tonumber(tolua_S,3,0)); int yoff = ((int) tolua_tonumber(tolua_S,4,0)); Rect r = *((Rect*) tolua_tousertype(tolua_S,5,0)); { int tolua_ret = (int) DefineSubImage(name,fname,xoff,yoff,r); tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: tolua_error(tolua_S,"#ferror in function 'DefineSubImage'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE /* function: DefineRandModel */ #ifndef TOLUA_DISABLE_tolua_display_display_DefineRandModel00 static int tolua_display_display_DefineRandModel00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( !tolua_isstring(tolua_S,1,0,&tolua_err) || !tolua_isnumber(tolua_S,2,0,&tolua_err) || !tolua_istable(tolua_S,3,0,&tolua_err) || !tolua_isnoobj(tolua_S,4,&tolua_err) ) goto tolua_lerror; else #endif { const char* name = ((const char*) tolua_tostring(tolua_S,1,0)); int n = ((int) tolua_tonumber(tolua_S,2,0)); #ifdef __cplusplus char** names = new char*[n]; #else char** names = (char**) malloc((n)*sizeof(char*)); #endif { #ifndef TOLUA_RELEASE if (!tolua_isstringarray(tolua_S,3,n,0,&tolua_err)) goto tolua_lerror; else #endif { int i; for(i=0; i= 501 TOLUA_API int luaopen_display (lua_State* tolua_S) { return tolua_display_open(tolua_S); }; #endif