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