00001
00002
00003
00004
00005
00006 #ifndef __cplusplus
00007 #include "stdlib.h"
00008 #endif
00009 #include "string.h"
00010
00011 #include "tolua++.h"
00012
00013
00014 TOLUA_API int tolua_LuaInterface_open (lua_State* tolua_S);
00015
00016 #include "edt/Editeur.hpp"
00017 #include <SFML/Graphics/View.hpp>
00018 #include <SFML/System/Vector2.hpp>
00019 #include "edt/CarteEditable.hpp"
00020 #include "edt/CoucheTileEditable.hpp"
00021
00022
00023 static void tolua_reg_types (lua_State* tolua_S)
00024 {
00025 tolua_usertype(tolua_S,"sf::View");
00026 tolua_usertype(tolua_S,"edt::CarteEditable");
00027 tolua_usertype(tolua_S,"edt::CoucheTileEditable");
00028 tolua_usertype(tolua_S,"sf::Vector2f");
00029 tolua_usertype(tolua_S,"edt::Editeur");
00030 }
00031
00032
00033 #ifndef TOLUA_DISABLE_tolua_LuaInterface_edt_Editeur_getInstance00
00034 static int tolua_LuaInterface_edt_Editeur_getInstance00(lua_State* tolua_S)
00035 {
00036 #ifndef TOLUA_RELEASE
00037 tolua_Error tolua_err;
00038 if (
00039 !tolua_isusertable(tolua_S,1,"edt::Editeur",0,&tolua_err) ||
00040 !tolua_isnoobj(tolua_S,2,&tolua_err)
00041 )
00042 goto tolua_lerror;
00043 else
00044 #endif
00045 {
00046 {
00047 edt::Editeur* tolua_ret = (edt::Editeur*) edt::Editeur::getInstance();
00048 tolua_pushusertype(tolua_S,(void*)tolua_ret,"edt::Editeur");
00049 }
00050 }
00051 return 1;
00052 #ifndef TOLUA_RELEASE
00053 tolua_lerror:
00054 tolua_error(tolua_S,"#ferror in function 'getInstance'.",&tolua_err);
00055 return 0;
00056 #endif
00057 }
00058 #endif //#ifndef TOLUA_DISABLE
00059
00060
00061 #ifndef TOLUA_DISABLE_tolua_LuaInterface_edt_Editeur_getVueCourante00
00062 static int tolua_LuaInterface_edt_Editeur_getVueCourante00(lua_State* tolua_S)
00063 {
00064 #ifndef TOLUA_RELEASE
00065 tolua_Error tolua_err;
00066 if (
00067 !tolua_isusertype(tolua_S,1,"edt::Editeur",0,&tolua_err) ||
00068 !tolua_isnoobj(tolua_S,2,&tolua_err)
00069 )
00070 goto tolua_lerror;
00071 else
00072 #endif
00073 {
00074 edt::Editeur* self = (edt::Editeur*) tolua_tousertype(tolua_S,1,0);
00075 #ifndef TOLUA_RELEASE
00076 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getVueCourante'", NULL);
00077 #endif
00078 {
00079 sf::View* tolua_ret = (sf::View*) self->getVueCourante();
00080 tolua_pushusertype(tolua_S,(void*)tolua_ret,"sf::View");
00081 }
00082 }
00083 return 1;
00084 #ifndef TOLUA_RELEASE
00085 tolua_lerror:
00086 tolua_error(tolua_S,"#ferror in function 'getVueCourante'.",&tolua_err);
00087 return 0;
00088 #endif
00089 }
00090 #endif //#ifndef TOLUA_DISABLE
00091
00092
00093 #ifndef TOLUA_DISABLE_tolua_LuaInterface_edt_Editeur_getCarteCourante00
00094 static int tolua_LuaInterface_edt_Editeur_getCarteCourante00(lua_State* tolua_S)
00095 {
00096 #ifndef TOLUA_RELEASE
00097 tolua_Error tolua_err;
00098 if (
00099 !tolua_isusertype(tolua_S,1,"edt::Editeur",0,&tolua_err) ||
00100 !tolua_isnoobj(tolua_S,2,&tolua_err)
00101 )
00102 goto tolua_lerror;
00103 else
00104 #endif
00105 {
00106 edt::Editeur* self = (edt::Editeur*) tolua_tousertype(tolua_S,1,0);
00107 #ifndef TOLUA_RELEASE
00108 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getCarteCourante'", NULL);
00109 #endif
00110 {
00111 edt::CarteEditable* tolua_ret = (edt::CarteEditable*) self->getCarteCourante();
00112 tolua_pushusertype(tolua_S,(void*)tolua_ret,"edt::CarteEditable");
00113 }
00114 }
00115 return 1;
00116 #ifndef TOLUA_RELEASE
00117 tolua_lerror:
00118 tolua_error(tolua_S,"#ferror in function 'getCarteCourante'.",&tolua_err);
00119 return 0;
00120 #endif
00121 }
00122 #endif //#ifndef TOLUA_DISABLE
00123
00124
00125 #ifndef TOLUA_DISABLE_tolua_LuaInterface_edt_CarteEditable_getCoucheTileEditable00
00126 static int tolua_LuaInterface_edt_CarteEditable_getCoucheTileEditable00(lua_State* tolua_S)
00127 {
00128 #ifndef TOLUA_RELEASE
00129 tolua_Error tolua_err;
00130 if (
00131 !tolua_isusertype(tolua_S,1,"const edt::CarteEditable",0,&tolua_err) ||
00132 !tolua_isnoobj(tolua_S,2,&tolua_err)
00133 )
00134 goto tolua_lerror;
00135 else
00136 #endif
00137 {
00138 const edt::CarteEditable* self = (const edt::CarteEditable*) tolua_tousertype(tolua_S,1,0);
00139 #ifndef TOLUA_RELEASE
00140 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getCoucheTileEditable'", NULL);
00141 #endif
00142 {
00143 edt::CoucheTileEditable* tolua_ret = (edt::CoucheTileEditable*) self->getCoucheTileEditable();
00144 tolua_pushusertype(tolua_S,(void*)tolua_ret,"edt::CoucheTileEditable");
00145 }
00146 }
00147 return 1;
00148 #ifndef TOLUA_RELEASE
00149 tolua_lerror:
00150 tolua_error(tolua_S,"#ferror in function 'getCoucheTileEditable'.",&tolua_err);
00151 return 0;
00152 #endif
00153 }
00154 #endif //#ifndef TOLUA_DISABLE
00155
00156
00157 #ifndef TOLUA_DISABLE_tolua_LuaInterface_edt_CoucheTileEditable_getLargeur00
00158 static int tolua_LuaInterface_edt_CoucheTileEditable_getLargeur00(lua_State* tolua_S)
00159 {
00160 #ifndef TOLUA_RELEASE
00161 tolua_Error tolua_err;
00162 if (
00163 !tolua_isusertype(tolua_S,1,"const edt::CoucheTileEditable",0,&tolua_err) ||
00164 !tolua_isnoobj(tolua_S,2,&tolua_err)
00165 )
00166 goto tolua_lerror;
00167 else
00168 #endif
00169 {
00170 const edt::CoucheTileEditable* self = (const edt::CoucheTileEditable*) tolua_tousertype(tolua_S,1,0);
00171 #ifndef TOLUA_RELEASE
00172 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getLargeur'", NULL);
00173 #endif
00174 {
00175 int tolua_ret = (int) self->getLargeur();
00176 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
00177 }
00178 }
00179 return 1;
00180 #ifndef TOLUA_RELEASE
00181 tolua_lerror:
00182 tolua_error(tolua_S,"#ferror in function 'getLargeur'.",&tolua_err);
00183 return 0;
00184 #endif
00185 }
00186 #endif //#ifndef TOLUA_DISABLE
00187
00188
00189 #ifndef TOLUA_DISABLE_tolua_LuaInterface_edt_CoucheTileEditable_getHauteur00
00190 static int tolua_LuaInterface_edt_CoucheTileEditable_getHauteur00(lua_State* tolua_S)
00191 {
00192 #ifndef TOLUA_RELEASE
00193 tolua_Error tolua_err;
00194 if (
00195 !tolua_isusertype(tolua_S,1,"const edt::CoucheTileEditable",0,&tolua_err) ||
00196 !tolua_isnoobj(tolua_S,2,&tolua_err)
00197 )
00198 goto tolua_lerror;
00199 else
00200 #endif
00201 {
00202 const edt::CoucheTileEditable* self = (const edt::CoucheTileEditable*) tolua_tousertype(tolua_S,1,0);
00203 #ifndef TOLUA_RELEASE
00204 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getHauteur'", NULL);
00205 #endif
00206 {
00207 int tolua_ret = (int) self->getHauteur();
00208 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
00209 }
00210 }
00211 return 1;
00212 #ifndef TOLUA_RELEASE
00213 tolua_lerror:
00214 tolua_error(tolua_S,"#ferror in function 'getHauteur'.",&tolua_err);
00215 return 0;
00216 #endif
00217 }
00218 #endif //#ifndef TOLUA_DISABLE
00219
00220
00221 #ifndef TOLUA_DISABLE_tolua_LuaInterface_sf_View_SetCenter00
00222 static int tolua_LuaInterface_sf_View_SetCenter00(lua_State* tolua_S)
00223 {
00224 #ifndef TOLUA_RELEASE
00225 tolua_Error tolua_err;
00226 if (
00227 !tolua_isusertype(tolua_S,1,"sf::View",0,&tolua_err) ||
00228 !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
00229 !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
00230 !tolua_isnoobj(tolua_S,4,&tolua_err)
00231 )
00232 goto tolua_lerror;
00233 else
00234 #endif
00235 {
00236 sf::View* self = (sf::View*) tolua_tousertype(tolua_S,1,0);
00237 float x = ((float) tolua_tonumber(tolua_S,2,0));
00238 float y = ((float) tolua_tonumber(tolua_S,3,0));
00239 #ifndef TOLUA_RELEASE
00240 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetCenter'", NULL);
00241 #endif
00242 {
00243 self->SetCenter(x,y);
00244 }
00245 }
00246 return 0;
00247 #ifndef TOLUA_RELEASE
00248 tolua_lerror:
00249 tolua_error(tolua_S,"#ferror in function 'SetCenter'.",&tolua_err);
00250 return 0;
00251 #endif
00252 }
00253 #endif //#ifndef TOLUA_DISABLE
00254
00255
00256 #ifndef TOLUA_DISABLE_tolua_LuaInterface_sf_View_GetCenter00
00257 static int tolua_LuaInterface_sf_View_GetCenter00(lua_State* tolua_S)
00258 {
00259 #ifndef TOLUA_RELEASE
00260 tolua_Error tolua_err;
00261 if (
00262 !tolua_isusertype(tolua_S,1,"const sf::View",0,&tolua_err) ||
00263 !tolua_isnoobj(tolua_S,2,&tolua_err)
00264 )
00265 goto tolua_lerror;
00266 else
00267 #endif
00268 {
00269 const sf::View* self = (const sf::View*) tolua_tousertype(tolua_S,1,0);
00270 #ifndef TOLUA_RELEASE
00271 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetCenter'", NULL);
00272 #endif
00273 {
00274 const sf::Vector2f& tolua_ret = (const sf::Vector2f&) self->GetCenter();
00275 tolua_pushusertype(tolua_S,(void*)&tolua_ret,"const sf::Vector2f");
00276 }
00277 }
00278 return 1;
00279 #ifndef TOLUA_RELEASE
00280 tolua_lerror:
00281 tolua_error(tolua_S,"#ferror in function 'GetCenter'.",&tolua_err);
00282 return 0;
00283 #endif
00284 }
00285 #endif //#ifndef TOLUA_DISABLE
00286
00287
00288 #ifndef TOLUA_DISABLE_tolua_LuaInterface_sf_View_GetSize00
00289 static int tolua_LuaInterface_sf_View_GetSize00(lua_State* tolua_S)
00290 {
00291 #ifndef TOLUA_RELEASE
00292 tolua_Error tolua_err;
00293 if (
00294 !tolua_isusertype(tolua_S,1,"const sf::View",0,&tolua_err) ||
00295 !tolua_isnoobj(tolua_S,2,&tolua_err)
00296 )
00297 goto tolua_lerror;
00298 else
00299 #endif
00300 {
00301 const sf::View* self = (const sf::View*) tolua_tousertype(tolua_S,1,0);
00302 #ifndef TOLUA_RELEASE
00303 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetSize'", NULL);
00304 #endif
00305 {
00306 const sf::Vector2f& tolua_ret = (const sf::Vector2f&) self->GetSize();
00307 tolua_pushusertype(tolua_S,(void*)&tolua_ret,"const sf::Vector2f");
00308 }
00309 }
00310 return 1;
00311 #ifndef TOLUA_RELEASE
00312 tolua_lerror:
00313 tolua_error(tolua_S,"#ferror in function 'GetSize'.",&tolua_err);
00314 return 0;
00315 #endif
00316 }
00317 #endif //#ifndef TOLUA_DISABLE
00318
00319
00320 #ifndef TOLUA_DISABLE_tolua_get_sf__Vector2f_x
00321 static int tolua_get_sf__Vector2f_x(lua_State* tolua_S)
00322 {
00323 sf::Vector2f* self = (sf::Vector2f*) tolua_tousertype(tolua_S,1,0);
00324 #ifndef TOLUA_RELEASE
00325 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'x'",NULL);
00326 #endif
00327 tolua_pushnumber(tolua_S,(lua_Number)self->x);
00328 return 1;
00329 }
00330 #endif //#ifndef TOLUA_DISABLE
00331
00332
00333 #ifndef TOLUA_DISABLE_tolua_set_sf__Vector2f_x
00334 static int tolua_set_sf__Vector2f_x(lua_State* tolua_S)
00335 {
00336 sf::Vector2f* self = (sf::Vector2f*) tolua_tousertype(tolua_S,1,0);
00337 #ifndef TOLUA_RELEASE
00338 tolua_Error tolua_err;
00339 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'x'",NULL);
00340 if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
00341 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
00342 #endif
00343 self->x = ((float) tolua_tonumber(tolua_S,2,0))
00344 ;
00345 return 0;
00346 }
00347 #endif //#ifndef TOLUA_DISABLE
00348
00349
00350 #ifndef TOLUA_DISABLE_tolua_get_sf__Vector2f_y
00351 static int tolua_get_sf__Vector2f_y(lua_State* tolua_S)
00352 {
00353 sf::Vector2f* self = (sf::Vector2f*) tolua_tousertype(tolua_S,1,0);
00354 #ifndef TOLUA_RELEASE
00355 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'y'",NULL);
00356 #endif
00357 tolua_pushnumber(tolua_S,(lua_Number)self->y);
00358 return 1;
00359 }
00360 #endif //#ifndef TOLUA_DISABLE
00361
00362
00363 #ifndef TOLUA_DISABLE_tolua_set_sf__Vector2f_y
00364 static int tolua_set_sf__Vector2f_y(lua_State* tolua_S)
00365 {
00366 sf::Vector2f* self = (sf::Vector2f*) tolua_tousertype(tolua_S,1,0);
00367 #ifndef TOLUA_RELEASE
00368 tolua_Error tolua_err;
00369 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'y'",NULL);
00370 if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
00371 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
00372 #endif
00373 self->y = ((float) tolua_tonumber(tolua_S,2,0))
00374 ;
00375 return 0;
00376 }
00377 #endif //#ifndef TOLUA_DISABLE
00378
00379
00380 TOLUA_API int tolua_LuaInterface_open (lua_State* tolua_S)
00381 {
00382 tolua_open(tolua_S);
00383 tolua_reg_types(tolua_S);
00384 tolua_module(tolua_S,NULL,0);
00385 tolua_beginmodule(tolua_S,NULL);
00386 tolua_module(tolua_S,"edt",0);
00387 tolua_beginmodule(tolua_S,"edt");
00388 tolua_cclass(tolua_S,"Editeur","edt::Editeur","",NULL);
00389 tolua_beginmodule(tolua_S,"Editeur");
00390 tolua_function(tolua_S,"getInstance",tolua_LuaInterface_edt_Editeur_getInstance00);
00391 tolua_function(tolua_S,"getVueCourante",tolua_LuaInterface_edt_Editeur_getVueCourante00);
00392 tolua_function(tolua_S,"getCarteCourante",tolua_LuaInterface_edt_Editeur_getCarteCourante00);
00393 tolua_endmodule(tolua_S);
00394 tolua_cclass(tolua_S,"CarteEditable","edt::CarteEditable","",NULL);
00395 tolua_beginmodule(tolua_S,"CarteEditable");
00396 tolua_function(tolua_S,"getCoucheTileEditable",tolua_LuaInterface_edt_CarteEditable_getCoucheTileEditable00);
00397 tolua_endmodule(tolua_S);
00398 tolua_cclass(tolua_S,"CoucheTileEditable","edt::CoucheTileEditable","",NULL);
00399 tolua_beginmodule(tolua_S,"CoucheTileEditable");
00400 tolua_function(tolua_S,"getLargeur",tolua_LuaInterface_edt_CoucheTileEditable_getLargeur00);
00401 tolua_function(tolua_S,"getHauteur",tolua_LuaInterface_edt_CoucheTileEditable_getHauteur00);
00402 tolua_endmodule(tolua_S);
00403 tolua_endmodule(tolua_S);
00404 tolua_module(tolua_S,"sf",0);
00405 tolua_beginmodule(tolua_S,"sf");
00406 tolua_cclass(tolua_S,"View","sf::View","",NULL);
00407 tolua_beginmodule(tolua_S,"View");
00408 tolua_function(tolua_S,"SetCenter",tolua_LuaInterface_sf_View_SetCenter00);
00409 tolua_function(tolua_S,"GetCenter",tolua_LuaInterface_sf_View_GetCenter00);
00410 tolua_function(tolua_S,"GetSize",tolua_LuaInterface_sf_View_GetSize00);
00411 tolua_endmodule(tolua_S);
00412 tolua_cclass(tolua_S,"Vector2f","sf::Vector2f","",NULL);
00413 tolua_beginmodule(tolua_S,"Vector2f");
00414 tolua_variable(tolua_S,"x",tolua_get_sf__Vector2f_x,tolua_set_sf__Vector2f_x);
00415 tolua_variable(tolua_S,"y",tolua_get_sf__Vector2f_y,tolua_set_sf__Vector2f_y);
00416 tolua_endmodule(tolua_S);
00417 tolua_endmodule(tolua_S);
00418 tolua_endmodule(tolua_S);
00419 return 1;
00420 }
00421
00422
00423 #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
00424 TOLUA_API int luaopen_LuaInterface (lua_State* tolua_S) {
00425 return tolua_LuaInterface_open(tolua_S);
00426 }
00427 #endif
00428