Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/script/src/util/tolua/tolua_bind.cc @ 1019

Last change on this file since 1019 was 1019, checked in by bknecht, 16 years ago

You can now use lua tags everywhere in the XML file you want: It'll work. Even wrongly put tags are corrected now. Read the wikipages about scripting to see how you can use it.

File size: 2.8 KB
RevLine 
[996]1/*
[1019]2** Lua binding: orxonox
3** Generated automatically by tolua++-1.0.92 on Sun Apr  6 15:44:17 2008.
[996]4*/
5
6#ifndef __cplusplus
7#include "stdlib.h"
8#endif
9#include "string.h"
10
11#include "tolua++.h"
12
13/* Exported function */
[1019]14TOLUA_API int  tolua_orxonox_open (lua_State* tolua_S);
[996]15
[1019]16#include "../../orxonox/core/Script.h"
[996]17
18/* function to register type */
19static void tolua_reg_types (lua_State* tolua_S)
20{
21 tolua_usertype(tolua_S,"orxonox::Script");
22}
23
[1019]24/* method: getInstance of class  orxonox::Script */
25#ifndef TOLUA_DISABLE_tolua_orxonox_orxonox_Script_getInstance00
26static int tolua_orxonox_orxonox_Script_getInstance00(lua_State* tolua_S)
[996]27{
28#ifndef TOLUA_RELEASE
29 tolua_Error tolua_err;
30 if (
31     !tolua_isusertable(tolua_S,1,"orxonox::Script",0,&tolua_err) ||
32     !tolua_isnoobj(tolua_S,2,&tolua_err)
33 )
34  goto tolua_lerror;
35 else
36#endif
37 {
38  {
[1019]39   orxonox::Script* tolua_ret = (orxonox::Script*)  orxonox::Script::getInstance();
[996]40    tolua_pushusertype(tolua_S,(void*)tolua_ret,"orxonox::Script");
41  }
42 }
43 return 1;
44#ifndef TOLUA_RELEASE
45 tolua_lerror:
[1019]46 tolua_error(tolua_S,"#ferror in function 'getInstance'.",&tolua_err);
[996]47 return 0;
48#endif
49}
50#endif //#ifndef TOLUA_DISABLE
51
52/* method: luaPrint of class  orxonox::Script */
[1019]53#ifndef TOLUA_DISABLE_tolua_orxonox_orxonox_Script_luaPrint00
54static int tolua_orxonox_orxonox_Script_luaPrint00(lua_State* tolua_S)
[996]55{
56#ifndef TOLUA_RELEASE
57 tolua_Error tolua_err;
58 if (
59     !tolua_isusertype(tolua_S,1,"orxonox::Script",0,&tolua_err) ||
[1019]60     !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
[996]61     !tolua_isnoobj(tolua_S,3,&tolua_err)
62 )
63  goto tolua_lerror;
64 else
65#endif
66 {
67  orxonox::Script* self = (orxonox::Script*)  tolua_tousertype(tolua_S,1,0);
[1019]68  std::string str = ((std::string)  tolua_tocppstring(tolua_S,2,0));
[996]69#ifndef TOLUA_RELEASE
70  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'luaPrint'",NULL);
71#endif
72  {
73   self->luaPrint(str);
74  }
75 }
76 return 0;
77#ifndef TOLUA_RELEASE
78 tolua_lerror:
79 tolua_error(tolua_S,"#ferror in function 'luaPrint'.",&tolua_err);
80 return 0;
81#endif
82}
83#endif //#ifndef TOLUA_DISABLE
84
85/* Open function */
[1019]86TOLUA_API int tolua_orxonox_open (lua_State* tolua_S)
[996]87{
88 tolua_open(tolua_S);
89 tolua_reg_types(tolua_S);
90 tolua_module(tolua_S,NULL,0);
91 tolua_beginmodule(tolua_S,NULL);
92  tolua_module(tolua_S,"orxonox",0);
93  tolua_beginmodule(tolua_S,"orxonox");
94   tolua_cclass(tolua_S,"Script","orxonox::Script","",NULL);
95   tolua_beginmodule(tolua_S,"Script");
[1019]96    tolua_function(tolua_S,"getInstance",tolua_orxonox_orxonox_Script_getInstance00);
97    tolua_function(tolua_S,"luaPrint",tolua_orxonox_orxonox_Script_luaPrint00);
[996]98   tolua_endmodule(tolua_S);
99  tolua_endmodule(tolua_S);
100 tolua_endmodule(tolua_S);
101 return 1;
102}
103
104
105#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
[1019]106 TOLUA_API int luaopen_orxonox (lua_State* tolua_S) {
107 return tolua_orxonox_open(tolua_S);
[996]108};
109#endif
110
Note: See TracBrowser for help on using the repository browser.