d0683cda98b6fac0ad6d3a26d7be050aa1350723
[supertux.git] / src / scripting / wrapper.cpp
1 /**
2  * WARNING: This file is automatically generated from:
3  *  'src/scripting/wrapper.interface.hpp'
4  * DO NOT CHANGE
5  */
6 #include <config.h>
7
8 #include <new>
9 #include <assert.h>
10 #include <string>
11 #include <sstream>
12 #include <squirrel.h>
13 #include "squirrel_error.hpp"
14 #include "wrapper.interface.hpp"
15
16 namespace Scripting
17 {
18 namespace Wrapper
19 {
20
21 static SQInteger DisplayEffect_release_hook(SQUserPointer ptr, SQInteger )
22 {
23   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (ptr);
24   delete _this;
25   return 0;
26 }
27
28 static SQInteger DisplayEffect_fade_out_wrapper(HSQUIRRELVM vm)
29 {
30   SQUserPointer data;
31   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
32     sq_throwerror(vm, _SC("'fade_out' called without instance"));
33     return SQ_ERROR;
34   }
35   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
36   SQFloat arg0;
37   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
38     sq_throwerror(vm, _SC("Argument 1 not a float"));
39     return SQ_ERROR;
40   }
41
42   try {
43     _this->fade_out(static_cast<float> (arg0));
44
45     return 0;
46
47   } catch(std::exception& e) {
48     sq_throwerror(vm, e.what());
49     return SQ_ERROR;
50   } catch(...) {
51     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
52     return SQ_ERROR;
53   }
54
55 }
56
57 static SQInteger DisplayEffect_fade_in_wrapper(HSQUIRRELVM vm)
58 {
59   SQUserPointer data;
60   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
61     sq_throwerror(vm, _SC("'fade_in' called without instance"));
62     return SQ_ERROR;
63   }
64   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
65   SQFloat arg0;
66   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
67     sq_throwerror(vm, _SC("Argument 1 not a float"));
68     return SQ_ERROR;
69   }
70
71   try {
72     _this->fade_in(static_cast<float> (arg0));
73
74     return 0;
75
76   } catch(std::exception& e) {
77     sq_throwerror(vm, e.what());
78     return SQ_ERROR;
79   } catch(...) {
80     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
81     return SQ_ERROR;
82   }
83
84 }
85
86 static SQInteger DisplayEffect_set_black_wrapper(HSQUIRRELVM vm)
87 {
88   SQUserPointer data;
89   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
90     sq_throwerror(vm, _SC("'set_black' called without instance"));
91     return SQ_ERROR;
92   }
93   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
94   SQBool arg0;
95   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
96     sq_throwerror(vm, _SC("Argument 1 not a bool"));
97     return SQ_ERROR;
98   }
99
100   try {
101     _this->set_black(arg0 == SQTrue);
102
103     return 0;
104
105   } catch(std::exception& e) {
106     sq_throwerror(vm, e.what());
107     return SQ_ERROR;
108   } catch(...) {
109     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_black'"));
110     return SQ_ERROR;
111   }
112
113 }
114
115 static SQInteger DisplayEffect_is_black_wrapper(HSQUIRRELVM vm)
116 {
117   SQUserPointer data;
118   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
119     sq_throwerror(vm, _SC("'is_black' called without instance"));
120     return SQ_ERROR;
121   }
122   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
123
124   try {
125     bool return_value = _this->is_black();
126
127     sq_pushbool(vm, return_value);
128     return 1;
129
130   } catch(std::exception& e) {
131     sq_throwerror(vm, e.what());
132     return SQ_ERROR;
133   } catch(...) {
134     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_black'"));
135     return SQ_ERROR;
136   }
137
138 }
139
140 static SQInteger DisplayEffect_sixteen_to_nine_wrapper(HSQUIRRELVM vm)
141 {
142   SQUserPointer data;
143   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
144     sq_throwerror(vm, _SC("'sixteen_to_nine' called without instance"));
145     return SQ_ERROR;
146   }
147   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
148   SQFloat arg0;
149   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
150     sq_throwerror(vm, _SC("Argument 1 not a float"));
151     return SQ_ERROR;
152   }
153
154   try {
155     _this->sixteen_to_nine(static_cast<float> (arg0));
156
157     return 0;
158
159   } catch(std::exception& e) {
160     sq_throwerror(vm, e.what());
161     return SQ_ERROR;
162   } catch(...) {
163     sq_throwerror(vm, _SC("Unexpected exception while executing function 'sixteen_to_nine'"));
164     return SQ_ERROR;
165   }
166
167 }
168
169 static SQInteger DisplayEffect_four_to_three_wrapper(HSQUIRRELVM vm)
170 {
171   SQUserPointer data;
172   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
173     sq_throwerror(vm, _SC("'four_to_three' called without instance"));
174     return SQ_ERROR;
175   }
176   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
177   SQFloat arg0;
178   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
179     sq_throwerror(vm, _SC("Argument 1 not a float"));
180     return SQ_ERROR;
181   }
182
183   try {
184     _this->four_to_three(static_cast<float> (arg0));
185
186     return 0;
187
188   } catch(std::exception& e) {
189     sq_throwerror(vm, e.what());
190     return SQ_ERROR;
191   } catch(...) {
192     sq_throwerror(vm, _SC("Unexpected exception while executing function 'four_to_three'"));
193     return SQ_ERROR;
194   }
195
196 }
197
198 static SQInteger Camera_release_hook(SQUserPointer ptr, SQInteger )
199 {
200   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (ptr);
201   delete _this;
202   return 0;
203 }
204
205 static SQInteger Camera_reload_config_wrapper(HSQUIRRELVM vm)
206 {
207   SQUserPointer data;
208   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
209     sq_throwerror(vm, _SC("'reload_config' called without instance"));
210     return SQ_ERROR;
211   }
212   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
213
214   try {
215     _this->reload_config();
216
217     return 0;
218
219   } catch(std::exception& e) {
220     sq_throwerror(vm, e.what());
221     return SQ_ERROR;
222   } catch(...) {
223     sq_throwerror(vm, _SC("Unexpected exception while executing function 'reload_config'"));
224     return SQ_ERROR;
225   }
226
227 }
228
229 static SQInteger Camera_shake_wrapper(HSQUIRRELVM vm)
230 {
231   SQUserPointer data;
232   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
233     sq_throwerror(vm, _SC("'shake' called without instance"));
234     return SQ_ERROR;
235   }
236   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
237   SQFloat arg0;
238   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
239     sq_throwerror(vm, _SC("Argument 1 not a float"));
240     return SQ_ERROR;
241   }
242   SQFloat arg1;
243   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
244     sq_throwerror(vm, _SC("Argument 2 not a float"));
245     return SQ_ERROR;
246   }
247   SQFloat arg2;
248   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
249     sq_throwerror(vm, _SC("Argument 3 not a float"));
250     return SQ_ERROR;
251   }
252
253   try {
254     _this->shake(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
255
256     return 0;
257
258   } catch(std::exception& e) {
259     sq_throwerror(vm, e.what());
260     return SQ_ERROR;
261   } catch(...) {
262     sq_throwerror(vm, _SC("Unexpected exception while executing function 'shake'"));
263     return SQ_ERROR;
264   }
265
266 }
267
268 static SQInteger Camera_set_pos_wrapper(HSQUIRRELVM vm)
269 {
270   SQUserPointer data;
271   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
272     sq_throwerror(vm, _SC("'set_pos' called without instance"));
273     return SQ_ERROR;
274   }
275   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
276   SQFloat arg0;
277   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
278     sq_throwerror(vm, _SC("Argument 1 not a float"));
279     return SQ_ERROR;
280   }
281   SQFloat arg1;
282   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
283     sq_throwerror(vm, _SC("Argument 2 not a float"));
284     return SQ_ERROR;
285   }
286
287   try {
288     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
289
290     return 0;
291
292   } catch(std::exception& e) {
293     sq_throwerror(vm, e.what());
294     return SQ_ERROR;
295   } catch(...) {
296     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
297     return SQ_ERROR;
298   }
299
300 }
301
302 static SQInteger Camera_set_mode_wrapper(HSQUIRRELVM vm)
303 {
304   SQUserPointer data;
305   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
306     sq_throwerror(vm, _SC("'set_mode' called without instance"));
307     return SQ_ERROR;
308   }
309   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
310   const SQChar* arg0;
311   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
312     sq_throwerror(vm, _SC("Argument 1 not a string"));
313     return SQ_ERROR;
314   }
315
316   try {
317     _this->set_mode(arg0);
318
319     return 0;
320
321   } catch(std::exception& e) {
322     sq_throwerror(vm, e.what());
323     return SQ_ERROR;
324   } catch(...) {
325     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_mode'"));
326     return SQ_ERROR;
327   }
328
329 }
330
331 static SQInteger Camera_scroll_to_wrapper(HSQUIRRELVM vm)
332 {
333   SQUserPointer data;
334   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
335     sq_throwerror(vm, _SC("'scroll_to' called without instance"));
336     return SQ_ERROR;
337   }
338   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
339   SQFloat arg0;
340   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
341     sq_throwerror(vm, _SC("Argument 1 not a float"));
342     return SQ_ERROR;
343   }
344   SQFloat arg1;
345   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
346     sq_throwerror(vm, _SC("Argument 2 not a float"));
347     return SQ_ERROR;
348   }
349   SQFloat arg2;
350   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
351     sq_throwerror(vm, _SC("Argument 3 not a float"));
352     return SQ_ERROR;
353   }
354
355   try {
356     _this->scroll_to(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
357
358     return 0;
359
360   } catch(std::exception& e) {
361     sq_throwerror(vm, e.what());
362     return SQ_ERROR;
363   } catch(...) {
364     sq_throwerror(vm, _SC("Unexpected exception while executing function 'scroll_to'"));
365     return SQ_ERROR;
366   }
367
368 }
369
370 static SQInteger Level_release_hook(SQUserPointer ptr, SQInteger )
371 {
372   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (ptr);
373   delete _this;
374   return 0;
375 }
376
377 static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
378 {
379   SQUserPointer data;
380   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
381     sq_throwerror(vm, _SC("'finish' called without instance"));
382     return SQ_ERROR;
383   }
384   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
385   SQBool arg0;
386   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
387     sq_throwerror(vm, _SC("Argument 1 not a bool"));
388     return SQ_ERROR;
389   }
390
391   try {
392     _this->finish(arg0 == SQTrue);
393
394     return 0;
395
396   } catch(std::exception& e) {
397     sq_throwerror(vm, e.what());
398     return SQ_ERROR;
399   } catch(...) {
400     sq_throwerror(vm, _SC("Unexpected exception while executing function 'finish'"));
401     return SQ_ERROR;
402   }
403
404 }
405
406 static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
407 {
408   SQUserPointer data;
409   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
410     sq_throwerror(vm, _SC("'spawn' called without instance"));
411     return SQ_ERROR;
412   }
413   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
414   const SQChar* arg0;
415   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
416     sq_throwerror(vm, _SC("Argument 1 not a string"));
417     return SQ_ERROR;
418   }
419   const SQChar* arg1;
420   if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
421     sq_throwerror(vm, _SC("Argument 2 not a string"));
422     return SQ_ERROR;
423   }
424
425   try {
426     _this->spawn(arg0, arg1);
427
428     return 0;
429
430   } catch(std::exception& e) {
431     sq_throwerror(vm, e.what());
432     return SQ_ERROR;
433   } catch(...) {
434     sq_throwerror(vm, _SC("Unexpected exception while executing function 'spawn'"));
435     return SQ_ERROR;
436   }
437
438 }
439
440 static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
441 {
442   SQUserPointer data;
443   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
444     sq_throwerror(vm, _SC("'flip_vertically' called without instance"));
445     return SQ_ERROR;
446   }
447   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
448
449   try {
450     _this->flip_vertically();
451
452     return 0;
453
454   } catch(std::exception& e) {
455     sq_throwerror(vm, e.what());
456     return SQ_ERROR;
457   } catch(...) {
458     sq_throwerror(vm, _SC("Unexpected exception while executing function 'flip_vertically'"));
459     return SQ_ERROR;
460   }
461
462 }
463
464 static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
465 {
466   SQUserPointer data;
467   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
468     sq_throwerror(vm, _SC("'toggle_pause' called without instance"));
469     return SQ_ERROR;
470   }
471   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
472
473   try {
474     _this->toggle_pause();
475
476     return 0;
477
478   } catch(std::exception& e) {
479     sq_throwerror(vm, e.what());
480     return SQ_ERROR;
481   } catch(...) {
482     sq_throwerror(vm, _SC("Unexpected exception while executing function 'toggle_pause'"));
483     return SQ_ERROR;
484   }
485
486 }
487
488 static SQInteger Level_edit_wrapper(HSQUIRRELVM vm)
489 {
490   SQUserPointer data;
491   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
492     sq_throwerror(vm, _SC("'edit' called without instance"));
493     return SQ_ERROR;
494   }
495   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
496   SQBool arg0;
497   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
498     sq_throwerror(vm, _SC("Argument 1 not a bool"));
499     return SQ_ERROR;
500   }
501
502   try {
503     _this->edit(arg0 == SQTrue);
504
505     return 0;
506
507   } catch(std::exception& e) {
508     sq_throwerror(vm, e.what());
509     return SQ_ERROR;
510   } catch(...) {
511     sq_throwerror(vm, _SC("Unexpected exception while executing function 'edit'"));
512     return SQ_ERROR;
513   }
514
515 }
516
517 static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
518 {
519   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
520   delete _this;
521   return 0;
522 }
523
524 static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm)
525 {
526   SQUserPointer data;
527   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
528     sq_throwerror(vm, _SC("'set_action' called without instance"));
529     return SQ_ERROR;
530   }
531   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
532   const SQChar* arg0;
533   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
534     sq_throwerror(vm, _SC("Argument 1 not a string"));
535     return SQ_ERROR;
536   }
537
538   try {
539     _this->set_action(arg0);
540
541     return 0;
542
543   } catch(std::exception& e) {
544     sq_throwerror(vm, e.what());
545     return SQ_ERROR;
546   } catch(...) {
547     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
548     return SQ_ERROR;
549   }
550
551 }
552
553 static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm)
554 {
555   SQUserPointer data;
556   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
557     sq_throwerror(vm, _SC("'get_action' called without instance"));
558     return SQ_ERROR;
559   }
560   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
561
562   try {
563     std::string return_value = _this->get_action();
564
565     sq_pushstring(vm, return_value.c_str(), return_value.size());
566     return 1;
567
568   } catch(std::exception& e) {
569     sq_throwerror(vm, e.what());
570     return SQ_ERROR;
571   } catch(...) {
572     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
573     return SQ_ERROR;
574   }
575
576 }
577
578 static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm)
579 {
580   SQUserPointer data;
581   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
582     sq_throwerror(vm, _SC("'move' called without instance"));
583     return SQ_ERROR;
584   }
585   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
586   SQFloat arg0;
587   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
588     sq_throwerror(vm, _SC("Argument 1 not a float"));
589     return SQ_ERROR;
590   }
591   SQFloat arg1;
592   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
593     sq_throwerror(vm, _SC("Argument 2 not a float"));
594     return SQ_ERROR;
595   }
596
597   try {
598     _this->move(static_cast<float> (arg0), static_cast<float> (arg1));
599
600     return 0;
601
602   } catch(std::exception& e) {
603     sq_throwerror(vm, e.what());
604     return SQ_ERROR;
605   } catch(...) {
606     sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'"));
607     return SQ_ERROR;
608   }
609
610 }
611
612 static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm)
613 {
614   SQUserPointer data;
615   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
616     sq_throwerror(vm, _SC("'set_pos' called without instance"));
617     return SQ_ERROR;
618   }
619   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
620   SQFloat arg0;
621   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
622     sq_throwerror(vm, _SC("Argument 1 not a float"));
623     return SQ_ERROR;
624   }
625   SQFloat arg1;
626   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
627     sq_throwerror(vm, _SC("Argument 2 not a float"));
628     return SQ_ERROR;
629   }
630
631   try {
632     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
633
634     return 0;
635
636   } catch(std::exception& e) {
637     sq_throwerror(vm, e.what());
638     return SQ_ERROR;
639   } catch(...) {
640     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
641     return SQ_ERROR;
642   }
643
644 }
645
646 static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm)
647 {
648   SQUserPointer data;
649   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
650     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
651     return SQ_ERROR;
652   }
653   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
654
655   try {
656     float return_value = _this->get_pos_x();
657
658     sq_pushfloat(vm, return_value);
659     return 1;
660
661   } catch(std::exception& e) {
662     sq_throwerror(vm, e.what());
663     return SQ_ERROR;
664   } catch(...) {
665     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
666     return SQ_ERROR;
667   }
668
669 }
670
671 static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm)
672 {
673   SQUserPointer data;
674   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
675     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
676     return SQ_ERROR;
677   }
678   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
679
680   try {
681     float return_value = _this->get_pos_y();
682
683     sq_pushfloat(vm, return_value);
684     return 1;
685
686   } catch(std::exception& e) {
687     sq_throwerror(vm, e.what());
688     return SQ_ERROR;
689   } catch(...) {
690     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
691     return SQ_ERROR;
692   }
693
694 }
695
696 static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm)
697 {
698   SQUserPointer data;
699   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
700     sq_throwerror(vm, _SC("'set_velocity' called without instance"));
701     return SQ_ERROR;
702   }
703   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
704   SQFloat arg0;
705   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
706     sq_throwerror(vm, _SC("Argument 1 not a float"));
707     return SQ_ERROR;
708   }
709   SQFloat arg1;
710   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
711     sq_throwerror(vm, _SC("Argument 2 not a float"));
712     return SQ_ERROR;
713   }
714
715   try {
716     _this->set_velocity(static_cast<float> (arg0), static_cast<float> (arg1));
717
718     return 0;
719
720   } catch(std::exception& e) {
721     sq_throwerror(vm, e.what());
722     return SQ_ERROR;
723   } catch(...) {
724     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_velocity'"));
725     return SQ_ERROR;
726   }
727
728 }
729
730 static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm)
731 {
732   SQUserPointer data;
733   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
734     sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
735     return SQ_ERROR;
736   }
737   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
738
739   try {
740     float return_value = _this->get_velocity_x();
741
742     sq_pushfloat(vm, return_value);
743     return 1;
744
745   } catch(std::exception& e) {
746     sq_throwerror(vm, e.what());
747     return SQ_ERROR;
748   } catch(...) {
749     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_x'"));
750     return SQ_ERROR;
751   }
752
753 }
754
755 static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm)
756 {
757   SQUserPointer data;
758   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
759     sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
760     return SQ_ERROR;
761   }
762   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
763
764   try {
765     float return_value = _this->get_velocity_y();
766
767     sq_pushfloat(vm, return_value);
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_velocity_y'"));
775     return SQ_ERROR;
776   }
777
778 }
779
780 static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
781 {
782   SQUserPointer data;
783   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
784     sq_throwerror(vm, _SC("'set_visible' called without instance"));
785     return SQ_ERROR;
786   }
787   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
788   SQBool arg0;
789   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
790     sq_throwerror(vm, _SC("Argument 1 not a bool"));
791     return SQ_ERROR;
792   }
793
794   try {
795     _this->set_visible(arg0 == SQTrue);
796
797     return 0;
798
799   } catch(std::exception& e) {
800     sq_throwerror(vm, e.what());
801     return SQ_ERROR;
802   } catch(...) {
803     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
804     return SQ_ERROR;
805   }
806
807 }
808
809 static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
810 {
811   SQUserPointer data;
812   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
813     sq_throwerror(vm, _SC("'is_visible' called without instance"));
814     return SQ_ERROR;
815   }
816   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
817
818   try {
819     bool return_value = _this->is_visible();
820
821     sq_pushbool(vm, return_value);
822     return 1;
823
824   } catch(std::exception& e) {
825     sq_throwerror(vm, e.what());
826     return SQ_ERROR;
827   } catch(...) {
828     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_visible'"));
829     return SQ_ERROR;
830   }
831
832 }
833
834 static SQInteger ScriptedObject_set_solid_wrapper(HSQUIRRELVM vm)
835 {
836   SQUserPointer data;
837   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
838     sq_throwerror(vm, _SC("'set_solid' called without instance"));
839     return SQ_ERROR;
840   }
841   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
842   SQBool arg0;
843   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
844     sq_throwerror(vm, _SC("Argument 1 not a bool"));
845     return SQ_ERROR;
846   }
847
848   try {
849     _this->set_solid(arg0 == SQTrue);
850
851     return 0;
852
853   } catch(std::exception& e) {
854     sq_throwerror(vm, e.what());
855     return SQ_ERROR;
856   } catch(...) {
857     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_solid'"));
858     return SQ_ERROR;
859   }
860
861 }
862
863 static SQInteger ScriptedObject_is_solid_wrapper(HSQUIRRELVM vm)
864 {
865   SQUserPointer data;
866   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
867     sq_throwerror(vm, _SC("'is_solid' called without instance"));
868     return SQ_ERROR;
869   }
870   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
871
872   try {
873     bool return_value = _this->is_solid();
874
875     sq_pushbool(vm, return_value);
876     return 1;
877
878   } catch(std::exception& e) {
879     sq_throwerror(vm, e.what());
880     return SQ_ERROR;
881   } catch(...) {
882     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_solid'"));
883     return SQ_ERROR;
884   }
885
886 }
887
888 static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
889 {
890   SQUserPointer data;
891   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
892     sq_throwerror(vm, _SC("'get_name' called without instance"));
893     return SQ_ERROR;
894   }
895   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
896
897   try {
898     std::string return_value = _this->get_name();
899
900     sq_pushstring(vm, return_value.c_str(), return_value.size());
901     return 1;
902
903   } catch(std::exception& e) {
904     sq_throwerror(vm, e.what());
905     return SQ_ERROR;
906   } catch(...) {
907     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
908     return SQ_ERROR;
909   }
910
911 }
912
913 static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
914 {
915   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (ptr);
916   delete _this;
917   return 0;
918 }
919
920 static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm)
921 {
922   SQUserPointer data;
923   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
924     sq_throwerror(vm, _SC("'set_text' called without instance"));
925     return SQ_ERROR;
926   }
927   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
928   const SQChar* arg0;
929   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
930     sq_throwerror(vm, _SC("Argument 1 not a string"));
931     return SQ_ERROR;
932   }
933
934   try {
935     _this->set_text(arg0);
936
937     return 0;
938
939   } catch(std::exception& e) {
940     sq_throwerror(vm, e.what());
941     return SQ_ERROR;
942   } catch(...) {
943     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
944     return SQ_ERROR;
945   }
946
947 }
948
949 static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm)
950 {
951   SQUserPointer data;
952   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
953     sq_throwerror(vm, _SC("'set_font' called without instance"));
954     return SQ_ERROR;
955   }
956   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
957   const SQChar* arg0;
958   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
959     sq_throwerror(vm, _SC("Argument 1 not a string"));
960     return SQ_ERROR;
961   }
962
963   try {
964     _this->set_font(arg0);
965
966     return 0;
967
968   } catch(std::exception& e) {
969     sq_throwerror(vm, e.what());
970     return SQ_ERROR;
971   } catch(...) {
972     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_font'"));
973     return SQ_ERROR;
974   }
975
976 }
977
978 static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm)
979 {
980   SQUserPointer data;
981   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
982     sq_throwerror(vm, _SC("'fade_in' called without instance"));
983     return SQ_ERROR;
984   }
985   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
986   SQFloat arg0;
987   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
988     sq_throwerror(vm, _SC("Argument 1 not a float"));
989     return SQ_ERROR;
990   }
991
992   try {
993     _this->fade_in(static_cast<float> (arg0));
994
995     return 0;
996
997   } catch(std::exception& e) {
998     sq_throwerror(vm, e.what());
999     return SQ_ERROR;
1000   } catch(...) {
1001     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
1002     return SQ_ERROR;
1003   }
1004
1005 }
1006
1007 static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm)
1008 {
1009   SQUserPointer data;
1010   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1011     sq_throwerror(vm, _SC("'fade_out' called without instance"));
1012     return SQ_ERROR;
1013   }
1014   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1015   SQFloat arg0;
1016   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1017     sq_throwerror(vm, _SC("Argument 1 not a float"));
1018     return SQ_ERROR;
1019   }
1020
1021   try {
1022     _this->fade_out(static_cast<float> (arg0));
1023
1024     return 0;
1025
1026   } catch(std::exception& e) {
1027     sq_throwerror(vm, e.what());
1028     return SQ_ERROR;
1029   } catch(...) {
1030     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
1031     return SQ_ERROR;
1032   }
1033
1034 }
1035
1036 static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm)
1037 {
1038   SQUserPointer data;
1039   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1040     sq_throwerror(vm, _SC("'set_visible' called without instance"));
1041     return SQ_ERROR;
1042   }
1043   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1044   SQBool arg0;
1045   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1046     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1047     return SQ_ERROR;
1048   }
1049
1050   try {
1051     _this->set_visible(arg0 == SQTrue);
1052
1053     return 0;
1054
1055   } catch(std::exception& e) {
1056     sq_throwerror(vm, e.what());
1057     return SQ_ERROR;
1058   } catch(...) {
1059     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1060     return SQ_ERROR;
1061   }
1062
1063 }
1064
1065 static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
1066 {
1067   SQUserPointer data;
1068   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1069     sq_throwerror(vm, _SC("'set_centered' called without instance"));
1070     return SQ_ERROR;
1071   }
1072   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1073   SQBool arg0;
1074   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1075     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1076     return SQ_ERROR;
1077   }
1078
1079   try {
1080     _this->set_centered(arg0 == SQTrue);
1081
1082     return 0;
1083
1084   } catch(std::exception& e) {
1085     sq_throwerror(vm, e.what());
1086     return SQ_ERROR;
1087   } catch(...) {
1088     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_centered'"));
1089     return SQ_ERROR;
1090   }
1091
1092 }
1093
1094 static SQInteger Text_set_pos_wrapper(HSQUIRRELVM vm)
1095 {
1096   SQUserPointer data;
1097   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1098     sq_throwerror(vm, _SC("'set_pos' called without instance"));
1099     return SQ_ERROR;
1100   }
1101   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1102   SQFloat arg0;
1103   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1104     sq_throwerror(vm, _SC("Argument 1 not a float"));
1105     return SQ_ERROR;
1106   }
1107   SQFloat arg1;
1108   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1109     sq_throwerror(vm, _SC("Argument 2 not a float"));
1110     return SQ_ERROR;
1111   }
1112
1113   try {
1114     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1115
1116     return 0;
1117
1118   } catch(std::exception& e) {
1119     sq_throwerror(vm, e.what());
1120     return SQ_ERROR;
1121   } catch(...) {
1122     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1123     return SQ_ERROR;
1124   }
1125
1126 }
1127
1128 static SQInteger Text_get_pos_x_wrapper(HSQUIRRELVM vm)
1129 {
1130   SQUserPointer data;
1131   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1132     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1133     return SQ_ERROR;
1134   }
1135   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1136
1137   try {
1138     float return_value = _this->get_pos_x();
1139
1140     sq_pushfloat(vm, return_value);
1141     return 1;
1142
1143   } catch(std::exception& e) {
1144     sq_throwerror(vm, e.what());
1145     return SQ_ERROR;
1146   } catch(...) {
1147     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1148     return SQ_ERROR;
1149   }
1150
1151 }
1152
1153 static SQInteger Text_get_pos_y_wrapper(HSQUIRRELVM vm)
1154 {
1155   SQUserPointer data;
1156   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1157     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1158     return SQ_ERROR;
1159   }
1160   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1161
1162   try {
1163     float return_value = _this->get_pos_y();
1164
1165     sq_pushfloat(vm, return_value);
1166     return 1;
1167
1168   } catch(std::exception& e) {
1169     sq_throwerror(vm, e.what());
1170     return SQ_ERROR;
1171   } catch(...) {
1172     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1173     return SQ_ERROR;
1174   }
1175
1176 }
1177
1178 static SQInteger Text_set_anchor_point_wrapper(HSQUIRRELVM vm)
1179 {
1180   SQUserPointer data;
1181   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1182     sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1183     return SQ_ERROR;
1184   }
1185   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1186   SQInteger arg0;
1187   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1188     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1189     return SQ_ERROR;
1190   }
1191
1192   try {
1193     _this->set_anchor_point(static_cast<int> (arg0));
1194
1195     return 0;
1196
1197   } catch(std::exception& e) {
1198     sq_throwerror(vm, e.what());
1199     return SQ_ERROR;
1200   } catch(...) {
1201     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1202     return SQ_ERROR;
1203   }
1204
1205 }
1206
1207 static SQInteger Text_get_anchor_point_wrapper(HSQUIRRELVM vm)
1208 {
1209   SQUserPointer data;
1210   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1211     sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1212     return SQ_ERROR;
1213   }
1214   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1215
1216   try {
1217     int return_value = _this->get_anchor_point();
1218
1219     sq_pushinteger(vm, return_value);
1220     return 1;
1221
1222   } catch(std::exception& e) {
1223     sq_throwerror(vm, e.what());
1224     return SQ_ERROR;
1225   } catch(...) {
1226     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1227     return SQ_ERROR;
1228   }
1229
1230 }
1231
1232 static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger )
1233 {
1234   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
1235   delete _this;
1236   return 0;
1237 }
1238
1239 static SQInteger Player_add_bonus_wrapper(HSQUIRRELVM vm)
1240 {
1241   SQUserPointer data;
1242   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1243     sq_throwerror(vm, _SC("'add_bonus' called without instance"));
1244     return SQ_ERROR;
1245   }
1246   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1247   const SQChar* arg0;
1248   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1249     sq_throwerror(vm, _SC("Argument 1 not a string"));
1250     return SQ_ERROR;
1251   }
1252
1253   try {
1254     bool return_value = _this->add_bonus(arg0);
1255
1256     sq_pushbool(vm, return_value);
1257     return 1;
1258
1259   } catch(std::exception& e) {
1260     sq_throwerror(vm, e.what());
1261     return SQ_ERROR;
1262   } catch(...) {
1263     sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_bonus'"));
1264     return SQ_ERROR;
1265   }
1266
1267 }
1268
1269 static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm)
1270 {
1271   SQUserPointer data;
1272   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1273     sq_throwerror(vm, _SC("'add_coins' called without instance"));
1274     return SQ_ERROR;
1275   }
1276   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1277   SQInteger arg0;
1278   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1279     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1280     return SQ_ERROR;
1281   }
1282
1283   try {
1284     _this->add_coins(static_cast<int> (arg0));
1285
1286     return 0;
1287
1288   } catch(std::exception& e) {
1289     sq_throwerror(vm, e.what());
1290     return SQ_ERROR;
1291   } catch(...) {
1292     sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_coins'"));
1293     return SQ_ERROR;
1294   }
1295
1296 }
1297
1298 static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm)
1299 {
1300   SQUserPointer data;
1301   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1302     sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1303     return SQ_ERROR;
1304   }
1305   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1306
1307   try {
1308     _this->make_invincible();
1309
1310     return 0;
1311
1312   } catch(std::exception& e) {
1313     sq_throwerror(vm, e.what());
1314     return SQ_ERROR;
1315   } catch(...) {
1316     sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1317     return SQ_ERROR;
1318   }
1319
1320 }
1321
1322 static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm)
1323 {
1324   SQUserPointer data;
1325   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1326     sq_throwerror(vm, _SC("'deactivate' called without instance"));
1327     return SQ_ERROR;
1328   }
1329   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1330
1331   try {
1332     _this->deactivate();
1333
1334     return 0;
1335
1336   } catch(std::exception& e) {
1337     sq_throwerror(vm, e.what());
1338     return SQ_ERROR;
1339   } catch(...) {
1340     sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1341     return SQ_ERROR;
1342   }
1343
1344 }
1345
1346 static SQInteger Player_activate_wrapper(HSQUIRRELVM vm)
1347 {
1348   SQUserPointer data;
1349   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1350     sq_throwerror(vm, _SC("'activate' called without instance"));
1351     return SQ_ERROR;
1352   }
1353   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1354
1355   try {
1356     _this->activate();
1357
1358     return 0;
1359
1360   } catch(std::exception& e) {
1361     sq_throwerror(vm, e.what());
1362     return SQ_ERROR;
1363   } catch(...) {
1364     sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1365     return SQ_ERROR;
1366   }
1367
1368 }
1369
1370 static SQInteger Player_walk_wrapper(HSQUIRRELVM vm)
1371 {
1372   SQUserPointer data;
1373   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1374     sq_throwerror(vm, _SC("'walk' called without instance"));
1375     return SQ_ERROR;
1376   }
1377   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1378   SQFloat arg0;
1379   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1380     sq_throwerror(vm, _SC("Argument 1 not a float"));
1381     return SQ_ERROR;
1382   }
1383
1384   try {
1385     _this->walk(static_cast<float> (arg0));
1386
1387     return 0;
1388
1389   } catch(std::exception& e) {
1390     sq_throwerror(vm, e.what());
1391     return SQ_ERROR;
1392   } catch(...) {
1393     sq_throwerror(vm, _SC("Unexpected exception while executing function 'walk'"));
1394     return SQ_ERROR;
1395   }
1396
1397 }
1398
1399 static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm)
1400 {
1401   SQUserPointer data;
1402   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1403     sq_throwerror(vm, _SC("'set_visible' called without instance"));
1404     return SQ_ERROR;
1405   }
1406   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1407   SQBool arg0;
1408   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1409     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1410     return SQ_ERROR;
1411   }
1412
1413   try {
1414     _this->set_visible(arg0 == SQTrue);
1415
1416     return 0;
1417
1418   } catch(std::exception& e) {
1419     sq_throwerror(vm, e.what());
1420     return SQ_ERROR;
1421   } catch(...) {
1422     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1423     return SQ_ERROR;
1424   }
1425
1426 }
1427
1428 static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm)
1429 {
1430   SQUserPointer data;
1431   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1432     sq_throwerror(vm, _SC("'get_visible' called without instance"));
1433     return SQ_ERROR;
1434   }
1435   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1436
1437   try {
1438     bool return_value = _this->get_visible();
1439
1440     sq_pushbool(vm, return_value);
1441     return 1;
1442
1443   } catch(std::exception& e) {
1444     sq_throwerror(vm, e.what());
1445     return SQ_ERROR;
1446   } catch(...) {
1447     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1448     return SQ_ERROR;
1449   }
1450
1451 }
1452
1453 static SQInteger Player_kill_wrapper(HSQUIRRELVM vm)
1454 {
1455   SQUserPointer data;
1456   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1457     sq_throwerror(vm, _SC("'kill' called without instance"));
1458     return SQ_ERROR;
1459   }
1460   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1461   SQBool arg0;
1462   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1463     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1464     return SQ_ERROR;
1465   }
1466
1467   try {
1468     _this->kill(arg0 == SQTrue);
1469
1470     return 0;
1471
1472   } catch(std::exception& e) {
1473     sq_throwerror(vm, e.what());
1474     return SQ_ERROR;
1475   } catch(...) {
1476     sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'"));
1477     return SQ_ERROR;
1478   }
1479
1480 }
1481
1482 static SQInteger Player_set_ghost_mode_wrapper(HSQUIRRELVM vm)
1483 {
1484   SQUserPointer data;
1485   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1486     sq_throwerror(vm, _SC("'set_ghost_mode' called without instance"));
1487     return SQ_ERROR;
1488   }
1489   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1490   SQBool arg0;
1491   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1492     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1493     return SQ_ERROR;
1494   }
1495
1496   try {
1497     _this->set_ghost_mode(arg0 == SQTrue);
1498
1499     return 0;
1500
1501   } catch(std::exception& e) {
1502     sq_throwerror(vm, e.what());
1503     return SQ_ERROR;
1504   } catch(...) {
1505     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ghost_mode'"));
1506     return SQ_ERROR;
1507   }
1508
1509 }
1510
1511 static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm)
1512 {
1513   SQUserPointer data;
1514   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1515     sq_throwerror(vm, _SC("'get_ghost_mode' called without instance"));
1516     return SQ_ERROR;
1517   }
1518   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1519
1520   try {
1521     bool return_value = _this->get_ghost_mode();
1522
1523     sq_pushbool(vm, return_value);
1524     return 1;
1525
1526   } catch(std::exception& e) {
1527     sq_throwerror(vm, e.what());
1528     return SQ_ERROR;
1529   } catch(...) {
1530     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ghost_mode'"));
1531     return SQ_ERROR;
1532   }
1533
1534 }
1535
1536 static SQInteger Player_do_cheer_wrapper(HSQUIRRELVM vm)
1537 {
1538   SQUserPointer data;
1539   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1540     sq_throwerror(vm, _SC("'do_cheer' called without instance"));
1541     return SQ_ERROR;
1542   }
1543   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1544
1545   try {
1546     _this->do_cheer();
1547
1548     return 0;
1549
1550   } catch(std::exception& e) {
1551     sq_throwerror(vm, e.what());
1552     return SQ_ERROR;
1553   } catch(...) {
1554     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_cheer'"));
1555     return SQ_ERROR;
1556   }
1557
1558 }
1559
1560 static SQInteger Player_do_duck_wrapper(HSQUIRRELVM vm)
1561 {
1562   SQUserPointer data;
1563   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1564     sq_throwerror(vm, _SC("'do_duck' called without instance"));
1565     return SQ_ERROR;
1566   }
1567   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1568
1569   try {
1570     _this->do_duck();
1571
1572     return 0;
1573
1574   } catch(std::exception& e) {
1575     sq_throwerror(vm, e.what());
1576     return SQ_ERROR;
1577   } catch(...) {
1578     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_duck'"));
1579     return SQ_ERROR;
1580   }
1581
1582 }
1583
1584 static SQInteger Player_do_standup_wrapper(HSQUIRRELVM vm)
1585 {
1586   SQUserPointer data;
1587   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1588     sq_throwerror(vm, _SC("'do_standup' called without instance"));
1589     return SQ_ERROR;
1590   }
1591   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1592
1593   try {
1594     _this->do_standup();
1595
1596     return 0;
1597
1598   } catch(std::exception& e) {
1599     sq_throwerror(vm, e.what());
1600     return SQ_ERROR;
1601   } catch(...) {
1602     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_standup'"));
1603     return SQ_ERROR;
1604   }
1605
1606 }
1607
1608 static SQInteger Player_do_backflip_wrapper(HSQUIRRELVM vm)
1609 {
1610   SQUserPointer data;
1611   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1612     sq_throwerror(vm, _SC("'do_backflip' called without instance"));
1613     return SQ_ERROR;
1614   }
1615   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1616
1617   try {
1618     _this->do_backflip();
1619
1620     return 0;
1621
1622   } catch(std::exception& e) {
1623     sq_throwerror(vm, e.what());
1624     return SQ_ERROR;
1625   } catch(...) {
1626     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_backflip'"));
1627     return SQ_ERROR;
1628   }
1629
1630 }
1631
1632 static SQInteger Player_do_jump_wrapper(HSQUIRRELVM vm)
1633 {
1634   SQUserPointer data;
1635   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1636     sq_throwerror(vm, _SC("'do_jump' called without instance"));
1637     return SQ_ERROR;
1638   }
1639   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1640   SQFloat arg0;
1641   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1642     sq_throwerror(vm, _SC("Argument 1 not a float"));
1643     return SQ_ERROR;
1644   }
1645
1646   try {
1647     _this->do_jump(static_cast<float> (arg0));
1648
1649     return 0;
1650
1651   } catch(std::exception& e) {
1652     sq_throwerror(vm, e.what());
1653     return SQ_ERROR;
1654   } catch(...) {
1655     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_jump'"));
1656     return SQ_ERROR;
1657   }
1658
1659 }
1660
1661 static SQInteger Player_trigger_sequence_wrapper(HSQUIRRELVM vm)
1662 {
1663   SQUserPointer data;
1664   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1665     sq_throwerror(vm, _SC("'trigger_sequence' called without instance"));
1666     return SQ_ERROR;
1667   }
1668   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1669   const SQChar* arg0;
1670   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1671     sq_throwerror(vm, _SC("Argument 1 not a string"));
1672     return SQ_ERROR;
1673   }
1674
1675   try {
1676     _this->trigger_sequence(arg0);
1677
1678     return 0;
1679
1680   } catch(std::exception& e) {
1681     sq_throwerror(vm, e.what());
1682     return SQ_ERROR;
1683   } catch(...) {
1684     sq_throwerror(vm, _SC("Unexpected exception while executing function 'trigger_sequence'"));
1685     return SQ_ERROR;
1686   }
1687
1688 }
1689
1690 static SQInteger Player_use_scripting_controller_wrapper(HSQUIRRELVM vm)
1691 {
1692   SQUserPointer data;
1693   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1694     sq_throwerror(vm, _SC("'use_scripting_controller' called without instance"));
1695     return SQ_ERROR;
1696   }
1697   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1698   SQBool arg0;
1699   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1700     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1701     return SQ_ERROR;
1702   }
1703
1704   try {
1705     _this->use_scripting_controller(arg0 == SQTrue);
1706
1707     return 0;
1708
1709   } catch(std::exception& e) {
1710     sq_throwerror(vm, e.what());
1711     return SQ_ERROR;
1712   } catch(...) {
1713     sq_throwerror(vm, _SC("Unexpected exception while executing function 'use_scripting_controller'"));
1714     return SQ_ERROR;
1715   }
1716
1717 }
1718
1719 static SQInteger Player_do_scripting_controller_wrapper(HSQUIRRELVM vm)
1720 {
1721   SQUserPointer data;
1722   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1723     sq_throwerror(vm, _SC("'do_scripting_controller' called without instance"));
1724     return SQ_ERROR;
1725   }
1726   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1727   const SQChar* arg0;
1728   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1729     sq_throwerror(vm, _SC("Argument 1 not a string"));
1730     return SQ_ERROR;
1731   }
1732   SQBool arg1;
1733   if(SQ_FAILED(sq_getbool(vm, 3, &arg1))) {
1734     sq_throwerror(vm, _SC("Argument 2 not a bool"));
1735     return SQ_ERROR;
1736   }
1737
1738   try {
1739     _this->do_scripting_controller(arg0, arg1 == SQTrue);
1740
1741     return 0;
1742
1743   } catch(std::exception& e) {
1744     sq_throwerror(vm, e.what());
1745     return SQ_ERROR;
1746   } catch(...) {
1747     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_scripting_controller'"));
1748     return SQ_ERROR;
1749   }
1750
1751 }
1752
1753 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
1754 {
1755   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1756   delete _this;
1757   return 0;
1758 }
1759
1760 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1761 {
1762   const SQChar* arg0;
1763   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1764     sq_throwerror(vm, _SC("Argument 1 not a string"));
1765     return SQ_ERROR;
1766   }
1767
1768   try {
1769     Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1770   if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1771     sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1772     return SQ_ERROR;
1773   }
1774   sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1775
1776     return 0;
1777
1778   } catch(std::exception& e) {
1779     sq_throwerror(vm, e.what());
1780     return SQ_ERROR;
1781   } catch(...) {
1782     sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1783     return SQ_ERROR;
1784   }
1785
1786 }
1787
1788 static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
1789 {
1790   SQUserPointer data;
1791   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1792     sq_throwerror(vm, _SC("'set_layer' called without instance"));
1793     return SQ_ERROR;
1794   }
1795   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1796   SQInteger arg0;
1797   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1798     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1799     return SQ_ERROR;
1800   }
1801
1802   try {
1803     _this->set_layer(static_cast<int> (arg0));
1804
1805     return 0;
1806
1807   } catch(std::exception& e) {
1808     sq_throwerror(vm, e.what());
1809     return SQ_ERROR;
1810   } catch(...) {
1811     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
1812     return SQ_ERROR;
1813   }
1814
1815 }
1816
1817 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1818 {
1819   SQUserPointer data;
1820   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1821     sq_throwerror(vm, _SC("'get_layer' called without instance"));
1822     return SQ_ERROR;
1823   }
1824   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1825
1826   try {
1827     int return_value = _this->get_layer();
1828
1829     sq_pushinteger(vm, return_value);
1830     return 1;
1831
1832   } catch(std::exception& e) {
1833     sq_throwerror(vm, e.what());
1834     return SQ_ERROR;
1835   } catch(...) {
1836     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1837     return SQ_ERROR;
1838   }
1839
1840 }
1841
1842 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1843 {
1844   SQUserPointer data;
1845   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1846     sq_throwerror(vm, _SC("'set_pos' called without instance"));
1847     return SQ_ERROR;
1848   }
1849   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1850   SQFloat arg0;
1851   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1852     sq_throwerror(vm, _SC("Argument 1 not a float"));
1853     return SQ_ERROR;
1854   }
1855   SQFloat arg1;
1856   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1857     sq_throwerror(vm, _SC("Argument 2 not a float"));
1858     return SQ_ERROR;
1859   }
1860
1861   try {
1862     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1863
1864     return 0;
1865
1866   } catch(std::exception& e) {
1867     sq_throwerror(vm, e.what());
1868     return SQ_ERROR;
1869   } catch(...) {
1870     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1871     return SQ_ERROR;
1872   }
1873
1874 }
1875
1876 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1877 {
1878   SQUserPointer data;
1879   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1880     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1881     return SQ_ERROR;
1882   }
1883   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1884
1885   try {
1886     float return_value = _this->get_pos_x();
1887
1888     sq_pushfloat(vm, return_value);
1889     return 1;
1890
1891   } catch(std::exception& e) {
1892     sq_throwerror(vm, e.what());
1893     return SQ_ERROR;
1894   } catch(...) {
1895     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1896     return SQ_ERROR;
1897   }
1898
1899 }
1900
1901 static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
1902 {
1903   SQUserPointer data;
1904   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1905     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1906     return SQ_ERROR;
1907   }
1908   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1909
1910   try {
1911     float return_value = _this->get_pos_y();
1912
1913     sq_pushfloat(vm, return_value);
1914     return 1;
1915
1916   } catch(std::exception& e) {
1917     sq_throwerror(vm, e.what());
1918     return SQ_ERROR;
1919   } catch(...) {
1920     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1921     return SQ_ERROR;
1922   }
1923
1924 }
1925
1926 static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
1927 {
1928   SQUserPointer data;
1929   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1930     sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1931     return SQ_ERROR;
1932   }
1933   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1934   SQInteger arg0;
1935   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1936     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1937     return SQ_ERROR;
1938   }
1939
1940   try {
1941     _this->set_anchor_point(static_cast<int> (arg0));
1942
1943     return 0;
1944
1945   } catch(std::exception& e) {
1946     sq_throwerror(vm, e.what());
1947     return SQ_ERROR;
1948   } catch(...) {
1949     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1950     return SQ_ERROR;
1951   }
1952
1953 }
1954
1955 static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
1956 {
1957   SQUserPointer data;
1958   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1959     sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1960     return SQ_ERROR;
1961   }
1962   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1963
1964   try {
1965     int return_value = _this->get_anchor_point();
1966
1967     sq_pushinteger(vm, return_value);
1968     return 1;
1969
1970   } catch(std::exception& e) {
1971     sq_throwerror(vm, e.what());
1972     return SQ_ERROR;
1973   } catch(...) {
1974     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1975     return SQ_ERROR;
1976   }
1977
1978 }
1979
1980 static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
1981 {
1982   SQUserPointer data;
1983   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1984     sq_throwerror(vm, _SC("'set_visible' called without instance"));
1985     return SQ_ERROR;
1986   }
1987   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1988   SQBool arg0;
1989   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1990     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1991     return SQ_ERROR;
1992   }
1993
1994   try {
1995     _this->set_visible(arg0 == SQTrue);
1996
1997     return 0;
1998
1999   } catch(std::exception& e) {
2000     sq_throwerror(vm, e.what());
2001     return SQ_ERROR;
2002   } catch(...) {
2003     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
2004     return SQ_ERROR;
2005   }
2006
2007 }
2008
2009 static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
2010 {
2011   SQUserPointer data;
2012   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2013     sq_throwerror(vm, _SC("'get_visible' called without instance"));
2014     return SQ_ERROR;
2015   }
2016   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
2017
2018   try {
2019     bool return_value = _this->get_visible();
2020
2021     sq_pushbool(vm, return_value);
2022     return 1;
2023
2024   } catch(std::exception& e) {
2025     sq_throwerror(vm, e.what());
2026     return SQ_ERROR;
2027   } catch(...) {
2028     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
2029     return SQ_ERROR;
2030   }
2031
2032 }
2033
2034 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
2035 {
2036   SQUserPointer data;
2037   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2038     sq_throwerror(vm, _SC("'set_action' called without instance"));
2039     return SQ_ERROR;
2040   }
2041   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
2042   const SQChar* arg0;
2043   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2044     sq_throwerror(vm, _SC("Argument 1 not a string"));
2045     return SQ_ERROR;
2046   }
2047
2048   try {
2049     _this->set_action(arg0);
2050
2051     return 0;
2052
2053   } catch(std::exception& e) {
2054     sq_throwerror(vm, e.what());
2055     return SQ_ERROR;
2056   } catch(...) {
2057     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
2058     return SQ_ERROR;
2059   }
2060
2061 }
2062
2063 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
2064 {
2065   SQUserPointer data;
2066   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2067     sq_throwerror(vm, _SC("'get_action' called without instance"));
2068     return SQ_ERROR;
2069   }
2070   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
2071
2072   try {
2073     std::string return_value = _this->get_action();
2074
2075     sq_pushstring(vm, return_value.c_str(), return_value.size());
2076     return 1;
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 'get_action'"));
2083     return SQ_ERROR;
2084   }
2085
2086 }
2087
2088 static SQInteger FloatingImage_fade_in_wrapper(HSQUIRRELVM vm)
2089 {
2090   SQUserPointer data;
2091   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2092     sq_throwerror(vm, _SC("'fade_in' called without instance"));
2093     return SQ_ERROR;
2094   }
2095   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
2096   SQFloat arg0;
2097   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2098     sq_throwerror(vm, _SC("Argument 1 not a float"));
2099     return SQ_ERROR;
2100   }
2101
2102   try {
2103     _this->fade_in(static_cast<float> (arg0));
2104
2105     return 0;
2106
2107   } catch(std::exception& e) {
2108     sq_throwerror(vm, e.what());
2109     return SQ_ERROR;
2110   } catch(...) {
2111     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
2112     return SQ_ERROR;
2113   }
2114
2115 }
2116
2117 static SQInteger FloatingImage_fade_out_wrapper(HSQUIRRELVM vm)
2118 {
2119   SQUserPointer data;
2120   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2121     sq_throwerror(vm, _SC("'fade_out' called without instance"));
2122     return SQ_ERROR;
2123   }
2124   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
2125   SQFloat arg0;
2126   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2127     sq_throwerror(vm, _SC("Argument 1 not a float"));
2128     return SQ_ERROR;
2129   }
2130
2131   try {
2132     _this->fade_out(static_cast<float> (arg0));
2133
2134     return 0;
2135
2136   } catch(std::exception& e) {
2137     sq_throwerror(vm, e.what());
2138     return SQ_ERROR;
2139   } catch(...) {
2140     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
2141     return SQ_ERROR;
2142   }
2143
2144 }
2145
2146 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
2147 {
2148   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (ptr);
2149   delete _this;
2150   return 0;
2151 }
2152
2153 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
2154 {
2155   SQUserPointer data;
2156   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2157     sq_throwerror(vm, _SC("'goto_node' called without instance"));
2158     return SQ_ERROR;
2159   }
2160   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
2161   SQInteger arg0;
2162   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2163     sq_throwerror(vm, _SC("Argument 1 not an integer"));
2164     return SQ_ERROR;
2165   }
2166
2167   try {
2168     _this->goto_node(static_cast<int> (arg0));
2169
2170     return 0;
2171
2172   } catch(std::exception& e) {
2173     sq_throwerror(vm, e.what());
2174     return SQ_ERROR;
2175   } catch(...) {
2176     sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2177     return SQ_ERROR;
2178   }
2179
2180 }
2181
2182 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
2183 {
2184   SQUserPointer data;
2185   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2186     sq_throwerror(vm, _SC("'start_moving' called without instance"));
2187     return SQ_ERROR;
2188   }
2189   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
2190
2191   try {
2192     _this->start_moving();
2193
2194     return 0;
2195
2196   } catch(std::exception& e) {
2197     sq_throwerror(vm, e.what());
2198     return SQ_ERROR;
2199   } catch(...) {
2200     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
2201     return SQ_ERROR;
2202   }
2203
2204 }
2205
2206 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
2207 {
2208   SQUserPointer data;
2209   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2210     sq_throwerror(vm, _SC("'stop_moving' called without instance"));
2211     return SQ_ERROR;
2212   }
2213   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
2214
2215   try {
2216     _this->stop_moving();
2217
2218     return 0;
2219
2220   } catch(std::exception& e) {
2221     sq_throwerror(vm, e.what());
2222     return SQ_ERROR;
2223   } catch(...) {
2224     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
2225     return SQ_ERROR;
2226   }
2227
2228 }
2229
2230 static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger )
2231 {
2232   Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (ptr);
2233   delete _this;
2234   return 0;
2235 }
2236
2237 static SQInteger Candle_get_burning_wrapper(HSQUIRRELVM vm)
2238 {
2239   SQUserPointer data;
2240   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2241     sq_throwerror(vm, _SC("'get_burning' called without instance"));
2242     return SQ_ERROR;
2243   }
2244   Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
2245
2246   try {
2247     bool return_value = _this->get_burning();
2248
2249     sq_pushbool(vm, return_value);
2250     return 1;
2251
2252   } catch(std::exception& e) {
2253     sq_throwerror(vm, e.what());
2254     return SQ_ERROR;
2255   } catch(...) {
2256     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_burning'"));
2257     return SQ_ERROR;
2258   }
2259
2260 }
2261
2262 static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm)
2263 {
2264   SQUserPointer data;
2265   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2266     sq_throwerror(vm, _SC("'set_burning' called without instance"));
2267     return SQ_ERROR;
2268   }
2269   Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
2270   SQBool arg0;
2271   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2272     sq_throwerror(vm, _SC("Argument 1 not a bool"));
2273     return SQ_ERROR;
2274   }
2275
2276   try {
2277     _this->set_burning(arg0 == SQTrue);
2278
2279     return 0;
2280
2281   } catch(std::exception& e) {
2282     sq_throwerror(vm, e.what());
2283     return SQ_ERROR;
2284   } catch(...) {
2285     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_burning'"));
2286     return SQ_ERROR;
2287   }
2288
2289 }
2290
2291 static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger )
2292 {
2293   Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (ptr);
2294   delete _this;
2295   return 0;
2296 }
2297
2298 static SQInteger Wind_start_wrapper(HSQUIRRELVM vm)
2299 {
2300   SQUserPointer data;
2301   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2302     sq_throwerror(vm, _SC("'start' called without instance"));
2303     return SQ_ERROR;
2304   }
2305   Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
2306
2307   try {
2308     _this->start();
2309
2310     return 0;
2311
2312   } catch(std::exception& e) {
2313     sq_throwerror(vm, e.what());
2314     return SQ_ERROR;
2315   } catch(...) {
2316     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2317     return SQ_ERROR;
2318   }
2319
2320 }
2321
2322 static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm)
2323 {
2324   SQUserPointer data;
2325   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2326     sq_throwerror(vm, _SC("'stop' called without instance"));
2327     return SQ_ERROR;
2328   }
2329   Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
2330
2331   try {
2332     _this->stop();
2333
2334     return 0;
2335
2336   } catch(std::exception& e) {
2337     sq_throwerror(vm, e.what());
2338     return SQ_ERROR;
2339   } catch(...) {
2340     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2341     return SQ_ERROR;
2342   }
2343
2344 }
2345
2346 static SQInteger AmbientSound_release_hook(SQUserPointer ptr, SQInteger )
2347 {
2348   Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (ptr);
2349   delete _this;
2350   return 0;
2351 }
2352
2353 static SQInteger AmbientSound_set_pos_wrapper(HSQUIRRELVM vm)
2354 {
2355   SQUserPointer data;
2356   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2357     sq_throwerror(vm, _SC("'set_pos' called without instance"));
2358     return SQ_ERROR;
2359   }
2360   Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2361   SQFloat arg0;
2362   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2363     sq_throwerror(vm, _SC("Argument 1 not a float"));
2364     return SQ_ERROR;
2365   }
2366   SQFloat arg1;
2367   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2368     sq_throwerror(vm, _SC("Argument 2 not a float"));
2369     return SQ_ERROR;
2370   }
2371
2372   try {
2373     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
2374
2375     return 0;
2376
2377   } catch(std::exception& e) {
2378     sq_throwerror(vm, e.what());
2379     return SQ_ERROR;
2380   } catch(...) {
2381     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
2382     return SQ_ERROR;
2383   }
2384
2385 }
2386
2387 static SQInteger AmbientSound_get_pos_x_wrapper(HSQUIRRELVM vm)
2388 {
2389   SQUserPointer data;
2390   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2391     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
2392     return SQ_ERROR;
2393   }
2394   Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2395
2396   try {
2397     float return_value = _this->get_pos_x();
2398
2399     sq_pushfloat(vm, return_value);
2400     return 1;
2401
2402   } catch(std::exception& e) {
2403     sq_throwerror(vm, e.what());
2404     return SQ_ERROR;
2405   } catch(...) {
2406     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
2407     return SQ_ERROR;
2408   }
2409
2410 }
2411
2412 static SQInteger AmbientSound_get_pos_y_wrapper(HSQUIRRELVM vm)
2413 {
2414   SQUserPointer data;
2415   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2416     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
2417     return SQ_ERROR;
2418   }
2419   Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2420
2421   try {
2422     float return_value = _this->get_pos_y();
2423
2424     sq_pushfloat(vm, return_value);
2425     return 1;
2426
2427   } catch(std::exception& e) {
2428     sq_throwerror(vm, e.what());
2429     return SQ_ERROR;
2430   } catch(...) {
2431     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
2432     return SQ_ERROR;
2433   }
2434
2435 }
2436
2437 static SQInteger Thunderstorm_release_hook(SQUserPointer ptr, SQInteger )
2438 {
2439   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (ptr);
2440   delete _this;
2441   return 0;
2442 }
2443
2444 static SQInteger Thunderstorm_start_wrapper(HSQUIRRELVM vm)
2445 {
2446   SQUserPointer data;
2447   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2448     sq_throwerror(vm, _SC("'start' called without instance"));
2449     return SQ_ERROR;
2450   }
2451   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2452
2453   try {
2454     _this->start();
2455
2456     return 0;
2457
2458   } catch(std::exception& e) {
2459     sq_throwerror(vm, e.what());
2460     return SQ_ERROR;
2461   } catch(...) {
2462     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2463     return SQ_ERROR;
2464   }
2465
2466 }
2467
2468 static SQInteger Thunderstorm_stop_wrapper(HSQUIRRELVM vm)
2469 {
2470   SQUserPointer data;
2471   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2472     sq_throwerror(vm, _SC("'stop' called without instance"));
2473     return SQ_ERROR;
2474   }
2475   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2476
2477   try {
2478     _this->stop();
2479
2480     return 0;
2481
2482   } catch(std::exception& e) {
2483     sq_throwerror(vm, e.what());
2484     return SQ_ERROR;
2485   } catch(...) {
2486     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2487     return SQ_ERROR;
2488   }
2489
2490 }
2491
2492 static SQInteger Thunderstorm_thunder_wrapper(HSQUIRRELVM vm)
2493 {
2494   SQUserPointer data;
2495   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2496     sq_throwerror(vm, _SC("'thunder' called without instance"));
2497     return SQ_ERROR;
2498   }
2499   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2500
2501   try {
2502     _this->thunder();
2503
2504     return 0;
2505
2506   } catch(std::exception& e) {
2507     sq_throwerror(vm, e.what());
2508     return SQ_ERROR;
2509   } catch(...) {
2510     sq_throwerror(vm, _SC("Unexpected exception while executing function 'thunder'"));
2511     return SQ_ERROR;
2512   }
2513
2514 }
2515
2516 static SQInteger Thunderstorm_lightning_wrapper(HSQUIRRELVM vm)
2517 {
2518   SQUserPointer data;
2519   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2520     sq_throwerror(vm, _SC("'lightning' called without instance"));
2521     return SQ_ERROR;
2522   }
2523   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2524
2525   try {
2526     _this->lightning();
2527
2528     return 0;
2529
2530   } catch(std::exception& e) {
2531     sq_throwerror(vm, e.what());
2532     return SQ_ERROR;
2533   } catch(...) {
2534     sq_throwerror(vm, _SC("Unexpected exception while executing function 'lightning'"));
2535     return SQ_ERROR;
2536   }
2537
2538 }
2539
2540 static SQInteger Thunderstorm_flash_wrapper(HSQUIRRELVM vm)
2541 {
2542   SQUserPointer data;
2543   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2544     sq_throwerror(vm, _SC("'flash' called without instance"));
2545     return SQ_ERROR;
2546   }
2547   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2548
2549   try {
2550     _this->flash();
2551
2552     return 0;
2553
2554   } catch(std::exception& e) {
2555     sq_throwerror(vm, e.what());
2556     return SQ_ERROR;
2557   } catch(...) {
2558     sq_throwerror(vm, _SC("Unexpected exception while executing function 'flash'"));
2559     return SQ_ERROR;
2560   }
2561
2562 }
2563
2564 static SQInteger Thunderstorm_electrify_wrapper(HSQUIRRELVM vm)
2565 {
2566   SQUserPointer data;
2567   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2568     sq_throwerror(vm, _SC("'electrify' called without instance"));
2569     return SQ_ERROR;
2570   }
2571   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2572
2573   try {
2574     _this->electrify();
2575
2576     return 0;
2577
2578   } catch(std::exception& e) {
2579     sq_throwerror(vm, e.what());
2580     return SQ_ERROR;
2581   } catch(...) {
2582     sq_throwerror(vm, _SC("Unexpected exception while executing function 'electrify'"));
2583     return SQ_ERROR;
2584   }
2585
2586 }
2587
2588 static SQInteger TileMap_release_hook(SQUserPointer ptr, SQInteger )
2589 {
2590   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (ptr);
2591   delete _this;
2592   return 0;
2593 }
2594
2595 static SQInteger TileMap_goto_node_wrapper(HSQUIRRELVM vm)
2596 {
2597   SQUserPointer data;
2598   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2599     sq_throwerror(vm, _SC("'goto_node' called without instance"));
2600     return SQ_ERROR;
2601   }
2602   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2603   SQInteger arg0;
2604   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2605     sq_throwerror(vm, _SC("Argument 1 not an integer"));
2606     return SQ_ERROR;
2607   }
2608
2609   try {
2610     _this->goto_node(static_cast<int> (arg0));
2611
2612     return 0;
2613
2614   } catch(std::exception& e) {
2615     sq_throwerror(vm, e.what());
2616     return SQ_ERROR;
2617   } catch(...) {
2618     sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2619     return SQ_ERROR;
2620   }
2621
2622 }
2623
2624 static SQInteger TileMap_start_moving_wrapper(HSQUIRRELVM vm)
2625 {
2626   SQUserPointer data;
2627   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2628     sq_throwerror(vm, _SC("'start_moving' called without instance"));
2629     return SQ_ERROR;
2630   }
2631   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2632
2633   try {
2634     _this->start_moving();
2635
2636     return 0;
2637
2638   } catch(std::exception& e) {
2639     sq_throwerror(vm, e.what());
2640     return SQ_ERROR;
2641   } catch(...) {
2642     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
2643     return SQ_ERROR;
2644   }
2645
2646 }
2647
2648 static SQInteger TileMap_stop_moving_wrapper(HSQUIRRELVM vm)
2649 {
2650   SQUserPointer data;
2651   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2652     sq_throwerror(vm, _SC("'stop_moving' called without instance"));
2653     return SQ_ERROR;
2654   }
2655   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2656
2657   try {
2658     _this->stop_moving();
2659
2660     return 0;
2661
2662   } catch(std::exception& e) {
2663     sq_throwerror(vm, e.what());
2664     return SQ_ERROR;
2665   } catch(...) {
2666     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
2667     return SQ_ERROR;
2668   }
2669
2670 }
2671
2672 static SQInteger TileMap_fade_wrapper(HSQUIRRELVM vm)
2673 {
2674   SQUserPointer data;
2675   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2676     sq_throwerror(vm, _SC("'fade' called without instance"));
2677     return SQ_ERROR;
2678   }
2679   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2680   SQFloat arg0;
2681   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2682     sq_throwerror(vm, _SC("Argument 1 not a float"));
2683     return SQ_ERROR;
2684   }
2685   SQFloat arg1;
2686   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2687     sq_throwerror(vm, _SC("Argument 2 not a float"));
2688     return SQ_ERROR;
2689   }
2690
2691   try {
2692     _this->fade(static_cast<float> (arg0), static_cast<float> (arg1));
2693
2694     return 0;
2695
2696   } catch(std::exception& e) {
2697     sq_throwerror(vm, e.what());
2698     return SQ_ERROR;
2699   } catch(...) {
2700     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade'"));
2701     return SQ_ERROR;
2702   }
2703
2704 }
2705
2706 static SQInteger TileMap_set_alpha_wrapper(HSQUIRRELVM vm)
2707 {
2708   SQUserPointer data;
2709   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2710     sq_throwerror(vm, _SC("'set_alpha' called without instance"));
2711     return SQ_ERROR;
2712   }
2713   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2714   SQFloat arg0;
2715   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2716     sq_throwerror(vm, _SC("Argument 1 not a float"));
2717     return SQ_ERROR;
2718   }
2719
2720   try {
2721     _this->set_alpha(static_cast<float> (arg0));
2722
2723     return 0;
2724
2725   } catch(std::exception& e) {
2726     sq_throwerror(vm, e.what());
2727     return SQ_ERROR;
2728   } catch(...) {
2729     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_alpha'"));
2730     return SQ_ERROR;
2731   }
2732
2733 }
2734
2735 static SQInteger TileMap_get_alpha_wrapper(HSQUIRRELVM vm)
2736 {
2737   SQUserPointer data;
2738   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2739     sq_throwerror(vm, _SC("'get_alpha' called without instance"));
2740     return SQ_ERROR;
2741   }
2742   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2743
2744   try {
2745     float return_value = _this->get_alpha();
2746
2747     sq_pushfloat(vm, return_value);
2748     return 1;
2749
2750   } catch(std::exception& e) {
2751     sq_throwerror(vm, e.what());
2752     return SQ_ERROR;
2753   } catch(...) {
2754     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_alpha'"));
2755     return SQ_ERROR;
2756   }
2757
2758 }
2759
2760 static SQInteger SSector_release_hook(SQUserPointer ptr, SQInteger )
2761 {
2762   Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (ptr);
2763   delete _this;
2764   return 0;
2765 }
2766
2767 static SQInteger SSector_set_ambient_light_wrapper(HSQUIRRELVM vm)
2768 {
2769   SQUserPointer data;
2770   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2771     sq_throwerror(vm, _SC("'set_ambient_light' called without instance"));
2772     return SQ_ERROR;
2773   }
2774   Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2775   SQFloat arg0;
2776   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2777     sq_throwerror(vm, _SC("Argument 1 not a float"));
2778     return SQ_ERROR;
2779   }
2780   SQFloat arg1;
2781   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2782     sq_throwerror(vm, _SC("Argument 2 not a float"));
2783     return SQ_ERROR;
2784   }
2785   SQFloat arg2;
2786   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2787     sq_throwerror(vm, _SC("Argument 3 not a float"));
2788     return SQ_ERROR;
2789   }
2790
2791   try {
2792     _this->set_ambient_light(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2793
2794     return 0;
2795
2796   } catch(std::exception& e) {
2797     sq_throwerror(vm, e.what());
2798     return SQ_ERROR;
2799   } catch(...) {
2800     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ambient_light'"));
2801     return SQ_ERROR;
2802   }
2803
2804 }
2805
2806 static SQInteger SSector_get_ambient_red_wrapper(HSQUIRRELVM vm)
2807 {
2808   SQUserPointer data;
2809   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2810     sq_throwerror(vm, _SC("'get_ambient_red' called without instance"));
2811     return SQ_ERROR;
2812   }
2813   Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2814
2815   try {
2816     float return_value = _this->get_ambient_red();
2817
2818     sq_pushfloat(vm, return_value);
2819     return 1;
2820
2821   } catch(std::exception& e) {
2822     sq_throwerror(vm, e.what());
2823     return SQ_ERROR;
2824   } catch(...) {
2825     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_red'"));
2826     return SQ_ERROR;
2827   }
2828
2829 }
2830
2831 static SQInteger SSector_get_ambient_green_wrapper(HSQUIRRELVM vm)
2832 {
2833   SQUserPointer data;
2834   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2835     sq_throwerror(vm, _SC("'get_ambient_green' called without instance"));
2836     return SQ_ERROR;
2837   }
2838   Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2839
2840   try {
2841     float return_value = _this->get_ambient_green();
2842
2843     sq_pushfloat(vm, return_value);
2844     return 1;
2845
2846   } catch(std::exception& e) {
2847     sq_throwerror(vm, e.what());
2848     return SQ_ERROR;
2849   } catch(...) {
2850     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_green'"));
2851     return SQ_ERROR;
2852   }
2853
2854 }
2855
2856 static SQInteger SSector_get_ambient_blue_wrapper(HSQUIRRELVM vm)
2857 {
2858   SQUserPointer data;
2859   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2860     sq_throwerror(vm, _SC("'get_ambient_blue' called without instance"));
2861     return SQ_ERROR;
2862   }
2863   Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2864
2865   try {
2866     float return_value = _this->get_ambient_blue();
2867
2868     sq_pushfloat(vm, return_value);
2869     return 1;
2870
2871   } catch(std::exception& e) {
2872     sq_throwerror(vm, e.what());
2873     return SQ_ERROR;
2874   } catch(...) {
2875     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_blue'"));
2876     return SQ_ERROR;
2877   }
2878
2879 }
2880
2881 static SQInteger SSector_set_gravity_wrapper(HSQUIRRELVM vm)
2882 {
2883   SQUserPointer data;
2884   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2885     sq_throwerror(vm, _SC("'set_gravity' called without instance"));
2886     return SQ_ERROR;
2887   }
2888   Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2889   SQFloat arg0;
2890   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2891     sq_throwerror(vm, _SC("Argument 1 not a float"));
2892     return SQ_ERROR;
2893   }
2894
2895   try {
2896     _this->set_gravity(static_cast<float> (arg0));
2897
2898     return 0;
2899
2900   } catch(std::exception& e) {
2901     sq_throwerror(vm, e.what());
2902     return SQ_ERROR;
2903   } catch(...) {
2904     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_gravity'"));
2905     return SQ_ERROR;
2906   }
2907
2908 }
2909
2910 static SQInteger LevelTime_release_hook(SQUserPointer ptr, SQInteger )
2911 {
2912   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (ptr);
2913   delete _this;
2914   return 0;
2915 }
2916
2917 static SQInteger LevelTime_start_wrapper(HSQUIRRELVM vm)
2918 {
2919   SQUserPointer data;
2920   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2921     sq_throwerror(vm, _SC("'start' called without instance"));
2922     return SQ_ERROR;
2923   }
2924   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2925
2926   try {
2927     _this->start();
2928
2929     return 0;
2930
2931   } catch(std::exception& e) {
2932     sq_throwerror(vm, e.what());
2933     return SQ_ERROR;
2934   } catch(...) {
2935     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2936     return SQ_ERROR;
2937   }
2938
2939 }
2940
2941 static SQInteger LevelTime_stop_wrapper(HSQUIRRELVM vm)
2942 {
2943   SQUserPointer data;
2944   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2945     sq_throwerror(vm, _SC("'stop' called without instance"));
2946     return SQ_ERROR;
2947   }
2948   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2949
2950   try {
2951     _this->stop();
2952
2953     return 0;
2954
2955   } catch(std::exception& e) {
2956     sq_throwerror(vm, e.what());
2957     return SQ_ERROR;
2958   } catch(...) {
2959     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2960     return SQ_ERROR;
2961   }
2962
2963 }
2964
2965 static SQInteger LevelTime_get_time_wrapper(HSQUIRRELVM vm)
2966 {
2967   SQUserPointer data;
2968   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2969     sq_throwerror(vm, _SC("'get_time' called without instance"));
2970     return SQ_ERROR;
2971   }
2972   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2973
2974   try {
2975     float return_value = _this->get_time();
2976
2977     sq_pushfloat(vm, return_value);
2978     return 1;
2979
2980   } catch(std::exception& e) {
2981     sq_throwerror(vm, e.what());
2982     return SQ_ERROR;
2983   } catch(...) {
2984     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_time'"));
2985     return SQ_ERROR;
2986   }
2987
2988 }
2989
2990 static SQInteger LevelTime_set_time_wrapper(HSQUIRRELVM vm)
2991 {
2992   SQUserPointer data;
2993   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2994     sq_throwerror(vm, _SC("'set_time' called without instance"));
2995     return SQ_ERROR;
2996   }
2997   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2998   SQFloat arg0;
2999   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3000     sq_throwerror(vm, _SC("Argument 1 not a float"));
3001     return SQ_ERROR;
3002   }
3003
3004   try {
3005     _this->set_time(static_cast<float> (arg0));
3006
3007     return 0;
3008
3009   } catch(std::exception& e) {
3010     sq_throwerror(vm, e.what());
3011     return SQ_ERROR;
3012   } catch(...) {
3013     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_time'"));
3014     return SQ_ERROR;
3015   }
3016
3017 }
3018
3019 static SQInteger WillOWisp_release_hook(SQUserPointer ptr, SQInteger )
3020 {
3021   Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (ptr);
3022   delete _this;
3023   return 0;
3024 }
3025
3026 static SQInteger WillOWisp_goto_node_wrapper(HSQUIRRELVM vm)
3027 {
3028   SQUserPointer data;
3029   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
3030     sq_throwerror(vm, _SC("'goto_node' called without instance"));
3031     return SQ_ERROR;
3032   }
3033   Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
3034   SQInteger arg0;
3035   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
3036     sq_throwerror(vm, _SC("Argument 1 not an integer"));
3037     return SQ_ERROR;
3038   }
3039
3040   try {
3041     _this->goto_node(static_cast<int> (arg0));
3042
3043     return 0;
3044
3045   } catch(std::exception& e) {
3046     sq_throwerror(vm, e.what());
3047     return SQ_ERROR;
3048   } catch(...) {
3049     sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
3050     return SQ_ERROR;
3051   }
3052
3053 }
3054
3055 static SQInteger WillOWisp_set_state_wrapper(HSQUIRRELVM vm)
3056 {
3057   SQUserPointer data;
3058   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
3059     sq_throwerror(vm, _SC("'set_state' called without instance"));
3060     return SQ_ERROR;
3061   }
3062   Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
3063   const SQChar* arg0;
3064   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3065     sq_throwerror(vm, _SC("Argument 1 not a string"));
3066     return SQ_ERROR;
3067   }
3068
3069   try {
3070     _this->set_state(arg0);
3071
3072     return 0;
3073
3074   } catch(std::exception& e) {
3075     sq_throwerror(vm, e.what());
3076     return SQ_ERROR;
3077   } catch(...) {
3078     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_state'"));
3079     return SQ_ERROR;
3080   }
3081
3082 }
3083
3084 static SQInteger WillOWisp_start_moving_wrapper(HSQUIRRELVM vm)
3085 {
3086   SQUserPointer data;
3087   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
3088     sq_throwerror(vm, _SC("'start_moving' called without instance"));
3089     return SQ_ERROR;
3090   }
3091   Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
3092
3093   try {
3094     _this->start_moving();
3095
3096     return 0;
3097
3098   } catch(std::exception& e) {
3099     sq_throwerror(vm, e.what());
3100     return SQ_ERROR;
3101   } catch(...) {
3102     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
3103     return SQ_ERROR;
3104   }
3105
3106 }
3107
3108 static SQInteger WillOWisp_stop_moving_wrapper(HSQUIRRELVM vm)
3109 {
3110   SQUserPointer data;
3111   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
3112     sq_throwerror(vm, _SC("'stop_moving' called without instance"));
3113     return SQ_ERROR;
3114   }
3115   Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
3116
3117   try {
3118     _this->stop_moving();
3119
3120     return 0;
3121
3122   } catch(std::exception& e) {
3123     sq_throwerror(vm, e.what());
3124     return SQ_ERROR;
3125   } catch(...) {
3126     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
3127     return SQ_ERROR;
3128   }
3129
3130 }
3131
3132 static SQInteger display_wrapper(HSQUIRRELVM vm)
3133 {
3134   return Scripting::display(vm);
3135 }
3136
3137 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
3138 {
3139   HSQUIRRELVM arg0 = vm;
3140
3141   try {
3142     Scripting::print_stacktrace(arg0);
3143
3144     return 0;
3145
3146   } catch(std::exception& e) {
3147     sq_throwerror(vm, e.what());
3148     return SQ_ERROR;
3149   } catch(...) {
3150     sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
3151     return SQ_ERROR;
3152   }
3153
3154 }
3155
3156 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
3157 {
3158   return Scripting::get_current_thread(vm);
3159 }
3160
3161 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
3162 {
3163   const SQChar* arg0;
3164   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3165     sq_throwerror(vm, _SC("Argument 1 not a string"));
3166     return SQ_ERROR;
3167   }
3168
3169   try {
3170     Scripting::display_text_file(arg0);
3171
3172     return 0;
3173
3174   } catch(std::exception& e) {
3175     sq_throwerror(vm, e.what());
3176     return SQ_ERROR;
3177   } catch(...) {
3178     sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
3179     return SQ_ERROR;
3180   }
3181
3182 }
3183
3184 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
3185 {
3186   const SQChar* arg0;
3187   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3188     sq_throwerror(vm, _SC("Argument 1 not a string"));
3189     return SQ_ERROR;
3190   }
3191
3192   try {
3193     Scripting::load_worldmap(arg0);
3194
3195     return 0;
3196
3197   } catch(std::exception& e) {
3198     sq_throwerror(vm, e.what());
3199     return SQ_ERROR;
3200   } catch(...) {
3201     sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
3202     return SQ_ERROR;
3203   }
3204
3205 }
3206
3207 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
3208 {
3209   const SQChar* arg0;
3210   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3211     sq_throwerror(vm, _SC("Argument 1 not a string"));
3212     return SQ_ERROR;
3213   }
3214
3215   try {
3216     Scripting::load_level(arg0);
3217
3218     return 0;
3219
3220   } catch(std::exception& e) {
3221     sq_throwerror(vm, e.what());
3222     return SQ_ERROR;
3223   } catch(...) {
3224     sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
3225     return SQ_ERROR;
3226   }
3227
3228 }
3229
3230 static SQInteger wait_wrapper(HSQUIRRELVM vm)
3231 {
3232   HSQUIRRELVM arg0 = vm;
3233   SQFloat arg1;
3234   if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
3235     sq_throwerror(vm, _SC("Argument 1 not a float"));
3236     return SQ_ERROR;
3237   }
3238
3239   try {
3240     Scripting::wait(arg0, static_cast<float> (arg1));
3241
3242     return sq_suspendvm(vm);
3243
3244   } catch(std::exception& e) {
3245     sq_throwerror(vm, e.what());
3246     return SQ_ERROR;
3247   } catch(...) {
3248     sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
3249     return SQ_ERROR;
3250   }
3251
3252 }
3253
3254 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
3255 {
3256   HSQUIRRELVM arg0 = vm;
3257
3258   try {
3259     Scripting::wait_for_screenswitch(arg0);
3260
3261     return sq_suspendvm(vm);
3262
3263   } catch(std::exception& e) {
3264     sq_throwerror(vm, e.what());
3265     return SQ_ERROR;
3266   } catch(...) {
3267     sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
3268     return SQ_ERROR;
3269   }
3270
3271 }
3272
3273 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
3274 {
3275   (void) vm;
3276
3277   try {
3278     Scripting::exit_screen();
3279
3280     return 0;
3281
3282   } catch(std::exception& e) {
3283     sq_throwerror(vm, e.what());
3284     return SQ_ERROR;
3285   } catch(...) {
3286     sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
3287     return SQ_ERROR;
3288   }
3289
3290 }
3291
3292 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
3293 {
3294   SQFloat arg0;
3295   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3296     sq_throwerror(vm, _SC("Argument 1 not a float"));
3297     return SQ_ERROR;
3298   }
3299
3300   try {
3301     Scripting::fadeout_screen(static_cast<float> (arg0));
3302
3303     return 0;
3304
3305   } catch(std::exception& e) {
3306     sq_throwerror(vm, e.what());
3307     return SQ_ERROR;
3308   } catch(...) {
3309     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
3310     return SQ_ERROR;
3311   }
3312
3313 }
3314
3315 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
3316 {
3317   SQFloat arg0;
3318   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3319     sq_throwerror(vm, _SC("Argument 1 not a float"));
3320     return SQ_ERROR;
3321   }
3322   SQFloat arg1;
3323   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
3324     sq_throwerror(vm, _SC("Argument 2 not a float"));
3325     return SQ_ERROR;
3326   }
3327   SQFloat arg2;
3328   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
3329     sq_throwerror(vm, _SC("Argument 3 not a float"));
3330     return SQ_ERROR;
3331   }
3332
3333   try {
3334     Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
3335
3336     return 0;
3337
3338   } catch(std::exception& e) {
3339     sq_throwerror(vm, e.what());
3340     return SQ_ERROR;
3341   } catch(...) {
3342     sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
3343     return SQ_ERROR;
3344   }
3345
3346 }
3347
3348 static SQInteger abort_screenfade_wrapper(HSQUIRRELVM vm)
3349 {
3350   (void) vm;
3351
3352   try {
3353     Scripting::abort_screenfade();
3354
3355     return 0;
3356
3357   } catch(std::exception& e) {
3358     sq_throwerror(vm, e.what());
3359     return SQ_ERROR;
3360   } catch(...) {
3361     sq_throwerror(vm, _SC("Unexpected exception while executing function 'abort_screenfade'"));
3362     return SQ_ERROR;
3363   }
3364
3365 }
3366
3367 static SQInteger translate_wrapper(HSQUIRRELVM vm)
3368 {
3369   const SQChar* arg0;
3370   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3371     sq_throwerror(vm, _SC("Argument 1 not a string"));
3372     return SQ_ERROR;
3373   }
3374
3375   try {
3376     std::string return_value = Scripting::translate(arg0);
3377
3378     sq_pushstring(vm, return_value.c_str(), return_value.size());
3379     return 1;
3380
3381   } catch(std::exception& e) {
3382     sq_throwerror(vm, e.what());
3383     return SQ_ERROR;
3384   } catch(...) {
3385     sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
3386     return SQ_ERROR;
3387   }
3388
3389 }
3390
3391 static SQInteger import_wrapper(HSQUIRRELVM vm)
3392 {
3393   HSQUIRRELVM arg0 = vm;
3394   const SQChar* arg1;
3395   if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
3396     sq_throwerror(vm, _SC("Argument 1 not a string"));
3397     return SQ_ERROR;
3398   }
3399
3400   try {
3401     Scripting::import(arg0, arg1);
3402
3403     return 0;
3404
3405   } catch(std::exception& e) {
3406     sq_throwerror(vm, e.what());
3407     return SQ_ERROR;
3408   } catch(...) {
3409     sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
3410     return SQ_ERROR;
3411   }
3412
3413 }
3414
3415 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
3416 {
3417   (void) vm;
3418
3419   try {
3420     Scripting::save_state();
3421
3422     return 0;
3423
3424   } catch(std::exception& e) {
3425     sq_throwerror(vm, e.what());
3426     return SQ_ERROR;
3427   } catch(...) {
3428     sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
3429     return SQ_ERROR;
3430   }
3431
3432 }
3433
3434 static SQInteger update_worldmap_wrapper(HSQUIRRELVM vm)
3435 {
3436   (void) vm;
3437
3438   try {
3439     Scripting::update_worldmap();
3440
3441     return 0;
3442
3443   } catch(std::exception& e) {
3444     sq_throwerror(vm, e.what());
3445     return SQ_ERROR;
3446   } catch(...) {
3447     sq_throwerror(vm, _SC("Unexpected exception while executing function 'update_worldmap'"));
3448     return SQ_ERROR;
3449   }
3450
3451 }
3452
3453 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
3454 {
3455   SQBool arg0;
3456   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3457     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3458     return SQ_ERROR;
3459   }
3460
3461   try {
3462     Scripting::debug_collrects(arg0 == SQTrue);
3463
3464     return 0;
3465
3466   } catch(std::exception& e) {
3467     sq_throwerror(vm, e.what());
3468     return SQ_ERROR;
3469   } catch(...) {
3470     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
3471     return SQ_ERROR;
3472   }
3473
3474 }
3475
3476 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
3477 {
3478   SQBool arg0;
3479   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3480     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3481     return SQ_ERROR;
3482   }
3483
3484   try {
3485     Scripting::debug_show_fps(arg0 == SQTrue);
3486
3487     return 0;
3488
3489   } catch(std::exception& e) {
3490     sq_throwerror(vm, e.what());
3491     return SQ_ERROR;
3492   } catch(...) {
3493     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
3494     return SQ_ERROR;
3495   }
3496
3497 }
3498
3499 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
3500 {
3501   SQBool arg0;
3502   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3503     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3504     return SQ_ERROR;
3505   }
3506
3507   try {
3508     Scripting::debug_draw_solids_only(arg0 == SQTrue);
3509
3510     return 0;
3511
3512   } catch(std::exception& e) {
3513     sq_throwerror(vm, e.what());
3514     return SQ_ERROR;
3515   } catch(...) {
3516     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
3517     return SQ_ERROR;
3518   }
3519
3520 }
3521
3522 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
3523 {
3524   const SQChar* arg0;
3525   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3526     sq_throwerror(vm, _SC("Argument 1 not a string"));
3527     return SQ_ERROR;
3528   }
3529
3530   try {
3531     Scripting::play_music(arg0);
3532
3533     return 0;
3534
3535   } catch(std::exception& e) {
3536     sq_throwerror(vm, e.what());
3537     return SQ_ERROR;
3538   } catch(...) {
3539     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
3540     return SQ_ERROR;
3541   }
3542
3543 }
3544
3545 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
3546 {
3547   const SQChar* arg0;
3548   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3549     sq_throwerror(vm, _SC("Argument 1 not a string"));
3550     return SQ_ERROR;
3551   }
3552
3553   try {
3554     Scripting::play_sound(arg0);
3555
3556     return 0;
3557
3558   } catch(std::exception& e) {
3559     sq_throwerror(vm, e.what());
3560     return SQ_ERROR;
3561   } catch(...) {
3562     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
3563     return SQ_ERROR;
3564   }
3565
3566 }
3567
3568 static SQInteger set_game_speed_wrapper(HSQUIRRELVM vm)
3569 {
3570   SQFloat arg0;
3571   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3572     sq_throwerror(vm, _SC("Argument 1 not a float"));
3573     return SQ_ERROR;
3574   }
3575
3576   try {
3577     Scripting::set_game_speed(static_cast<float> (arg0));
3578
3579     return 0;
3580
3581   } catch(std::exception& e) {
3582     sq_throwerror(vm, e.what());
3583     return SQ_ERROR;
3584   } catch(...) {
3585     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_game_speed'"));
3586     return SQ_ERROR;
3587   }
3588
3589 }
3590
3591 static SQInteger grease_wrapper(HSQUIRRELVM vm)
3592 {
3593   (void) vm;
3594
3595   try {
3596     Scripting::grease();
3597
3598     return 0;
3599
3600   } catch(std::exception& e) {
3601     sq_throwerror(vm, e.what());
3602     return SQ_ERROR;
3603   } catch(...) {
3604     sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
3605     return SQ_ERROR;
3606   }
3607
3608 }
3609
3610 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
3611 {
3612   (void) vm;
3613
3614   try {
3615     Scripting::invincible();
3616
3617     return 0;
3618
3619   } catch(std::exception& e) {
3620     sq_throwerror(vm, e.what());
3621     return SQ_ERROR;
3622   } catch(...) {
3623     sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
3624     return SQ_ERROR;
3625   }
3626
3627 }
3628
3629 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
3630 {
3631   (void) vm;
3632
3633   try {
3634     Scripting::ghost();
3635
3636     return 0;
3637
3638   } catch(std::exception& e) {
3639     sq_throwerror(vm, e.what());
3640     return SQ_ERROR;
3641   } catch(...) {
3642     sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
3643     return SQ_ERROR;
3644   }
3645
3646 }
3647
3648 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
3649 {
3650   (void) vm;
3651
3652   try {
3653     Scripting::mortal();
3654
3655     return 0;
3656
3657   } catch(std::exception& e) {
3658     sq_throwerror(vm, e.what());
3659     return SQ_ERROR;
3660   } catch(...) {
3661     sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
3662     return SQ_ERROR;
3663   }
3664
3665 }
3666
3667 static SQInteger restart_wrapper(HSQUIRRELVM vm)
3668 {
3669   (void) vm;
3670
3671   try {
3672     Scripting::restart();
3673
3674     return 0;
3675
3676   } catch(std::exception& e) {
3677     sq_throwerror(vm, e.what());
3678     return SQ_ERROR;
3679   } catch(...) {
3680     sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
3681     return SQ_ERROR;
3682   }
3683
3684 }
3685
3686 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
3687 {
3688   (void) vm;
3689
3690   try {
3691     Scripting::whereami();
3692
3693     return 0;
3694
3695   } catch(std::exception& e) {
3696     sq_throwerror(vm, e.what());
3697     return SQ_ERROR;
3698   } catch(...) {
3699     sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
3700     return SQ_ERROR;
3701   }
3702
3703 }
3704
3705 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
3706 {
3707   (void) vm;
3708
3709   try {
3710     Scripting::gotoend();
3711
3712     return 0;
3713
3714   } catch(std::exception& e) {
3715     sq_throwerror(vm, e.what());
3716     return SQ_ERROR;
3717   } catch(...) {
3718     sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
3719     return SQ_ERROR;
3720   }
3721
3722 }
3723
3724 static SQInteger camera_wrapper(HSQUIRRELVM vm)
3725 {
3726   (void) vm;
3727
3728   try {
3729     Scripting::camera();
3730
3731     return 0;
3732
3733   } catch(std::exception& e) {
3734     sq_throwerror(vm, e.what());
3735     return SQ_ERROR;
3736   } catch(...) {
3737     sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
3738     return SQ_ERROR;
3739   }
3740
3741 }
3742
3743 static SQInteger set_gamma_wrapper(HSQUIRRELVM vm)
3744 {
3745   SQFloat arg0;
3746   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3747     sq_throwerror(vm, _SC("Argument 1 not a float"));
3748     return SQ_ERROR;
3749   }
3750
3751   try {
3752     Scripting::set_gamma(static_cast<float> (arg0));
3753
3754     return 0;
3755
3756   } catch(std::exception& e) {
3757     sq_throwerror(vm, e.what());
3758     return SQ_ERROR;
3759   } catch(...) {
3760     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_gamma'"));
3761     return SQ_ERROR;
3762   }
3763
3764 }
3765
3766 static SQInteger quit_wrapper(HSQUIRRELVM vm)
3767 {
3768   (void) vm;
3769
3770   try {
3771     Scripting::quit();
3772
3773     return 0;
3774
3775   } catch(std::exception& e) {
3776     sq_throwerror(vm, e.what());
3777     return SQ_ERROR;
3778   } catch(...) {
3779     sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
3780     return SQ_ERROR;
3781   }
3782
3783 }
3784
3785 static SQInteger rand_wrapper(HSQUIRRELVM vm)
3786 {
3787
3788   try {
3789     int return_value = Scripting::rand();
3790
3791     sq_pushinteger(vm, return_value);
3792     return 1;
3793
3794   } catch(std::exception& e) {
3795     sq_throwerror(vm, e.what());
3796     return SQ_ERROR;
3797   } catch(...) {
3798     sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
3799     return SQ_ERROR;
3800   }
3801
3802 }
3803
3804 } // end of namespace Wrapper
3805 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
3806 {
3807   using namespace Wrapper;
3808
3809   sq_pushroottable(v);
3810   sq_pushstring(v, "DisplayEffect", -1);
3811   if(SQ_FAILED(sq_get(v, -2))) {
3812     std::ostringstream msg;
3813     msg << "Couldn't resolved squirrel type 'DisplayEffect'";
3814     throw SquirrelError(v, msg.str());
3815   }
3816
3817   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3818     std::ostringstream msg;
3819     msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
3820     throw SquirrelError(v, msg.str());
3821   }
3822   sq_remove(v, -2); // remove object name
3823
3824   if(setup_releasehook) {
3825     sq_setreleasehook(v, -1, DisplayEffect_release_hook);
3826   }
3827
3828   sq_remove(v, -2); // remove root table
3829 }
3830
3831 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
3832 {
3833   using namespace Wrapper;
3834
3835   sq_pushroottable(v);
3836   sq_pushstring(v, "Camera", -1);
3837   if(SQ_FAILED(sq_get(v, -2))) {
3838     std::ostringstream msg;
3839     msg << "Couldn't resolved squirrel type 'Camera'";
3840     throw SquirrelError(v, msg.str());
3841   }
3842
3843   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3844     std::ostringstream msg;
3845     msg << "Couldn't setup squirrel instance for object of type 'Camera'";
3846     throw SquirrelError(v, msg.str());
3847   }
3848   sq_remove(v, -2); // remove object name
3849
3850   if(setup_releasehook) {
3851     sq_setreleasehook(v, -1, Camera_release_hook);
3852   }
3853
3854   sq_remove(v, -2); // remove root table
3855 }
3856
3857 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
3858 {
3859   using namespace Wrapper;
3860
3861   sq_pushroottable(v);
3862   sq_pushstring(v, "Level", -1);
3863   if(SQ_FAILED(sq_get(v, -2))) {
3864     std::ostringstream msg;
3865     msg << "Couldn't resolved squirrel type 'Level'";
3866     throw SquirrelError(v, msg.str());
3867   }
3868
3869   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3870     std::ostringstream msg;
3871     msg << "Couldn't setup squirrel instance for object of type 'Level'";
3872     throw SquirrelError(v, msg.str());
3873   }
3874   sq_remove(v, -2); // remove object name
3875
3876   if(setup_releasehook) {
3877     sq_setreleasehook(v, -1, Level_release_hook);
3878   }
3879
3880   sq_remove(v, -2); // remove root table
3881 }
3882
3883 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
3884 {
3885   using namespace Wrapper;
3886
3887   sq_pushroottable(v);
3888   sq_pushstring(v, "ScriptedObject", -1);
3889   if(SQ_FAILED(sq_get(v, -2))) {
3890     std::ostringstream msg;
3891     msg << "Couldn't resolved squirrel type 'ScriptedObject'";
3892     throw SquirrelError(v, msg.str());
3893   }
3894
3895   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3896     std::ostringstream msg;
3897     msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
3898     throw SquirrelError(v, msg.str());
3899   }
3900   sq_remove(v, -2); // remove object name
3901
3902   if(setup_releasehook) {
3903     sq_setreleasehook(v, -1, ScriptedObject_release_hook);
3904   }
3905
3906   sq_remove(v, -2); // remove root table
3907 }
3908
3909 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
3910 {
3911   using namespace Wrapper;
3912
3913   sq_pushroottable(v);
3914   sq_pushstring(v, "Text", -1);
3915   if(SQ_FAILED(sq_get(v, -2))) {
3916     std::ostringstream msg;
3917     msg << "Couldn't resolved squirrel type 'Text'";
3918     throw SquirrelError(v, msg.str());
3919   }
3920
3921   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3922     std::ostringstream msg;
3923     msg << "Couldn't setup squirrel instance for object of type 'Text'";
3924     throw SquirrelError(v, msg.str());
3925   }
3926   sq_remove(v, -2); // remove object name
3927
3928   if(setup_releasehook) {
3929     sq_setreleasehook(v, -1, Text_release_hook);
3930   }
3931
3932   sq_remove(v, -2); // remove root table
3933 }
3934
3935 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
3936 {
3937   using namespace Wrapper;
3938
3939   sq_pushroottable(v);
3940   sq_pushstring(v, "Player", -1);
3941   if(SQ_FAILED(sq_get(v, -2))) {
3942     std::ostringstream msg;
3943     msg << "Couldn't resolved squirrel type 'Player'";
3944     throw SquirrelError(v, msg.str());
3945   }
3946
3947   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3948     std::ostringstream msg;
3949     msg << "Couldn't setup squirrel instance for object of type 'Player'";
3950     throw SquirrelError(v, msg.str());
3951   }
3952   sq_remove(v, -2); // remove object name
3953
3954   if(setup_releasehook) {
3955     sq_setreleasehook(v, -1, Player_release_hook);
3956   }
3957
3958   sq_remove(v, -2); // remove root table
3959 }
3960
3961 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
3962 {
3963   using namespace Wrapper;
3964
3965   sq_pushroottable(v);
3966   sq_pushstring(v, "FloatingImage", -1);
3967   if(SQ_FAILED(sq_get(v, -2))) {
3968     std::ostringstream msg;
3969     msg << "Couldn't resolved squirrel type 'FloatingImage'";
3970     throw SquirrelError(v, msg.str());
3971   }
3972
3973   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3974     std::ostringstream msg;
3975     msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
3976     throw SquirrelError(v, msg.str());
3977   }
3978   sq_remove(v, -2); // remove object name
3979
3980   if(setup_releasehook) {
3981     sq_setreleasehook(v, -1, FloatingImage_release_hook);
3982   }
3983
3984   sq_remove(v, -2); // remove root table
3985 }
3986
3987 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
3988 {
3989   using namespace Wrapper;
3990
3991   sq_pushroottable(v);
3992   sq_pushstring(v, "Platform", -1);
3993   if(SQ_FAILED(sq_get(v, -2))) {
3994     std::ostringstream msg;
3995     msg << "Couldn't resolved squirrel type 'Platform'";
3996     throw SquirrelError(v, msg.str());
3997   }
3998
3999   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4000     std::ostringstream msg;
4001     msg << "Couldn't setup squirrel instance for object of type 'Platform'";
4002     throw SquirrelError(v, msg.str());
4003   }
4004   sq_remove(v, -2); // remove object name
4005
4006   if(setup_releasehook) {
4007     sq_setreleasehook(v, -1, Platform_release_hook);
4008   }
4009
4010   sq_remove(v, -2); // remove root table
4011 }
4012
4013 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook)
4014 {
4015   using namespace Wrapper;
4016
4017   sq_pushroottable(v);
4018   sq_pushstring(v, "Candle", -1);
4019   if(SQ_FAILED(sq_get(v, -2))) {
4020     std::ostringstream msg;
4021     msg << "Couldn't resolved squirrel type 'Candle'";
4022     throw SquirrelError(v, msg.str());
4023   }
4024
4025   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4026     std::ostringstream msg;
4027     msg << "Couldn't setup squirrel instance for object of type 'Candle'";
4028     throw SquirrelError(v, msg.str());
4029   }
4030   sq_remove(v, -2); // remove object name
4031
4032   if(setup_releasehook) {
4033     sq_setreleasehook(v, -1, Candle_release_hook);
4034   }
4035
4036   sq_remove(v, -2); // remove root table
4037 }
4038
4039 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup_releasehook)
4040 {
4041   using namespace Wrapper;
4042
4043   sq_pushroottable(v);
4044   sq_pushstring(v, "Wind", -1);
4045   if(SQ_FAILED(sq_get(v, -2))) {
4046     std::ostringstream msg;
4047     msg << "Couldn't resolved squirrel type 'Wind'";
4048     throw SquirrelError(v, msg.str());
4049   }
4050
4051   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4052     std::ostringstream msg;
4053     msg << "Couldn't setup squirrel instance for object of type 'Wind'";
4054     throw SquirrelError(v, msg.str());
4055   }
4056   sq_remove(v, -2); // remove object name
4057
4058   if(setup_releasehook) {
4059     sq_setreleasehook(v, -1, Wind_release_hook);
4060   }
4061
4062   sq_remove(v, -2); // remove root table
4063 }
4064
4065 void create_squirrel_instance(HSQUIRRELVM v, Scripting::AmbientSound* object, bool setup_releasehook)
4066 {
4067   using namespace Wrapper;
4068
4069   sq_pushroottable(v);
4070   sq_pushstring(v, "AmbientSound", -1);
4071   if(SQ_FAILED(sq_get(v, -2))) {
4072     std::ostringstream msg;
4073     msg << "Couldn't resolved squirrel type 'AmbientSound'";
4074     throw SquirrelError(v, msg.str());
4075   }
4076
4077   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4078     std::ostringstream msg;
4079     msg << "Couldn't setup squirrel instance for object of type 'AmbientSound'";
4080     throw SquirrelError(v, msg.str());
4081   }
4082   sq_remove(v, -2); // remove object name
4083
4084   if(setup_releasehook) {
4085     sq_setreleasehook(v, -1, AmbientSound_release_hook);
4086   }
4087
4088   sq_remove(v, -2); // remove root table
4089 }
4090
4091 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Thunderstorm* object, bool setup_releasehook)
4092 {
4093   using namespace Wrapper;
4094
4095   sq_pushroottable(v);
4096   sq_pushstring(v, "Thunderstorm", -1);
4097   if(SQ_FAILED(sq_get(v, -2))) {
4098     std::ostringstream msg;
4099     msg << "Couldn't resolved squirrel type 'Thunderstorm'";
4100     throw SquirrelError(v, msg.str());
4101   }
4102
4103   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4104     std::ostringstream msg;
4105     msg << "Couldn't setup squirrel instance for object of type 'Thunderstorm'";
4106     throw SquirrelError(v, msg.str());
4107   }
4108   sq_remove(v, -2); // remove object name
4109
4110   if(setup_releasehook) {
4111     sq_setreleasehook(v, -1, Thunderstorm_release_hook);
4112   }
4113
4114   sq_remove(v, -2); // remove root table
4115 }
4116
4117 void create_squirrel_instance(HSQUIRRELVM v, Scripting::TileMap* object, bool setup_releasehook)
4118 {
4119   using namespace Wrapper;
4120
4121   sq_pushroottable(v);
4122   sq_pushstring(v, "TileMap", -1);
4123   if(SQ_FAILED(sq_get(v, -2))) {
4124     std::ostringstream msg;
4125     msg << "Couldn't resolved squirrel type 'TileMap'";
4126     throw SquirrelError(v, msg.str());
4127   }
4128
4129   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4130     std::ostringstream msg;
4131     msg << "Couldn't setup squirrel instance for object of type 'TileMap'";
4132     throw SquirrelError(v, msg.str());
4133   }
4134   sq_remove(v, -2); // remove object name
4135
4136   if(setup_releasehook) {
4137     sq_setreleasehook(v, -1, TileMap_release_hook);
4138   }
4139
4140   sq_remove(v, -2); // remove root table
4141 }
4142
4143 void create_squirrel_instance(HSQUIRRELVM v, Scripting::SSector* object, bool setup_releasehook)
4144 {
4145   using namespace Wrapper;
4146
4147   sq_pushroottable(v);
4148   sq_pushstring(v, "SSector", -1);
4149   if(SQ_FAILED(sq_get(v, -2))) {
4150     std::ostringstream msg;
4151     msg << "Couldn't resolved squirrel type 'SSector'";
4152     throw SquirrelError(v, msg.str());
4153   }
4154
4155   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4156     std::ostringstream msg;
4157     msg << "Couldn't setup squirrel instance for object of type 'SSector'";
4158     throw SquirrelError(v, msg.str());
4159   }
4160   sq_remove(v, -2); // remove object name
4161
4162   if(setup_releasehook) {
4163     sq_setreleasehook(v, -1, SSector_release_hook);
4164   }
4165
4166   sq_remove(v, -2); // remove root table
4167 }
4168
4169 void create_squirrel_instance(HSQUIRRELVM v, Scripting::LevelTime* object, bool setup_releasehook)
4170 {
4171   using namespace Wrapper;
4172
4173   sq_pushroottable(v);
4174   sq_pushstring(v, "LevelTime", -1);
4175   if(SQ_FAILED(sq_get(v, -2))) {
4176     std::ostringstream msg;
4177     msg << "Couldn't resolved squirrel type 'LevelTime'";
4178     throw SquirrelError(v, msg.str());
4179   }
4180
4181   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4182     std::ostringstream msg;
4183     msg << "Couldn't setup squirrel instance for object of type 'LevelTime'";
4184     throw SquirrelError(v, msg.str());
4185   }
4186   sq_remove(v, -2); // remove object name
4187
4188   if(setup_releasehook) {
4189     sq_setreleasehook(v, -1, LevelTime_release_hook);
4190   }
4191
4192   sq_remove(v, -2); // remove root table
4193 }
4194
4195 void create_squirrel_instance(HSQUIRRELVM v, Scripting::WillOWisp* object, bool setup_releasehook)
4196 {
4197   using namespace Wrapper;
4198
4199   sq_pushroottable(v);
4200   sq_pushstring(v, "WillOWisp", -1);
4201   if(SQ_FAILED(sq_get(v, -2))) {
4202     std::ostringstream msg;
4203     msg << "Couldn't resolved squirrel type 'WillOWisp'";
4204     throw SquirrelError(v, msg.str());
4205   }
4206
4207   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4208     std::ostringstream msg;
4209     msg << "Couldn't setup squirrel instance for object of type 'WillOWisp'";
4210     throw SquirrelError(v, msg.str());
4211   }
4212   sq_remove(v, -2); // remove object name
4213
4214   if(setup_releasehook) {
4215     sq_setreleasehook(v, -1, WillOWisp_release_hook);
4216   }
4217
4218   sq_remove(v, -2); // remove root table
4219 }
4220
4221 void register_supertux_wrapper(HSQUIRRELVM v)
4222 {
4223   using namespace Wrapper;
4224
4225   sq_pushstring(v, "ANCHOR_TOP", -1);
4226   sq_pushinteger(v, 16);
4227   if(SQ_FAILED(sq_createslot(v, -3))) {
4228     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
4229   }
4230
4231   sq_pushstring(v, "ANCHOR_BOTTOM", -1);
4232   sq_pushinteger(v, 32);
4233   if(SQ_FAILED(sq_createslot(v, -3))) {
4234     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
4235   }
4236
4237   sq_pushstring(v, "ANCHOR_LEFT", -1);
4238   sq_pushinteger(v, 1);
4239   if(SQ_FAILED(sq_createslot(v, -3))) {
4240     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
4241   }
4242
4243   sq_pushstring(v, "ANCHOR_RIGHT", -1);
4244   sq_pushinteger(v, 2);
4245   if(SQ_FAILED(sq_createslot(v, -3))) {
4246     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
4247   }
4248
4249   sq_pushstring(v, "ANCHOR_MIDDLE", -1);
4250   sq_pushinteger(v, 0);
4251   if(SQ_FAILED(sq_createslot(v, -3))) {
4252     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
4253   }
4254
4255   sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
4256   sq_pushinteger(v, 17);
4257   if(SQ_FAILED(sq_createslot(v, -3))) {
4258     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
4259   }
4260
4261   sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
4262   sq_pushinteger(v, 18);
4263   if(SQ_FAILED(sq_createslot(v, -3))) {
4264     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
4265   }
4266
4267   sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
4268   sq_pushinteger(v, 33);
4269   if(SQ_FAILED(sq_createslot(v, -3))) {
4270     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
4271   }
4272
4273   sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
4274   sq_pushinteger(v, 34);
4275   if(SQ_FAILED(sq_createslot(v, -3))) {
4276     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
4277   }
4278
4279   sq_pushstring(v, "display", -1);
4280   sq_newclosure(v, &display_wrapper, 0);
4281   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "t.");
4282   if(SQ_FAILED(sq_createslot(v, -3))) {
4283     throw SquirrelError(v, "Couldn't register function 'display'");
4284   }
4285
4286   sq_pushstring(v, "print_stacktrace", -1);
4287   sq_newclosure(v, &print_stacktrace_wrapper, 0);
4288   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4289   if(SQ_FAILED(sq_createslot(v, -3))) {
4290     throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
4291   }
4292
4293   sq_pushstring(v, "get_current_thread", -1);
4294   sq_newclosure(v, &get_current_thread_wrapper, 0);
4295   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "t");
4296   if(SQ_FAILED(sq_createslot(v, -3))) {
4297     throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
4298   }
4299
4300   sq_pushstring(v, "display_text_file", -1);
4301   sq_newclosure(v, &display_text_file_wrapper, 0);
4302   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4303   if(SQ_FAILED(sq_createslot(v, -3))) {
4304     throw SquirrelError(v, "Couldn't register function 'display_text_file'");
4305   }
4306
4307   sq_pushstring(v, "load_worldmap", -1);
4308   sq_newclosure(v, &load_worldmap_wrapper, 0);
4309   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4310   if(SQ_FAILED(sq_createslot(v, -3))) {
4311     throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
4312   }
4313
4314   sq_pushstring(v, "load_level", -1);
4315   sq_newclosure(v, &load_level_wrapper, 0);
4316   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4317   if(SQ_FAILED(sq_createslot(v, -3))) {
4318     throw SquirrelError(v, "Couldn't register function 'load_level'");
4319   }
4320
4321   sq_pushstring(v, "wait", -1);
4322   sq_newclosure(v, &wait_wrapper, 0);
4323   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4324   if(SQ_FAILED(sq_createslot(v, -3))) {
4325     throw SquirrelError(v, "Couldn't register function 'wait'");
4326   }
4327
4328   sq_pushstring(v, "wait_for_screenswitch", -1);
4329   sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
4330   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4331   if(SQ_FAILED(sq_createslot(v, -3))) {
4332     throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
4333   }
4334
4335   sq_pushstring(v, "exit_screen", -1);
4336   sq_newclosure(v, &exit_screen_wrapper, 0);
4337   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4338   if(SQ_FAILED(sq_createslot(v, -3))) {
4339     throw SquirrelError(v, "Couldn't register function 'exit_screen'");
4340   }
4341
4342   sq_pushstring(v, "fadeout_screen", -1);
4343   sq_newclosure(v, &fadeout_screen_wrapper, 0);
4344   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4345   if(SQ_FAILED(sq_createslot(v, -3))) {
4346     throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
4347   }
4348
4349   sq_pushstring(v, "shrink_screen", -1);
4350   sq_newclosure(v, &shrink_screen_wrapper, 0);
4351   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4352   if(SQ_FAILED(sq_createslot(v, -3))) {
4353     throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
4354   }
4355
4356   sq_pushstring(v, "abort_screenfade", -1);
4357   sq_newclosure(v, &abort_screenfade_wrapper, 0);
4358   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4359   if(SQ_FAILED(sq_createslot(v, -3))) {
4360     throw SquirrelError(v, "Couldn't register function 'abort_screenfade'");
4361   }
4362
4363   sq_pushstring(v, "translate", -1);
4364   sq_newclosure(v, &translate_wrapper, 0);
4365   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4366   if(SQ_FAILED(sq_createslot(v, -3))) {
4367     throw SquirrelError(v, "Couldn't register function 'translate'");
4368   }
4369
4370   sq_pushstring(v, "import", -1);
4371   sq_newclosure(v, &import_wrapper, 0);
4372   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4373   if(SQ_FAILED(sq_createslot(v, -3))) {
4374     throw SquirrelError(v, "Couldn't register function 'import'");
4375   }
4376
4377   sq_pushstring(v, "save_state", -1);
4378   sq_newclosure(v, &save_state_wrapper, 0);
4379   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4380   if(SQ_FAILED(sq_createslot(v, -3))) {
4381     throw SquirrelError(v, "Couldn't register function 'save_state'");
4382   }
4383
4384   sq_pushstring(v, "update_worldmap", -1);
4385   sq_newclosure(v, &update_worldmap_wrapper, 0);
4386   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4387   if(SQ_FAILED(sq_createslot(v, -3))) {
4388     throw SquirrelError(v, "Couldn't register function 'update_worldmap'");
4389   }
4390
4391   sq_pushstring(v, "debug_collrects", -1);
4392   sq_newclosure(v, &debug_collrects_wrapper, 0);
4393   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4394   if(SQ_FAILED(sq_createslot(v, -3))) {
4395     throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
4396   }
4397
4398   sq_pushstring(v, "debug_show_fps", -1);
4399   sq_newclosure(v, &debug_show_fps_wrapper, 0);
4400   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4401   if(SQ_FAILED(sq_createslot(v, -3))) {
4402     throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
4403   }
4404
4405   sq_pushstring(v, "debug_draw_solids_only", -1);
4406   sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
4407   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4408   if(SQ_FAILED(sq_createslot(v, -3))) {
4409     throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
4410   }
4411
4412   sq_pushstring(v, "play_music", -1);
4413   sq_newclosure(v, &play_music_wrapper, 0);
4414   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4415   if(SQ_FAILED(sq_createslot(v, -3))) {
4416     throw SquirrelError(v, "Couldn't register function 'play_music'");
4417   }
4418
4419   sq_pushstring(v, "play_sound", -1);
4420   sq_newclosure(v, &play_sound_wrapper, 0);
4421   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4422   if(SQ_FAILED(sq_createslot(v, -3))) {
4423     throw SquirrelError(v, "Couldn't register function 'play_sound'");
4424   }
4425
4426   sq_pushstring(v, "set_game_speed", -1);
4427   sq_newclosure(v, &set_game_speed_wrapper, 0);
4428   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4429   if(SQ_FAILED(sq_createslot(v, -3))) {
4430     throw SquirrelError(v, "Couldn't register function 'set_game_speed'");
4431   }
4432
4433   sq_pushstring(v, "grease", -1);
4434   sq_newclosure(v, &grease_wrapper, 0);
4435   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4436   if(SQ_FAILED(sq_createslot(v, -3))) {
4437     throw SquirrelError(v, "Couldn't register function 'grease'");
4438   }
4439
4440   sq_pushstring(v, "invincible", -1);
4441   sq_newclosure(v, &invincible_wrapper, 0);
4442   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4443   if(SQ_FAILED(sq_createslot(v, -3))) {
4444     throw SquirrelError(v, "Couldn't register function 'invincible'");
4445   }
4446
4447   sq_pushstring(v, "ghost", -1);
4448   sq_newclosure(v, &ghost_wrapper, 0);
4449   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4450   if(SQ_FAILED(sq_createslot(v, -3))) {
4451     throw SquirrelError(v, "Couldn't register function 'ghost'");
4452   }
4453
4454   sq_pushstring(v, "mortal", -1);
4455   sq_newclosure(v, &mortal_wrapper, 0);
4456   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4457   if(SQ_FAILED(sq_createslot(v, -3))) {
4458     throw SquirrelError(v, "Couldn't register function 'mortal'");
4459   }
4460
4461   sq_pushstring(v, "restart", -1);
4462   sq_newclosure(v, &restart_wrapper, 0);
4463   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4464   if(SQ_FAILED(sq_createslot(v, -3))) {
4465     throw SquirrelError(v, "Couldn't register function 'restart'");
4466   }
4467
4468   sq_pushstring(v, "whereami", -1);
4469   sq_newclosure(v, &whereami_wrapper, 0);
4470   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4471   if(SQ_FAILED(sq_createslot(v, -3))) {
4472     throw SquirrelError(v, "Couldn't register function 'whereami'");
4473   }
4474
4475   sq_pushstring(v, "gotoend", -1);
4476   sq_newclosure(v, &gotoend_wrapper, 0);
4477   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4478   if(SQ_FAILED(sq_createslot(v, -3))) {
4479     throw SquirrelError(v, "Couldn't register function 'gotoend'");
4480   }
4481
4482   sq_pushstring(v, "camera", -1);
4483   sq_newclosure(v, &camera_wrapper, 0);
4484   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4485   if(SQ_FAILED(sq_createslot(v, -3))) {
4486     throw SquirrelError(v, "Couldn't register function 'camera'");
4487   }
4488
4489   sq_pushstring(v, "set_gamma", -1);
4490   sq_newclosure(v, &set_gamma_wrapper, 0);
4491   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4492   if(SQ_FAILED(sq_createslot(v, -3))) {
4493     throw SquirrelError(v, "Couldn't register function 'set_gamma'");
4494   }
4495
4496   sq_pushstring(v, "quit", -1);
4497   sq_newclosure(v, &quit_wrapper, 0);
4498   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4499   if(SQ_FAILED(sq_createslot(v, -3))) {
4500     throw SquirrelError(v, "Couldn't register function 'quit'");
4501   }
4502
4503   sq_pushstring(v, "rand", -1);
4504   sq_newclosure(v, &rand_wrapper, 0);
4505   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4506   if(SQ_FAILED(sq_createslot(v, -3))) {
4507     throw SquirrelError(v, "Couldn't register function 'rand'");
4508   }
4509
4510   // Register class DisplayEffect
4511   sq_pushstring(v, "DisplayEffect", -1);
4512   if(sq_newclass(v, SQFalse) < 0) {
4513     std::ostringstream msg;
4514     msg << "Couldn't create new class 'DisplayEffect'";
4515     throw SquirrelError(v, msg.str());
4516   }
4517   sq_pushstring(v, "fade_out", -1);
4518   sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
4519   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4520   if(SQ_FAILED(sq_createslot(v, -3))) {
4521     throw SquirrelError(v, "Couldn't register function 'fade_out'");
4522   }
4523
4524   sq_pushstring(v, "fade_in", -1);
4525   sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
4526   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4527   if(SQ_FAILED(sq_createslot(v, -3))) {
4528     throw SquirrelError(v, "Couldn't register function 'fade_in'");
4529   }
4530
4531   sq_pushstring(v, "set_black", -1);
4532   sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
4533   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4534   if(SQ_FAILED(sq_createslot(v, -3))) {
4535     throw SquirrelError(v, "Couldn't register function 'set_black'");
4536   }
4537
4538   sq_pushstring(v, "is_black", -1);
4539   sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
4540   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4541   if(SQ_FAILED(sq_createslot(v, -3))) {
4542     throw SquirrelError(v, "Couldn't register function 'is_black'");
4543   }
4544
4545   sq_pushstring(v, "sixteen_to_nine", -1);
4546   sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
4547   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4548   if(SQ_FAILED(sq_createslot(v, -3))) {
4549     throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
4550   }
4551
4552   sq_pushstring(v, "four_to_three", -1);
4553   sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
4554   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4555   if(SQ_FAILED(sq_createslot(v, -3))) {
4556     throw SquirrelError(v, "Couldn't register function 'four_to_three'");
4557   }
4558
4559   if(SQ_FAILED(sq_createslot(v, -3))) {
4560     throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
4561   }
4562
4563   // Register class Camera
4564   sq_pushstring(v, "Camera", -1);
4565   if(sq_newclass(v, SQFalse) < 0) {
4566     std::ostringstream msg;
4567     msg << "Couldn't create new class 'Camera'";
4568     throw SquirrelError(v, msg.str());
4569   }
4570   sq_pushstring(v, "reload_config", -1);
4571   sq_newclosure(v, &Camera_reload_config_wrapper, 0);
4572   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4573   if(SQ_FAILED(sq_createslot(v, -3))) {
4574     throw SquirrelError(v, "Couldn't register function 'reload_config'");
4575   }
4576
4577   sq_pushstring(v, "shake", -1);
4578   sq_newclosure(v, &Camera_shake_wrapper, 0);
4579   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4580   if(SQ_FAILED(sq_createslot(v, -3))) {
4581     throw SquirrelError(v, "Couldn't register function 'shake'");
4582   }
4583
4584   sq_pushstring(v, "set_pos", -1);
4585   sq_newclosure(v, &Camera_set_pos_wrapper, 0);
4586   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4587   if(SQ_FAILED(sq_createslot(v, -3))) {
4588     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4589   }
4590
4591   sq_pushstring(v, "set_mode", -1);
4592   sq_newclosure(v, &Camera_set_mode_wrapper, 0);
4593   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4594   if(SQ_FAILED(sq_createslot(v, -3))) {
4595     throw SquirrelError(v, "Couldn't register function 'set_mode'");
4596   }
4597
4598   sq_pushstring(v, "scroll_to", -1);
4599   sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
4600   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4601   if(SQ_FAILED(sq_createslot(v, -3))) {
4602     throw SquirrelError(v, "Couldn't register function 'scroll_to'");
4603   }
4604
4605   if(SQ_FAILED(sq_createslot(v, -3))) {
4606     throw SquirrelError(v, "Couldn't register class 'Camera'");
4607   }
4608
4609   // Register class Level
4610   sq_pushstring(v, "Level", -1);
4611   if(sq_newclass(v, SQFalse) < 0) {
4612     std::ostringstream msg;
4613     msg << "Couldn't create new class 'Level'";
4614     throw SquirrelError(v, msg.str());
4615   }
4616   sq_pushstring(v, "finish", -1);
4617   sq_newclosure(v, &Level_finish_wrapper, 0);
4618   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4619   if(SQ_FAILED(sq_createslot(v, -3))) {
4620     throw SquirrelError(v, "Couldn't register function 'finish'");
4621   }
4622
4623   sq_pushstring(v, "spawn", -1);
4624   sq_newclosure(v, &Level_spawn_wrapper, 0);
4625   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tss");
4626   if(SQ_FAILED(sq_createslot(v, -3))) {
4627     throw SquirrelError(v, "Couldn't register function 'spawn'");
4628   }
4629
4630   sq_pushstring(v, "flip_vertically", -1);
4631   sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
4632   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4633   if(SQ_FAILED(sq_createslot(v, -3))) {
4634     throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
4635   }
4636
4637   sq_pushstring(v, "toggle_pause", -1);
4638   sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
4639   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4640   if(SQ_FAILED(sq_createslot(v, -3))) {
4641     throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
4642   }
4643
4644   sq_pushstring(v, "edit", -1);
4645   sq_newclosure(v, &Level_edit_wrapper, 0);
4646   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4647   if(SQ_FAILED(sq_createslot(v, -3))) {
4648     throw SquirrelError(v, "Couldn't register function 'edit'");
4649   }
4650
4651   if(SQ_FAILED(sq_createslot(v, -3))) {
4652     throw SquirrelError(v, "Couldn't register class 'Level'");
4653   }
4654
4655   // Register class ScriptedObject
4656   sq_pushstring(v, "ScriptedObject", -1);
4657   if(sq_newclass(v, SQFalse) < 0) {
4658     std::ostringstream msg;
4659     msg << "Couldn't create new class 'ScriptedObject'";
4660     throw SquirrelError(v, msg.str());
4661   }
4662   sq_pushstring(v, "set_action", -1);
4663   sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
4664   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4665   if(SQ_FAILED(sq_createslot(v, -3))) {
4666     throw SquirrelError(v, "Couldn't register function 'set_action'");
4667   }
4668
4669   sq_pushstring(v, "get_action", -1);
4670   sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
4671   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4672   if(SQ_FAILED(sq_createslot(v, -3))) {
4673     throw SquirrelError(v, "Couldn't register function 'get_action'");
4674   }
4675
4676   sq_pushstring(v, "move", -1);
4677   sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
4678   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4679   if(SQ_FAILED(sq_createslot(v, -3))) {
4680     throw SquirrelError(v, "Couldn't register function 'move'");
4681   }
4682
4683   sq_pushstring(v, "set_pos", -1);
4684   sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
4685   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4686   if(SQ_FAILED(sq_createslot(v, -3))) {
4687     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4688   }
4689
4690   sq_pushstring(v, "get_pos_x", -1);
4691   sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
4692   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4693   if(SQ_FAILED(sq_createslot(v, -3))) {
4694     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4695   }
4696
4697   sq_pushstring(v, "get_pos_y", -1);
4698   sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
4699   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4700   if(SQ_FAILED(sq_createslot(v, -3))) {
4701     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4702   }
4703
4704   sq_pushstring(v, "set_velocity", -1);
4705   sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
4706   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4707   if(SQ_FAILED(sq_createslot(v, -3))) {
4708     throw SquirrelError(v, "Couldn't register function 'set_velocity'");
4709   }
4710
4711   sq_pushstring(v, "get_velocity_x", -1);
4712   sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
4713   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4714   if(SQ_FAILED(sq_createslot(v, -3))) {
4715     throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
4716   }
4717
4718   sq_pushstring(v, "get_velocity_y", -1);
4719   sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
4720   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4721   if(SQ_FAILED(sq_createslot(v, -3))) {
4722     throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
4723   }
4724
4725   sq_pushstring(v, "set_visible", -1);
4726   sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
4727   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4728   if(SQ_FAILED(sq_createslot(v, -3))) {
4729     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4730   }
4731
4732   sq_pushstring(v, "is_visible", -1);
4733   sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
4734   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4735   if(SQ_FAILED(sq_createslot(v, -3))) {
4736     throw SquirrelError(v, "Couldn't register function 'is_visible'");
4737   }
4738
4739   sq_pushstring(v, "set_solid", -1);
4740   sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
4741   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4742   if(SQ_FAILED(sq_createslot(v, -3))) {
4743     throw SquirrelError(v, "Couldn't register function 'set_solid'");
4744   }
4745
4746   sq_pushstring(v, "is_solid", -1);
4747   sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
4748   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4749   if(SQ_FAILED(sq_createslot(v, -3))) {
4750     throw SquirrelError(v, "Couldn't register function 'is_solid'");
4751   }
4752
4753   sq_pushstring(v, "get_name", -1);
4754   sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
4755   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4756   if(SQ_FAILED(sq_createslot(v, -3))) {
4757     throw SquirrelError(v, "Couldn't register function 'get_name'");
4758   }
4759
4760   if(SQ_FAILED(sq_createslot(v, -3))) {
4761     throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
4762   }
4763
4764   // Register class Text
4765   sq_pushstring(v, "Text", -1);
4766   if(sq_newclass(v, SQFalse) < 0) {
4767     std::ostringstream msg;
4768     msg << "Couldn't create new class 'Text'";
4769     throw SquirrelError(v, msg.str());
4770   }
4771   sq_pushstring(v, "set_text", -1);
4772   sq_newclosure(v, &Text_set_text_wrapper, 0);
4773   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4774   if(SQ_FAILED(sq_createslot(v, -3))) {
4775     throw SquirrelError(v, "Couldn't register function 'set_text'");
4776   }
4777
4778   sq_pushstring(v, "set_font", -1);
4779   sq_newclosure(v, &Text_set_font_wrapper, 0);
4780   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4781   if(SQ_FAILED(sq_createslot(v, -3))) {
4782     throw SquirrelError(v, "Couldn't register function 'set_font'");
4783   }
4784
4785   sq_pushstring(v, "fade_in", -1);
4786   sq_newclosure(v, &Text_fade_in_wrapper, 0);
4787   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4788   if(SQ_FAILED(sq_createslot(v, -3))) {
4789     throw SquirrelError(v, "Couldn't register function 'fade_in'");
4790   }
4791
4792   sq_pushstring(v, "fade_out", -1);
4793   sq_newclosure(v, &Text_fade_out_wrapper, 0);
4794   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4795   if(SQ_FAILED(sq_createslot(v, -3))) {
4796     throw SquirrelError(v, "Couldn't register function 'fade_out'");
4797   }
4798
4799   sq_pushstring(v, "set_visible", -1);
4800   sq_newclosure(v, &Text_set_visible_wrapper, 0);
4801   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4802   if(SQ_FAILED(sq_createslot(v, -3))) {
4803     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4804   }
4805
4806   sq_pushstring(v, "set_centered", -1);
4807   sq_newclosure(v, &Text_set_centered_wrapper, 0);
4808   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4809   if(SQ_FAILED(sq_createslot(v, -3))) {
4810     throw SquirrelError(v, "Couldn't register function 'set_centered'");
4811   }
4812
4813   sq_pushstring(v, "set_pos", -1);
4814   sq_newclosure(v, &Text_set_pos_wrapper, 0);
4815   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4816   if(SQ_FAILED(sq_createslot(v, -3))) {
4817     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4818   }
4819
4820   sq_pushstring(v, "get_pos_x", -1);
4821   sq_newclosure(v, &Text_get_pos_x_wrapper, 0);
4822   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4823   if(SQ_FAILED(sq_createslot(v, -3))) {
4824     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4825   }
4826
4827   sq_pushstring(v, "get_pos_y", -1);
4828   sq_newclosure(v, &Text_get_pos_y_wrapper, 0);
4829   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4830   if(SQ_FAILED(sq_createslot(v, -3))) {
4831     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4832   }
4833
4834   sq_pushstring(v, "set_anchor_point", -1);
4835   sq_newclosure(v, &Text_set_anchor_point_wrapper, 0);
4836   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4837   if(SQ_FAILED(sq_createslot(v, -3))) {
4838     throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
4839   }
4840
4841   sq_pushstring(v, "get_anchor_point", -1);
4842   sq_newclosure(v, &Text_get_anchor_point_wrapper, 0);
4843   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4844   if(SQ_FAILED(sq_createslot(v, -3))) {
4845     throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
4846   }
4847
4848   if(SQ_FAILED(sq_createslot(v, -3))) {
4849     throw SquirrelError(v, "Couldn't register class 'Text'");
4850   }
4851
4852   // Register class Player
4853   sq_pushstring(v, "Player", -1);
4854   if(sq_newclass(v, SQFalse) < 0) {
4855     std::ostringstream msg;
4856     msg << "Couldn't create new class 'Player'";
4857     throw SquirrelError(v, msg.str());
4858   }
4859   sq_pushstring(v, "add_bonus", -1);
4860   sq_newclosure(v, &Player_add_bonus_wrapper, 0);
4861   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4862   if(SQ_FAILED(sq_createslot(v, -3))) {
4863     throw SquirrelError(v, "Couldn't register function 'add_bonus'");
4864   }
4865
4866   sq_pushstring(v, "add_coins", -1);
4867   sq_newclosure(v, &Player_add_coins_wrapper, 0);
4868   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4869   if(SQ_FAILED(sq_createslot(v, -3))) {
4870     throw SquirrelError(v, "Couldn't register function 'add_coins'");
4871   }
4872
4873   sq_pushstring(v, "make_invincible", -1);
4874   sq_newclosure(v, &Player_make_invincible_wrapper, 0);
4875   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4876   if(SQ_FAILED(sq_createslot(v, -3))) {
4877     throw SquirrelError(v, "Couldn't register function 'make_invincible'");
4878   }
4879
4880   sq_pushstring(v, "deactivate", -1);
4881   sq_newclosure(v, &Player_deactivate_wrapper, 0);
4882   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4883   if(SQ_FAILED(sq_createslot(v, -3))) {
4884     throw SquirrelError(v, "Couldn't register function 'deactivate'");
4885   }
4886
4887   sq_pushstring(v, "activate", -1);
4888   sq_newclosure(v, &Player_activate_wrapper, 0);
4889   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4890   if(SQ_FAILED(sq_createslot(v, -3))) {
4891     throw SquirrelError(v, "Couldn't register function 'activate'");
4892   }
4893
4894   sq_pushstring(v, "walk", -1);
4895   sq_newclosure(v, &Player_walk_wrapper, 0);
4896   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4897   if(SQ_FAILED(sq_createslot(v, -3))) {
4898     throw SquirrelError(v, "Couldn't register function 'walk'");
4899   }
4900
4901   sq_pushstring(v, "set_visible", -1);
4902   sq_newclosure(v, &Player_set_visible_wrapper, 0);
4903   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4904   if(SQ_FAILED(sq_createslot(v, -3))) {
4905     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4906   }
4907
4908   sq_pushstring(v, "get_visible", -1);
4909   sq_newclosure(v, &Player_get_visible_wrapper, 0);
4910   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4911   if(SQ_FAILED(sq_createslot(v, -3))) {
4912     throw SquirrelError(v, "Couldn't register function 'get_visible'");
4913   }
4914
4915   sq_pushstring(v, "kill", -1);
4916   sq_newclosure(v, &Player_kill_wrapper, 0);
4917   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4918   if(SQ_FAILED(sq_createslot(v, -3))) {
4919     throw SquirrelError(v, "Couldn't register function 'kill'");
4920   }
4921
4922   sq_pushstring(v, "set_ghost_mode", -1);
4923   sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
4924   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4925   if(SQ_FAILED(sq_createslot(v, -3))) {
4926     throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
4927   }
4928
4929   sq_pushstring(v, "get_ghost_mode", -1);
4930   sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
4931   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4932   if(SQ_FAILED(sq_createslot(v, -3))) {
4933     throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
4934   }
4935
4936   sq_pushstring(v, "do_cheer", -1);
4937   sq_newclosure(v, &Player_do_cheer_wrapper, 0);
4938   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4939   if(SQ_FAILED(sq_createslot(v, -3))) {
4940     throw SquirrelError(v, "Couldn't register function 'do_cheer'");
4941   }
4942
4943   sq_pushstring(v, "do_duck", -1);
4944   sq_newclosure(v, &Player_do_duck_wrapper, 0);
4945   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4946   if(SQ_FAILED(sq_createslot(v, -3))) {
4947     throw SquirrelError(v, "Couldn't register function 'do_duck'");
4948   }
4949
4950   sq_pushstring(v, "do_standup", -1);
4951   sq_newclosure(v, &Player_do_standup_wrapper, 0);
4952   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4953   if(SQ_FAILED(sq_createslot(v, -3))) {
4954     throw SquirrelError(v, "Couldn't register function 'do_standup'");
4955   }
4956
4957   sq_pushstring(v, "do_backflip", -1);
4958   sq_newclosure(v, &Player_do_backflip_wrapper, 0);
4959   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4960   if(SQ_FAILED(sq_createslot(v, -3))) {
4961     throw SquirrelError(v, "Couldn't register function 'do_backflip'");
4962   }
4963
4964   sq_pushstring(v, "do_jump", -1);
4965   sq_newclosure(v, &Player_do_jump_wrapper, 0);
4966   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4967   if(SQ_FAILED(sq_createslot(v, -3))) {
4968     throw SquirrelError(v, "Couldn't register function 'do_jump'");
4969   }
4970
4971   sq_pushstring(v, "trigger_sequence", -1);
4972   sq_newclosure(v, &Player_trigger_sequence_wrapper, 0);
4973   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4974   if(SQ_FAILED(sq_createslot(v, -3))) {
4975     throw SquirrelError(v, "Couldn't register function 'trigger_sequence'");
4976   }
4977
4978   sq_pushstring(v, "use_scripting_controller", -1);
4979   sq_newclosure(v, &Player_use_scripting_controller_wrapper, 0);
4980   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4981   if(SQ_FAILED(sq_createslot(v, -3))) {
4982     throw SquirrelError(v, "Couldn't register function 'use_scripting_controller'");
4983   }
4984
4985   sq_pushstring(v, "do_scripting_controller", -1);
4986   sq_newclosure(v, &Player_do_scripting_controller_wrapper, 0);
4987   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tsb");
4988   if(SQ_FAILED(sq_createslot(v, -3))) {
4989     throw SquirrelError(v, "Couldn't register function 'do_scripting_controller'");
4990   }
4991
4992   if(SQ_FAILED(sq_createslot(v, -3))) {
4993     throw SquirrelError(v, "Couldn't register class 'Player'");
4994   }
4995
4996   // Register class FloatingImage
4997   sq_pushstring(v, "FloatingImage", -1);
4998   if(sq_newclass(v, SQFalse) < 0) {
4999     std::ostringstream msg;
5000     msg << "Couldn't create new class 'FloatingImage'";
5001     throw SquirrelError(v, msg.str());
5002   }
5003   sq_pushstring(v, "constructor", -1);
5004   sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
5005   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5006   if(SQ_FAILED(sq_createslot(v, -3))) {
5007     throw SquirrelError(v, "Couldn't register function 'constructor'");
5008   }
5009
5010   sq_pushstring(v, "set_layer", -1);
5011   sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
5012   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5013   if(SQ_FAILED(sq_createslot(v, -3))) {
5014     throw SquirrelError(v, "Couldn't register function 'set_layer'");
5015   }
5016
5017   sq_pushstring(v, "get_layer", -1);
5018   sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
5019   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5020   if(SQ_FAILED(sq_createslot(v, -3))) {
5021     throw SquirrelError(v, "Couldn't register function 'get_layer'");
5022   }
5023
5024   sq_pushstring(v, "set_pos", -1);
5025   sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
5026   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5027   if(SQ_FAILED(sq_createslot(v, -3))) {
5028     throw SquirrelError(v, "Couldn't register function 'set_pos'");
5029   }
5030
5031   sq_pushstring(v, "get_pos_x", -1);
5032   sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
5033   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5034   if(SQ_FAILED(sq_createslot(v, -3))) {
5035     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
5036   }
5037
5038   sq_pushstring(v, "get_pos_y", -1);
5039   sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
5040   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5041   if(SQ_FAILED(sq_createslot(v, -3))) {
5042     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
5043   }
5044
5045   sq_pushstring(v, "set_anchor_point", -1);
5046   sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
5047   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5048   if(SQ_FAILED(sq_createslot(v, -3))) {
5049     throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
5050   }
5051
5052   sq_pushstring(v, "get_anchor_point", -1);
5053   sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
5054   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5055   if(SQ_FAILED(sq_createslot(v, -3))) {
5056     throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
5057   }
5058
5059   sq_pushstring(v, "set_visible", -1);
5060   sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
5061   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5062   if(SQ_FAILED(sq_createslot(v, -3))) {
5063     throw SquirrelError(v, "Couldn't register function 'set_visible'");
5064   }
5065
5066   sq_pushstring(v, "get_visible", -1);
5067   sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
5068   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5069   if(SQ_FAILED(sq_createslot(v, -3))) {
5070     throw SquirrelError(v, "Couldn't register function 'get_visible'");
5071   }
5072
5073   sq_pushstring(v, "set_action", -1);
5074   sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
5075   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5076   if(SQ_FAILED(sq_createslot(v, -3))) {
5077     throw SquirrelError(v, "Couldn't register function 'set_action'");
5078   }
5079
5080   sq_pushstring(v, "get_action", -1);
5081   sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
5082   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5083   if(SQ_FAILED(sq_createslot(v, -3))) {
5084     throw SquirrelError(v, "Couldn't register function 'get_action'");
5085   }
5086
5087   sq_pushstring(v, "fade_in", -1);
5088   sq_newclosure(v, &FloatingImage_fade_in_wrapper, 0);
5089   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5090   if(SQ_FAILED(sq_createslot(v, -3))) {
5091     throw SquirrelError(v, "Couldn't register function 'fade_in'");
5092   }
5093
5094   sq_pushstring(v, "fade_out", -1);
5095   sq_newclosure(v, &FloatingImage_fade_out_wrapper, 0);
5096   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5097   if(SQ_FAILED(sq_createslot(v, -3))) {
5098     throw SquirrelError(v, "Couldn't register function 'fade_out'");
5099   }
5100
5101   if(SQ_FAILED(sq_createslot(v, -3))) {
5102     throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
5103   }
5104
5105   // Register class Platform
5106   sq_pushstring(v, "Platform", -1);
5107   if(sq_newclass(v, SQFalse) < 0) {
5108     std::ostringstream msg;
5109     msg << "Couldn't create new class 'Platform'";
5110     throw SquirrelError(v, msg.str());
5111   }
5112   sq_pushstring(v, "goto_node", -1);
5113   sq_newclosure(v, &Platform_goto_node_wrapper, 0);
5114   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5115   if(SQ_FAILED(sq_createslot(v, -3))) {
5116     throw SquirrelError(v, "Couldn't register function 'goto_node'");
5117   }
5118
5119   sq_pushstring(v, "start_moving", -1);
5120   sq_newclosure(v, &Platform_start_moving_wrapper, 0);
5121   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5122   if(SQ_FAILED(sq_createslot(v, -3))) {
5123     throw SquirrelError(v, "Couldn't register function 'start_moving'");
5124   }
5125
5126   sq_pushstring(v, "stop_moving", -1);
5127   sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
5128   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5129   if(SQ_FAILED(sq_createslot(v, -3))) {
5130     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5131   }
5132
5133   if(SQ_FAILED(sq_createslot(v, -3))) {
5134     throw SquirrelError(v, "Couldn't register class 'Platform'");
5135   }
5136
5137   // Register class Candle
5138   sq_pushstring(v, "Candle", -1);
5139   if(sq_newclass(v, SQFalse) < 0) {
5140     std::ostringstream msg;
5141     msg << "Couldn't create new class 'Candle'";
5142     throw SquirrelError(v, msg.str());
5143   }
5144   sq_pushstring(v, "get_burning", -1);
5145   sq_newclosure(v, &Candle_get_burning_wrapper, 0);
5146   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5147   if(SQ_FAILED(sq_createslot(v, -3))) {
5148     throw SquirrelError(v, "Couldn't register function 'get_burning'");
5149   }
5150
5151   sq_pushstring(v, "set_burning", -1);
5152   sq_newclosure(v, &Candle_set_burning_wrapper, 0);
5153   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5154   if(SQ_FAILED(sq_createslot(v, -3))) {
5155     throw SquirrelError(v, "Couldn't register function 'set_burning'");
5156   }
5157
5158   if(SQ_FAILED(sq_createslot(v, -3))) {
5159     throw SquirrelError(v, "Couldn't register class 'Candle'");
5160   }
5161
5162   // Register class Wind
5163   sq_pushstring(v, "Wind", -1);
5164   if(sq_newclass(v, SQFalse) < 0) {
5165     std::ostringstream msg;
5166     msg << "Couldn't create new class 'Wind'";
5167     throw SquirrelError(v, msg.str());
5168   }
5169   sq_pushstring(v, "start", -1);
5170   sq_newclosure(v, &Wind_start_wrapper, 0);
5171   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5172   if(SQ_FAILED(sq_createslot(v, -3))) {
5173     throw SquirrelError(v, "Couldn't register function 'start'");
5174   }
5175
5176   sq_pushstring(v, "stop", -1);
5177   sq_newclosure(v, &Wind_stop_wrapper, 0);
5178   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5179   if(SQ_FAILED(sq_createslot(v, -3))) {
5180     throw SquirrelError(v, "Couldn't register function 'stop'");
5181   }
5182
5183   if(SQ_FAILED(sq_createslot(v, -3))) {
5184     throw SquirrelError(v, "Couldn't register class 'Wind'");
5185   }
5186
5187   // Register class AmbientSound
5188   sq_pushstring(v, "AmbientSound", -1);
5189   if(sq_newclass(v, SQFalse) < 0) {
5190     std::ostringstream msg;
5191     msg << "Couldn't create new class 'AmbientSound'";
5192     throw SquirrelError(v, msg.str());
5193   }
5194   sq_pushstring(v, "set_pos", -1);
5195   sq_newclosure(v, &AmbientSound_set_pos_wrapper, 0);
5196   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5197   if(SQ_FAILED(sq_createslot(v, -3))) {
5198     throw SquirrelError(v, "Couldn't register function 'set_pos'");
5199   }
5200
5201   sq_pushstring(v, "get_pos_x", -1);
5202   sq_newclosure(v, &AmbientSound_get_pos_x_wrapper, 0);
5203   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5204   if(SQ_FAILED(sq_createslot(v, -3))) {
5205     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
5206   }
5207
5208   sq_pushstring(v, "get_pos_y", -1);
5209   sq_newclosure(v, &AmbientSound_get_pos_y_wrapper, 0);
5210   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5211   if(SQ_FAILED(sq_createslot(v, -3))) {
5212     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
5213   }
5214
5215   if(SQ_FAILED(sq_createslot(v, -3))) {
5216     throw SquirrelError(v, "Couldn't register class 'AmbientSound'");
5217   }
5218
5219   // Register class Thunderstorm
5220   sq_pushstring(v, "Thunderstorm", -1);
5221   if(sq_newclass(v, SQFalse) < 0) {
5222     std::ostringstream msg;
5223     msg << "Couldn't create new class 'Thunderstorm'";
5224     throw SquirrelError(v, msg.str());
5225   }
5226   sq_pushstring(v, "start", -1);
5227   sq_newclosure(v, &Thunderstorm_start_wrapper, 0);
5228   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5229   if(SQ_FAILED(sq_createslot(v, -3))) {
5230     throw SquirrelError(v, "Couldn't register function 'start'");
5231   }
5232
5233   sq_pushstring(v, "stop", -1);
5234   sq_newclosure(v, &Thunderstorm_stop_wrapper, 0);
5235   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5236   if(SQ_FAILED(sq_createslot(v, -3))) {
5237     throw SquirrelError(v, "Couldn't register function 'stop'");
5238   }
5239
5240   sq_pushstring(v, "thunder", -1);
5241   sq_newclosure(v, &Thunderstorm_thunder_wrapper, 0);
5242   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5243   if(SQ_FAILED(sq_createslot(v, -3))) {
5244     throw SquirrelError(v, "Couldn't register function 'thunder'");
5245   }
5246
5247   sq_pushstring(v, "lightning", -1);
5248   sq_newclosure(v, &Thunderstorm_lightning_wrapper, 0);
5249   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5250   if(SQ_FAILED(sq_createslot(v, -3))) {
5251     throw SquirrelError(v, "Couldn't register function 'lightning'");
5252   }
5253
5254   sq_pushstring(v, "flash", -1);
5255   sq_newclosure(v, &Thunderstorm_flash_wrapper, 0);
5256   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5257   if(SQ_FAILED(sq_createslot(v, -3))) {
5258     throw SquirrelError(v, "Couldn't register function 'flash'");
5259   }
5260
5261   sq_pushstring(v, "electrify", -1);
5262   sq_newclosure(v, &Thunderstorm_electrify_wrapper, 0);
5263   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5264   if(SQ_FAILED(sq_createslot(v, -3))) {
5265     throw SquirrelError(v, "Couldn't register function 'electrify'");
5266   }
5267
5268   if(SQ_FAILED(sq_createslot(v, -3))) {
5269     throw SquirrelError(v, "Couldn't register class 'Thunderstorm'");
5270   }
5271
5272   // Register class TileMap
5273   sq_pushstring(v, "TileMap", -1);
5274   if(sq_newclass(v, SQFalse) < 0) {
5275     std::ostringstream msg;
5276     msg << "Couldn't create new class 'TileMap'";
5277     throw SquirrelError(v, msg.str());
5278   }
5279   sq_pushstring(v, "goto_node", -1);
5280   sq_newclosure(v, &TileMap_goto_node_wrapper, 0);
5281   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5282   if(SQ_FAILED(sq_createslot(v, -3))) {
5283     throw SquirrelError(v, "Couldn't register function 'goto_node'");
5284   }
5285
5286   sq_pushstring(v, "start_moving", -1);
5287   sq_newclosure(v, &TileMap_start_moving_wrapper, 0);
5288   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5289   if(SQ_FAILED(sq_createslot(v, -3))) {
5290     throw SquirrelError(v, "Couldn't register function 'start_moving'");
5291   }
5292
5293   sq_pushstring(v, "stop_moving", -1);
5294   sq_newclosure(v, &TileMap_stop_moving_wrapper, 0);
5295   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5296   if(SQ_FAILED(sq_createslot(v, -3))) {
5297     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5298   }
5299
5300   sq_pushstring(v, "fade", -1);
5301   sq_newclosure(v, &TileMap_fade_wrapper, 0);
5302   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5303   if(SQ_FAILED(sq_createslot(v, -3))) {
5304     throw SquirrelError(v, "Couldn't register function 'fade'");
5305   }
5306
5307   sq_pushstring(v, "set_alpha", -1);
5308   sq_newclosure(v, &TileMap_set_alpha_wrapper, 0);
5309   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5310   if(SQ_FAILED(sq_createslot(v, -3))) {
5311     throw SquirrelError(v, "Couldn't register function 'set_alpha'");
5312   }
5313
5314   sq_pushstring(v, "get_alpha", -1);
5315   sq_newclosure(v, &TileMap_get_alpha_wrapper, 0);
5316   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5317   if(SQ_FAILED(sq_createslot(v, -3))) {
5318     throw SquirrelError(v, "Couldn't register function 'get_alpha'");
5319   }
5320
5321   if(SQ_FAILED(sq_createslot(v, -3))) {
5322     throw SquirrelError(v, "Couldn't register class 'TileMap'");
5323   }
5324
5325   // Register class SSector
5326   sq_pushstring(v, "SSector", -1);
5327   if(sq_newclass(v, SQFalse) < 0) {
5328     std::ostringstream msg;
5329     msg << "Couldn't create new class 'SSector'";
5330     throw SquirrelError(v, msg.str());
5331   }
5332   sq_pushstring(v, "set_ambient_light", -1);
5333   sq_newclosure(v, &SSector_set_ambient_light_wrapper, 0);
5334   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
5335   if(SQ_FAILED(sq_createslot(v, -3))) {
5336     throw SquirrelError(v, "Couldn't register function 'set_ambient_light'");
5337   }
5338
5339   sq_pushstring(v, "get_ambient_red", -1);
5340   sq_newclosure(v, &SSector_get_ambient_red_wrapper, 0);
5341   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5342   if(SQ_FAILED(sq_createslot(v, -3))) {
5343     throw SquirrelError(v, "Couldn't register function 'get_ambient_red'");
5344   }
5345
5346   sq_pushstring(v, "get_ambient_green", -1);
5347   sq_newclosure(v, &SSector_get_ambient_green_wrapper, 0);
5348   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5349   if(SQ_FAILED(sq_createslot(v, -3))) {
5350     throw SquirrelError(v, "Couldn't register function 'get_ambient_green'");
5351   }
5352
5353   sq_pushstring(v, "get_ambient_blue", -1);
5354   sq_newclosure(v, &SSector_get_ambient_blue_wrapper, 0);
5355   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5356   if(SQ_FAILED(sq_createslot(v, -3))) {
5357     throw SquirrelError(v, "Couldn't register function 'get_ambient_blue'");
5358   }
5359
5360   sq_pushstring(v, "set_gravity", -1);
5361   sq_newclosure(v, &SSector_set_gravity_wrapper, 0);
5362   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5363   if(SQ_FAILED(sq_createslot(v, -3))) {
5364     throw SquirrelError(v, "Couldn't register function 'set_gravity'");
5365   }
5366
5367   if(SQ_FAILED(sq_createslot(v, -3))) {
5368     throw SquirrelError(v, "Couldn't register class 'SSector'");
5369   }
5370
5371   // Register class LevelTime
5372   sq_pushstring(v, "LevelTime", -1);
5373   if(sq_newclass(v, SQFalse) < 0) {
5374     std::ostringstream msg;
5375     msg << "Couldn't create new class 'LevelTime'";
5376     throw SquirrelError(v, msg.str());
5377   }
5378   sq_pushstring(v, "start", -1);
5379   sq_newclosure(v, &LevelTime_start_wrapper, 0);
5380   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5381   if(SQ_FAILED(sq_createslot(v, -3))) {
5382     throw SquirrelError(v, "Couldn't register function 'start'");
5383   }
5384
5385   sq_pushstring(v, "stop", -1);
5386   sq_newclosure(v, &LevelTime_stop_wrapper, 0);
5387   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5388   if(SQ_FAILED(sq_createslot(v, -3))) {
5389     throw SquirrelError(v, "Couldn't register function 'stop'");
5390   }
5391
5392   sq_pushstring(v, "get_time", -1);
5393   sq_newclosure(v, &LevelTime_get_time_wrapper, 0);
5394   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5395   if(SQ_FAILED(sq_createslot(v, -3))) {
5396     throw SquirrelError(v, "Couldn't register function 'get_time'");
5397   }
5398
5399   sq_pushstring(v, "set_time", -1);
5400   sq_newclosure(v, &LevelTime_set_time_wrapper, 0);
5401   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5402   if(SQ_FAILED(sq_createslot(v, -3))) {
5403     throw SquirrelError(v, "Couldn't register function 'set_time'");
5404   }
5405
5406   if(SQ_FAILED(sq_createslot(v, -3))) {
5407     throw SquirrelError(v, "Couldn't register class 'LevelTime'");
5408   }
5409
5410   // Register class WillOWisp
5411   sq_pushstring(v, "WillOWisp", -1);
5412   if(sq_newclass(v, SQFalse) < 0) {
5413     std::ostringstream msg;
5414     msg << "Couldn't create new class 'WillOWisp'";
5415     throw SquirrelError(v, msg.str());
5416   }
5417   sq_pushstring(v, "goto_node", -1);
5418   sq_newclosure(v, &WillOWisp_goto_node_wrapper, 0);
5419   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5420   if(SQ_FAILED(sq_createslot(v, -3))) {
5421     throw SquirrelError(v, "Couldn't register function 'goto_node'");
5422   }
5423
5424   sq_pushstring(v, "set_state", -1);
5425   sq_newclosure(v, &WillOWisp_set_state_wrapper, 0);
5426   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5427   if(SQ_FAILED(sq_createslot(v, -3))) {
5428     throw SquirrelError(v, "Couldn't register function 'set_state'");
5429   }
5430
5431   sq_pushstring(v, "start_moving", -1);
5432   sq_newclosure(v, &WillOWisp_start_moving_wrapper, 0);
5433   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5434   if(SQ_FAILED(sq_createslot(v, -3))) {
5435     throw SquirrelError(v, "Couldn't register function 'start_moving'");
5436   }
5437
5438   sq_pushstring(v, "stop_moving", -1);
5439   sq_newclosure(v, &WillOWisp_stop_moving_wrapper, 0);
5440   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5441   if(SQ_FAILED(sq_createslot(v, -3))) {
5442     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5443   }
5444
5445   if(SQ_FAILED(sq_createslot(v, -3))) {
5446     throw SquirrelError(v, "Couldn't register class 'WillOWisp'");
5447   }
5448
5449 }
5450
5451 } // end of namespace Scripting