Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: nacltoons/bindings/LuaCocos2dExtensions.cpp

Issue 15070003: [nacltoons] Add compound shapes. (Closed) Base URL: https://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « nacltoons/bindings/LuaCocos2dExtensions.h ('k') | nacltoons/bindings/extensions.pkg » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ** Lua binding: extensions 2 ** Lua binding: extensions
3 ** Generated automatically by tolua++-1.0.93 on Fri Mar 8 17:21:39 2013. 3 ** Generated automatically by tolua++-1.0.93 on Wed May 15 13:59:27 2013.
4 */ 4 */
5 5
6 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 6 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
7 // Use of this source code is governed by a BSD-style license that can be 7 // Use of this source code is governed by a BSD-style license that can be
8 // found in the LICENSE file. 8 // found in the LICENSE file.
9 #ifndef __cplusplus 9 #ifndef __cplusplus
10 #include "stdlib.h" 10 #include "stdlib.h"
11 #endif 11 #endif
12 #include "string.h" 12 #include "string.h"
13 13
14 #include "tolua++.h" 14 #include "tolua++.h"
15 15
16 /* Exported function */ 16 /* Exported function */
17 TOLUA_API int tolua_extensions_open (lua_State* tolua_S); 17 TOLUA_API int tolua_extensions_open (lua_State* tolua_S);
18 18
19 #include "LuaCocos2dExtensions.h" 19 #include "LuaCocos2dExtensions.h"
20 #include "physics_nodes/CCPhysicsSprite.h" 20 #include "physics_nodes/CCPhysicsSprite.h"
21 #include "physics_nodes/CCPhysicsNode.h"
21 #include "tolua_fix.h" 22 #include "tolua_fix.h"
22 USING_NS_CC; 23 USING_NS_CC;
23 USING_NS_CC_EXT; 24 USING_NS_CC_EXT;
24 25
25 /* function to register type */ 26 /* function to register type */
26 static void tolua_reg_types (lua_State* tolua_S) 27 static void tolua_reg_types (lua_State* tolua_S)
27 { 28 {
28 tolua_usertype(tolua_S,"CCTexture2D"); 29 tolua_usertype(tolua_S,"CCSpriteFrame");
30 tolua_usertype(tolua_S,"CCRect");
31 tolua_usertype(tolua_S,"CCPhysicsNode");
29 tolua_usertype(tolua_S,"CCSprite"); 32 tolua_usertype(tolua_S,"CCSprite");
30 tolua_usertype(tolua_S,"CCPhysicsSprite"); 33 tolua_usertype(tolua_S,"CCPhysicsSprite");
31 tolua_usertype(tolua_S,"b2Body"); 34 tolua_usertype(tolua_S,"b2Body");
32 tolua_usertype(tolua_S,"CCSpriteFrame"); 35 tolua_usertype(tolua_S,"CCTexture2D");
33 tolua_usertype(tolua_S,"CCRect"); 36 tolua_usertype(tolua_S,"CCNode");
34 } 37 }
35 38
39 /* method: getB2Body of class CCPhysicsNode */
40 #ifndef TOLUA_DISABLE_tolua_extensions_CCPhysicsNode_getB2Body00
41 static int tolua_extensions_CCPhysicsNode_getB2Body00(lua_State* tolua_S)
42 {
43 #ifndef TOLUA_RELEASE
44 tolua_Error tolua_err;
45 if (
46 !tolua_isusertype(tolua_S,1,"const CCPhysicsNode",0,&tolua_err) ||
47 !tolua_isnoobj(tolua_S,2,&tolua_err)
48 )
49 goto tolua_lerror;
50 else
51 #endif
52 {
53 const CCPhysicsNode* self = (const CCPhysicsNode*) tolua_tousertype(tolua_S,1 ,0);
54 #ifndef TOLUA_RELEASE
55 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getB2Body'", NULL) ;
56 #endif
57 {
58 b2Body* tolua_ret = (b2Body*) self->getB2Body();
59 tolua_pushusertype(tolua_S,(void*)tolua_ret,"b2Body");
60 }
61 }
62 return 1;
63 #ifndef TOLUA_RELEASE
64 tolua_lerror:
65 tolua_error(tolua_S,"#ferror in function 'getB2Body'.",&tolua_err);
66 return 0;
67 #endif
68 }
69 #endif //#ifndef TOLUA_DISABLE
70
71 /* method: setB2Body of class CCPhysicsNode */
72 #ifndef TOLUA_DISABLE_tolua_extensions_CCPhysicsNode_setB2Body00
73 static int tolua_extensions_CCPhysicsNode_setB2Body00(lua_State* tolua_S)
74 {
75 #ifndef TOLUA_RELEASE
76 tolua_Error tolua_err;
77 if (
78 !tolua_isusertype(tolua_S,1,"CCPhysicsNode",0,&tolua_err) ||
79 !tolua_isusertype(tolua_S,2,"b2Body",0,&tolua_err) ||
80 !tolua_isnoobj(tolua_S,3,&tolua_err)
81 )
82 goto tolua_lerror;
83 else
84 #endif
85 {
86 CCPhysicsNode* self = (CCPhysicsNode*) tolua_tousertype(tolua_S,1,0);
87 b2Body* pBody = ((b2Body*) tolua_tousertype(tolua_S,2,0));
88 #ifndef TOLUA_RELEASE
89 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'setB2Body'", NULL) ;
90 #endif
91 {
92 self->setB2Body(pBody);
93 }
94 }
95 return 0;
96 #ifndef TOLUA_RELEASE
97 tolua_lerror:
98 tolua_error(tolua_S,"#ferror in function 'setB2Body'.",&tolua_err);
99 return 0;
100 #endif
101 }
102 #endif //#ifndef TOLUA_DISABLE
103
104 /* method: getPTMRatio of class CCPhysicsNode */
105 #ifndef TOLUA_DISABLE_tolua_extensions_CCPhysicsNode_getPTMRatio00
106 static int tolua_extensions_CCPhysicsNode_getPTMRatio00(lua_State* tolua_S)
107 {
108 #ifndef TOLUA_RELEASE
109 tolua_Error tolua_err;
110 if (
111 !tolua_isusertype(tolua_S,1,"const CCPhysicsNode",0,&tolua_err) ||
112 !tolua_isnoobj(tolua_S,2,&tolua_err)
113 )
114 goto tolua_lerror;
115 else
116 #endif
117 {
118 const CCPhysicsNode* self = (const CCPhysicsNode*) tolua_tousertype(tolua_S,1 ,0);
119 #ifndef TOLUA_RELEASE
120 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getPTMRatio'", NUL L);
121 #endif
122 {
123 float tolua_ret = (float) self->getPTMRatio();
124 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
125 }
126 }
127 return 1;
128 #ifndef TOLUA_RELEASE
129 tolua_lerror:
130 tolua_error(tolua_S,"#ferror in function 'getPTMRatio'.",&tolua_err);
131 return 0;
132 #endif
133 }
134 #endif //#ifndef TOLUA_DISABLE
135
136 /* method: setPTMRatio of class CCPhysicsNode */
137 #ifndef TOLUA_DISABLE_tolua_extensions_CCPhysicsNode_setPTMRatio00
138 static int tolua_extensions_CCPhysicsNode_setPTMRatio00(lua_State* tolua_S)
139 {
140 #ifndef TOLUA_RELEASE
141 tolua_Error tolua_err;
142 if (
143 !tolua_isusertype(tolua_S,1,"CCPhysicsNode",0,&tolua_err) ||
144 !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
145 !tolua_isnoobj(tolua_S,3,&tolua_err)
146 )
147 goto tolua_lerror;
148 else
149 #endif
150 {
151 CCPhysicsNode* self = (CCPhysicsNode*) tolua_tousertype(tolua_S,1,0);
152 float fPTMRatio = ((float) tolua_tonumber(tolua_S,2,0));
153 #ifndef TOLUA_RELEASE
154 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'setPTMRatio'", NUL L);
155 #endif
156 {
157 self->setPTMRatio(fPTMRatio);
158 }
159 }
160 return 0;
161 #ifndef TOLUA_RELEASE
162 tolua_lerror:
163 tolua_error(tolua_S,"#ferror in function 'setPTMRatio'.",&tolua_err);
164 return 0;
165 #endif
166 }
167 #endif //#ifndef TOLUA_DISABLE
168
169 /* method: create of class CCPhysicsNode */
170 #ifndef TOLUA_DISABLE_tolua_extensions_CCPhysicsNode_create00
171 static int tolua_extensions_CCPhysicsNode_create00(lua_State* tolua_S)
172 {
173 #ifndef TOLUA_RELEASE
174 tolua_Error tolua_err;
175 if (
176 !tolua_isusertable(tolua_S,1,"CCPhysicsNode",0,&tolua_err) ||
177 !tolua_isnoobj(tolua_S,2,&tolua_err)
178 )
179 goto tolua_lerror;
180 else
181 #endif
182 {
183 {
184 CCPhysicsNode* tolua_ret = (CCPhysicsNode*) CCPhysicsNode::create();
185 tolua_pushusertype(tolua_S,(void*)tolua_ret,"CCPhysicsNode");
186 }
187 }
188 return 1;
189 #ifndef TOLUA_RELEASE
190 tolua_lerror:
191 tolua_error(tolua_S,"#ferror in function 'create'.",&tolua_err);
192 return 0;
193 #endif
194 }
195 #endif //#ifndef TOLUA_DISABLE
196
36 /* method: getB2Body of class CCPhysicsSprite */ 197 /* method: getB2Body of class CCPhysicsSprite */
37 #ifndef TOLUA_DISABLE_tolua_extensions_CCPhysicsSprite_getB2Body00 198 #ifndef TOLUA_DISABLE_tolua_extensions_CCPhysicsSprite_getB2Body00
38 static int tolua_extensions_CCPhysicsSprite_getB2Body00(lua_State* tolua_S) 199 static int tolua_extensions_CCPhysicsSprite_getB2Body00(lua_State* tolua_S)
39 { 200 {
40 #ifndef TOLUA_RELEASE 201 #ifndef TOLUA_RELEASE
41 tolua_Error tolua_err; 202 tolua_Error tolua_err;
42 if ( 203 if (
43 !tolua_isusertype(tolua_S,1,"const CCPhysicsSprite",0,&tolua_err) || 204 !tolua_isusertype(tolua_S,1,"const CCPhysicsSprite",0,&tolua_err) ||
44 !tolua_isnoobj(tolua_S,2,&tolua_err) 205 !tolua_isnoobj(tolua_S,2,&tolua_err)
45 ) 206 )
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 } 535 }
375 #endif //#ifndef TOLUA_DISABLE 536 #endif //#ifndef TOLUA_DISABLE
376 537
377 /* Open function */ 538 /* Open function */
378 TOLUA_API int tolua_extensions_open (lua_State* tolua_S) 539 TOLUA_API int tolua_extensions_open (lua_State* tolua_S)
379 { 540 {
380 tolua_open(tolua_S); 541 tolua_open(tolua_S);
381 tolua_reg_types(tolua_S); 542 tolua_reg_types(tolua_S);
382 tolua_module(tolua_S,NULL,0); 543 tolua_module(tolua_S,NULL,0);
383 tolua_beginmodule(tolua_S,NULL); 544 tolua_beginmodule(tolua_S,NULL);
545 tolua_cclass(tolua_S,"CCPhysicsNode","CCPhysicsNode","CCNode",NULL);
546 tolua_beginmodule(tolua_S,"CCPhysicsNode");
547 tolua_function(tolua_S,"getB2Body",tolua_extensions_CCPhysicsNode_getB2Body00 );
548 tolua_function(tolua_S,"setB2Body",tolua_extensions_CCPhysicsNode_setB2Body00 );
549 tolua_function(tolua_S,"getPTMRatio",tolua_extensions_CCPhysicsNode_getPTMRat io00);
550 tolua_function(tolua_S,"setPTMRatio",tolua_extensions_CCPhysicsNode_setPTMRat io00);
551 tolua_function(tolua_S,"create",tolua_extensions_CCPhysicsNode_create00);
552 tolua_endmodule(tolua_S);
384 tolua_cclass(tolua_S,"CCPhysicsSprite","CCPhysicsSprite","CCSprite",NULL); 553 tolua_cclass(tolua_S,"CCPhysicsSprite","CCPhysicsSprite","CCSprite",NULL);
385 tolua_beginmodule(tolua_S,"CCPhysicsSprite"); 554 tolua_beginmodule(tolua_S,"CCPhysicsSprite");
386 tolua_function(tolua_S,"getB2Body",tolua_extensions_CCPhysicsSprite_getB2Body 00); 555 tolua_function(tolua_S,"getB2Body",tolua_extensions_CCPhysicsSprite_getB2Body 00);
387 tolua_function(tolua_S,"setB2Body",tolua_extensions_CCPhysicsSprite_setB2Body 00); 556 tolua_function(tolua_S,"setB2Body",tolua_extensions_CCPhysicsSprite_setB2Body 00);
388 tolua_function(tolua_S,"getPTMRatio",tolua_extensions_CCPhysicsSprite_getPTMR atio00); 557 tolua_function(tolua_S,"getPTMRatio",tolua_extensions_CCPhysicsSprite_getPTMR atio00);
389 tolua_function(tolua_S,"setPTMRatio",tolua_extensions_CCPhysicsSprite_setPTMR atio00); 558 tolua_function(tolua_S,"setPTMRatio",tolua_extensions_CCPhysicsSprite_setPTMR atio00);
390 tolua_function(tolua_S,"createWithTexture",tolua_extensions_CCPhysicsSprite_c reateWithTexture00); 559 tolua_function(tolua_S,"createWithTexture",tolua_extensions_CCPhysicsSprite_c reateWithTexture00);
391 tolua_function(tolua_S,"createWithTexture",tolua_extensions_CCPhysicsSprite_c reateWithTexture01); 560 tolua_function(tolua_S,"createWithTexture",tolua_extensions_CCPhysicsSprite_c reateWithTexture01);
392 tolua_function(tolua_S,"createWithSpriteFrame",tolua_extensions_CCPhysicsSpri te_createWithSpriteFrame00); 561 tolua_function(tolua_S,"createWithSpriteFrame",tolua_extensions_CCPhysicsSpri te_createWithSpriteFrame00);
393 tolua_function(tolua_S,"createWithSpriteFrameName",tolua_extensions_CCPhysics Sprite_createWithSpriteFrameName00); 562 tolua_function(tolua_S,"createWithSpriteFrameName",tolua_extensions_CCPhysics Sprite_createWithSpriteFrameName00);
394 tolua_function(tolua_S,"create",tolua_extensions_CCPhysicsSprite_create00); 563 tolua_function(tolua_S,"create",tolua_extensions_CCPhysicsSprite_create00);
395 tolua_function(tolua_S,"create",tolua_extensions_CCPhysicsSprite_create01); 564 tolua_function(tolua_S,"create",tolua_extensions_CCPhysicsSprite_create01);
396 tolua_function(tolua_S,"create",tolua_extensions_CCPhysicsSprite_create02); 565 tolua_function(tolua_S,"create",tolua_extensions_CCPhysicsSprite_create02);
397 tolua_endmodule(tolua_S); 566 tolua_endmodule(tolua_S);
398 tolua_endmodule(tolua_S); 567 tolua_endmodule(tolua_S);
399 return 1; 568 return 1;
400 } 569 }
401 570
402 571
403 #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501 572 #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
404 TOLUA_API int luaopen_extensions (lua_State* tolua_S) { 573 TOLUA_API int luaopen_extensions (lua_State* tolua_S) {
405 return tolua_extensions_open(tolua_S); 574 return tolua_extensions_open(tolua_S);
406 }; 575 };
407 #endif 576 #endif
408 577
OLDNEW
« no previous file with comments | « nacltoons/bindings/LuaCocos2dExtensions.h ('k') | nacltoons/bindings/extensions.pkg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698