keys are displayed on the screen, they can be "collected" via a scripting function
[supertux.git] / src / scripting / wrapper.cpp
1 /**
2  * WARNING: This file is automatically generated from:
3  *  'src/scripting/wrapper.interface.hpp'
4  * DO NOT CHANGE
5  */
6 #include <config.h>
7
8 #include <new>
9 #include <assert.h>
10 #include <string>
11 #include <sstream>
12 #include <squirrel.h>
13 #include "squirrel_error.hpp"
14 #include "wrapper.interface.hpp"
15
16 namespace Scripting
17 {
18 namespace Wrapper
19 {
20
21 static int DisplayEffect_release_hook(SQUserPointer ptr, int )
22 {
23   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (ptr);
24   delete _this;
25   return 0;
26 }
27
28 static int DisplayEffect_fade_out_wrapper(HSQUIRRELVM v)
29 {
30   Scripting::DisplayEffect* _this;
31   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
32   float arg0;
33   sq_getfloat(v, 2, &arg0);
34   
35   _this->fade_out(arg0);
36   
37   return 0;
38 }
39
40 static int DisplayEffect_fade_in_wrapper(HSQUIRRELVM v)
41 {
42   Scripting::DisplayEffect* _this;
43   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
44   float arg0;
45   sq_getfloat(v, 2, &arg0);
46   
47   _this->fade_in(arg0);
48   
49   return 0;
50 }
51
52 static int DisplayEffect_set_black_wrapper(HSQUIRRELVM v)
53 {
54   Scripting::DisplayEffect* _this;
55   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
56   SQBool arg0;
57   sq_getbool(v, 2, &arg0);
58   
59   _this->set_black(arg0);
60   
61   return 0;
62 }
63
64 static int DisplayEffect_is_black_wrapper(HSQUIRRELVM v)
65 {
66   Scripting::DisplayEffect* _this;
67   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
68   
69   bool return_value = _this->is_black();
70   
71   sq_pushbool(v, return_value);
72   return 1;
73 }
74
75 static int Camera_release_hook(SQUserPointer ptr, int )
76 {
77   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (ptr);
78   delete _this;
79   return 0;
80 }
81
82 static int Camera_shake_wrapper(HSQUIRRELVM v)
83 {
84   Scripting::Camera* _this;
85   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
86   float arg0;
87   sq_getfloat(v, 2, &arg0);
88   float arg1;
89   sq_getfloat(v, 3, &arg1);
90   float arg2;
91   sq_getfloat(v, 4, &arg2);
92   
93   _this->shake(arg0, arg1, arg2);
94   
95   return 0;
96 }
97
98 static int Camera_set_pos_wrapper(HSQUIRRELVM v)
99 {
100   Scripting::Camera* _this;
101   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
102   float arg0;
103   sq_getfloat(v, 2, &arg0);
104   float arg1;
105   sq_getfloat(v, 3, &arg1);
106   
107   _this->set_pos(arg0, arg1);
108   
109   return 0;
110 }
111
112 static int Camera_set_mode_wrapper(HSQUIRRELVM v)
113 {
114   Scripting::Camera* _this;
115   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
116   const char* arg0;
117   sq_getstring(v, 2, &arg0);
118   
119   _this->set_mode(arg0);
120   
121   return 0;
122 }
123
124 static int Level_release_hook(SQUserPointer ptr, int )
125 {
126   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (ptr);
127   delete _this;
128   return 0;
129 }
130
131 static int Level_finish_wrapper(HSQUIRRELVM v)
132 {
133   Scripting::Level* _this;
134   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
135   
136   _this->finish();
137   
138   return 0;
139 }
140
141 static int Level_spawn_wrapper(HSQUIRRELVM v)
142 {
143   Scripting::Level* _this;
144   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
145   const char* arg0;
146   sq_getstring(v, 2, &arg0);
147   const char* arg1;
148   sq_getstring(v, 3, &arg1);
149   
150   _this->spawn(arg0, arg1);
151   
152   return 0;
153 }
154
155 static int Level_flip_vertically_wrapper(HSQUIRRELVM v)
156 {
157   Scripting::Level* _this;
158   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
159   
160   _this->flip_vertically();
161   
162   return 0;
163 }
164
165 static int ScriptedObject_release_hook(SQUserPointer ptr, int )
166 {
167   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
168   delete _this;
169   return 0;
170 }
171
172 static int ScriptedObject_set_animation_wrapper(HSQUIRRELVM v)
173 {
174   Scripting::ScriptedObject* _this;
175   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
176   const char* arg0;
177   sq_getstring(v, 2, &arg0);
178   
179   _this->set_animation(arg0);
180   
181   return 0;
182 }
183
184 static int ScriptedObject_get_animation_wrapper(HSQUIRRELVM v)
185 {
186   Scripting::ScriptedObject* _this;
187   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
188   
189   std::string return_value = _this->get_animation();
190   
191   sq_pushstring(v, return_value.c_str(), return_value.size());
192   return 1;
193 }
194
195 static int ScriptedObject_move_wrapper(HSQUIRRELVM v)
196 {
197   Scripting::ScriptedObject* _this;
198   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
199   float arg0;
200   sq_getfloat(v, 2, &arg0);
201   float arg1;
202   sq_getfloat(v, 3, &arg1);
203   
204   _this->move(arg0, arg1);
205   
206   return 0;
207 }
208
209 static int ScriptedObject_set_pos_wrapper(HSQUIRRELVM v)
210 {
211   Scripting::ScriptedObject* _this;
212   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
213   float arg0;
214   sq_getfloat(v, 2, &arg0);
215   float arg1;
216   sq_getfloat(v, 3, &arg1);
217   
218   _this->set_pos(arg0, arg1);
219   
220   return 0;
221 }
222
223 static int ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM v)
224 {
225   Scripting::ScriptedObject* _this;
226   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
227   
228   float return_value = _this->get_pos_x();
229   
230   sq_pushfloat(v, return_value);
231   return 1;
232 }
233
234 static int ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM v)
235 {
236   Scripting::ScriptedObject* _this;
237   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
238   
239   float return_value = _this->get_pos_y();
240   
241   sq_pushfloat(v, return_value);
242   return 1;
243 }
244
245 static int ScriptedObject_set_velocity_wrapper(HSQUIRRELVM v)
246 {
247   Scripting::ScriptedObject* _this;
248   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
249   float arg0;
250   sq_getfloat(v, 2, &arg0);
251   float arg1;
252   sq_getfloat(v, 3, &arg1);
253   
254   _this->set_velocity(arg0, arg1);
255   
256   return 0;
257 }
258
259 static int ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM v)
260 {
261   Scripting::ScriptedObject* _this;
262   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
263   
264   float return_value = _this->get_velocity_x();
265   
266   sq_pushfloat(v, return_value);
267   return 1;
268 }
269
270 static int ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM v)
271 {
272   Scripting::ScriptedObject* _this;
273   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
274   
275   float return_value = _this->get_velocity_y();
276   
277   sq_pushfloat(v, return_value);
278   return 1;
279 }
280
281 static int ScriptedObject_set_visible_wrapper(HSQUIRRELVM v)
282 {
283   Scripting::ScriptedObject* _this;
284   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
285   SQBool arg0;
286   sq_getbool(v, 2, &arg0);
287   
288   _this->set_visible(arg0);
289   
290   return 0;
291 }
292
293 static int ScriptedObject_is_visible_wrapper(HSQUIRRELVM v)
294 {
295   Scripting::ScriptedObject* _this;
296   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
297   
298   bool return_value = _this->is_visible();
299   
300   sq_pushbool(v, return_value);
301   return 1;
302 }
303
304 static int ScriptedObject_get_name_wrapper(HSQUIRRELVM v)
305 {
306   Scripting::ScriptedObject* _this;
307   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
308   
309   std::string return_value = _this->get_name();
310   
311   sq_pushstring(v, return_value.c_str(), return_value.size());
312   return 1;
313 }
314
315 static int Sound_release_hook(SQUserPointer ptr, int )
316 {
317   Scripting::Sound* _this = reinterpret_cast<Scripting::Sound*> (ptr);
318   delete _this;
319   return 0;
320 }
321
322 static int Sound_play_music_wrapper(HSQUIRRELVM v)
323 {
324   Scripting::Sound* _this;
325   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
326   const char* arg0;
327   sq_getstring(v, 2, &arg0);
328   
329   _this->play_music(arg0);
330   
331   return 0;
332 }
333
334 static int Sound_play_wrapper(HSQUIRRELVM v)
335 {
336   Scripting::Sound* _this;
337   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
338   const char* arg0;
339   sq_getstring(v, 2, &arg0);
340   
341   _this->play(arg0);
342   
343   return 0;
344 }
345
346 static int Text_release_hook(SQUserPointer ptr, int )
347 {
348   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (ptr);
349   delete _this;
350   return 0;
351 }
352
353 static int Text_set_text_wrapper(HSQUIRRELVM v)
354 {
355   Scripting::Text* _this;
356   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
357   const char* arg0;
358   sq_getstring(v, 2, &arg0);
359   
360   _this->set_text(arg0);
361   
362   return 0;
363 }
364
365 static int Text_set_font_wrapper(HSQUIRRELVM v)
366 {
367   Scripting::Text* _this;
368   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
369   const char* arg0;
370   sq_getstring(v, 2, &arg0);
371   
372   _this->set_font(arg0);
373   
374   return 0;
375 }
376
377 static int Text_fade_in_wrapper(HSQUIRRELVM v)
378 {
379   Scripting::Text* _this;
380   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
381   float arg0;
382   sq_getfloat(v, 2, &arg0);
383   
384   _this->fade_in(arg0);
385   
386   return 0;
387 }
388
389 static int Text_fade_out_wrapper(HSQUIRRELVM v)
390 {
391   Scripting::Text* _this;
392   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
393   float arg0;
394   sq_getfloat(v, 2, &arg0);
395   
396   _this->fade_out(arg0);
397   
398   return 0;
399 }
400
401 static int Text_set_visible_wrapper(HSQUIRRELVM v)
402 {
403   Scripting::Text* _this;
404   sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
405   SQBool arg0;
406   sq_getbool(v, 2, &arg0);
407   
408   _this->set_visible(arg0);
409   
410   return 0;
411 }
412
413 static int Player_release_hook(SQUserPointer ptr, int )
414 {
415   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
416   delete _this;
417   return 0;
418 }
419
420 static int display_text_file_wrapper(HSQUIRRELVM v)
421 {
422   const char* arg0;
423   sq_getstring(v, 2, &arg0);
424   
425   Scripting::display_text_file(arg0);
426   
427   return 0;
428 }
429
430 static int wait_wrapper(HSQUIRRELVM v)
431 {
432   float arg0;
433   sq_getfloat(v, 2, &arg0);
434   
435   Scripting::wait(arg0);
436   
437   return sq_suspendvm(v);
438 }
439
440 static int translate_wrapper(HSQUIRRELVM v)
441 {
442   const char* arg0;
443   sq_getstring(v, 2, &arg0);
444   
445   std::string return_value = Scripting::translate(arg0);
446   
447   sq_pushstring(v, return_value.c_str(), return_value.size());
448   return 1;
449 }
450
451 static int import_wrapper(HSQUIRRELVM v)
452 {
453   HSQUIRRELVM arg0 = v;
454   const char* arg1;
455   sq_getstring(v, 2, &arg1);
456   
457   Scripting::import(arg0, arg1);
458   
459   return 0;
460 }
461
462 static int add_key_wrapper(HSQUIRRELVM v)
463 {
464   int arg0;
465   sq_getinteger(v, 2, &arg0);
466   
467   Scripting::add_key(arg0);
468   
469   return 0;
470 }
471
472 } // end of namespace Wrapper
473
474 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
475 {
476   using namespace Wrapper;
477
478   sq_pushroottable(v);
479   sq_pushstring(v, "DisplayEffect", -1);
480   if(SQ_FAILED(sq_get(v, -2))) {
481     std::ostringstream msg;
482     msg << "Couldn't resolved squirrel type 'DisplayEffect'";
483     throw SquirrelError(v, msg.str());
484   }
485
486   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
487     std::ostringstream msg;
488     msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
489     throw SquirrelError(v, msg.str());
490   }
491   sq_remove(v, -2); // remove object name
492
493   if(setup_releasehook) {
494     sq_setreleasehook(v, -1, DisplayEffect_release_hook);
495   }
496
497   sq_remove(v, -2); // remove root table
498 }
499
500 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
501 {
502   using namespace Wrapper;
503
504   sq_pushroottable(v);
505   sq_pushstring(v, "Camera", -1);
506   if(SQ_FAILED(sq_get(v, -2))) {
507     std::ostringstream msg;
508     msg << "Couldn't resolved squirrel type 'Camera'";
509     throw SquirrelError(v, msg.str());
510   }
511
512   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
513     std::ostringstream msg;
514     msg << "Couldn't setup squirrel instance for object of type 'Camera'";
515     throw SquirrelError(v, msg.str());
516   }
517   sq_remove(v, -2); // remove object name
518
519   if(setup_releasehook) {
520     sq_setreleasehook(v, -1, Camera_release_hook);
521   }
522
523   sq_remove(v, -2); // remove root table
524 }
525
526 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
527 {
528   using namespace Wrapper;
529
530   sq_pushroottable(v);
531   sq_pushstring(v, "Level", -1);
532   if(SQ_FAILED(sq_get(v, -2))) {
533     std::ostringstream msg;
534     msg << "Couldn't resolved squirrel type 'Level'";
535     throw SquirrelError(v, msg.str());
536   }
537
538   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
539     std::ostringstream msg;
540     msg << "Couldn't setup squirrel instance for object of type 'Level'";
541     throw SquirrelError(v, msg.str());
542   }
543   sq_remove(v, -2); // remove object name
544
545   if(setup_releasehook) {
546     sq_setreleasehook(v, -1, Level_release_hook);
547   }
548
549   sq_remove(v, -2); // remove root table
550 }
551
552 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
553 {
554   using namespace Wrapper;
555
556   sq_pushroottable(v);
557   sq_pushstring(v, "ScriptedObject", -1);
558   if(SQ_FAILED(sq_get(v, -2))) {
559     std::ostringstream msg;
560     msg << "Couldn't resolved squirrel type 'ScriptedObject'";
561     throw SquirrelError(v, msg.str());
562   }
563
564   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
565     std::ostringstream msg;
566     msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
567     throw SquirrelError(v, msg.str());
568   }
569   sq_remove(v, -2); // remove object name
570
571   if(setup_releasehook) {
572     sq_setreleasehook(v, -1, ScriptedObject_release_hook);
573   }
574
575   sq_remove(v, -2); // remove root table
576 }
577
578 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Sound* object, bool setup_releasehook)
579 {
580   using namespace Wrapper;
581
582   sq_pushroottable(v);
583   sq_pushstring(v, "Sound", -1);
584   if(SQ_FAILED(sq_get(v, -2))) {
585     std::ostringstream msg;
586     msg << "Couldn't resolved squirrel type 'Sound'";
587     throw SquirrelError(v, msg.str());
588   }
589
590   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
591     std::ostringstream msg;
592     msg << "Couldn't setup squirrel instance for object of type 'Sound'";
593     throw SquirrelError(v, msg.str());
594   }
595   sq_remove(v, -2); // remove object name
596
597   if(setup_releasehook) {
598     sq_setreleasehook(v, -1, Sound_release_hook);
599   }
600
601   sq_remove(v, -2); // remove root table
602 }
603
604 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
605 {
606   using namespace Wrapper;
607
608   sq_pushroottable(v);
609   sq_pushstring(v, "Text", -1);
610   if(SQ_FAILED(sq_get(v, -2))) {
611     std::ostringstream msg;
612     msg << "Couldn't resolved squirrel type 'Text'";
613     throw SquirrelError(v, msg.str());
614   }
615
616   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
617     std::ostringstream msg;
618     msg << "Couldn't setup squirrel instance for object of type 'Text'";
619     throw SquirrelError(v, msg.str());
620   }
621   sq_remove(v, -2); // remove object name
622
623   if(setup_releasehook) {
624     sq_setreleasehook(v, -1, Text_release_hook);
625   }
626
627   sq_remove(v, -2); // remove root table
628 }
629
630 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
631 {
632   using namespace Wrapper;
633
634   sq_pushroottable(v);
635   sq_pushstring(v, "Player", -1);
636   if(SQ_FAILED(sq_get(v, -2))) {
637     std::ostringstream msg;
638     msg << "Couldn't resolved squirrel type 'Player'";
639     throw SquirrelError(v, msg.str());
640   }
641
642   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
643     std::ostringstream msg;
644     msg << "Couldn't setup squirrel instance for object of type 'Player'";
645     throw SquirrelError(v, msg.str());
646   }
647   sq_remove(v, -2); // remove object name
648
649   if(setup_releasehook) {
650     sq_setreleasehook(v, -1, Player_release_hook);
651   }
652
653   sq_remove(v, -2); // remove root table
654 }
655
656 void register_supertux_wrapper(HSQUIRRELVM v)
657 {
658   using namespace Wrapper;
659
660   sq_pushroottable(v);
661   sq_pushstring(v, "KEY_BRASS", -1);
662   sq_pushinteger(v, 1);
663   if(SQ_FAILED(sq_createslot(v, -3))) {
664     std::ostringstream msg;
665     msg << "Couldn't register constant'KEY_BRASS'";
666     throw SquirrelError(v, msg.str());
667   }
668
669   sq_pushstring(v, "KEY_IRON", -1);
670   sq_pushinteger(v, 2);
671   if(SQ_FAILED(sq_createslot(v, -3))) {
672     std::ostringstream msg;
673     msg << "Couldn't register constant'KEY_IRON'";
674     throw SquirrelError(v, msg.str());
675   }
676
677   sq_pushstring(v, "KEY_BRONZE", -1);
678   sq_pushinteger(v, 4);
679   if(SQ_FAILED(sq_createslot(v, -3))) {
680     std::ostringstream msg;
681     msg << "Couldn't register constant'KEY_BRONZE'";
682     throw SquirrelError(v, msg.str());
683   }
684
685   sq_pushstring(v, "KEY_SILVER", -1);
686   sq_pushinteger(v, 8);
687   if(SQ_FAILED(sq_createslot(v, -3))) {
688     std::ostringstream msg;
689     msg << "Couldn't register constant'KEY_SILVER'";
690     throw SquirrelError(v, msg.str());
691   }
692
693   sq_pushstring(v, "KEY_GOLD", -1);
694   sq_pushinteger(v, 16);
695   if(SQ_FAILED(sq_createslot(v, -3))) {
696     std::ostringstream msg;
697     msg << "Couldn't register constant'KEY_GOLD'";
698     throw SquirrelError(v, msg.str());
699   }
700
701   sq_pushstring(v, "display_text_file", -1);
702   sq_newclosure(v, &display_text_file_wrapper, 0);
703   if(SQ_FAILED(sq_createslot(v, -3))) {
704     std::ostringstream msg;
705     msg << "Couldn't register function'display_text_file'";
706     throw SquirrelError(v, msg.str());
707   }
708
709   sq_pushstring(v, "wait", -1);
710   sq_newclosure(v, &wait_wrapper, 0);
711   if(SQ_FAILED(sq_createslot(v, -3))) {
712     std::ostringstream msg;
713     msg << "Couldn't register function'wait'";
714     throw SquirrelError(v, msg.str());
715   }
716
717   sq_pushstring(v, "translate", -1);
718   sq_newclosure(v, &translate_wrapper, 0);
719   if(SQ_FAILED(sq_createslot(v, -3))) {
720     std::ostringstream msg;
721     msg << "Couldn't register function'translate'";
722     throw SquirrelError(v, msg.str());
723   }
724
725   sq_pushstring(v, "import", -1);
726   sq_newclosure(v, &import_wrapper, 0);
727   if(SQ_FAILED(sq_createslot(v, -3))) {
728     std::ostringstream msg;
729     msg << "Couldn't register function'import'";
730     throw SquirrelError(v, msg.str());
731   }
732
733   sq_pushstring(v, "add_key", -1);
734   sq_newclosure(v, &add_key_wrapper, 0);
735   if(SQ_FAILED(sq_createslot(v, -3))) {
736     std::ostringstream msg;
737     msg << "Couldn't register function'add_key'";
738     throw SquirrelError(v, msg.str());
739   }
740
741   // Register class DisplayEffect
742   sq_pushstring(v, "DisplayEffect", -1);
743   if(sq_newclass(v, SQFalse) < 0) {
744     std::ostringstream msg;
745     msg << "Couldn't create new class 'DisplayEffect'";
746     throw SquirrelError(v, msg.str());
747   }
748   sq_pushstring(v, "fade_out", -1);
749   sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
750   if(SQ_FAILED(sq_createslot(v, -3))) {
751     std::ostringstream msg;
752     msg << "Couldn't register function'fade_out'";
753     throw SquirrelError(v, msg.str());
754   }
755
756   sq_pushstring(v, "fade_in", -1);
757   sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
758   if(SQ_FAILED(sq_createslot(v, -3))) {
759     std::ostringstream msg;
760     msg << "Couldn't register function'fade_in'";
761     throw SquirrelError(v, msg.str());
762   }
763
764   sq_pushstring(v, "set_black", -1);
765   sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
766   if(SQ_FAILED(sq_createslot(v, -3))) {
767     std::ostringstream msg;
768     msg << "Couldn't register function'set_black'";
769     throw SquirrelError(v, msg.str());
770   }
771
772   sq_pushstring(v, "is_black", -1);
773   sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
774   if(SQ_FAILED(sq_createslot(v, -3))) {
775     std::ostringstream msg;
776     msg << "Couldn't register function'is_black'";
777     throw SquirrelError(v, msg.str());
778   }
779
780   if(SQ_FAILED(sq_createslot(v, -3))) {
781     std::ostringstream msg;
782     msg << "Couldn't register class'DisplayEffect'";
783     throw SquirrelError(v, msg.str());
784   }
785
786   // Register class Camera
787   sq_pushstring(v, "Camera", -1);
788   if(sq_newclass(v, SQFalse) < 0) {
789     std::ostringstream msg;
790     msg << "Couldn't create new class 'Camera'";
791     throw SquirrelError(v, msg.str());
792   }
793   sq_pushstring(v, "shake", -1);
794   sq_newclosure(v, &Camera_shake_wrapper, 0);
795   if(SQ_FAILED(sq_createslot(v, -3))) {
796     std::ostringstream msg;
797     msg << "Couldn't register function'shake'";
798     throw SquirrelError(v, msg.str());
799   }
800
801   sq_pushstring(v, "set_pos", -1);
802   sq_newclosure(v, &Camera_set_pos_wrapper, 0);
803   if(SQ_FAILED(sq_createslot(v, -3))) {
804     std::ostringstream msg;
805     msg << "Couldn't register function'set_pos'";
806     throw SquirrelError(v, msg.str());
807   }
808
809   sq_pushstring(v, "set_mode", -1);
810   sq_newclosure(v, &Camera_set_mode_wrapper, 0);
811   if(SQ_FAILED(sq_createslot(v, -3))) {
812     std::ostringstream msg;
813     msg << "Couldn't register function'set_mode'";
814     throw SquirrelError(v, msg.str());
815   }
816
817   if(SQ_FAILED(sq_createslot(v, -3))) {
818     std::ostringstream msg;
819     msg << "Couldn't register class'Camera'";
820     throw SquirrelError(v, msg.str());
821   }
822
823   // Register class Level
824   sq_pushstring(v, "Level", -1);
825   if(sq_newclass(v, SQFalse) < 0) {
826     std::ostringstream msg;
827     msg << "Couldn't create new class 'Level'";
828     throw SquirrelError(v, msg.str());
829   }
830   sq_pushstring(v, "finish", -1);
831   sq_newclosure(v, &Level_finish_wrapper, 0);
832   if(SQ_FAILED(sq_createslot(v, -3))) {
833     std::ostringstream msg;
834     msg << "Couldn't register function'finish'";
835     throw SquirrelError(v, msg.str());
836   }
837
838   sq_pushstring(v, "spawn", -1);
839   sq_newclosure(v, &Level_spawn_wrapper, 0);
840   if(SQ_FAILED(sq_createslot(v, -3))) {
841     std::ostringstream msg;
842     msg << "Couldn't register function'spawn'";
843     throw SquirrelError(v, msg.str());
844   }
845
846   sq_pushstring(v, "flip_vertically", -1);
847   sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
848   if(SQ_FAILED(sq_createslot(v, -3))) {
849     std::ostringstream msg;
850     msg << "Couldn't register function'flip_vertically'";
851     throw SquirrelError(v, msg.str());
852   }
853
854   if(SQ_FAILED(sq_createslot(v, -3))) {
855     std::ostringstream msg;
856     msg << "Couldn't register class'Level'";
857     throw SquirrelError(v, msg.str());
858   }
859
860   // Register class ScriptedObject
861   sq_pushstring(v, "ScriptedObject", -1);
862   if(sq_newclass(v, SQFalse) < 0) {
863     std::ostringstream msg;
864     msg << "Couldn't create new class 'ScriptedObject'";
865     throw SquirrelError(v, msg.str());
866   }
867   sq_pushstring(v, "set_animation", -1);
868   sq_newclosure(v, &ScriptedObject_set_animation_wrapper, 0);
869   if(SQ_FAILED(sq_createslot(v, -3))) {
870     std::ostringstream msg;
871     msg << "Couldn't register function'set_animation'";
872     throw SquirrelError(v, msg.str());
873   }
874
875   sq_pushstring(v, "get_animation", -1);
876   sq_newclosure(v, &ScriptedObject_get_animation_wrapper, 0);
877   if(SQ_FAILED(sq_createslot(v, -3))) {
878     std::ostringstream msg;
879     msg << "Couldn't register function'get_animation'";
880     throw SquirrelError(v, msg.str());
881   }
882
883   sq_pushstring(v, "move", -1);
884   sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
885   if(SQ_FAILED(sq_createslot(v, -3))) {
886     std::ostringstream msg;
887     msg << "Couldn't register function'move'";
888     throw SquirrelError(v, msg.str());
889   }
890
891   sq_pushstring(v, "set_pos", -1);
892   sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
893   if(SQ_FAILED(sq_createslot(v, -3))) {
894     std::ostringstream msg;
895     msg << "Couldn't register function'set_pos'";
896     throw SquirrelError(v, msg.str());
897   }
898
899   sq_pushstring(v, "get_pos_x", -1);
900   sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
901   if(SQ_FAILED(sq_createslot(v, -3))) {
902     std::ostringstream msg;
903     msg << "Couldn't register function'get_pos_x'";
904     throw SquirrelError(v, msg.str());
905   }
906
907   sq_pushstring(v, "get_pos_y", -1);
908   sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
909   if(SQ_FAILED(sq_createslot(v, -3))) {
910     std::ostringstream msg;
911     msg << "Couldn't register function'get_pos_y'";
912     throw SquirrelError(v, msg.str());
913   }
914
915   sq_pushstring(v, "set_velocity", -1);
916   sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
917   if(SQ_FAILED(sq_createslot(v, -3))) {
918     std::ostringstream msg;
919     msg << "Couldn't register function'set_velocity'";
920     throw SquirrelError(v, msg.str());
921   }
922
923   sq_pushstring(v, "get_velocity_x", -1);
924   sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
925   if(SQ_FAILED(sq_createslot(v, -3))) {
926     std::ostringstream msg;
927     msg << "Couldn't register function'get_velocity_x'";
928     throw SquirrelError(v, msg.str());
929   }
930
931   sq_pushstring(v, "get_velocity_y", -1);
932   sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
933   if(SQ_FAILED(sq_createslot(v, -3))) {
934     std::ostringstream msg;
935     msg << "Couldn't register function'get_velocity_y'";
936     throw SquirrelError(v, msg.str());
937   }
938
939   sq_pushstring(v, "set_visible", -1);
940   sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
941   if(SQ_FAILED(sq_createslot(v, -3))) {
942     std::ostringstream msg;
943     msg << "Couldn't register function'set_visible'";
944     throw SquirrelError(v, msg.str());
945   }
946
947   sq_pushstring(v, "is_visible", -1);
948   sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
949   if(SQ_FAILED(sq_createslot(v, -3))) {
950     std::ostringstream msg;
951     msg << "Couldn't register function'is_visible'";
952     throw SquirrelError(v, msg.str());
953   }
954
955   sq_pushstring(v, "get_name", -1);
956   sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
957   if(SQ_FAILED(sq_createslot(v, -3))) {
958     std::ostringstream msg;
959     msg << "Couldn't register function'get_name'";
960     throw SquirrelError(v, msg.str());
961   }
962
963   if(SQ_FAILED(sq_createslot(v, -3))) {
964     std::ostringstream msg;
965     msg << "Couldn't register class'ScriptedObject'";
966     throw SquirrelError(v, msg.str());
967   }
968
969   // Register class Sound
970   sq_pushstring(v, "Sound", -1);
971   if(sq_newclass(v, SQFalse) < 0) {
972     std::ostringstream msg;
973     msg << "Couldn't create new class 'Sound'";
974     throw SquirrelError(v, msg.str());
975   }
976   sq_pushstring(v, "play_music", -1);
977   sq_newclosure(v, &Sound_play_music_wrapper, 0);
978   if(SQ_FAILED(sq_createslot(v, -3))) {
979     std::ostringstream msg;
980     msg << "Couldn't register function'play_music'";
981     throw SquirrelError(v, msg.str());
982   }
983
984   sq_pushstring(v, "play", -1);
985   sq_newclosure(v, &Sound_play_wrapper, 0);
986   if(SQ_FAILED(sq_createslot(v, -3))) {
987     std::ostringstream msg;
988     msg << "Couldn't register function'play'";
989     throw SquirrelError(v, msg.str());
990   }
991
992   if(SQ_FAILED(sq_createslot(v, -3))) {
993     std::ostringstream msg;
994     msg << "Couldn't register class'Sound'";
995     throw SquirrelError(v, msg.str());
996   }
997
998   // Register class Text
999   sq_pushstring(v, "Text", -1);
1000   if(sq_newclass(v, SQFalse) < 0) {
1001     std::ostringstream msg;
1002     msg << "Couldn't create new class 'Text'";
1003     throw SquirrelError(v, msg.str());
1004   }
1005   sq_pushstring(v, "set_text", -1);
1006   sq_newclosure(v, &Text_set_text_wrapper, 0);
1007   if(SQ_FAILED(sq_createslot(v, -3))) {
1008     std::ostringstream msg;
1009     msg << "Couldn't register function'set_text'";
1010     throw SquirrelError(v, msg.str());
1011   }
1012
1013   sq_pushstring(v, "set_font", -1);
1014   sq_newclosure(v, &Text_set_font_wrapper, 0);
1015   if(SQ_FAILED(sq_createslot(v, -3))) {
1016     std::ostringstream msg;
1017     msg << "Couldn't register function'set_font'";
1018     throw SquirrelError(v, msg.str());
1019   }
1020
1021   sq_pushstring(v, "fade_in", -1);
1022   sq_newclosure(v, &Text_fade_in_wrapper, 0);
1023   if(SQ_FAILED(sq_createslot(v, -3))) {
1024     std::ostringstream msg;
1025     msg << "Couldn't register function'fade_in'";
1026     throw SquirrelError(v, msg.str());
1027   }
1028
1029   sq_pushstring(v, "fade_out", -1);
1030   sq_newclosure(v, &Text_fade_out_wrapper, 0);
1031   if(SQ_FAILED(sq_createslot(v, -3))) {
1032     std::ostringstream msg;
1033     msg << "Couldn't register function'fade_out'";
1034     throw SquirrelError(v, msg.str());
1035   }
1036
1037   sq_pushstring(v, "set_visible", -1);
1038   sq_newclosure(v, &Text_set_visible_wrapper, 0);
1039   if(SQ_FAILED(sq_createslot(v, -3))) {
1040     std::ostringstream msg;
1041     msg << "Couldn't register function'set_visible'";
1042     throw SquirrelError(v, msg.str());
1043   }
1044
1045   if(SQ_FAILED(sq_createslot(v, -3))) {
1046     std::ostringstream msg;
1047     msg << "Couldn't register class'Text'";
1048     throw SquirrelError(v, msg.str());
1049   }
1050
1051   // Register class Player
1052   sq_pushstring(v, "Player", -1);
1053   if(sq_newclass(v, SQFalse) < 0) {
1054     std::ostringstream msg;
1055     msg << "Couldn't create new class 'Player'";
1056     throw SquirrelError(v, msg.str());
1057   }
1058   if(SQ_FAILED(sq_createslot(v, -3))) {
1059     std::ostringstream msg;
1060     msg << "Couldn't register class'Player'";
1061     throw SquirrelError(v, msg.str());
1062   }
1063
1064   sq_pop(v, 1);
1065 }
1066
1067 } // end of namespace Scripting
1068