Made invincibility sparkle a particle effect
[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 SQInteger DisplayEffect_release_hook(SQUserPointer ptr, SQInteger )
22 {
23   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (ptr);
24   delete _this;
25   return 0;
26 }
27
28 static SQInteger DisplayEffect_fade_out_wrapper(HSQUIRRELVM vm)
29 {
30   SQUserPointer data;
31   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
32     sq_throwerror(vm, _SC("'fade_out' called without instance"));
33     return SQ_ERROR;
34   }
35   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
36   SQFloat arg0;
37   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
38     sq_throwerror(vm, _SC("Argument 1 not a float"));
39     return SQ_ERROR;
40   }
41   
42   try {
43     _this->fade_out(static_cast<float> (arg0));
44   
45     return 0;
46   
47   } catch(std::exception& e) {
48     sq_throwerror(vm, e.what());
49     return SQ_ERROR;
50   } catch(...) {
51     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
52     return SQ_ERROR;
53   }
54   
55 }
56
57 static SQInteger DisplayEffect_fade_in_wrapper(HSQUIRRELVM vm)
58 {
59   SQUserPointer data;
60   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
61     sq_throwerror(vm, _SC("'fade_in' called without instance"));
62     return SQ_ERROR;
63   }
64   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
65   SQFloat arg0;
66   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
67     sq_throwerror(vm, _SC("Argument 1 not a float"));
68     return SQ_ERROR;
69   }
70   
71   try {
72     _this->fade_in(static_cast<float> (arg0));
73   
74     return 0;
75   
76   } catch(std::exception& e) {
77     sq_throwerror(vm, e.what());
78     return SQ_ERROR;
79   } catch(...) {
80     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
81     return SQ_ERROR;
82   }
83   
84 }
85
86 static SQInteger DisplayEffect_set_black_wrapper(HSQUIRRELVM vm)
87 {
88   SQUserPointer data;
89   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
90     sq_throwerror(vm, _SC("'set_black' called without instance"));
91     return SQ_ERROR;
92   }
93   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
94   SQBool arg0;
95   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
96     sq_throwerror(vm, _SC("Argument 1 not a bool"));
97     return SQ_ERROR;
98   }
99   
100   try {
101     _this->set_black(arg0 == SQTrue);
102   
103     return 0;
104   
105   } catch(std::exception& e) {
106     sq_throwerror(vm, e.what());
107     return SQ_ERROR;
108   } catch(...) {
109     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_black'"));
110     return SQ_ERROR;
111   }
112   
113 }
114
115 static SQInteger DisplayEffect_is_black_wrapper(HSQUIRRELVM vm)
116 {
117   SQUserPointer data;
118   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
119     sq_throwerror(vm, _SC("'is_black' called without instance"));
120     return SQ_ERROR;
121   }
122   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
123   
124   try {
125     bool return_value = _this->is_black();
126   
127     sq_pushbool(vm, return_value);
128     return 1;
129   
130   } catch(std::exception& e) {
131     sq_throwerror(vm, e.what());
132     return SQ_ERROR;
133   } catch(...) {
134     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_black'"));
135     return SQ_ERROR;
136   }
137   
138 }
139
140 static SQInteger DisplayEffect_sixteen_to_nine_wrapper(HSQUIRRELVM vm)
141 {
142   SQUserPointer data;
143   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
144     sq_throwerror(vm, _SC("'sixteen_to_nine' called without instance"));
145     return SQ_ERROR;
146   }
147   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
148   SQFloat arg0;
149   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
150     sq_throwerror(vm, _SC("Argument 1 not a float"));
151     return SQ_ERROR;
152   }
153   
154   try {
155     _this->sixteen_to_nine(static_cast<float> (arg0));
156   
157     return 0;
158   
159   } catch(std::exception& e) {
160     sq_throwerror(vm, e.what());
161     return SQ_ERROR;
162   } catch(...) {
163     sq_throwerror(vm, _SC("Unexpected exception while executing function 'sixteen_to_nine'"));
164     return SQ_ERROR;
165   }
166   
167 }
168
169 static SQInteger DisplayEffect_four_to_three_wrapper(HSQUIRRELVM vm)
170 {
171   SQUserPointer data;
172   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
173     sq_throwerror(vm, _SC("'four_to_three' called without instance"));
174     return SQ_ERROR;
175   }
176   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
177   SQFloat arg0;
178   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
179     sq_throwerror(vm, _SC("Argument 1 not a float"));
180     return SQ_ERROR;
181   }
182   
183   try {
184     _this->four_to_three(static_cast<float> (arg0));
185   
186     return 0;
187   
188   } catch(std::exception& e) {
189     sq_throwerror(vm, e.what());
190     return SQ_ERROR;
191   } catch(...) {
192     sq_throwerror(vm, _SC("Unexpected exception while executing function 'four_to_three'"));
193     return SQ_ERROR;
194   }
195   
196 }
197
198 static SQInteger Camera_release_hook(SQUserPointer ptr, SQInteger )
199 {
200   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (ptr);
201   delete _this;
202   return 0;
203 }
204
205 static SQInteger Camera_shake_wrapper(HSQUIRRELVM vm)
206 {
207   SQUserPointer data;
208   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
209     sq_throwerror(vm, _SC("'shake' called without instance"));
210     return SQ_ERROR;
211   }
212   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
213   SQFloat arg0;
214   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
215     sq_throwerror(vm, _SC("Argument 1 not a float"));
216     return SQ_ERROR;
217   }
218   SQFloat arg1;
219   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
220     sq_throwerror(vm, _SC("Argument 2 not a float"));
221     return SQ_ERROR;
222   }
223   SQFloat arg2;
224   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
225     sq_throwerror(vm, _SC("Argument 3 not a float"));
226     return SQ_ERROR;
227   }
228   
229   try {
230     _this->shake(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
231   
232     return 0;
233   
234   } catch(std::exception& e) {
235     sq_throwerror(vm, e.what());
236     return SQ_ERROR;
237   } catch(...) {
238     sq_throwerror(vm, _SC("Unexpected exception while executing function 'shake'"));
239     return SQ_ERROR;
240   }
241   
242 }
243
244 static SQInteger Camera_set_pos_wrapper(HSQUIRRELVM vm)
245 {
246   SQUserPointer data;
247   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
248     sq_throwerror(vm, _SC("'set_pos' called without instance"));
249     return SQ_ERROR;
250   }
251   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
252   SQFloat arg0;
253   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
254     sq_throwerror(vm, _SC("Argument 1 not a float"));
255     return SQ_ERROR;
256   }
257   SQFloat arg1;
258   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
259     sq_throwerror(vm, _SC("Argument 2 not a float"));
260     return SQ_ERROR;
261   }
262   
263   try {
264     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
265   
266     return 0;
267   
268   } catch(std::exception& e) {
269     sq_throwerror(vm, e.what());
270     return SQ_ERROR;
271   } catch(...) {
272     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
273     return SQ_ERROR;
274   }
275   
276 }
277
278 static SQInteger Camera_set_mode_wrapper(HSQUIRRELVM vm)
279 {
280   SQUserPointer data;
281   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
282     sq_throwerror(vm, _SC("'set_mode' called without instance"));
283     return SQ_ERROR;
284   }
285   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
286   const SQChar* arg0;
287   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
288     sq_throwerror(vm, _SC("Argument 1 not a string"));
289     return SQ_ERROR;
290   }
291   
292   try {
293     _this->set_mode(arg0);
294   
295     return 0;
296   
297   } catch(std::exception& e) {
298     sq_throwerror(vm, e.what());
299     return SQ_ERROR;
300   } catch(...) {
301     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_mode'"));
302     return SQ_ERROR;
303   }
304   
305 }
306
307 static SQInteger Camera_scroll_to_wrapper(HSQUIRRELVM vm)
308 {
309   SQUserPointer data;
310   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
311     sq_throwerror(vm, _SC("'scroll_to' called without instance"));
312     return SQ_ERROR;
313   }
314   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
315   SQFloat arg0;
316   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
317     sq_throwerror(vm, _SC("Argument 1 not a float"));
318     return SQ_ERROR;
319   }
320   SQFloat arg1;
321   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
322     sq_throwerror(vm, _SC("Argument 2 not a float"));
323     return SQ_ERROR;
324   }
325   SQFloat arg2;
326   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
327     sq_throwerror(vm, _SC("Argument 3 not a float"));
328     return SQ_ERROR;
329   }
330   
331   try {
332     _this->scroll_to(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
333   
334     return 0;
335   
336   } catch(std::exception& e) {
337     sq_throwerror(vm, e.what());
338     return SQ_ERROR;
339   } catch(...) {
340     sq_throwerror(vm, _SC("Unexpected exception while executing function 'scroll_to'"));
341     return SQ_ERROR;
342   }
343   
344 }
345
346 static SQInteger Level_release_hook(SQUserPointer ptr, SQInteger )
347 {
348   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (ptr);
349   delete _this;
350   return 0;
351 }
352
353 static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
354 {
355   SQUserPointer data;
356   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
357     sq_throwerror(vm, _SC("'finish' called without instance"));
358     return SQ_ERROR;
359   }
360   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
361   SQBool arg0;
362   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
363     sq_throwerror(vm, _SC("Argument 1 not a bool"));
364     return SQ_ERROR;
365   }
366   
367   try {
368     _this->finish(arg0 == SQTrue);
369   
370     return 0;
371   
372   } catch(std::exception& e) {
373     sq_throwerror(vm, e.what());
374     return SQ_ERROR;
375   } catch(...) {
376     sq_throwerror(vm, _SC("Unexpected exception while executing function 'finish'"));
377     return SQ_ERROR;
378   }
379   
380 }
381
382 static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
383 {
384   SQUserPointer data;
385   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
386     sq_throwerror(vm, _SC("'spawn' called without instance"));
387     return SQ_ERROR;
388   }
389   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
390   const SQChar* arg0;
391   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
392     sq_throwerror(vm, _SC("Argument 1 not a string"));
393     return SQ_ERROR;
394   }
395   const SQChar* arg1;
396   if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
397     sq_throwerror(vm, _SC("Argument 2 not a string"));
398     return SQ_ERROR;
399   }
400   
401   try {
402     _this->spawn(arg0, arg1);
403   
404     return 0;
405   
406   } catch(std::exception& e) {
407     sq_throwerror(vm, e.what());
408     return SQ_ERROR;
409   } catch(...) {
410     sq_throwerror(vm, _SC("Unexpected exception while executing function 'spawn'"));
411     return SQ_ERROR;
412   }
413   
414 }
415
416 static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
417 {
418   SQUserPointer data;
419   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
420     sq_throwerror(vm, _SC("'flip_vertically' called without instance"));
421     return SQ_ERROR;
422   }
423   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
424   
425   try {
426     _this->flip_vertically();
427   
428     return 0;
429   
430   } catch(std::exception& e) {
431     sq_throwerror(vm, e.what());
432     return SQ_ERROR;
433   } catch(...) {
434     sq_throwerror(vm, _SC("Unexpected exception while executing function 'flip_vertically'"));
435     return SQ_ERROR;
436   }
437   
438 }
439
440 static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
441 {
442   SQUserPointer data;
443   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
444     sq_throwerror(vm, _SC("'toggle_pause' called without instance"));
445     return SQ_ERROR;
446   }
447   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
448   
449   try {
450     _this->toggle_pause();
451   
452     return 0;
453   
454   } catch(std::exception& e) {
455     sq_throwerror(vm, e.what());
456     return SQ_ERROR;
457   } catch(...) {
458     sq_throwerror(vm, _SC("Unexpected exception while executing function 'toggle_pause'"));
459     return SQ_ERROR;
460   }
461   
462 }
463
464 static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
465 {
466   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
467   delete _this;
468   return 0;
469 }
470
471 static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm)
472 {
473   SQUserPointer data;
474   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
475     sq_throwerror(vm, _SC("'set_action' called without instance"));
476     return SQ_ERROR;
477   }
478   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
479   const SQChar* arg0;
480   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
481     sq_throwerror(vm, _SC("Argument 1 not a string"));
482     return SQ_ERROR;
483   }
484   
485   try {
486     _this->set_action(arg0);
487   
488     return 0;
489   
490   } catch(std::exception& e) {
491     sq_throwerror(vm, e.what());
492     return SQ_ERROR;
493   } catch(...) {
494     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
495     return SQ_ERROR;
496   }
497   
498 }
499
500 static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm)
501 {
502   SQUserPointer data;
503   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
504     sq_throwerror(vm, _SC("'get_action' called without instance"));
505     return SQ_ERROR;
506   }
507   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
508   
509   try {
510     std::string return_value = _this->get_action();
511   
512     sq_pushstring(vm, return_value.c_str(), return_value.size());
513     return 1;
514   
515   } catch(std::exception& e) {
516     sq_throwerror(vm, e.what());
517     return SQ_ERROR;
518   } catch(...) {
519     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
520     return SQ_ERROR;
521   }
522   
523 }
524
525 static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm)
526 {
527   SQUserPointer data;
528   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
529     sq_throwerror(vm, _SC("'move' called without instance"));
530     return SQ_ERROR;
531   }
532   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
533   SQFloat arg0;
534   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
535     sq_throwerror(vm, _SC("Argument 1 not a float"));
536     return SQ_ERROR;
537   }
538   SQFloat arg1;
539   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
540     sq_throwerror(vm, _SC("Argument 2 not a float"));
541     return SQ_ERROR;
542   }
543   
544   try {
545     _this->move(static_cast<float> (arg0), static_cast<float> (arg1));
546   
547     return 0;
548   
549   } catch(std::exception& e) {
550     sq_throwerror(vm, e.what());
551     return SQ_ERROR;
552   } catch(...) {
553     sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'"));
554     return SQ_ERROR;
555   }
556   
557 }
558
559 static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm)
560 {
561   SQUserPointer data;
562   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
563     sq_throwerror(vm, _SC("'set_pos' called without instance"));
564     return SQ_ERROR;
565   }
566   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
567   SQFloat arg0;
568   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
569     sq_throwerror(vm, _SC("Argument 1 not a float"));
570     return SQ_ERROR;
571   }
572   SQFloat arg1;
573   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
574     sq_throwerror(vm, _SC("Argument 2 not a float"));
575     return SQ_ERROR;
576   }
577   
578   try {
579     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
580   
581     return 0;
582   
583   } catch(std::exception& e) {
584     sq_throwerror(vm, e.what());
585     return SQ_ERROR;
586   } catch(...) {
587     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
588     return SQ_ERROR;
589   }
590   
591 }
592
593 static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm)
594 {
595   SQUserPointer data;
596   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
597     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
598     return SQ_ERROR;
599   }
600   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
601   
602   try {
603     float return_value = _this->get_pos_x();
604   
605     sq_pushfloat(vm, return_value);
606     return 1;
607   
608   } catch(std::exception& e) {
609     sq_throwerror(vm, e.what());
610     return SQ_ERROR;
611   } catch(...) {
612     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
613     return SQ_ERROR;
614   }
615   
616 }
617
618 static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm)
619 {
620   SQUserPointer data;
621   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
622     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
623     return SQ_ERROR;
624   }
625   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
626   
627   try {
628     float return_value = _this->get_pos_y();
629   
630     sq_pushfloat(vm, return_value);
631     return 1;
632   
633   } catch(std::exception& e) {
634     sq_throwerror(vm, e.what());
635     return SQ_ERROR;
636   } catch(...) {
637     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
638     return SQ_ERROR;
639   }
640   
641 }
642
643 static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm)
644 {
645   SQUserPointer data;
646   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
647     sq_throwerror(vm, _SC("'set_velocity' called without instance"));
648     return SQ_ERROR;
649   }
650   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
651   SQFloat arg0;
652   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
653     sq_throwerror(vm, _SC("Argument 1 not a float"));
654     return SQ_ERROR;
655   }
656   SQFloat arg1;
657   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
658     sq_throwerror(vm, _SC("Argument 2 not a float"));
659     return SQ_ERROR;
660   }
661   
662   try {
663     _this->set_velocity(static_cast<float> (arg0), static_cast<float> (arg1));
664   
665     return 0;
666   
667   } catch(std::exception& e) {
668     sq_throwerror(vm, e.what());
669     return SQ_ERROR;
670   } catch(...) {
671     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_velocity'"));
672     return SQ_ERROR;
673   }
674   
675 }
676
677 static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm)
678 {
679   SQUserPointer data;
680   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
681     sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
682     return SQ_ERROR;
683   }
684   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
685   
686   try {
687     float return_value = _this->get_velocity_x();
688   
689     sq_pushfloat(vm, return_value);
690     return 1;
691   
692   } catch(std::exception& e) {
693     sq_throwerror(vm, e.what());
694     return SQ_ERROR;
695   } catch(...) {
696     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_x'"));
697     return SQ_ERROR;
698   }
699   
700 }
701
702 static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm)
703 {
704   SQUserPointer data;
705   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
706     sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
707     return SQ_ERROR;
708   }
709   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
710   
711   try {
712     float return_value = _this->get_velocity_y();
713   
714     sq_pushfloat(vm, return_value);
715     return 1;
716   
717   } catch(std::exception& e) {
718     sq_throwerror(vm, e.what());
719     return SQ_ERROR;
720   } catch(...) {
721     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_y'"));
722     return SQ_ERROR;
723   }
724   
725 }
726
727 static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
728 {
729   SQUserPointer data;
730   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
731     sq_throwerror(vm, _SC("'set_visible' called without instance"));
732     return SQ_ERROR;
733   }
734   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
735   SQBool arg0;
736   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
737     sq_throwerror(vm, _SC("Argument 1 not a bool"));
738     return SQ_ERROR;
739   }
740   
741   try {
742     _this->set_visible(arg0 == SQTrue);
743   
744     return 0;
745   
746   } catch(std::exception& e) {
747     sq_throwerror(vm, e.what());
748     return SQ_ERROR;
749   } catch(...) {
750     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
751     return SQ_ERROR;
752   }
753   
754 }
755
756 static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
757 {
758   SQUserPointer data;
759   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
760     sq_throwerror(vm, _SC("'is_visible' called without instance"));
761     return SQ_ERROR;
762   }
763   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
764   
765   try {
766     bool return_value = _this->is_visible();
767   
768     sq_pushbool(vm, return_value);
769     return 1;
770   
771   } catch(std::exception& e) {
772     sq_throwerror(vm, e.what());
773     return SQ_ERROR;
774   } catch(...) {
775     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_visible'"));
776     return SQ_ERROR;
777   }
778   
779 }
780
781 static SQInteger ScriptedObject_set_solid_wrapper(HSQUIRRELVM vm)
782 {
783   SQUserPointer data;
784   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
785     sq_throwerror(vm, _SC("'set_solid' called without instance"));
786     return SQ_ERROR;
787   }
788   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
789   SQBool arg0;
790   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
791     sq_throwerror(vm, _SC("Argument 1 not a bool"));
792     return SQ_ERROR;
793   }
794   
795   try {
796     _this->set_solid(arg0 == SQTrue);
797   
798     return 0;
799   
800   } catch(std::exception& e) {
801     sq_throwerror(vm, e.what());
802     return SQ_ERROR;
803   } catch(...) {
804     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_solid'"));
805     return SQ_ERROR;
806   }
807   
808 }
809
810 static SQInteger ScriptedObject_is_solid_wrapper(HSQUIRRELVM vm)
811 {
812   SQUserPointer data;
813   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
814     sq_throwerror(vm, _SC("'is_solid' called without instance"));
815     return SQ_ERROR;
816   }
817   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
818   
819   try {
820     bool return_value = _this->is_solid();
821   
822     sq_pushbool(vm, return_value);
823     return 1;
824   
825   } catch(std::exception& e) {
826     sq_throwerror(vm, e.what());
827     return SQ_ERROR;
828   } catch(...) {
829     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_solid'"));
830     return SQ_ERROR;
831   }
832   
833 }
834
835 static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
836 {
837   SQUserPointer data;
838   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
839     sq_throwerror(vm, _SC("'get_name' called without instance"));
840     return SQ_ERROR;
841   }
842   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
843   
844   try {
845     std::string return_value = _this->get_name();
846   
847     sq_pushstring(vm, return_value.c_str(), return_value.size());
848     return 1;
849   
850   } catch(std::exception& e) {
851     sq_throwerror(vm, e.what());
852     return SQ_ERROR;
853   } catch(...) {
854     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
855     return SQ_ERROR;
856   }
857   
858 }
859
860 static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
861 {
862   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (ptr);
863   delete _this;
864   return 0;
865 }
866
867 static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm)
868 {
869   SQUserPointer data;
870   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
871     sq_throwerror(vm, _SC("'set_text' called without instance"));
872     return SQ_ERROR;
873   }
874   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
875   const SQChar* arg0;
876   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
877     sq_throwerror(vm, _SC("Argument 1 not a string"));
878     return SQ_ERROR;
879   }
880   
881   try {
882     _this->set_text(arg0);
883   
884     return 0;
885   
886   } catch(std::exception& e) {
887     sq_throwerror(vm, e.what());
888     return SQ_ERROR;
889   } catch(...) {
890     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
891     return SQ_ERROR;
892   }
893   
894 }
895
896 static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm)
897 {
898   SQUserPointer data;
899   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
900     sq_throwerror(vm, _SC("'set_font' called without instance"));
901     return SQ_ERROR;
902   }
903   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
904   const SQChar* arg0;
905   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
906     sq_throwerror(vm, _SC("Argument 1 not a string"));
907     return SQ_ERROR;
908   }
909   
910   try {
911     _this->set_font(arg0);
912   
913     return 0;
914   
915   } catch(std::exception& e) {
916     sq_throwerror(vm, e.what());
917     return SQ_ERROR;
918   } catch(...) {
919     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_font'"));
920     return SQ_ERROR;
921   }
922   
923 }
924
925 static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm)
926 {
927   SQUserPointer data;
928   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
929     sq_throwerror(vm, _SC("'fade_in' called without instance"));
930     return SQ_ERROR;
931   }
932   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
933   SQFloat arg0;
934   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
935     sq_throwerror(vm, _SC("Argument 1 not a float"));
936     return SQ_ERROR;
937   }
938   
939   try {
940     _this->fade_in(static_cast<float> (arg0));
941   
942     return 0;
943   
944   } catch(std::exception& e) {
945     sq_throwerror(vm, e.what());
946     return SQ_ERROR;
947   } catch(...) {
948     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
949     return SQ_ERROR;
950   }
951   
952 }
953
954 static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm)
955 {
956   SQUserPointer data;
957   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
958     sq_throwerror(vm, _SC("'fade_out' called without instance"));
959     return SQ_ERROR;
960   }
961   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
962   SQFloat arg0;
963   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
964     sq_throwerror(vm, _SC("Argument 1 not a float"));
965     return SQ_ERROR;
966   }
967   
968   try {
969     _this->fade_out(static_cast<float> (arg0));
970   
971     return 0;
972   
973   } catch(std::exception& e) {
974     sq_throwerror(vm, e.what());
975     return SQ_ERROR;
976   } catch(...) {
977     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
978     return SQ_ERROR;
979   }
980   
981 }
982
983 static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm)
984 {
985   SQUserPointer data;
986   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
987     sq_throwerror(vm, _SC("'set_visible' called without instance"));
988     return SQ_ERROR;
989   }
990   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
991   SQBool arg0;
992   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
993     sq_throwerror(vm, _SC("Argument 1 not a bool"));
994     return SQ_ERROR;
995   }
996   
997   try {
998     _this->set_visible(arg0 == SQTrue);
999   
1000     return 0;
1001   
1002   } catch(std::exception& e) {
1003     sq_throwerror(vm, e.what());
1004     return SQ_ERROR;
1005   } catch(...) {
1006     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1007     return SQ_ERROR;
1008   }
1009   
1010 }
1011
1012 static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
1013 {
1014   SQUserPointer data;
1015   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1016     sq_throwerror(vm, _SC("'set_centered' called without instance"));
1017     return SQ_ERROR;
1018   }
1019   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1020   SQBool arg0;
1021   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1022     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1023     return SQ_ERROR;
1024   }
1025   
1026   try {
1027     _this->set_centered(arg0 == SQTrue);
1028   
1029     return 0;
1030   
1031   } catch(std::exception& e) {
1032     sq_throwerror(vm, e.what());
1033     return SQ_ERROR;
1034   } catch(...) {
1035     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_centered'"));
1036     return SQ_ERROR;
1037   }
1038   
1039 }
1040
1041 static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger )
1042 {
1043   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
1044   delete _this;
1045   return 0;
1046 }
1047
1048 static SQInteger Player_add_bonus_wrapper(HSQUIRRELVM vm)
1049 {
1050   SQUserPointer data;
1051   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1052     sq_throwerror(vm, _SC("'add_bonus' called without instance"));
1053     return SQ_ERROR;
1054   }
1055   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1056   const SQChar* arg0;
1057   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1058     sq_throwerror(vm, _SC("Argument 1 not a string"));
1059     return SQ_ERROR;
1060   }
1061   
1062   try {
1063     _this->add_bonus(arg0);
1064   
1065     return 0;
1066   
1067   } catch(std::exception& e) {
1068     sq_throwerror(vm, e.what());
1069     return SQ_ERROR;
1070   } catch(...) {
1071     sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_bonus'"));
1072     return SQ_ERROR;
1073   }
1074   
1075 }
1076
1077 static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm)
1078 {
1079   SQUserPointer data;
1080   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1081     sq_throwerror(vm, _SC("'add_coins' called without instance"));
1082     return SQ_ERROR;
1083   }
1084   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1085   SQInteger arg0;
1086   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1087     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1088     return SQ_ERROR;
1089   }
1090   
1091   try {
1092     _this->add_coins(static_cast<int> (arg0));
1093   
1094     return 0;
1095   
1096   } catch(std::exception& e) {
1097     sq_throwerror(vm, e.what());
1098     return SQ_ERROR;
1099   } catch(...) {
1100     sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_coins'"));
1101     return SQ_ERROR;
1102   }
1103   
1104 }
1105
1106 static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm)
1107 {
1108   SQUserPointer data;
1109   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1110     sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1111     return SQ_ERROR;
1112   }
1113   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1114   
1115   try {
1116     _this->make_invincible();
1117   
1118     return 0;
1119   
1120   } catch(std::exception& e) {
1121     sq_throwerror(vm, e.what());
1122     return SQ_ERROR;
1123   } catch(...) {
1124     sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1125     return SQ_ERROR;
1126   }
1127   
1128 }
1129
1130 static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm)
1131 {
1132   SQUserPointer data;
1133   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1134     sq_throwerror(vm, _SC("'deactivate' called without instance"));
1135     return SQ_ERROR;
1136   }
1137   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1138   
1139   try {
1140     _this->deactivate();
1141   
1142     return 0;
1143   
1144   } catch(std::exception& e) {
1145     sq_throwerror(vm, e.what());
1146     return SQ_ERROR;
1147   } catch(...) {
1148     sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1149     return SQ_ERROR;
1150   }
1151   
1152 }
1153
1154 static SQInteger Player_activate_wrapper(HSQUIRRELVM vm)
1155 {
1156   SQUserPointer data;
1157   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1158     sq_throwerror(vm, _SC("'activate' called without instance"));
1159     return SQ_ERROR;
1160   }
1161   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1162   
1163   try {
1164     _this->activate();
1165   
1166     return 0;
1167   
1168   } catch(std::exception& e) {
1169     sq_throwerror(vm, e.what());
1170     return SQ_ERROR;
1171   } catch(...) {
1172     sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1173     return SQ_ERROR;
1174   }
1175   
1176 }
1177
1178 static SQInteger Player_walk_wrapper(HSQUIRRELVM vm)
1179 {
1180   SQUserPointer data;
1181   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1182     sq_throwerror(vm, _SC("'walk' called without instance"));
1183     return SQ_ERROR;
1184   }
1185   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1186   SQFloat arg0;
1187   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1188     sq_throwerror(vm, _SC("Argument 1 not a float"));
1189     return SQ_ERROR;
1190   }
1191   
1192   try {
1193     _this->walk(static_cast<float> (arg0));
1194   
1195     return 0;
1196   
1197   } catch(std::exception& e) {
1198     sq_throwerror(vm, e.what());
1199     return SQ_ERROR;
1200   } catch(...) {
1201     sq_throwerror(vm, _SC("Unexpected exception while executing function 'walk'"));
1202     return SQ_ERROR;
1203   }
1204   
1205 }
1206
1207 static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm)
1208 {
1209   SQUserPointer data;
1210   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1211     sq_throwerror(vm, _SC("'set_visible' called without instance"));
1212     return SQ_ERROR;
1213   }
1214   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1215   SQBool arg0;
1216   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1217     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1218     return SQ_ERROR;
1219   }
1220   
1221   try {
1222     _this->set_visible(arg0 == SQTrue);
1223   
1224     return 0;
1225   
1226   } catch(std::exception& e) {
1227     sq_throwerror(vm, e.what());
1228     return SQ_ERROR;
1229   } catch(...) {
1230     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1231     return SQ_ERROR;
1232   }
1233   
1234 }
1235
1236 static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm)
1237 {
1238   SQUserPointer data;
1239   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1240     sq_throwerror(vm, _SC("'get_visible' called without instance"));
1241     return SQ_ERROR;
1242   }
1243   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1244   
1245   try {
1246     bool return_value = _this->get_visible();
1247   
1248     sq_pushbool(vm, return_value);
1249     return 1;
1250   
1251   } catch(std::exception& e) {
1252     sq_throwerror(vm, e.what());
1253     return SQ_ERROR;
1254   } catch(...) {
1255     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1256     return SQ_ERROR;
1257   }
1258   
1259 }
1260
1261 static SQInteger Player_kill_wrapper(HSQUIRRELVM vm)
1262 {
1263   SQUserPointer data;
1264   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1265     sq_throwerror(vm, _SC("'kill' called without instance"));
1266     return SQ_ERROR;
1267   }
1268   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1269   SQBool arg0;
1270   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1271     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1272     return SQ_ERROR;
1273   }
1274   
1275   try {
1276     _this->kill(arg0 == SQTrue);
1277   
1278     return 0;
1279   
1280   } catch(std::exception& e) {
1281     sq_throwerror(vm, e.what());
1282     return SQ_ERROR;
1283   } catch(...) {
1284     sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'"));
1285     return SQ_ERROR;
1286   }
1287   
1288 }
1289
1290 static SQInteger Player_set_ghost_mode_wrapper(HSQUIRRELVM vm)
1291 {
1292   SQUserPointer data;
1293   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1294     sq_throwerror(vm, _SC("'set_ghost_mode' called without instance"));
1295     return SQ_ERROR;
1296   }
1297   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1298   SQBool arg0;
1299   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1300     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1301     return SQ_ERROR;
1302   }
1303   
1304   try {
1305     _this->set_ghost_mode(arg0 == SQTrue);
1306   
1307     return 0;
1308   
1309   } catch(std::exception& e) {
1310     sq_throwerror(vm, e.what());
1311     return SQ_ERROR;
1312   } catch(...) {
1313     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ghost_mode'"));
1314     return SQ_ERROR;
1315   }
1316   
1317 }
1318
1319 static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm)
1320 {
1321   SQUserPointer data;
1322   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1323     sq_throwerror(vm, _SC("'get_ghost_mode' called without instance"));
1324     return SQ_ERROR;
1325   }
1326   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1327   
1328   try {
1329     bool return_value = _this->get_ghost_mode();
1330   
1331     sq_pushbool(vm, return_value);
1332     return 1;
1333   
1334   } catch(std::exception& e) {
1335     sq_throwerror(vm, e.what());
1336     return SQ_ERROR;
1337   } catch(...) {
1338     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ghost_mode'"));
1339     return SQ_ERROR;
1340   }
1341   
1342 }
1343
1344 static SQInteger Player_do_cheer_wrapper(HSQUIRRELVM vm)
1345 {
1346   SQUserPointer data;
1347   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1348     sq_throwerror(vm, _SC("'do_cheer' called without instance"));
1349     return SQ_ERROR;
1350   }
1351   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1352   
1353   try {
1354     _this->do_cheer();
1355   
1356     return 0;
1357   
1358   } catch(std::exception& e) {
1359     sq_throwerror(vm, e.what());
1360     return SQ_ERROR;
1361   } catch(...) {
1362     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_cheer'"));
1363     return SQ_ERROR;
1364   }
1365   
1366 }
1367
1368 static SQInteger Player_do_duck_wrapper(HSQUIRRELVM vm)
1369 {
1370   SQUserPointer data;
1371   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1372     sq_throwerror(vm, _SC("'do_duck' called without instance"));
1373     return SQ_ERROR;
1374   }
1375   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1376   
1377   try {
1378     _this->do_duck();
1379   
1380     return 0;
1381   
1382   } catch(std::exception& e) {
1383     sq_throwerror(vm, e.what());
1384     return SQ_ERROR;
1385   } catch(...) {
1386     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_duck'"));
1387     return SQ_ERROR;
1388   }
1389   
1390 }
1391
1392 static SQInteger Player_do_standup_wrapper(HSQUIRRELVM vm)
1393 {
1394   SQUserPointer data;
1395   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1396     sq_throwerror(vm, _SC("'do_standup' called without instance"));
1397     return SQ_ERROR;
1398   }
1399   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1400   
1401   try {
1402     _this->do_standup();
1403   
1404     return 0;
1405   
1406   } catch(std::exception& e) {
1407     sq_throwerror(vm, e.what());
1408     return SQ_ERROR;
1409   } catch(...) {
1410     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_standup'"));
1411     return SQ_ERROR;
1412   }
1413   
1414 }
1415
1416 static SQInteger Player_do_backflip_wrapper(HSQUIRRELVM vm)
1417 {
1418   SQUserPointer data;
1419   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1420     sq_throwerror(vm, _SC("'do_backflip' called without instance"));
1421     return SQ_ERROR;
1422   }
1423   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1424   
1425   try {
1426     _this->do_backflip();
1427   
1428     return 0;
1429   
1430   } catch(std::exception& e) {
1431     sq_throwerror(vm, e.what());
1432     return SQ_ERROR;
1433   } catch(...) {
1434     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_backflip'"));
1435     return SQ_ERROR;
1436   }
1437   
1438 }
1439
1440 static SQInteger Player_do_jump_wrapper(HSQUIRRELVM vm)
1441 {
1442   SQUserPointer data;
1443   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1444     sq_throwerror(vm, _SC("'do_jump' called without instance"));
1445     return SQ_ERROR;
1446   }
1447   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1448   SQFloat arg0;
1449   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1450     sq_throwerror(vm, _SC("Argument 1 not a float"));
1451     return SQ_ERROR;
1452   }
1453   
1454   try {
1455     _this->do_jump(static_cast<float> (arg0));
1456   
1457     return 0;
1458   
1459   } catch(std::exception& e) {
1460     sq_throwerror(vm, e.what());
1461     return SQ_ERROR;
1462   } catch(...) {
1463     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_jump'"));
1464     return SQ_ERROR;
1465   }
1466   
1467 }
1468
1469 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
1470 {
1471   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1472   delete _this;
1473   return 0;
1474 }
1475
1476 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1477 {
1478   const SQChar* arg0;
1479   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1480     sq_throwerror(vm, _SC("Argument 1 not a string"));
1481     return SQ_ERROR;
1482   }
1483   
1484   try {
1485     Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1486   if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1487     sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1488     return SQ_ERROR;
1489   }
1490   sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1491   
1492     return 0;
1493   
1494   } catch(std::exception& e) {
1495     sq_throwerror(vm, e.what());
1496     return SQ_ERROR;
1497   } catch(...) {
1498     sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1499     return SQ_ERROR;
1500   }
1501   
1502 }
1503
1504 static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
1505 {
1506   SQUserPointer data;
1507   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1508     sq_throwerror(vm, _SC("'set_layer' called without instance"));
1509     return SQ_ERROR;
1510   }
1511   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1512   SQInteger arg0;
1513   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1514     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1515     return SQ_ERROR;
1516   }
1517   
1518   try {
1519     _this->set_layer(static_cast<int> (arg0));
1520   
1521     return 0;
1522   
1523   } catch(std::exception& e) {
1524     sq_throwerror(vm, e.what());
1525     return SQ_ERROR;
1526   } catch(...) {
1527     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
1528     return SQ_ERROR;
1529   }
1530   
1531 }
1532
1533 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1534 {
1535   SQUserPointer data;
1536   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1537     sq_throwerror(vm, _SC("'get_layer' called without instance"));
1538     return SQ_ERROR;
1539   }
1540   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1541   
1542   try {
1543     int return_value = _this->get_layer();
1544   
1545     sq_pushinteger(vm, return_value);
1546     return 1;
1547   
1548   } catch(std::exception& e) {
1549     sq_throwerror(vm, e.what());
1550     return SQ_ERROR;
1551   } catch(...) {
1552     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1553     return SQ_ERROR;
1554   }
1555   
1556 }
1557
1558 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1559 {
1560   SQUserPointer data;
1561   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1562     sq_throwerror(vm, _SC("'set_pos' called without instance"));
1563     return SQ_ERROR;
1564   }
1565   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1566   SQFloat arg0;
1567   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1568     sq_throwerror(vm, _SC("Argument 1 not a float"));
1569     return SQ_ERROR;
1570   }
1571   SQFloat arg1;
1572   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1573     sq_throwerror(vm, _SC("Argument 2 not a float"));
1574     return SQ_ERROR;
1575   }
1576   
1577   try {
1578     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1579   
1580     return 0;
1581   
1582   } catch(std::exception& e) {
1583     sq_throwerror(vm, e.what());
1584     return SQ_ERROR;
1585   } catch(...) {
1586     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1587     return SQ_ERROR;
1588   }
1589   
1590 }
1591
1592 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1593 {
1594   SQUserPointer data;
1595   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1596     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1597     return SQ_ERROR;
1598   }
1599   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1600   
1601   try {
1602     float return_value = _this->get_pos_x();
1603   
1604     sq_pushfloat(vm, return_value);
1605     return 1;
1606   
1607   } catch(std::exception& e) {
1608     sq_throwerror(vm, e.what());
1609     return SQ_ERROR;
1610   } catch(...) {
1611     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1612     return SQ_ERROR;
1613   }
1614   
1615 }
1616
1617 static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
1618 {
1619   SQUserPointer data;
1620   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1621     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1622     return SQ_ERROR;
1623   }
1624   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1625   
1626   try {
1627     float return_value = _this->get_pos_y();
1628   
1629     sq_pushfloat(vm, return_value);
1630     return 1;
1631   
1632   } catch(std::exception& e) {
1633     sq_throwerror(vm, e.what());
1634     return SQ_ERROR;
1635   } catch(...) {
1636     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1637     return SQ_ERROR;
1638   }
1639   
1640 }
1641
1642 static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
1643 {
1644   SQUserPointer data;
1645   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1646     sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1647     return SQ_ERROR;
1648   }
1649   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1650   SQInteger arg0;
1651   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1652     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1653     return SQ_ERROR;
1654   }
1655   
1656   try {
1657     _this->set_anchor_point(static_cast<int> (arg0));
1658   
1659     return 0;
1660   
1661   } catch(std::exception& e) {
1662     sq_throwerror(vm, e.what());
1663     return SQ_ERROR;
1664   } catch(...) {
1665     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1666     return SQ_ERROR;
1667   }
1668   
1669 }
1670
1671 static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
1672 {
1673   SQUserPointer data;
1674   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1675     sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1676     return SQ_ERROR;
1677   }
1678   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1679   
1680   try {
1681     int return_value = _this->get_anchor_point();
1682   
1683     sq_pushinteger(vm, return_value);
1684     return 1;
1685   
1686   } catch(std::exception& e) {
1687     sq_throwerror(vm, e.what());
1688     return SQ_ERROR;
1689   } catch(...) {
1690     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1691     return SQ_ERROR;
1692   }
1693   
1694 }
1695
1696 static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
1697 {
1698   SQUserPointer data;
1699   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1700     sq_throwerror(vm, _SC("'set_visible' called without instance"));
1701     return SQ_ERROR;
1702   }
1703   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1704   SQBool arg0;
1705   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1706     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1707     return SQ_ERROR;
1708   }
1709   
1710   try {
1711     _this->set_visible(arg0 == SQTrue);
1712   
1713     return 0;
1714   
1715   } catch(std::exception& e) {
1716     sq_throwerror(vm, e.what());
1717     return SQ_ERROR;
1718   } catch(...) {
1719     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1720     return SQ_ERROR;
1721   }
1722   
1723 }
1724
1725 static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
1726 {
1727   SQUserPointer data;
1728   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1729     sq_throwerror(vm, _SC("'get_visible' called without instance"));
1730     return SQ_ERROR;
1731   }
1732   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1733   
1734   try {
1735     bool return_value = _this->get_visible();
1736   
1737     sq_pushbool(vm, return_value);
1738     return 1;
1739   
1740   } catch(std::exception& e) {
1741     sq_throwerror(vm, e.what());
1742     return SQ_ERROR;
1743   } catch(...) {
1744     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1745     return SQ_ERROR;
1746   }
1747   
1748 }
1749
1750 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
1751 {
1752   SQUserPointer data;
1753   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1754     sq_throwerror(vm, _SC("'set_action' called without instance"));
1755     return SQ_ERROR;
1756   }
1757   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1758   const SQChar* arg0;
1759   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1760     sq_throwerror(vm, _SC("Argument 1 not a string"));
1761     return SQ_ERROR;
1762   }
1763   
1764   try {
1765     _this->set_action(arg0);
1766   
1767     return 0;
1768   
1769   } catch(std::exception& e) {
1770     sq_throwerror(vm, e.what());
1771     return SQ_ERROR;
1772   } catch(...) {
1773     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
1774     return SQ_ERROR;
1775   }
1776   
1777 }
1778
1779 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
1780 {
1781   SQUserPointer data;
1782   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1783     sq_throwerror(vm, _SC("'get_action' called without instance"));
1784     return SQ_ERROR;
1785   }
1786   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1787   
1788   try {
1789     std::string return_value = _this->get_action();
1790   
1791     sq_pushstring(vm, return_value.c_str(), return_value.size());
1792     return 1;
1793   
1794   } catch(std::exception& e) {
1795     sq_throwerror(vm, e.what());
1796     return SQ_ERROR;
1797   } catch(...) {
1798     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
1799     return SQ_ERROR;
1800   }
1801   
1802 }
1803
1804 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
1805 {
1806   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (ptr);
1807   delete _this;
1808   return 0;
1809 }
1810
1811 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
1812 {
1813   SQUserPointer data;
1814   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1815     sq_throwerror(vm, _SC("'goto_node' called without instance"));
1816     return SQ_ERROR;
1817   }
1818   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1819   SQInteger arg0;
1820   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1821     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1822     return SQ_ERROR;
1823   }
1824   
1825   try {
1826     _this->goto_node(static_cast<int> (arg0));
1827   
1828     return 0;
1829   
1830   } catch(std::exception& e) {
1831     sq_throwerror(vm, e.what());
1832     return SQ_ERROR;
1833   } catch(...) {
1834     sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
1835     return SQ_ERROR;
1836   }
1837   
1838 }
1839
1840 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
1841 {
1842   SQUserPointer data;
1843   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1844     sq_throwerror(vm, _SC("'start_moving' called without instance"));
1845     return SQ_ERROR;
1846   }
1847   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1848   
1849   try {
1850     _this->start_moving();
1851   
1852     return 0;
1853   
1854   } catch(std::exception& e) {
1855     sq_throwerror(vm, e.what());
1856     return SQ_ERROR;
1857   } catch(...) {
1858     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
1859     return SQ_ERROR;
1860   }
1861   
1862 }
1863
1864 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
1865 {
1866   SQUserPointer data;
1867   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1868     sq_throwerror(vm, _SC("'stop_moving' called without instance"));
1869     return SQ_ERROR;
1870   }
1871   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1872   
1873   try {
1874     _this->stop_moving();
1875   
1876     return 0;
1877   
1878   } catch(std::exception& e) {
1879     sq_throwerror(vm, e.what());
1880     return SQ_ERROR;
1881   } catch(...) {
1882     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
1883     return SQ_ERROR;
1884   }
1885   
1886 }
1887
1888 static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger )
1889 {
1890   Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (ptr);
1891   delete _this;
1892   return 0;
1893 }
1894
1895 static SQInteger Candle_get_burning_wrapper(HSQUIRRELVM vm)
1896 {
1897   SQUserPointer data;
1898   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1899     sq_throwerror(vm, _SC("'get_burning' called without instance"));
1900     return SQ_ERROR;
1901   }
1902   Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
1903   
1904   try {
1905     bool return_value = _this->get_burning();
1906   
1907     sq_pushbool(vm, return_value);
1908     return 1;
1909   
1910   } catch(std::exception& e) {
1911     sq_throwerror(vm, e.what());
1912     return SQ_ERROR;
1913   } catch(...) {
1914     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_burning'"));
1915     return SQ_ERROR;
1916   }
1917   
1918 }
1919
1920 static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm)
1921 {
1922   SQUserPointer data;
1923   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1924     sq_throwerror(vm, _SC("'set_burning' called without instance"));
1925     return SQ_ERROR;
1926   }
1927   Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
1928   SQBool arg0;
1929   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1930     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1931     return SQ_ERROR;
1932   }
1933   
1934   try {
1935     _this->set_burning(arg0 == SQTrue);
1936   
1937     return 0;
1938   
1939   } catch(std::exception& e) {
1940     sq_throwerror(vm, e.what());
1941     return SQ_ERROR;
1942   } catch(...) {
1943     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_burning'"));
1944     return SQ_ERROR;
1945   }
1946   
1947 }
1948
1949 static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger )
1950 {
1951   Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (ptr);
1952   delete _this;
1953   return 0;
1954 }
1955
1956 static SQInteger Wind_start_wrapper(HSQUIRRELVM vm)
1957 {
1958   SQUserPointer data;
1959   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1960     sq_throwerror(vm, _SC("'start' called without instance"));
1961     return SQ_ERROR;
1962   }
1963   Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
1964   
1965   try {
1966     _this->start();
1967   
1968     return 0;
1969   
1970   } catch(std::exception& e) {
1971     sq_throwerror(vm, e.what());
1972     return SQ_ERROR;
1973   } catch(...) {
1974     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
1975     return SQ_ERROR;
1976   }
1977   
1978 }
1979
1980 static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm)
1981 {
1982   SQUserPointer data;
1983   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1984     sq_throwerror(vm, _SC("'stop' called without instance"));
1985     return SQ_ERROR;
1986   }
1987   Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
1988   
1989   try {
1990     _this->stop();
1991   
1992     return 0;
1993   
1994   } catch(std::exception& e) {
1995     sq_throwerror(vm, e.what());
1996     return SQ_ERROR;
1997   } catch(...) {
1998     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
1999     return SQ_ERROR;
2000   }
2001   
2002 }
2003
2004 static SQInteger display_wrapper(HSQUIRRELVM vm)
2005 {
2006   return Scripting::display(vm);
2007 }
2008
2009 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
2010 {
2011   HSQUIRRELVM arg0 = vm;
2012   
2013   try {
2014     Scripting::print_stacktrace(arg0);
2015   
2016     return 0;
2017   
2018   } catch(std::exception& e) {
2019     sq_throwerror(vm, e.what());
2020     return SQ_ERROR;
2021   } catch(...) {
2022     sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
2023     return SQ_ERROR;
2024   }
2025   
2026 }
2027
2028 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
2029 {
2030   return Scripting::get_current_thread(vm);
2031 }
2032
2033 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
2034 {
2035   const SQChar* arg0;
2036   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2037     sq_throwerror(vm, _SC("Argument 1 not a string"));
2038     return SQ_ERROR;
2039   }
2040   
2041   try {
2042     Scripting::display_text_file(arg0);
2043   
2044     return 0;
2045   
2046   } catch(std::exception& e) {
2047     sq_throwerror(vm, e.what());
2048     return SQ_ERROR;
2049   } catch(...) {
2050     sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
2051     return SQ_ERROR;
2052   }
2053   
2054 }
2055
2056 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
2057 {
2058   const SQChar* arg0;
2059   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2060     sq_throwerror(vm, _SC("Argument 1 not a string"));
2061     return SQ_ERROR;
2062   }
2063   
2064   try {
2065     Scripting::load_worldmap(arg0);
2066   
2067     return 0;
2068   
2069   } catch(std::exception& e) {
2070     sq_throwerror(vm, e.what());
2071     return SQ_ERROR;
2072   } catch(...) {
2073     sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
2074     return SQ_ERROR;
2075   }
2076   
2077 }
2078
2079 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
2080 {
2081   const SQChar* arg0;
2082   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2083     sq_throwerror(vm, _SC("Argument 1 not a string"));
2084     return SQ_ERROR;
2085   }
2086   
2087   try {
2088     Scripting::load_level(arg0);
2089   
2090     return 0;
2091   
2092   } catch(std::exception& e) {
2093     sq_throwerror(vm, e.what());
2094     return SQ_ERROR;
2095   } catch(...) {
2096     sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
2097     return SQ_ERROR;
2098   }
2099   
2100 }
2101
2102 static SQInteger wait_wrapper(HSQUIRRELVM vm)
2103 {
2104   HSQUIRRELVM arg0 = vm;
2105   SQFloat arg1;
2106   if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
2107     sq_throwerror(vm, _SC("Argument 1 not a float"));
2108     return SQ_ERROR;
2109   }
2110   
2111   try {
2112     Scripting::wait(arg0, static_cast<float> (arg1));
2113   
2114     return sq_suspendvm(vm);
2115   
2116   } catch(std::exception& e) {
2117     sq_throwerror(vm, e.what());
2118     return SQ_ERROR;
2119   } catch(...) {
2120     sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
2121     return SQ_ERROR;
2122   }
2123   
2124 }
2125
2126 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
2127 {
2128   HSQUIRRELVM arg0 = vm;
2129   
2130   try {
2131     Scripting::wait_for_screenswitch(arg0);
2132   
2133     return sq_suspendvm(vm);
2134   
2135   } catch(std::exception& e) {
2136     sq_throwerror(vm, e.what());
2137     return SQ_ERROR;
2138   } catch(...) {
2139     sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
2140     return SQ_ERROR;
2141   }
2142   
2143 }
2144
2145 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
2146 {
2147   (void) vm;
2148   
2149   try {
2150     Scripting::exit_screen();
2151   
2152     return 0;
2153   
2154   } catch(std::exception& e) {
2155     sq_throwerror(vm, e.what());
2156     return SQ_ERROR;
2157   } catch(...) {
2158     sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
2159     return SQ_ERROR;
2160   }
2161   
2162 }
2163
2164 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
2165 {
2166   SQFloat arg0;
2167   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2168     sq_throwerror(vm, _SC("Argument 1 not a float"));
2169     return SQ_ERROR;
2170   }
2171   
2172   try {
2173     Scripting::fadeout_screen(static_cast<float> (arg0));
2174   
2175     return 0;
2176   
2177   } catch(std::exception& e) {
2178     sq_throwerror(vm, e.what());
2179     return SQ_ERROR;
2180   } catch(...) {
2181     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
2182     return SQ_ERROR;
2183   }
2184   
2185 }
2186
2187 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
2188 {
2189   SQFloat arg0;
2190   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2191     sq_throwerror(vm, _SC("Argument 1 not a float"));
2192     return SQ_ERROR;
2193   }
2194   SQFloat arg1;
2195   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2196     sq_throwerror(vm, _SC("Argument 2 not a float"));
2197     return SQ_ERROR;
2198   }
2199   SQFloat arg2;
2200   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2201     sq_throwerror(vm, _SC("Argument 3 not a float"));
2202     return SQ_ERROR;
2203   }
2204   
2205   try {
2206     Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2207   
2208     return 0;
2209   
2210   } catch(std::exception& e) {
2211     sq_throwerror(vm, e.what());
2212     return SQ_ERROR;
2213   } catch(...) {
2214     sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
2215     return SQ_ERROR;
2216   }
2217   
2218 }
2219
2220 static SQInteger translate_wrapper(HSQUIRRELVM vm)
2221 {
2222   const SQChar* arg0;
2223   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2224     sq_throwerror(vm, _SC("Argument 1 not a string"));
2225     return SQ_ERROR;
2226   }
2227   
2228   try {
2229     std::string return_value = Scripting::translate(arg0);
2230   
2231     sq_pushstring(vm, return_value.c_str(), return_value.size());
2232     return 1;
2233   
2234   } catch(std::exception& e) {
2235     sq_throwerror(vm, e.what());
2236     return SQ_ERROR;
2237   } catch(...) {
2238     sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
2239     return SQ_ERROR;
2240   }
2241   
2242 }
2243
2244 static SQInteger import_wrapper(HSQUIRRELVM vm)
2245 {
2246   HSQUIRRELVM arg0 = vm;
2247   const SQChar* arg1;
2248   if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
2249     sq_throwerror(vm, _SC("Argument 1 not a string"));
2250     return SQ_ERROR;
2251   }
2252   
2253   try {
2254     Scripting::import(arg0, arg1);
2255   
2256     return 0;
2257   
2258   } catch(std::exception& e) {
2259     sq_throwerror(vm, e.what());
2260     return SQ_ERROR;
2261   } catch(...) {
2262     sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
2263     return SQ_ERROR;
2264   }
2265   
2266 }
2267
2268 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
2269 {
2270   (void) vm;
2271   
2272   try {
2273     Scripting::save_state();
2274   
2275     return 0;
2276   
2277   } catch(std::exception& e) {
2278     sq_throwerror(vm, e.what());
2279     return SQ_ERROR;
2280   } catch(...) {
2281     sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
2282     return SQ_ERROR;
2283   }
2284   
2285 }
2286
2287 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
2288 {
2289   SQBool arg0;
2290   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2291     sq_throwerror(vm, _SC("Argument 1 not a bool"));
2292     return SQ_ERROR;
2293   }
2294   
2295   try {
2296     Scripting::debug_collrects(arg0 == SQTrue);
2297   
2298     return 0;
2299   
2300   } catch(std::exception& e) {
2301     sq_throwerror(vm, e.what());
2302     return SQ_ERROR;
2303   } catch(...) {
2304     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
2305     return SQ_ERROR;
2306   }
2307   
2308 }
2309
2310 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
2311 {
2312   SQBool arg0;
2313   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2314     sq_throwerror(vm, _SC("Argument 1 not a bool"));
2315     return SQ_ERROR;
2316   }
2317   
2318   try {
2319     Scripting::debug_show_fps(arg0 == SQTrue);
2320   
2321     return 0;
2322   
2323   } catch(std::exception& e) {
2324     sq_throwerror(vm, e.what());
2325     return SQ_ERROR;
2326   } catch(...) {
2327     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
2328     return SQ_ERROR;
2329   }
2330   
2331 }
2332
2333 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
2334 {
2335   SQBool arg0;
2336   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2337     sq_throwerror(vm, _SC("Argument 1 not a bool"));
2338     return SQ_ERROR;
2339   }
2340   
2341   try {
2342     Scripting::debug_draw_solids_only(arg0 == SQTrue);
2343   
2344     return 0;
2345   
2346   } catch(std::exception& e) {
2347     sq_throwerror(vm, e.what());
2348     return SQ_ERROR;
2349   } catch(...) {
2350     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
2351     return SQ_ERROR;
2352   }
2353   
2354 }
2355
2356 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
2357 {
2358   const SQChar* arg0;
2359   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2360     sq_throwerror(vm, _SC("Argument 1 not a string"));
2361     return SQ_ERROR;
2362   }
2363   
2364   try {
2365     Scripting::play_music(arg0);
2366   
2367     return 0;
2368   
2369   } catch(std::exception& e) {
2370     sq_throwerror(vm, e.what());
2371     return SQ_ERROR;
2372   } catch(...) {
2373     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
2374     return SQ_ERROR;
2375   }
2376   
2377 }
2378
2379 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
2380 {
2381   const SQChar* arg0;
2382   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2383     sq_throwerror(vm, _SC("Argument 1 not a string"));
2384     return SQ_ERROR;
2385   }
2386   
2387   try {
2388     Scripting::play_sound(arg0);
2389   
2390     return 0;
2391   
2392   } catch(std::exception& e) {
2393     sq_throwerror(vm, e.what());
2394     return SQ_ERROR;
2395   } catch(...) {
2396     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
2397     return SQ_ERROR;
2398   }
2399   
2400 }
2401
2402 static SQInteger grease_wrapper(HSQUIRRELVM vm)
2403 {
2404   (void) vm;
2405   
2406   try {
2407     Scripting::grease();
2408   
2409     return 0;
2410   
2411   } catch(std::exception& e) {
2412     sq_throwerror(vm, e.what());
2413     return SQ_ERROR;
2414   } catch(...) {
2415     sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
2416     return SQ_ERROR;
2417   }
2418   
2419 }
2420
2421 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
2422 {
2423   (void) vm;
2424   
2425   try {
2426     Scripting::invincible();
2427   
2428     return 0;
2429   
2430   } catch(std::exception& e) {
2431     sq_throwerror(vm, e.what());
2432     return SQ_ERROR;
2433   } catch(...) {
2434     sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
2435     return SQ_ERROR;
2436   }
2437   
2438 }
2439
2440 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
2441 {
2442   (void) vm;
2443   
2444   try {
2445     Scripting::ghost();
2446   
2447     return 0;
2448   
2449   } catch(std::exception& e) {
2450     sq_throwerror(vm, e.what());
2451     return SQ_ERROR;
2452   } catch(...) {
2453     sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
2454     return SQ_ERROR;
2455   }
2456   
2457 }
2458
2459 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
2460 {
2461   (void) vm;
2462   
2463   try {
2464     Scripting::mortal();
2465   
2466     return 0;
2467   
2468   } catch(std::exception& e) {
2469     sq_throwerror(vm, e.what());
2470     return SQ_ERROR;
2471   } catch(...) {
2472     sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
2473     return SQ_ERROR;
2474   }
2475   
2476 }
2477
2478 static SQInteger restart_wrapper(HSQUIRRELVM vm)
2479 {
2480   (void) vm;
2481   
2482   try {
2483     Scripting::restart();
2484   
2485     return 0;
2486   
2487   } catch(std::exception& e) {
2488     sq_throwerror(vm, e.what());
2489     return SQ_ERROR;
2490   } catch(...) {
2491     sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
2492     return SQ_ERROR;
2493   }
2494   
2495 }
2496
2497 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
2498 {
2499   (void) vm;
2500   
2501   try {
2502     Scripting::whereami();
2503   
2504     return 0;
2505   
2506   } catch(std::exception& e) {
2507     sq_throwerror(vm, e.what());
2508     return SQ_ERROR;
2509   } catch(...) {
2510     sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
2511     return SQ_ERROR;
2512   }
2513   
2514 }
2515
2516 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
2517 {
2518   (void) vm;
2519   
2520   try {
2521     Scripting::gotoend();
2522   
2523     return 0;
2524   
2525   } catch(std::exception& e) {
2526     sq_throwerror(vm, e.what());
2527     return SQ_ERROR;
2528   } catch(...) {
2529     sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
2530     return SQ_ERROR;
2531   }
2532   
2533 }
2534
2535 static SQInteger camera_wrapper(HSQUIRRELVM vm)
2536 {
2537   (void) vm;
2538   
2539   try {
2540     Scripting::camera();
2541   
2542     return 0;
2543   
2544   } catch(std::exception& e) {
2545     sq_throwerror(vm, e.what());
2546     return SQ_ERROR;
2547   } catch(...) {
2548     sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
2549     return SQ_ERROR;
2550   }
2551   
2552 }
2553
2554 static SQInteger quit_wrapper(HSQUIRRELVM vm)
2555 {
2556   (void) vm;
2557   
2558   try {
2559     Scripting::quit();
2560   
2561     return 0;
2562   
2563   } catch(std::exception& e) {
2564     sq_throwerror(vm, e.what());
2565     return SQ_ERROR;
2566   } catch(...) {
2567     sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
2568     return SQ_ERROR;
2569   }
2570   
2571 }
2572
2573 static SQInteger rand_wrapper(HSQUIRRELVM vm)
2574 {
2575   
2576   try {
2577     int return_value = Scripting::rand();
2578   
2579     sq_pushinteger(vm, return_value);
2580     return 1;
2581   
2582   } catch(std::exception& e) {
2583     sq_throwerror(vm, e.what());
2584     return SQ_ERROR;
2585   } catch(...) {
2586     sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
2587     return SQ_ERROR;
2588   }
2589   
2590 }
2591
2592 } // end of namespace Wrapper
2593
2594 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
2595 {
2596   using namespace Wrapper;
2597
2598   sq_pushroottable(v);
2599   sq_pushstring(v, "DisplayEffect", -1);
2600   if(SQ_FAILED(sq_get(v, -2))) {
2601     std::ostringstream msg;
2602     msg << "Couldn't resolved squirrel type 'DisplayEffect'";
2603     throw SquirrelError(v, msg.str());
2604   }
2605
2606   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2607     std::ostringstream msg;
2608     msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
2609     throw SquirrelError(v, msg.str());
2610   }
2611   sq_remove(v, -2); // remove object name
2612
2613   if(setup_releasehook) {
2614     sq_setreleasehook(v, -1, DisplayEffect_release_hook);
2615   }
2616
2617   sq_remove(v, -2); // remove root table
2618 }
2619
2620 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
2621 {
2622   using namespace Wrapper;
2623
2624   sq_pushroottable(v);
2625   sq_pushstring(v, "Camera", -1);
2626   if(SQ_FAILED(sq_get(v, -2))) {
2627     std::ostringstream msg;
2628     msg << "Couldn't resolved squirrel type 'Camera'";
2629     throw SquirrelError(v, msg.str());
2630   }
2631
2632   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2633     std::ostringstream msg;
2634     msg << "Couldn't setup squirrel instance for object of type 'Camera'";
2635     throw SquirrelError(v, msg.str());
2636   }
2637   sq_remove(v, -2); // remove object name
2638
2639   if(setup_releasehook) {
2640     sq_setreleasehook(v, -1, Camera_release_hook);
2641   }
2642
2643   sq_remove(v, -2); // remove root table
2644 }
2645
2646 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
2647 {
2648   using namespace Wrapper;
2649
2650   sq_pushroottable(v);
2651   sq_pushstring(v, "Level", -1);
2652   if(SQ_FAILED(sq_get(v, -2))) {
2653     std::ostringstream msg;
2654     msg << "Couldn't resolved squirrel type 'Level'";
2655     throw SquirrelError(v, msg.str());
2656   }
2657
2658   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2659     std::ostringstream msg;
2660     msg << "Couldn't setup squirrel instance for object of type 'Level'";
2661     throw SquirrelError(v, msg.str());
2662   }
2663   sq_remove(v, -2); // remove object name
2664
2665   if(setup_releasehook) {
2666     sq_setreleasehook(v, -1, Level_release_hook);
2667   }
2668
2669   sq_remove(v, -2); // remove root table
2670 }
2671
2672 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
2673 {
2674   using namespace Wrapper;
2675
2676   sq_pushroottable(v);
2677   sq_pushstring(v, "ScriptedObject", -1);
2678   if(SQ_FAILED(sq_get(v, -2))) {
2679     std::ostringstream msg;
2680     msg << "Couldn't resolved squirrel type 'ScriptedObject'";
2681     throw SquirrelError(v, msg.str());
2682   }
2683
2684   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2685     std::ostringstream msg;
2686     msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
2687     throw SquirrelError(v, msg.str());
2688   }
2689   sq_remove(v, -2); // remove object name
2690
2691   if(setup_releasehook) {
2692     sq_setreleasehook(v, -1, ScriptedObject_release_hook);
2693   }
2694
2695   sq_remove(v, -2); // remove root table
2696 }
2697
2698 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
2699 {
2700   using namespace Wrapper;
2701
2702   sq_pushroottable(v);
2703   sq_pushstring(v, "Text", -1);
2704   if(SQ_FAILED(sq_get(v, -2))) {
2705     std::ostringstream msg;
2706     msg << "Couldn't resolved squirrel type 'Text'";
2707     throw SquirrelError(v, msg.str());
2708   }
2709
2710   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2711     std::ostringstream msg;
2712     msg << "Couldn't setup squirrel instance for object of type 'Text'";
2713     throw SquirrelError(v, msg.str());
2714   }
2715   sq_remove(v, -2); // remove object name
2716
2717   if(setup_releasehook) {
2718     sq_setreleasehook(v, -1, Text_release_hook);
2719   }
2720
2721   sq_remove(v, -2); // remove root table
2722 }
2723
2724 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
2725 {
2726   using namespace Wrapper;
2727
2728   sq_pushroottable(v);
2729   sq_pushstring(v, "Player", -1);
2730   if(SQ_FAILED(sq_get(v, -2))) {
2731     std::ostringstream msg;
2732     msg << "Couldn't resolved squirrel type 'Player'";
2733     throw SquirrelError(v, msg.str());
2734   }
2735
2736   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2737     std::ostringstream msg;
2738     msg << "Couldn't setup squirrel instance for object of type 'Player'";
2739     throw SquirrelError(v, msg.str());
2740   }
2741   sq_remove(v, -2); // remove object name
2742
2743   if(setup_releasehook) {
2744     sq_setreleasehook(v, -1, Player_release_hook);
2745   }
2746
2747   sq_remove(v, -2); // remove root table
2748 }
2749
2750 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
2751 {
2752   using namespace Wrapper;
2753
2754   sq_pushroottable(v);
2755   sq_pushstring(v, "FloatingImage", -1);
2756   if(SQ_FAILED(sq_get(v, -2))) {
2757     std::ostringstream msg;
2758     msg << "Couldn't resolved squirrel type 'FloatingImage'";
2759     throw SquirrelError(v, msg.str());
2760   }
2761
2762   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2763     std::ostringstream msg;
2764     msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
2765     throw SquirrelError(v, msg.str());
2766   }
2767   sq_remove(v, -2); // remove object name
2768
2769   if(setup_releasehook) {
2770     sq_setreleasehook(v, -1, FloatingImage_release_hook);
2771   }
2772
2773   sq_remove(v, -2); // remove root table
2774 }
2775
2776 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
2777 {
2778   using namespace Wrapper;
2779
2780   sq_pushroottable(v);
2781   sq_pushstring(v, "Platform", -1);
2782   if(SQ_FAILED(sq_get(v, -2))) {
2783     std::ostringstream msg;
2784     msg << "Couldn't resolved squirrel type 'Platform'";
2785     throw SquirrelError(v, msg.str());
2786   }
2787
2788   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2789     std::ostringstream msg;
2790     msg << "Couldn't setup squirrel instance for object of type 'Platform'";
2791     throw SquirrelError(v, msg.str());
2792   }
2793   sq_remove(v, -2); // remove object name
2794
2795   if(setup_releasehook) {
2796     sq_setreleasehook(v, -1, Platform_release_hook);
2797   }
2798
2799   sq_remove(v, -2); // remove root table
2800 }
2801
2802 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook)
2803 {
2804   using namespace Wrapper;
2805
2806   sq_pushroottable(v);
2807   sq_pushstring(v, "Candle", -1);
2808   if(SQ_FAILED(sq_get(v, -2))) {
2809     std::ostringstream msg;
2810     msg << "Couldn't resolved squirrel type 'Candle'";
2811     throw SquirrelError(v, msg.str());
2812   }
2813
2814   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2815     std::ostringstream msg;
2816     msg << "Couldn't setup squirrel instance for object of type 'Candle'";
2817     throw SquirrelError(v, msg.str());
2818   }
2819   sq_remove(v, -2); // remove object name
2820
2821   if(setup_releasehook) {
2822     sq_setreleasehook(v, -1, Candle_release_hook);
2823   }
2824
2825   sq_remove(v, -2); // remove root table
2826 }
2827
2828 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup_releasehook)
2829 {
2830   using namespace Wrapper;
2831
2832   sq_pushroottable(v);
2833   sq_pushstring(v, "Wind", -1);
2834   if(SQ_FAILED(sq_get(v, -2))) {
2835     std::ostringstream msg;
2836     msg << "Couldn't resolved squirrel type 'Wind'";
2837     throw SquirrelError(v, msg.str());
2838   }
2839
2840   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2841     std::ostringstream msg;
2842     msg << "Couldn't setup squirrel instance for object of type 'Wind'";
2843     throw SquirrelError(v, msg.str());
2844   }
2845   sq_remove(v, -2); // remove object name
2846
2847   if(setup_releasehook) {
2848     sq_setreleasehook(v, -1, Wind_release_hook);
2849   }
2850
2851   sq_remove(v, -2); // remove root table
2852 }
2853
2854 void register_supertux_wrapper(HSQUIRRELVM v)
2855 {
2856   using namespace Wrapper;
2857
2858   sq_pushstring(v, "ANCHOR_TOP", -1);
2859   sq_pushinteger(v, 16);
2860   if(SQ_FAILED(sq_createslot(v, -3))) {
2861     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
2862   }
2863
2864   sq_pushstring(v, "ANCHOR_BOTTOM", -1);
2865   sq_pushinteger(v, 32);
2866   if(SQ_FAILED(sq_createslot(v, -3))) {
2867     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
2868   }
2869
2870   sq_pushstring(v, "ANCHOR_LEFT", -1);
2871   sq_pushinteger(v, 1);
2872   if(SQ_FAILED(sq_createslot(v, -3))) {
2873     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
2874   }
2875
2876   sq_pushstring(v, "ANCHOR_RIGHT", -1);
2877   sq_pushinteger(v, 2);
2878   if(SQ_FAILED(sq_createslot(v, -3))) {
2879     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
2880   }
2881
2882   sq_pushstring(v, "ANCHOR_MIDDLE", -1);
2883   sq_pushinteger(v, 0);
2884   if(SQ_FAILED(sq_createslot(v, -3))) {
2885     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
2886   }
2887
2888   sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
2889   sq_pushinteger(v, 17);
2890   if(SQ_FAILED(sq_createslot(v, -3))) {
2891     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
2892   }
2893
2894   sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
2895   sq_pushinteger(v, 18);
2896   if(SQ_FAILED(sq_createslot(v, -3))) {
2897     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
2898   }
2899
2900   sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
2901   sq_pushinteger(v, 33);
2902   if(SQ_FAILED(sq_createslot(v, -3))) {
2903     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
2904   }
2905
2906   sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
2907   sq_pushinteger(v, 34);
2908   if(SQ_FAILED(sq_createslot(v, -3))) {
2909     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
2910   }
2911
2912   sq_pushstring(v, "display", -1);
2913   sq_newclosure(v, &display_wrapper, 0);
2914   if(SQ_FAILED(sq_createslot(v, -3))) {
2915     throw SquirrelError(v, "Couldn't register function 'display'");
2916   }
2917
2918   sq_pushstring(v, "print_stacktrace", -1);
2919   sq_newclosure(v, &print_stacktrace_wrapper, 0);
2920   if(SQ_FAILED(sq_createslot(v, -3))) {
2921     throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
2922   }
2923
2924   sq_pushstring(v, "get_current_thread", -1);
2925   sq_newclosure(v, &get_current_thread_wrapper, 0);
2926   if(SQ_FAILED(sq_createslot(v, -3))) {
2927     throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
2928   }
2929
2930   sq_pushstring(v, "display_text_file", -1);
2931   sq_newclosure(v, &display_text_file_wrapper, 0);
2932   if(SQ_FAILED(sq_createslot(v, -3))) {
2933     throw SquirrelError(v, "Couldn't register function 'display_text_file'");
2934   }
2935
2936   sq_pushstring(v, "load_worldmap", -1);
2937   sq_newclosure(v, &load_worldmap_wrapper, 0);
2938   if(SQ_FAILED(sq_createslot(v, -3))) {
2939     throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
2940   }
2941
2942   sq_pushstring(v, "load_level", -1);
2943   sq_newclosure(v, &load_level_wrapper, 0);
2944   if(SQ_FAILED(sq_createslot(v, -3))) {
2945     throw SquirrelError(v, "Couldn't register function 'load_level'");
2946   }
2947
2948   sq_pushstring(v, "wait", -1);
2949   sq_newclosure(v, &wait_wrapper, 0);
2950   if(SQ_FAILED(sq_createslot(v, -3))) {
2951     throw SquirrelError(v, "Couldn't register function 'wait'");
2952   }
2953
2954   sq_pushstring(v, "wait_for_screenswitch", -1);
2955   sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
2956   if(SQ_FAILED(sq_createslot(v, -3))) {
2957     throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
2958   }
2959
2960   sq_pushstring(v, "exit_screen", -1);
2961   sq_newclosure(v, &exit_screen_wrapper, 0);
2962   if(SQ_FAILED(sq_createslot(v, -3))) {
2963     throw SquirrelError(v, "Couldn't register function 'exit_screen'");
2964   }
2965
2966   sq_pushstring(v, "fadeout_screen", -1);
2967   sq_newclosure(v, &fadeout_screen_wrapper, 0);
2968   if(SQ_FAILED(sq_createslot(v, -3))) {
2969     throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
2970   }
2971
2972   sq_pushstring(v, "shrink_screen", -1);
2973   sq_newclosure(v, &shrink_screen_wrapper, 0);
2974   if(SQ_FAILED(sq_createslot(v, -3))) {
2975     throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
2976   }
2977
2978   sq_pushstring(v, "translate", -1);
2979   sq_newclosure(v, &translate_wrapper, 0);
2980   if(SQ_FAILED(sq_createslot(v, -3))) {
2981     throw SquirrelError(v, "Couldn't register function 'translate'");
2982   }
2983
2984   sq_pushstring(v, "import", -1);
2985   sq_newclosure(v, &import_wrapper, 0);
2986   if(SQ_FAILED(sq_createslot(v, -3))) {
2987     throw SquirrelError(v, "Couldn't register function 'import'");
2988   }
2989
2990   sq_pushstring(v, "save_state", -1);
2991   sq_newclosure(v, &save_state_wrapper, 0);
2992   if(SQ_FAILED(sq_createslot(v, -3))) {
2993     throw SquirrelError(v, "Couldn't register function 'save_state'");
2994   }
2995
2996   sq_pushstring(v, "debug_collrects", -1);
2997   sq_newclosure(v, &debug_collrects_wrapper, 0);
2998   if(SQ_FAILED(sq_createslot(v, -3))) {
2999     throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
3000   }
3001
3002   sq_pushstring(v, "debug_show_fps", -1);
3003   sq_newclosure(v, &debug_show_fps_wrapper, 0);
3004   if(SQ_FAILED(sq_createslot(v, -3))) {
3005     throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
3006   }
3007
3008   sq_pushstring(v, "debug_draw_solids_only", -1);
3009   sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
3010   if(SQ_FAILED(sq_createslot(v, -3))) {
3011     throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
3012   }
3013
3014   sq_pushstring(v, "play_music", -1);
3015   sq_newclosure(v, &play_music_wrapper, 0);
3016   if(SQ_FAILED(sq_createslot(v, -3))) {
3017     throw SquirrelError(v, "Couldn't register function 'play_music'");
3018   }
3019
3020   sq_pushstring(v, "play_sound", -1);
3021   sq_newclosure(v, &play_sound_wrapper, 0);
3022   if(SQ_FAILED(sq_createslot(v, -3))) {
3023     throw SquirrelError(v, "Couldn't register function 'play_sound'");
3024   }
3025
3026   sq_pushstring(v, "grease", -1);
3027   sq_newclosure(v, &grease_wrapper, 0);
3028   if(SQ_FAILED(sq_createslot(v, -3))) {
3029     throw SquirrelError(v, "Couldn't register function 'grease'");
3030   }
3031
3032   sq_pushstring(v, "invincible", -1);
3033   sq_newclosure(v, &invincible_wrapper, 0);
3034   if(SQ_FAILED(sq_createslot(v, -3))) {
3035     throw SquirrelError(v, "Couldn't register function 'invincible'");
3036   }
3037
3038   sq_pushstring(v, "ghost", -1);
3039   sq_newclosure(v, &ghost_wrapper, 0);
3040   if(SQ_FAILED(sq_createslot(v, -3))) {
3041     throw SquirrelError(v, "Couldn't register function 'ghost'");
3042   }
3043
3044   sq_pushstring(v, "mortal", -1);
3045   sq_newclosure(v, &mortal_wrapper, 0);
3046   if(SQ_FAILED(sq_createslot(v, -3))) {
3047     throw SquirrelError(v, "Couldn't register function 'mortal'");
3048   }
3049
3050   sq_pushstring(v, "restart", -1);
3051   sq_newclosure(v, &restart_wrapper, 0);
3052   if(SQ_FAILED(sq_createslot(v, -3))) {
3053     throw SquirrelError(v, "Couldn't register function 'restart'");
3054   }
3055
3056   sq_pushstring(v, "whereami", -1);
3057   sq_newclosure(v, &whereami_wrapper, 0);
3058   if(SQ_FAILED(sq_createslot(v, -3))) {
3059     throw SquirrelError(v, "Couldn't register function 'whereami'");
3060   }
3061
3062   sq_pushstring(v, "gotoend", -1);
3063   sq_newclosure(v, &gotoend_wrapper, 0);
3064   if(SQ_FAILED(sq_createslot(v, -3))) {
3065     throw SquirrelError(v, "Couldn't register function 'gotoend'");
3066   }
3067
3068   sq_pushstring(v, "camera", -1);
3069   sq_newclosure(v, &camera_wrapper, 0);
3070   if(SQ_FAILED(sq_createslot(v, -3))) {
3071     throw SquirrelError(v, "Couldn't register function 'camera'");
3072   }
3073
3074   sq_pushstring(v, "quit", -1);
3075   sq_newclosure(v, &quit_wrapper, 0);
3076   if(SQ_FAILED(sq_createslot(v, -3))) {
3077     throw SquirrelError(v, "Couldn't register function 'quit'");
3078   }
3079
3080   sq_pushstring(v, "rand", -1);
3081   sq_newclosure(v, &rand_wrapper, 0);
3082   if(SQ_FAILED(sq_createslot(v, -3))) {
3083     throw SquirrelError(v, "Couldn't register function 'rand'");
3084   }
3085
3086   // Register class DisplayEffect
3087   sq_pushstring(v, "DisplayEffect", -1);
3088   if(sq_newclass(v, SQFalse) < 0) {
3089     std::ostringstream msg;
3090     msg << "Couldn't create new class 'DisplayEffect'";
3091     throw SquirrelError(v, msg.str());
3092   }
3093   sq_pushstring(v, "fade_out", -1);
3094   sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
3095   if(SQ_FAILED(sq_createslot(v, -3))) {
3096     throw SquirrelError(v, "Couldn't register function 'fade_out'");
3097   }
3098
3099   sq_pushstring(v, "fade_in", -1);
3100   sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
3101   if(SQ_FAILED(sq_createslot(v, -3))) {
3102     throw SquirrelError(v, "Couldn't register function 'fade_in'");
3103   }
3104
3105   sq_pushstring(v, "set_black", -1);
3106   sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
3107   if(SQ_FAILED(sq_createslot(v, -3))) {
3108     throw SquirrelError(v, "Couldn't register function 'set_black'");
3109   }
3110
3111   sq_pushstring(v, "is_black", -1);
3112   sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
3113   if(SQ_FAILED(sq_createslot(v, -3))) {
3114     throw SquirrelError(v, "Couldn't register function 'is_black'");
3115   }
3116
3117   sq_pushstring(v, "sixteen_to_nine", -1);
3118   sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
3119   if(SQ_FAILED(sq_createslot(v, -3))) {
3120     throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
3121   }
3122
3123   sq_pushstring(v, "four_to_three", -1);
3124   sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
3125   if(SQ_FAILED(sq_createslot(v, -3))) {
3126     throw SquirrelError(v, "Couldn't register function 'four_to_three'");
3127   }
3128
3129   if(SQ_FAILED(sq_createslot(v, -3))) {
3130     throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
3131   }
3132
3133   // Register class Camera
3134   sq_pushstring(v, "Camera", -1);
3135   if(sq_newclass(v, SQFalse) < 0) {
3136     std::ostringstream msg;
3137     msg << "Couldn't create new class 'Camera'";
3138     throw SquirrelError(v, msg.str());
3139   }
3140   sq_pushstring(v, "shake", -1);
3141   sq_newclosure(v, &Camera_shake_wrapper, 0);
3142   if(SQ_FAILED(sq_createslot(v, -3))) {
3143     throw SquirrelError(v, "Couldn't register function 'shake'");
3144   }
3145
3146   sq_pushstring(v, "set_pos", -1);
3147   sq_newclosure(v, &Camera_set_pos_wrapper, 0);
3148   if(SQ_FAILED(sq_createslot(v, -3))) {
3149     throw SquirrelError(v, "Couldn't register function 'set_pos'");
3150   }
3151
3152   sq_pushstring(v, "set_mode", -1);
3153   sq_newclosure(v, &Camera_set_mode_wrapper, 0);
3154   if(SQ_FAILED(sq_createslot(v, -3))) {
3155     throw SquirrelError(v, "Couldn't register function 'set_mode'");
3156   }
3157
3158   sq_pushstring(v, "scroll_to", -1);
3159   sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
3160   if(SQ_FAILED(sq_createslot(v, -3))) {
3161     throw SquirrelError(v, "Couldn't register function 'scroll_to'");
3162   }
3163
3164   if(SQ_FAILED(sq_createslot(v, -3))) {
3165     throw SquirrelError(v, "Couldn't register class 'Camera'");
3166   }
3167
3168   // Register class Level
3169   sq_pushstring(v, "Level", -1);
3170   if(sq_newclass(v, SQFalse) < 0) {
3171     std::ostringstream msg;
3172     msg << "Couldn't create new class 'Level'";
3173     throw SquirrelError(v, msg.str());
3174   }
3175   sq_pushstring(v, "finish", -1);
3176   sq_newclosure(v, &Level_finish_wrapper, 0);
3177   if(SQ_FAILED(sq_createslot(v, -3))) {
3178     throw SquirrelError(v, "Couldn't register function 'finish'");
3179   }
3180
3181   sq_pushstring(v, "spawn", -1);
3182   sq_newclosure(v, &Level_spawn_wrapper, 0);
3183   if(SQ_FAILED(sq_createslot(v, -3))) {
3184     throw SquirrelError(v, "Couldn't register function 'spawn'");
3185   }
3186
3187   sq_pushstring(v, "flip_vertically", -1);
3188   sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
3189   if(SQ_FAILED(sq_createslot(v, -3))) {
3190     throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
3191   }
3192
3193   sq_pushstring(v, "toggle_pause", -1);
3194   sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
3195   if(SQ_FAILED(sq_createslot(v, -3))) {
3196     throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
3197   }
3198
3199   if(SQ_FAILED(sq_createslot(v, -3))) {
3200     throw SquirrelError(v, "Couldn't register class 'Level'");
3201   }
3202
3203   // Register class ScriptedObject
3204   sq_pushstring(v, "ScriptedObject", -1);
3205   if(sq_newclass(v, SQFalse) < 0) {
3206     std::ostringstream msg;
3207     msg << "Couldn't create new class 'ScriptedObject'";
3208     throw SquirrelError(v, msg.str());
3209   }
3210   sq_pushstring(v, "set_action", -1);
3211   sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
3212   if(SQ_FAILED(sq_createslot(v, -3))) {
3213     throw SquirrelError(v, "Couldn't register function 'set_action'");
3214   }
3215
3216   sq_pushstring(v, "get_action", -1);
3217   sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
3218   if(SQ_FAILED(sq_createslot(v, -3))) {
3219     throw SquirrelError(v, "Couldn't register function 'get_action'");
3220   }
3221
3222   sq_pushstring(v, "move", -1);
3223   sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
3224   if(SQ_FAILED(sq_createslot(v, -3))) {
3225     throw SquirrelError(v, "Couldn't register function 'move'");
3226   }
3227
3228   sq_pushstring(v, "set_pos", -1);
3229   sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
3230   if(SQ_FAILED(sq_createslot(v, -3))) {
3231     throw SquirrelError(v, "Couldn't register function 'set_pos'");
3232   }
3233
3234   sq_pushstring(v, "get_pos_x", -1);
3235   sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
3236   if(SQ_FAILED(sq_createslot(v, -3))) {
3237     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3238   }
3239
3240   sq_pushstring(v, "get_pos_y", -1);
3241   sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
3242   if(SQ_FAILED(sq_createslot(v, -3))) {
3243     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3244   }
3245
3246   sq_pushstring(v, "set_velocity", -1);
3247   sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
3248   if(SQ_FAILED(sq_createslot(v, -3))) {
3249     throw SquirrelError(v, "Couldn't register function 'set_velocity'");
3250   }
3251
3252   sq_pushstring(v, "get_velocity_x", -1);
3253   sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
3254   if(SQ_FAILED(sq_createslot(v, -3))) {
3255     throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
3256   }
3257
3258   sq_pushstring(v, "get_velocity_y", -1);
3259   sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
3260   if(SQ_FAILED(sq_createslot(v, -3))) {
3261     throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
3262   }
3263
3264   sq_pushstring(v, "set_visible", -1);
3265   sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
3266   if(SQ_FAILED(sq_createslot(v, -3))) {
3267     throw SquirrelError(v, "Couldn't register function 'set_visible'");
3268   }
3269
3270   sq_pushstring(v, "is_visible", -1);
3271   sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
3272   if(SQ_FAILED(sq_createslot(v, -3))) {
3273     throw SquirrelError(v, "Couldn't register function 'is_visible'");
3274   }
3275
3276   sq_pushstring(v, "set_solid", -1);
3277   sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
3278   if(SQ_FAILED(sq_createslot(v, -3))) {
3279     throw SquirrelError(v, "Couldn't register function 'set_solid'");
3280   }
3281
3282   sq_pushstring(v, "is_solid", -1);
3283   sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
3284   if(SQ_FAILED(sq_createslot(v, -3))) {
3285     throw SquirrelError(v, "Couldn't register function 'is_solid'");
3286   }
3287
3288   sq_pushstring(v, "get_name", -1);
3289   sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
3290   if(SQ_FAILED(sq_createslot(v, -3))) {
3291     throw SquirrelError(v, "Couldn't register function 'get_name'");
3292   }
3293
3294   if(SQ_FAILED(sq_createslot(v, -3))) {
3295     throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
3296   }
3297
3298   // Register class Text
3299   sq_pushstring(v, "Text", -1);
3300   if(sq_newclass(v, SQFalse) < 0) {
3301     std::ostringstream msg;
3302     msg << "Couldn't create new class 'Text'";
3303     throw SquirrelError(v, msg.str());
3304   }
3305   sq_pushstring(v, "set_text", -1);
3306   sq_newclosure(v, &Text_set_text_wrapper, 0);
3307   if(SQ_FAILED(sq_createslot(v, -3))) {
3308     throw SquirrelError(v, "Couldn't register function 'set_text'");
3309   }
3310
3311   sq_pushstring(v, "set_font", -1);
3312   sq_newclosure(v, &Text_set_font_wrapper, 0);
3313   if(SQ_FAILED(sq_createslot(v, -3))) {
3314     throw SquirrelError(v, "Couldn't register function 'set_font'");
3315   }
3316
3317   sq_pushstring(v, "fade_in", -1);
3318   sq_newclosure(v, &Text_fade_in_wrapper, 0);
3319   if(SQ_FAILED(sq_createslot(v, -3))) {
3320     throw SquirrelError(v, "Couldn't register function 'fade_in'");
3321   }
3322
3323   sq_pushstring(v, "fade_out", -1);
3324   sq_newclosure(v, &Text_fade_out_wrapper, 0);
3325   if(SQ_FAILED(sq_createslot(v, -3))) {
3326     throw SquirrelError(v, "Couldn't register function 'fade_out'");
3327   }
3328
3329   sq_pushstring(v, "set_visible", -1);
3330   sq_newclosure(v, &Text_set_visible_wrapper, 0);
3331   if(SQ_FAILED(sq_createslot(v, -3))) {
3332     throw SquirrelError(v, "Couldn't register function 'set_visible'");
3333   }
3334
3335   sq_pushstring(v, "set_centered", -1);
3336   sq_newclosure(v, &Text_set_centered_wrapper, 0);
3337   if(SQ_FAILED(sq_createslot(v, -3))) {
3338     throw SquirrelError(v, "Couldn't register function 'set_centered'");
3339   }
3340
3341   if(SQ_FAILED(sq_createslot(v, -3))) {
3342     throw SquirrelError(v, "Couldn't register class 'Text'");
3343   }
3344
3345   // Register class Player
3346   sq_pushstring(v, "Player", -1);
3347   if(sq_newclass(v, SQFalse) < 0) {
3348     std::ostringstream msg;
3349     msg << "Couldn't create new class 'Player'";
3350     throw SquirrelError(v, msg.str());
3351   }
3352   sq_pushstring(v, "add_bonus", -1);
3353   sq_newclosure(v, &Player_add_bonus_wrapper, 0);
3354   if(SQ_FAILED(sq_createslot(v, -3))) {
3355     throw SquirrelError(v, "Couldn't register function 'add_bonus'");
3356   }
3357
3358   sq_pushstring(v, "add_coins", -1);
3359   sq_newclosure(v, &Player_add_coins_wrapper, 0);
3360   if(SQ_FAILED(sq_createslot(v, -3))) {
3361     throw SquirrelError(v, "Couldn't register function 'add_coins'");
3362   }
3363
3364   sq_pushstring(v, "make_invincible", -1);
3365   sq_newclosure(v, &Player_make_invincible_wrapper, 0);
3366   if(SQ_FAILED(sq_createslot(v, -3))) {
3367     throw SquirrelError(v, "Couldn't register function 'make_invincible'");
3368   }
3369
3370   sq_pushstring(v, "deactivate", -1);
3371   sq_newclosure(v, &Player_deactivate_wrapper, 0);
3372   if(SQ_FAILED(sq_createslot(v, -3))) {
3373     throw SquirrelError(v, "Couldn't register function 'deactivate'");
3374   }
3375
3376   sq_pushstring(v, "activate", -1);
3377   sq_newclosure(v, &Player_activate_wrapper, 0);
3378   if(SQ_FAILED(sq_createslot(v, -3))) {
3379     throw SquirrelError(v, "Couldn't register function 'activate'");
3380   }
3381
3382   sq_pushstring(v, "walk", -1);
3383   sq_newclosure(v, &Player_walk_wrapper, 0);
3384   if(SQ_FAILED(sq_createslot(v, -3))) {
3385     throw SquirrelError(v, "Couldn't register function 'walk'");
3386   }
3387
3388   sq_pushstring(v, "set_visible", -1);
3389   sq_newclosure(v, &Player_set_visible_wrapper, 0);
3390   if(SQ_FAILED(sq_createslot(v, -3))) {
3391     throw SquirrelError(v, "Couldn't register function 'set_visible'");
3392   }
3393
3394   sq_pushstring(v, "get_visible", -1);
3395   sq_newclosure(v, &Player_get_visible_wrapper, 0);
3396   if(SQ_FAILED(sq_createslot(v, -3))) {
3397     throw SquirrelError(v, "Couldn't register function 'get_visible'");
3398   }
3399
3400   sq_pushstring(v, "kill", -1);
3401   sq_newclosure(v, &Player_kill_wrapper, 0);
3402   if(SQ_FAILED(sq_createslot(v, -3))) {
3403     throw SquirrelError(v, "Couldn't register function 'kill'");
3404   }
3405
3406   sq_pushstring(v, "set_ghost_mode", -1);
3407   sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
3408   if(SQ_FAILED(sq_createslot(v, -3))) {
3409     throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
3410   }
3411
3412   sq_pushstring(v, "get_ghost_mode", -1);
3413   sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
3414   if(SQ_FAILED(sq_createslot(v, -3))) {
3415     throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
3416   }
3417
3418   sq_pushstring(v, "do_cheer", -1);
3419   sq_newclosure(v, &Player_do_cheer_wrapper, 0);
3420   if(SQ_FAILED(sq_createslot(v, -3))) {
3421     throw SquirrelError(v, "Couldn't register function 'do_cheer'");
3422   }
3423
3424   sq_pushstring(v, "do_duck", -1);
3425   sq_newclosure(v, &Player_do_duck_wrapper, 0);
3426   if(SQ_FAILED(sq_createslot(v, -3))) {
3427     throw SquirrelError(v, "Couldn't register function 'do_duck'");
3428   }
3429
3430   sq_pushstring(v, "do_standup", -1);
3431   sq_newclosure(v, &Player_do_standup_wrapper, 0);
3432   if(SQ_FAILED(sq_createslot(v, -3))) {
3433     throw SquirrelError(v, "Couldn't register function 'do_standup'");
3434   }
3435
3436   sq_pushstring(v, "do_backflip", -1);
3437   sq_newclosure(v, &Player_do_backflip_wrapper, 0);
3438   if(SQ_FAILED(sq_createslot(v, -3))) {
3439     throw SquirrelError(v, "Couldn't register function 'do_backflip'");
3440   }
3441
3442   sq_pushstring(v, "do_jump", -1);
3443   sq_newclosure(v, &Player_do_jump_wrapper, 0);
3444   if(SQ_FAILED(sq_createslot(v, -3))) {
3445     throw SquirrelError(v, "Couldn't register function 'do_jump'");
3446   }
3447
3448   if(SQ_FAILED(sq_createslot(v, -3))) {
3449     throw SquirrelError(v, "Couldn't register class 'Player'");
3450   }
3451
3452   // Register class FloatingImage
3453   sq_pushstring(v, "FloatingImage", -1);
3454   if(sq_newclass(v, SQFalse) < 0) {
3455     std::ostringstream msg;
3456     msg << "Couldn't create new class 'FloatingImage'";
3457     throw SquirrelError(v, msg.str());
3458   }
3459   sq_pushstring(v, "constructor", -1);
3460   sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
3461   if(SQ_FAILED(sq_createslot(v, -3))) {
3462     throw SquirrelError(v, "Couldn't register function 'constructor'");
3463   }
3464
3465   sq_pushstring(v, "set_layer", -1);
3466   sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
3467   if(SQ_FAILED(sq_createslot(v, -3))) {
3468     throw SquirrelError(v, "Couldn't register function 'set_layer'");
3469   }
3470
3471   sq_pushstring(v, "get_layer", -1);
3472   sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
3473   if(SQ_FAILED(sq_createslot(v, -3))) {
3474     throw SquirrelError(v, "Couldn't register function 'get_layer'");
3475   }
3476
3477   sq_pushstring(v, "set_pos", -1);
3478   sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
3479   if(SQ_FAILED(sq_createslot(v, -3))) {
3480     throw SquirrelError(v, "Couldn't register function 'set_pos'");
3481   }
3482
3483   sq_pushstring(v, "get_pos_x", -1);
3484   sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
3485   if(SQ_FAILED(sq_createslot(v, -3))) {
3486     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3487   }
3488
3489   sq_pushstring(v, "get_pos_y", -1);
3490   sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
3491   if(SQ_FAILED(sq_createslot(v, -3))) {
3492     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3493   }
3494
3495   sq_pushstring(v, "set_anchor_point", -1);
3496   sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
3497   if(SQ_FAILED(sq_createslot(v, -3))) {
3498     throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
3499   }
3500
3501   sq_pushstring(v, "get_anchor_point", -1);
3502   sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
3503   if(SQ_FAILED(sq_createslot(v, -3))) {
3504     throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
3505   }
3506
3507   sq_pushstring(v, "set_visible", -1);
3508   sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
3509   if(SQ_FAILED(sq_createslot(v, -3))) {
3510     throw SquirrelError(v, "Couldn't register function 'set_visible'");
3511   }
3512
3513   sq_pushstring(v, "get_visible", -1);
3514   sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
3515   if(SQ_FAILED(sq_createslot(v, -3))) {
3516     throw SquirrelError(v, "Couldn't register function 'get_visible'");
3517   }
3518
3519   sq_pushstring(v, "set_action", -1);
3520   sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
3521   if(SQ_FAILED(sq_createslot(v, -3))) {
3522     throw SquirrelError(v, "Couldn't register function 'set_action'");
3523   }
3524
3525   sq_pushstring(v, "get_action", -1);
3526   sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
3527   if(SQ_FAILED(sq_createslot(v, -3))) {
3528     throw SquirrelError(v, "Couldn't register function 'get_action'");
3529   }
3530
3531   if(SQ_FAILED(sq_createslot(v, -3))) {
3532     throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
3533   }
3534
3535   // Register class Platform
3536   sq_pushstring(v, "Platform", -1);
3537   if(sq_newclass(v, SQFalse) < 0) {
3538     std::ostringstream msg;
3539     msg << "Couldn't create new class 'Platform'";
3540     throw SquirrelError(v, msg.str());
3541   }
3542   sq_pushstring(v, "goto_node", -1);
3543   sq_newclosure(v, &Platform_goto_node_wrapper, 0);
3544   if(SQ_FAILED(sq_createslot(v, -3))) {
3545     throw SquirrelError(v, "Couldn't register function 'goto_node'");
3546   }
3547
3548   sq_pushstring(v, "start_moving", -1);
3549   sq_newclosure(v, &Platform_start_moving_wrapper, 0);
3550   if(SQ_FAILED(sq_createslot(v, -3))) {
3551     throw SquirrelError(v, "Couldn't register function 'start_moving'");
3552   }
3553
3554   sq_pushstring(v, "stop_moving", -1);
3555   sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
3556   if(SQ_FAILED(sq_createslot(v, -3))) {
3557     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
3558   }
3559
3560   if(SQ_FAILED(sq_createslot(v, -3))) {
3561     throw SquirrelError(v, "Couldn't register class 'Platform'");
3562   }
3563
3564   // Register class Candle
3565   sq_pushstring(v, "Candle", -1);
3566   if(sq_newclass(v, SQFalse) < 0) {
3567     std::ostringstream msg;
3568     msg << "Couldn't create new class 'Candle'";
3569     throw SquirrelError(v, msg.str());
3570   }
3571   sq_pushstring(v, "get_burning", -1);
3572   sq_newclosure(v, &Candle_get_burning_wrapper, 0);
3573   if(SQ_FAILED(sq_createslot(v, -3))) {
3574     throw SquirrelError(v, "Couldn't register function 'get_burning'");
3575   }
3576
3577   sq_pushstring(v, "set_burning", -1);
3578   sq_newclosure(v, &Candle_set_burning_wrapper, 0);
3579   if(SQ_FAILED(sq_createslot(v, -3))) {
3580     throw SquirrelError(v, "Couldn't register function 'set_burning'");
3581   }
3582
3583   if(SQ_FAILED(sq_createslot(v, -3))) {
3584     throw SquirrelError(v, "Couldn't register class 'Candle'");
3585   }
3586
3587   // Register class Wind
3588   sq_pushstring(v, "Wind", -1);
3589   if(sq_newclass(v, SQFalse) < 0) {
3590     std::ostringstream msg;
3591     msg << "Couldn't create new class 'Wind'";
3592     throw SquirrelError(v, msg.str());
3593   }
3594   sq_pushstring(v, "start", -1);
3595   sq_newclosure(v, &Wind_start_wrapper, 0);
3596   if(SQ_FAILED(sq_createslot(v, -3))) {
3597     throw SquirrelError(v, "Couldn't register function 'start'");
3598   }
3599
3600   sq_pushstring(v, "stop", -1);
3601   sq_newclosure(v, &Wind_stop_wrapper, 0);
3602   if(SQ_FAILED(sq_createslot(v, -3))) {
3603     throw SquirrelError(v, "Couldn't register function 'stop'");
3604   }
3605
3606   if(SQ_FAILED(sq_createslot(v, -3))) {
3607     throw SquirrelError(v, "Couldn't register class 'Wind'");
3608   }
3609
3610 }
3611
3612 } // end of namespace Scripting
3613