Crude hack to slow down the game, use set_game_speed(2.0) in console to run at half...
[supertux.git] / src / scripting / wrapper.cpp
1 /**
2  * WARNING: This file is automatically generated from:
3  *  'src/scripting/wrapper.interface.hpp'
4  * DO NOT CHANGE
5  */
6 #include <config.h>
7
8 #include <new>
9 #include <assert.h>
10 #include <string>
11 #include <sstream>
12 #include <squirrel.h>
13 #include "squirrel_error.hpp"
14 #include "wrapper.interface.hpp"
15
16 namespace Scripting
17 {
18 namespace Wrapper
19 {
20
21 static SQInteger DisplayEffect_release_hook(SQUserPointer ptr, SQInteger )
22 {
23   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (ptr);
24   delete _this;
25   return 0;
26 }
27
28 static SQInteger DisplayEffect_fade_out_wrapper(HSQUIRRELVM vm)
29 {
30   SQUserPointer data;
31   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
32     sq_throwerror(vm, _SC("'fade_out' called without instance"));
33     return SQ_ERROR;
34   }
35   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
36   SQFloat arg0;
37   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
38     sq_throwerror(vm, _SC("Argument 1 not a float"));
39     return SQ_ERROR;
40   }
41
42   try {
43     _this->fade_out(static_cast<float> (arg0));
44
45     return 0;
46
47   } catch(std::exception& e) {
48     sq_throwerror(vm, e.what());
49     return SQ_ERROR;
50   } catch(...) {
51     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
52     return SQ_ERROR;
53   }
54
55 }
56
57 static SQInteger DisplayEffect_fade_in_wrapper(HSQUIRRELVM vm)
58 {
59   SQUserPointer data;
60   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
61     sq_throwerror(vm, _SC("'fade_in' called without instance"));
62     return SQ_ERROR;
63   }
64   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
65   SQFloat arg0;
66   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
67     sq_throwerror(vm, _SC("Argument 1 not a float"));
68     return SQ_ERROR;
69   }
70
71   try {
72     _this->fade_in(static_cast<float> (arg0));
73
74     return 0;
75
76   } catch(std::exception& e) {
77     sq_throwerror(vm, e.what());
78     return SQ_ERROR;
79   } catch(...) {
80     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
81     return SQ_ERROR;
82   }
83
84 }
85
86 static SQInteger DisplayEffect_set_black_wrapper(HSQUIRRELVM vm)
87 {
88   SQUserPointer data;
89   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
90     sq_throwerror(vm, _SC("'set_black' called without instance"));
91     return SQ_ERROR;
92   }
93   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
94   SQBool arg0;
95   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
96     sq_throwerror(vm, _SC("Argument 1 not a bool"));
97     return SQ_ERROR;
98   }
99
100   try {
101     _this->set_black(arg0 == SQTrue);
102
103     return 0;
104
105   } catch(std::exception& e) {
106     sq_throwerror(vm, e.what());
107     return SQ_ERROR;
108   } catch(...) {
109     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_black'"));
110     return SQ_ERROR;
111   }
112
113 }
114
115 static SQInteger DisplayEffect_is_black_wrapper(HSQUIRRELVM vm)
116 {
117   SQUserPointer data;
118   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
119     sq_throwerror(vm, _SC("'is_black' called without instance"));
120     return SQ_ERROR;
121   }
122   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
123
124   try {
125     bool return_value = _this->is_black();
126
127     sq_pushbool(vm, return_value);
128     return 1;
129
130   } catch(std::exception& e) {
131     sq_throwerror(vm, e.what());
132     return SQ_ERROR;
133   } catch(...) {
134     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_black'"));
135     return SQ_ERROR;
136   }
137
138 }
139
140 static SQInteger DisplayEffect_sixteen_to_nine_wrapper(HSQUIRRELVM vm)
141 {
142   SQUserPointer data;
143   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
144     sq_throwerror(vm, _SC("'sixteen_to_nine' called without instance"));
145     return SQ_ERROR;
146   }
147   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
148   SQFloat arg0;
149   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
150     sq_throwerror(vm, _SC("Argument 1 not a float"));
151     return SQ_ERROR;
152   }
153
154   try {
155     _this->sixteen_to_nine(static_cast<float> (arg0));
156
157     return 0;
158
159   } catch(std::exception& e) {
160     sq_throwerror(vm, e.what());
161     return SQ_ERROR;
162   } catch(...) {
163     sq_throwerror(vm, _SC("Unexpected exception while executing function 'sixteen_to_nine'"));
164     return SQ_ERROR;
165   }
166
167 }
168
169 static SQInteger DisplayEffect_four_to_three_wrapper(HSQUIRRELVM vm)
170 {
171   SQUserPointer data;
172   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
173     sq_throwerror(vm, _SC("'four_to_three' called without instance"));
174     return SQ_ERROR;
175   }
176   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
177   SQFloat arg0;
178   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
179     sq_throwerror(vm, _SC("Argument 1 not a float"));
180     return SQ_ERROR;
181   }
182
183   try {
184     _this->four_to_three(static_cast<float> (arg0));
185
186     return 0;
187
188   } catch(std::exception& e) {
189     sq_throwerror(vm, e.what());
190     return SQ_ERROR;
191   } catch(...) {
192     sq_throwerror(vm, _SC("Unexpected exception while executing function 'four_to_three'"));
193     return SQ_ERROR;
194   }
195
196 }
197
198 static SQInteger Camera_release_hook(SQUserPointer ptr, SQInteger )
199 {
200   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (ptr);
201   delete _this;
202   return 0;
203 }
204
205 static SQInteger Camera_reload_config_wrapper(HSQUIRRELVM vm)
206 {
207   SQUserPointer data;
208   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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))) {
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 LevelTime_release_hook(SQUserPointer ptr, SQInteger )
2882 {
2883   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (ptr);
2884   delete _this;
2885   return 0;
2886 }
2887
2888 static SQInteger LevelTime_start_wrapper(HSQUIRRELVM vm)
2889 {
2890   SQUserPointer data;
2891   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2892     sq_throwerror(vm, _SC("'start' called without instance"));
2893     return SQ_ERROR;
2894   }
2895   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2896
2897   try {
2898     _this->start();
2899
2900     return 0;
2901
2902   } catch(std::exception& e) {
2903     sq_throwerror(vm, e.what());
2904     return SQ_ERROR;
2905   } catch(...) {
2906     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2907     return SQ_ERROR;
2908   }
2909
2910 }
2911
2912 static SQInteger LevelTime_stop_wrapper(HSQUIRRELVM vm)
2913 {
2914   SQUserPointer data;
2915   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2916     sq_throwerror(vm, _SC("'stop' called without instance"));
2917     return SQ_ERROR;
2918   }
2919   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2920
2921   try {
2922     _this->stop();
2923
2924     return 0;
2925
2926   } catch(std::exception& e) {
2927     sq_throwerror(vm, e.what());
2928     return SQ_ERROR;
2929   } catch(...) {
2930     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2931     return SQ_ERROR;
2932   }
2933
2934 }
2935
2936 static SQInteger LevelTime_get_time_wrapper(HSQUIRRELVM vm)
2937 {
2938   SQUserPointer data;
2939   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2940     sq_throwerror(vm, _SC("'get_time' called without instance"));
2941     return SQ_ERROR;
2942   }
2943   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2944
2945   try {
2946     float return_value = _this->get_time();
2947
2948     sq_pushfloat(vm, return_value);
2949     return 1;
2950
2951   } catch(std::exception& e) {
2952     sq_throwerror(vm, e.what());
2953     return SQ_ERROR;
2954   } catch(...) {
2955     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_time'"));
2956     return SQ_ERROR;
2957   }
2958
2959 }
2960
2961 static SQInteger LevelTime_set_time_wrapper(HSQUIRRELVM vm)
2962 {
2963   SQUserPointer data;
2964   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2965     sq_throwerror(vm, _SC("'set_time' called without instance"));
2966     return SQ_ERROR;
2967   }
2968   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2969   SQFloat arg0;
2970   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2971     sq_throwerror(vm, _SC("Argument 1 not a float"));
2972     return SQ_ERROR;
2973   }
2974
2975   try {
2976     _this->set_time(static_cast<float> (arg0));
2977
2978     return 0;
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 'set_time'"));
2985     return SQ_ERROR;
2986   }
2987
2988 }
2989
2990 static SQInteger WillOWisp_release_hook(SQUserPointer ptr, SQInteger )
2991 {
2992   Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (ptr);
2993   delete _this;
2994   return 0;
2995 }
2996
2997 static SQInteger WillOWisp_goto_node_wrapper(HSQUIRRELVM vm)
2998 {
2999   SQUserPointer data;
3000   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
3001     sq_throwerror(vm, _SC("'goto_node' called without instance"));
3002     return SQ_ERROR;
3003   }
3004   Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
3005   SQInteger arg0;
3006   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
3007     sq_throwerror(vm, _SC("Argument 1 not an integer"));
3008     return SQ_ERROR;
3009   }
3010
3011   try {
3012     _this->goto_node(static_cast<int> (arg0));
3013
3014     return 0;
3015
3016   } catch(std::exception& e) {
3017     sq_throwerror(vm, e.what());
3018     return SQ_ERROR;
3019   } catch(...) {
3020     sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
3021     return SQ_ERROR;
3022   }
3023
3024 }
3025
3026 static SQInteger WillOWisp_set_state_wrapper(HSQUIRRELVM vm)
3027 {
3028   SQUserPointer data;
3029   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
3030     sq_throwerror(vm, _SC("'set_state' called without instance"));
3031     return SQ_ERROR;
3032   }
3033   Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
3034   const SQChar* arg0;
3035   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3036     sq_throwerror(vm, _SC("Argument 1 not a string"));
3037     return SQ_ERROR;
3038   }
3039
3040   try {
3041     _this->set_state(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 'set_state'"));
3050     return SQ_ERROR;
3051   }
3052
3053 }
3054
3055 static SQInteger WillOWisp_start_moving_wrapper(HSQUIRRELVM vm)
3056 {
3057   SQUserPointer data;
3058   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
3059     sq_throwerror(vm, _SC("'start_moving' called without instance"));
3060     return SQ_ERROR;
3061   }
3062   Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
3063
3064   try {
3065     _this->start_moving();
3066
3067     return 0;
3068
3069   } catch(std::exception& e) {
3070     sq_throwerror(vm, e.what());
3071     return SQ_ERROR;
3072   } catch(...) {
3073     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
3074     return SQ_ERROR;
3075   }
3076
3077 }
3078
3079 static SQInteger WillOWisp_stop_moving_wrapper(HSQUIRRELVM vm)
3080 {
3081   SQUserPointer data;
3082   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
3083     sq_throwerror(vm, _SC("'stop_moving' called without instance"));
3084     return SQ_ERROR;
3085   }
3086   Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
3087
3088   try {
3089     _this->stop_moving();
3090
3091     return 0;
3092
3093   } catch(std::exception& e) {
3094     sq_throwerror(vm, e.what());
3095     return SQ_ERROR;
3096   } catch(...) {
3097     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
3098     return SQ_ERROR;
3099   }
3100
3101 }
3102
3103 static SQInteger display_wrapper(HSQUIRRELVM vm)
3104 {
3105   return Scripting::display(vm);
3106 }
3107
3108 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
3109 {
3110   HSQUIRRELVM arg0 = vm;
3111
3112   try {
3113     Scripting::print_stacktrace(arg0);
3114
3115     return 0;
3116
3117   } catch(std::exception& e) {
3118     sq_throwerror(vm, e.what());
3119     return SQ_ERROR;
3120   } catch(...) {
3121     sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
3122     return SQ_ERROR;
3123   }
3124
3125 }
3126
3127 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
3128 {
3129   return Scripting::get_current_thread(vm);
3130 }
3131
3132 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
3133 {
3134   const SQChar* arg0;
3135   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3136     sq_throwerror(vm, _SC("Argument 1 not a string"));
3137     return SQ_ERROR;
3138   }
3139
3140   try {
3141     Scripting::display_text_file(arg0);
3142
3143     return 0;
3144
3145   } catch(std::exception& e) {
3146     sq_throwerror(vm, e.what());
3147     return SQ_ERROR;
3148   } catch(...) {
3149     sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
3150     return SQ_ERROR;
3151   }
3152
3153 }
3154
3155 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
3156 {
3157   const SQChar* arg0;
3158   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3159     sq_throwerror(vm, _SC("Argument 1 not a string"));
3160     return SQ_ERROR;
3161   }
3162
3163   try {
3164     Scripting::load_worldmap(arg0);
3165
3166     return 0;
3167
3168   } catch(std::exception& e) {
3169     sq_throwerror(vm, e.what());
3170     return SQ_ERROR;
3171   } catch(...) {
3172     sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
3173     return SQ_ERROR;
3174   }
3175
3176 }
3177
3178 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
3179 {
3180   const SQChar* arg0;
3181   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3182     sq_throwerror(vm, _SC("Argument 1 not a string"));
3183     return SQ_ERROR;
3184   }
3185
3186   try {
3187     Scripting::load_level(arg0);
3188
3189     return 0;
3190
3191   } catch(std::exception& e) {
3192     sq_throwerror(vm, e.what());
3193     return SQ_ERROR;
3194   } catch(...) {
3195     sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
3196     return SQ_ERROR;
3197   }
3198
3199 }
3200
3201 static SQInteger wait_wrapper(HSQUIRRELVM vm)
3202 {
3203   HSQUIRRELVM arg0 = vm;
3204   SQFloat arg1;
3205   if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
3206     sq_throwerror(vm, _SC("Argument 1 not a float"));
3207     return SQ_ERROR;
3208   }
3209
3210   try {
3211     Scripting::wait(arg0, static_cast<float> (arg1));
3212
3213     return sq_suspendvm(vm);
3214
3215   } catch(std::exception& e) {
3216     sq_throwerror(vm, e.what());
3217     return SQ_ERROR;
3218   } catch(...) {
3219     sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
3220     return SQ_ERROR;
3221   }
3222
3223 }
3224
3225 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
3226 {
3227   HSQUIRRELVM arg0 = vm;
3228
3229   try {
3230     Scripting::wait_for_screenswitch(arg0);
3231
3232     return sq_suspendvm(vm);
3233
3234   } catch(std::exception& e) {
3235     sq_throwerror(vm, e.what());
3236     return SQ_ERROR;
3237   } catch(...) {
3238     sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
3239     return SQ_ERROR;
3240   }
3241
3242 }
3243
3244 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
3245 {
3246   (void) vm;
3247
3248   try {
3249     Scripting::exit_screen();
3250
3251     return 0;
3252
3253   } catch(std::exception& e) {
3254     sq_throwerror(vm, e.what());
3255     return SQ_ERROR;
3256   } catch(...) {
3257     sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
3258     return SQ_ERROR;
3259   }
3260
3261 }
3262
3263 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
3264 {
3265   SQFloat arg0;
3266   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3267     sq_throwerror(vm, _SC("Argument 1 not a float"));
3268     return SQ_ERROR;
3269   }
3270
3271   try {
3272     Scripting::fadeout_screen(static_cast<float> (arg0));
3273
3274     return 0;
3275
3276   } catch(std::exception& e) {
3277     sq_throwerror(vm, e.what());
3278     return SQ_ERROR;
3279   } catch(...) {
3280     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
3281     return SQ_ERROR;
3282   }
3283
3284 }
3285
3286 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
3287 {
3288   SQFloat arg0;
3289   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3290     sq_throwerror(vm, _SC("Argument 1 not a float"));
3291     return SQ_ERROR;
3292   }
3293   SQFloat arg1;
3294   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
3295     sq_throwerror(vm, _SC("Argument 2 not a float"));
3296     return SQ_ERROR;
3297   }
3298   SQFloat arg2;
3299   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
3300     sq_throwerror(vm, _SC("Argument 3 not a float"));
3301     return SQ_ERROR;
3302   }
3303
3304   try {
3305     Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
3306
3307     return 0;
3308
3309   } catch(std::exception& e) {
3310     sq_throwerror(vm, e.what());
3311     return SQ_ERROR;
3312   } catch(...) {
3313     sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
3314     return SQ_ERROR;
3315   }
3316
3317 }
3318
3319 static SQInteger abort_screenfade_wrapper(HSQUIRRELVM vm)
3320 {
3321   (void) vm;
3322
3323   try {
3324     Scripting::abort_screenfade();
3325
3326     return 0;
3327
3328   } catch(std::exception& e) {
3329     sq_throwerror(vm, e.what());
3330     return SQ_ERROR;
3331   } catch(...) {
3332     sq_throwerror(vm, _SC("Unexpected exception while executing function 'abort_screenfade'"));
3333     return SQ_ERROR;
3334   }
3335
3336 }
3337
3338 static SQInteger translate_wrapper(HSQUIRRELVM vm)
3339 {
3340   const SQChar* arg0;
3341   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3342     sq_throwerror(vm, _SC("Argument 1 not a string"));
3343     return SQ_ERROR;
3344   }
3345
3346   try {
3347     std::string return_value = Scripting::translate(arg0);
3348
3349     sq_pushstring(vm, return_value.c_str(), return_value.size());
3350     return 1;
3351
3352   } catch(std::exception& e) {
3353     sq_throwerror(vm, e.what());
3354     return SQ_ERROR;
3355   } catch(...) {
3356     sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
3357     return SQ_ERROR;
3358   }
3359
3360 }
3361
3362 static SQInteger import_wrapper(HSQUIRRELVM vm)
3363 {
3364   HSQUIRRELVM arg0 = vm;
3365   const SQChar* arg1;
3366   if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
3367     sq_throwerror(vm, _SC("Argument 1 not a string"));
3368     return SQ_ERROR;
3369   }
3370
3371   try {
3372     Scripting::import(arg0, arg1);
3373
3374     return 0;
3375
3376   } catch(std::exception& e) {
3377     sq_throwerror(vm, e.what());
3378     return SQ_ERROR;
3379   } catch(...) {
3380     sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
3381     return SQ_ERROR;
3382   }
3383
3384 }
3385
3386 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
3387 {
3388   (void) vm;
3389
3390   try {
3391     Scripting::save_state();
3392
3393     return 0;
3394
3395   } catch(std::exception& e) {
3396     sq_throwerror(vm, e.what());
3397     return SQ_ERROR;
3398   } catch(...) {
3399     sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
3400     return SQ_ERROR;
3401   }
3402
3403 }
3404
3405 static SQInteger update_worldmap_wrapper(HSQUIRRELVM vm)
3406 {
3407   (void) vm;
3408
3409   try {
3410     Scripting::update_worldmap();
3411
3412     return 0;
3413
3414   } catch(std::exception& e) {
3415     sq_throwerror(vm, e.what());
3416     return SQ_ERROR;
3417   } catch(...) {
3418     sq_throwerror(vm, _SC("Unexpected exception while executing function 'update_worldmap'"));
3419     return SQ_ERROR;
3420   }
3421
3422 }
3423
3424 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
3425 {
3426   SQBool arg0;
3427   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3428     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3429     return SQ_ERROR;
3430   }
3431
3432   try {
3433     Scripting::debug_collrects(arg0 == SQTrue);
3434
3435     return 0;
3436
3437   } catch(std::exception& e) {
3438     sq_throwerror(vm, e.what());
3439     return SQ_ERROR;
3440   } catch(...) {
3441     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
3442     return SQ_ERROR;
3443   }
3444
3445 }
3446
3447 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
3448 {
3449   SQBool arg0;
3450   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3451     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3452     return SQ_ERROR;
3453   }
3454
3455   try {
3456     Scripting::debug_show_fps(arg0 == SQTrue);
3457
3458     return 0;
3459
3460   } catch(std::exception& e) {
3461     sq_throwerror(vm, e.what());
3462     return SQ_ERROR;
3463   } catch(...) {
3464     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
3465     return SQ_ERROR;
3466   }
3467
3468 }
3469
3470 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
3471 {
3472   SQBool arg0;
3473   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3474     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3475     return SQ_ERROR;
3476   }
3477
3478   try {
3479     Scripting::debug_draw_solids_only(arg0 == SQTrue);
3480
3481     return 0;
3482
3483   } catch(std::exception& e) {
3484     sq_throwerror(vm, e.what());
3485     return SQ_ERROR;
3486   } catch(...) {
3487     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
3488     return SQ_ERROR;
3489   }
3490
3491 }
3492
3493 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
3494 {
3495   const SQChar* arg0;
3496   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3497     sq_throwerror(vm, _SC("Argument 1 not a string"));
3498     return SQ_ERROR;
3499   }
3500
3501   try {
3502     Scripting::play_music(arg0);
3503
3504     return 0;
3505
3506   } catch(std::exception& e) {
3507     sq_throwerror(vm, e.what());
3508     return SQ_ERROR;
3509   } catch(...) {
3510     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
3511     return SQ_ERROR;
3512   }
3513
3514 }
3515
3516 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
3517 {
3518   const SQChar* arg0;
3519   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3520     sq_throwerror(vm, _SC("Argument 1 not a string"));
3521     return SQ_ERROR;
3522   }
3523
3524   try {
3525     Scripting::play_sound(arg0);
3526
3527     return 0;
3528
3529   } catch(std::exception& e) {
3530     sq_throwerror(vm, e.what());
3531     return SQ_ERROR;
3532   } catch(...) {
3533     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
3534     return SQ_ERROR;
3535   }
3536
3537 }
3538
3539 static SQInteger set_game_speed_wrapper(HSQUIRRELVM vm)
3540 {
3541   SQFloat arg0;
3542   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3543     sq_throwerror(vm, _SC("Argument 1 not a float"));
3544     return SQ_ERROR;
3545   }
3546
3547   try {
3548     Scripting::set_game_speed(static_cast<float> (arg0));
3549
3550     return 0;
3551
3552   } catch(std::exception& e) {
3553     sq_throwerror(vm, e.what());
3554     return SQ_ERROR;
3555   } catch(...) {
3556     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_game_speed'"));
3557     return SQ_ERROR;
3558   }
3559
3560 }
3561
3562 static SQInteger grease_wrapper(HSQUIRRELVM vm)
3563 {
3564   (void) vm;
3565
3566   try {
3567     Scripting::grease();
3568
3569     return 0;
3570
3571   } catch(std::exception& e) {
3572     sq_throwerror(vm, e.what());
3573     return SQ_ERROR;
3574   } catch(...) {
3575     sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
3576     return SQ_ERROR;
3577   }
3578
3579 }
3580
3581 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
3582 {
3583   (void) vm;
3584
3585   try {
3586     Scripting::invincible();
3587
3588     return 0;
3589
3590   } catch(std::exception& e) {
3591     sq_throwerror(vm, e.what());
3592     return SQ_ERROR;
3593   } catch(...) {
3594     sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
3595     return SQ_ERROR;
3596   }
3597
3598 }
3599
3600 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
3601 {
3602   (void) vm;
3603
3604   try {
3605     Scripting::ghost();
3606
3607     return 0;
3608
3609   } catch(std::exception& e) {
3610     sq_throwerror(vm, e.what());
3611     return SQ_ERROR;
3612   } catch(...) {
3613     sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
3614     return SQ_ERROR;
3615   }
3616
3617 }
3618
3619 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
3620 {
3621   (void) vm;
3622
3623   try {
3624     Scripting::mortal();
3625
3626     return 0;
3627
3628   } catch(std::exception& e) {
3629     sq_throwerror(vm, e.what());
3630     return SQ_ERROR;
3631   } catch(...) {
3632     sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
3633     return SQ_ERROR;
3634   }
3635
3636 }
3637
3638 static SQInteger restart_wrapper(HSQUIRRELVM vm)
3639 {
3640   (void) vm;
3641
3642   try {
3643     Scripting::restart();
3644
3645     return 0;
3646
3647   } catch(std::exception& e) {
3648     sq_throwerror(vm, e.what());
3649     return SQ_ERROR;
3650   } catch(...) {
3651     sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
3652     return SQ_ERROR;
3653   }
3654
3655 }
3656
3657 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
3658 {
3659   (void) vm;
3660
3661   try {
3662     Scripting::whereami();
3663
3664     return 0;
3665
3666   } catch(std::exception& e) {
3667     sq_throwerror(vm, e.what());
3668     return SQ_ERROR;
3669   } catch(...) {
3670     sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
3671     return SQ_ERROR;
3672   }
3673
3674 }
3675
3676 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
3677 {
3678   (void) vm;
3679
3680   try {
3681     Scripting::gotoend();
3682
3683     return 0;
3684
3685   } catch(std::exception& e) {
3686     sq_throwerror(vm, e.what());
3687     return SQ_ERROR;
3688   } catch(...) {
3689     sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
3690     return SQ_ERROR;
3691   }
3692
3693 }
3694
3695 static SQInteger camera_wrapper(HSQUIRRELVM vm)
3696 {
3697   (void) vm;
3698
3699   try {
3700     Scripting::camera();
3701
3702     return 0;
3703
3704   } catch(std::exception& e) {
3705     sq_throwerror(vm, e.what());
3706     return SQ_ERROR;
3707   } catch(...) {
3708     sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
3709     return SQ_ERROR;
3710   }
3711
3712 }
3713
3714 static SQInteger quit_wrapper(HSQUIRRELVM vm)
3715 {
3716   (void) vm;
3717
3718   try {
3719     Scripting::quit();
3720
3721     return 0;
3722
3723   } catch(std::exception& e) {
3724     sq_throwerror(vm, e.what());
3725     return SQ_ERROR;
3726   } catch(...) {
3727     sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
3728     return SQ_ERROR;
3729   }
3730
3731 }
3732
3733 static SQInteger rand_wrapper(HSQUIRRELVM vm)
3734 {
3735
3736   try {
3737     int return_value = Scripting::rand();
3738
3739     sq_pushinteger(vm, return_value);
3740     return 1;
3741
3742   } catch(std::exception& e) {
3743     sq_throwerror(vm, e.what());
3744     return SQ_ERROR;
3745   } catch(...) {
3746     sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
3747     return SQ_ERROR;
3748   }
3749
3750 }
3751
3752 } // end of namespace Wrapper
3753 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
3754 {
3755   using namespace Wrapper;
3756
3757   sq_pushroottable(v);
3758   sq_pushstring(v, "DisplayEffect", -1);
3759   if(SQ_FAILED(sq_get(v, -2))) {
3760     std::ostringstream msg;
3761     msg << "Couldn't resolved squirrel type 'DisplayEffect'";
3762     throw SquirrelError(v, msg.str());
3763   }
3764
3765   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3766     std::ostringstream msg;
3767     msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
3768     throw SquirrelError(v, msg.str());
3769   }
3770   sq_remove(v, -2); // remove object name
3771
3772   if(setup_releasehook) {
3773     sq_setreleasehook(v, -1, DisplayEffect_release_hook);
3774   }
3775
3776   sq_remove(v, -2); // remove root table
3777 }
3778
3779 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
3780 {
3781   using namespace Wrapper;
3782
3783   sq_pushroottable(v);
3784   sq_pushstring(v, "Camera", -1);
3785   if(SQ_FAILED(sq_get(v, -2))) {
3786     std::ostringstream msg;
3787     msg << "Couldn't resolved squirrel type 'Camera'";
3788     throw SquirrelError(v, msg.str());
3789   }
3790
3791   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3792     std::ostringstream msg;
3793     msg << "Couldn't setup squirrel instance for object of type 'Camera'";
3794     throw SquirrelError(v, msg.str());
3795   }
3796   sq_remove(v, -2); // remove object name
3797
3798   if(setup_releasehook) {
3799     sq_setreleasehook(v, -1, Camera_release_hook);
3800   }
3801
3802   sq_remove(v, -2); // remove root table
3803 }
3804
3805 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
3806 {
3807   using namespace Wrapper;
3808
3809   sq_pushroottable(v);
3810   sq_pushstring(v, "Level", -1);
3811   if(SQ_FAILED(sq_get(v, -2))) {
3812     std::ostringstream msg;
3813     msg << "Couldn't resolved squirrel type 'Level'";
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 'Level'";
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, Level_release_hook);
3826   }
3827
3828   sq_remove(v, -2); // remove root table
3829 }
3830
3831 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
3832 {
3833   using namespace Wrapper;
3834
3835   sq_pushroottable(v);
3836   sq_pushstring(v, "ScriptedObject", -1);
3837   if(SQ_FAILED(sq_get(v, -2))) {
3838     std::ostringstream msg;
3839     msg << "Couldn't resolved squirrel type 'ScriptedObject'";
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 'ScriptedObject'";
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, ScriptedObject_release_hook);
3852   }
3853
3854   sq_remove(v, -2); // remove root table
3855 }
3856
3857 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
3858 {
3859   using namespace Wrapper;
3860
3861   sq_pushroottable(v);
3862   sq_pushstring(v, "Text", -1);
3863   if(SQ_FAILED(sq_get(v, -2))) {
3864     std::ostringstream msg;
3865     msg << "Couldn't resolved squirrel type 'Text'";
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 'Text'";
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, Text_release_hook);
3878   }
3879
3880   sq_remove(v, -2); // remove root table
3881 }
3882
3883 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
3884 {
3885   using namespace Wrapper;
3886
3887   sq_pushroottable(v);
3888   sq_pushstring(v, "Player", -1);
3889   if(SQ_FAILED(sq_get(v, -2))) {
3890     std::ostringstream msg;
3891     msg << "Couldn't resolved squirrel type 'Player'";
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 'Player'";
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, Player_release_hook);
3904   }
3905
3906   sq_remove(v, -2); // remove root table
3907 }
3908
3909 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
3910 {
3911   using namespace Wrapper;
3912
3913   sq_pushroottable(v);
3914   sq_pushstring(v, "FloatingImage", -1);
3915   if(SQ_FAILED(sq_get(v, -2))) {
3916     std::ostringstream msg;
3917     msg << "Couldn't resolved squirrel type 'FloatingImage'";
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 'FloatingImage'";
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, FloatingImage_release_hook);
3930   }
3931
3932   sq_remove(v, -2); // remove root table
3933 }
3934
3935 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
3936 {
3937   using namespace Wrapper;
3938
3939   sq_pushroottable(v);
3940   sq_pushstring(v, "Platform", -1);
3941   if(SQ_FAILED(sq_get(v, -2))) {
3942     std::ostringstream msg;
3943     msg << "Couldn't resolved squirrel type 'Platform'";
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 'Platform'";
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, Platform_release_hook);
3956   }
3957
3958   sq_remove(v, -2); // remove root table
3959 }
3960
3961 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook)
3962 {
3963   using namespace Wrapper;
3964
3965   sq_pushroottable(v);
3966   sq_pushstring(v, "Candle", -1);
3967   if(SQ_FAILED(sq_get(v, -2))) {
3968     std::ostringstream msg;
3969     msg << "Couldn't resolved squirrel type 'Candle'";
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 'Candle'";
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, Candle_release_hook);
3982   }
3983
3984   sq_remove(v, -2); // remove root table
3985 }
3986
3987 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup_releasehook)
3988 {
3989   using namespace Wrapper;
3990
3991   sq_pushroottable(v);
3992   sq_pushstring(v, "Wind", -1);
3993   if(SQ_FAILED(sq_get(v, -2))) {
3994     std::ostringstream msg;
3995     msg << "Couldn't resolved squirrel type 'Wind'";
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 'Wind'";
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, Wind_release_hook);
4008   }
4009
4010   sq_remove(v, -2); // remove root table
4011 }
4012
4013 void create_squirrel_instance(HSQUIRRELVM v, Scripting::AmbientSound* object, bool setup_releasehook)
4014 {
4015   using namespace Wrapper;
4016
4017   sq_pushroottable(v);
4018   sq_pushstring(v, "AmbientSound", -1);
4019   if(SQ_FAILED(sq_get(v, -2))) {
4020     std::ostringstream msg;
4021     msg << "Couldn't resolved squirrel type 'AmbientSound'";
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 'AmbientSound'";
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, AmbientSound_release_hook);
4034   }
4035
4036   sq_remove(v, -2); // remove root table
4037 }
4038
4039 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Thunderstorm* object, bool setup_releasehook)
4040 {
4041   using namespace Wrapper;
4042
4043   sq_pushroottable(v);
4044   sq_pushstring(v, "Thunderstorm", -1);
4045   if(SQ_FAILED(sq_get(v, -2))) {
4046     std::ostringstream msg;
4047     msg << "Couldn't resolved squirrel type 'Thunderstorm'";
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 'Thunderstorm'";
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, Thunderstorm_release_hook);
4060   }
4061
4062   sq_remove(v, -2); // remove root table
4063 }
4064
4065 void create_squirrel_instance(HSQUIRRELVM v, Scripting::TileMap* object, bool setup_releasehook)
4066 {
4067   using namespace Wrapper;
4068
4069   sq_pushroottable(v);
4070   sq_pushstring(v, "TileMap", -1);
4071   if(SQ_FAILED(sq_get(v, -2))) {
4072     std::ostringstream msg;
4073     msg << "Couldn't resolved squirrel type 'TileMap'";
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 'TileMap'";
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, TileMap_release_hook);
4086   }
4087
4088   sq_remove(v, -2); // remove root table
4089 }
4090
4091 void create_squirrel_instance(HSQUIRRELVM v, Scripting::SSector* object, bool setup_releasehook)
4092 {
4093   using namespace Wrapper;
4094
4095   sq_pushroottable(v);
4096   sq_pushstring(v, "SSector", -1);
4097   if(SQ_FAILED(sq_get(v, -2))) {
4098     std::ostringstream msg;
4099     msg << "Couldn't resolved squirrel type 'SSector'";
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 'SSector'";
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, SSector_release_hook);
4112   }
4113
4114   sq_remove(v, -2); // remove root table
4115 }
4116
4117 void create_squirrel_instance(HSQUIRRELVM v, Scripting::LevelTime* object, bool setup_releasehook)
4118 {
4119   using namespace Wrapper;
4120
4121   sq_pushroottable(v);
4122   sq_pushstring(v, "LevelTime", -1);
4123   if(SQ_FAILED(sq_get(v, -2))) {
4124     std::ostringstream msg;
4125     msg << "Couldn't resolved squirrel type 'LevelTime'";
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 'LevelTime'";
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, LevelTime_release_hook);
4138   }
4139
4140   sq_remove(v, -2); // remove root table
4141 }
4142
4143 void create_squirrel_instance(HSQUIRRELVM v, Scripting::WillOWisp* object, bool setup_releasehook)
4144 {
4145   using namespace Wrapper;
4146
4147   sq_pushroottable(v);
4148   sq_pushstring(v, "WillOWisp", -1);
4149   if(SQ_FAILED(sq_get(v, -2))) {
4150     std::ostringstream msg;
4151     msg << "Couldn't resolved squirrel type 'WillOWisp'";
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 'WillOWisp'";
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, WillOWisp_release_hook);
4164   }
4165
4166   sq_remove(v, -2); // remove root table
4167 }
4168
4169 void register_supertux_wrapper(HSQUIRRELVM v)
4170 {
4171   using namespace Wrapper;
4172
4173   sq_pushstring(v, "ANCHOR_TOP", -1);
4174   sq_pushinteger(v, 16);
4175   if(SQ_FAILED(sq_createslot(v, -3))) {
4176     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
4177   }
4178
4179   sq_pushstring(v, "ANCHOR_BOTTOM", -1);
4180   sq_pushinteger(v, 32);
4181   if(SQ_FAILED(sq_createslot(v, -3))) {
4182     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
4183   }
4184
4185   sq_pushstring(v, "ANCHOR_LEFT", -1);
4186   sq_pushinteger(v, 1);
4187   if(SQ_FAILED(sq_createslot(v, -3))) {
4188     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
4189   }
4190
4191   sq_pushstring(v, "ANCHOR_RIGHT", -1);
4192   sq_pushinteger(v, 2);
4193   if(SQ_FAILED(sq_createslot(v, -3))) {
4194     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
4195   }
4196
4197   sq_pushstring(v, "ANCHOR_MIDDLE", -1);
4198   sq_pushinteger(v, 0);
4199   if(SQ_FAILED(sq_createslot(v, -3))) {
4200     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
4201   }
4202
4203   sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
4204   sq_pushinteger(v, 17);
4205   if(SQ_FAILED(sq_createslot(v, -3))) {
4206     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
4207   }
4208
4209   sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
4210   sq_pushinteger(v, 18);
4211   if(SQ_FAILED(sq_createslot(v, -3))) {
4212     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
4213   }
4214
4215   sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
4216   sq_pushinteger(v, 33);
4217   if(SQ_FAILED(sq_createslot(v, -3))) {
4218     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
4219   }
4220
4221   sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
4222   sq_pushinteger(v, 34);
4223   if(SQ_FAILED(sq_createslot(v, -3))) {
4224     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
4225   }
4226
4227   sq_pushstring(v, "display", -1);
4228   sq_newclosure(v, &display_wrapper, 0);
4229   if(SQ_FAILED(sq_createslot(v, -3))) {
4230     throw SquirrelError(v, "Couldn't register function 'display'");
4231   }
4232
4233   sq_pushstring(v, "print_stacktrace", -1);
4234   sq_newclosure(v, &print_stacktrace_wrapper, 0);
4235   if(SQ_FAILED(sq_createslot(v, -3))) {
4236     throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
4237   }
4238
4239   sq_pushstring(v, "get_current_thread", -1);
4240   sq_newclosure(v, &get_current_thread_wrapper, 0);
4241   if(SQ_FAILED(sq_createslot(v, -3))) {
4242     throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
4243   }
4244
4245   sq_pushstring(v, "display_text_file", -1);
4246   sq_newclosure(v, &display_text_file_wrapper, 0);
4247   if(SQ_FAILED(sq_createslot(v, -3))) {
4248     throw SquirrelError(v, "Couldn't register function 'display_text_file'");
4249   }
4250
4251   sq_pushstring(v, "load_worldmap", -1);
4252   sq_newclosure(v, &load_worldmap_wrapper, 0);
4253   if(SQ_FAILED(sq_createslot(v, -3))) {
4254     throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
4255   }
4256
4257   sq_pushstring(v, "load_level", -1);
4258   sq_newclosure(v, &load_level_wrapper, 0);
4259   if(SQ_FAILED(sq_createslot(v, -3))) {
4260     throw SquirrelError(v, "Couldn't register function 'load_level'");
4261   }
4262
4263   sq_pushstring(v, "wait", -1);
4264   sq_newclosure(v, &wait_wrapper, 0);
4265   if(SQ_FAILED(sq_createslot(v, -3))) {
4266     throw SquirrelError(v, "Couldn't register function 'wait'");
4267   }
4268
4269   sq_pushstring(v, "wait_for_screenswitch", -1);
4270   sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
4271   if(SQ_FAILED(sq_createslot(v, -3))) {
4272     throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
4273   }
4274
4275   sq_pushstring(v, "exit_screen", -1);
4276   sq_newclosure(v, &exit_screen_wrapper, 0);
4277   if(SQ_FAILED(sq_createslot(v, -3))) {
4278     throw SquirrelError(v, "Couldn't register function 'exit_screen'");
4279   }
4280
4281   sq_pushstring(v, "fadeout_screen", -1);
4282   sq_newclosure(v, &fadeout_screen_wrapper, 0);
4283   if(SQ_FAILED(sq_createslot(v, -3))) {
4284     throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
4285   }
4286
4287   sq_pushstring(v, "shrink_screen", -1);
4288   sq_newclosure(v, &shrink_screen_wrapper, 0);
4289   if(SQ_FAILED(sq_createslot(v, -3))) {
4290     throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
4291   }
4292
4293   sq_pushstring(v, "abort_screenfade", -1);
4294   sq_newclosure(v, &abort_screenfade_wrapper, 0);
4295   if(SQ_FAILED(sq_createslot(v, -3))) {
4296     throw SquirrelError(v, "Couldn't register function 'abort_screenfade'");
4297   }
4298
4299   sq_pushstring(v, "translate", -1);
4300   sq_newclosure(v, &translate_wrapper, 0);
4301   if(SQ_FAILED(sq_createslot(v, -3))) {
4302     throw SquirrelError(v, "Couldn't register function 'translate'");
4303   }
4304
4305   sq_pushstring(v, "import", -1);
4306   sq_newclosure(v, &import_wrapper, 0);
4307   if(SQ_FAILED(sq_createslot(v, -3))) {
4308     throw SquirrelError(v, "Couldn't register function 'import'");
4309   }
4310
4311   sq_pushstring(v, "save_state", -1);
4312   sq_newclosure(v, &save_state_wrapper, 0);
4313   if(SQ_FAILED(sq_createslot(v, -3))) {
4314     throw SquirrelError(v, "Couldn't register function 'save_state'");
4315   }
4316
4317   sq_pushstring(v, "update_worldmap", -1);
4318   sq_newclosure(v, &update_worldmap_wrapper, 0);
4319   if(SQ_FAILED(sq_createslot(v, -3))) {
4320     throw SquirrelError(v, "Couldn't register function 'update_worldmap'");
4321   }
4322
4323   sq_pushstring(v, "debug_collrects", -1);
4324   sq_newclosure(v, &debug_collrects_wrapper, 0);
4325   if(SQ_FAILED(sq_createslot(v, -3))) {
4326     throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
4327   }
4328
4329   sq_pushstring(v, "debug_show_fps", -1);
4330   sq_newclosure(v, &debug_show_fps_wrapper, 0);
4331   if(SQ_FAILED(sq_createslot(v, -3))) {
4332     throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
4333   }
4334
4335   sq_pushstring(v, "debug_draw_solids_only", -1);
4336   sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
4337   if(SQ_FAILED(sq_createslot(v, -3))) {
4338     throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
4339   }
4340
4341   sq_pushstring(v, "play_music", -1);
4342   sq_newclosure(v, &play_music_wrapper, 0);
4343   if(SQ_FAILED(sq_createslot(v, -3))) {
4344     throw SquirrelError(v, "Couldn't register function 'play_music'");
4345   }
4346
4347   sq_pushstring(v, "play_sound", -1);
4348   sq_newclosure(v, &play_sound_wrapper, 0);
4349   if(SQ_FAILED(sq_createslot(v, -3))) {
4350     throw SquirrelError(v, "Couldn't register function 'play_sound'");
4351   }
4352
4353   sq_pushstring(v, "set_game_speed", -1);
4354   sq_newclosure(v, &set_game_speed_wrapper, 0);
4355   if(SQ_FAILED(sq_createslot(v, -3))) {
4356     throw SquirrelError(v, "Couldn't register function 'set_game_speed'");
4357   }
4358
4359   sq_pushstring(v, "grease", -1);
4360   sq_newclosure(v, &grease_wrapper, 0);
4361   if(SQ_FAILED(sq_createslot(v, -3))) {
4362     throw SquirrelError(v, "Couldn't register function 'grease'");
4363   }
4364
4365   sq_pushstring(v, "invincible", -1);
4366   sq_newclosure(v, &invincible_wrapper, 0);
4367   if(SQ_FAILED(sq_createslot(v, -3))) {
4368     throw SquirrelError(v, "Couldn't register function 'invincible'");
4369   }
4370
4371   sq_pushstring(v, "ghost", -1);
4372   sq_newclosure(v, &ghost_wrapper, 0);
4373   if(SQ_FAILED(sq_createslot(v, -3))) {
4374     throw SquirrelError(v, "Couldn't register function 'ghost'");
4375   }
4376
4377   sq_pushstring(v, "mortal", -1);
4378   sq_newclosure(v, &mortal_wrapper, 0);
4379   if(SQ_FAILED(sq_createslot(v, -3))) {
4380     throw SquirrelError(v, "Couldn't register function 'mortal'");
4381   }
4382
4383   sq_pushstring(v, "restart", -1);
4384   sq_newclosure(v, &restart_wrapper, 0);
4385   if(SQ_FAILED(sq_createslot(v, -3))) {
4386     throw SquirrelError(v, "Couldn't register function 'restart'");
4387   }
4388
4389   sq_pushstring(v, "whereami", -1);
4390   sq_newclosure(v, &whereami_wrapper, 0);
4391   if(SQ_FAILED(sq_createslot(v, -3))) {
4392     throw SquirrelError(v, "Couldn't register function 'whereami'");
4393   }
4394
4395   sq_pushstring(v, "gotoend", -1);
4396   sq_newclosure(v, &gotoend_wrapper, 0);
4397   if(SQ_FAILED(sq_createslot(v, -3))) {
4398     throw SquirrelError(v, "Couldn't register function 'gotoend'");
4399   }
4400
4401   sq_pushstring(v, "camera", -1);
4402   sq_newclosure(v, &camera_wrapper, 0);
4403   if(SQ_FAILED(sq_createslot(v, -3))) {
4404     throw SquirrelError(v, "Couldn't register function 'camera'");
4405   }
4406
4407   sq_pushstring(v, "quit", -1);
4408   sq_newclosure(v, &quit_wrapper, 0);
4409   if(SQ_FAILED(sq_createslot(v, -3))) {
4410     throw SquirrelError(v, "Couldn't register function 'quit'");
4411   }
4412
4413   sq_pushstring(v, "rand", -1);
4414   sq_newclosure(v, &rand_wrapper, 0);
4415   if(SQ_FAILED(sq_createslot(v, -3))) {
4416     throw SquirrelError(v, "Couldn't register function 'rand'");
4417   }
4418
4419   // Register class DisplayEffect
4420   sq_pushstring(v, "DisplayEffect", -1);
4421   if(sq_newclass(v, SQFalse) < 0) {
4422     std::ostringstream msg;
4423     msg << "Couldn't create new class 'DisplayEffect'";
4424     throw SquirrelError(v, msg.str());
4425   }
4426   sq_pushstring(v, "fade_out", -1);
4427   sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
4428   if(SQ_FAILED(sq_createslot(v, -3))) {
4429     throw SquirrelError(v, "Couldn't register function 'fade_out'");
4430   }
4431
4432   sq_pushstring(v, "fade_in", -1);
4433   sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
4434   if(SQ_FAILED(sq_createslot(v, -3))) {
4435     throw SquirrelError(v, "Couldn't register function 'fade_in'");
4436   }
4437
4438   sq_pushstring(v, "set_black", -1);
4439   sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
4440   if(SQ_FAILED(sq_createslot(v, -3))) {
4441     throw SquirrelError(v, "Couldn't register function 'set_black'");
4442   }
4443
4444   sq_pushstring(v, "is_black", -1);
4445   sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
4446   if(SQ_FAILED(sq_createslot(v, -3))) {
4447     throw SquirrelError(v, "Couldn't register function 'is_black'");
4448   }
4449
4450   sq_pushstring(v, "sixteen_to_nine", -1);
4451   sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
4452   if(SQ_FAILED(sq_createslot(v, -3))) {
4453     throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
4454   }
4455
4456   sq_pushstring(v, "four_to_three", -1);
4457   sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
4458   if(SQ_FAILED(sq_createslot(v, -3))) {
4459     throw SquirrelError(v, "Couldn't register function 'four_to_three'");
4460   }
4461
4462   if(SQ_FAILED(sq_createslot(v, -3))) {
4463     throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
4464   }
4465
4466   // Register class Camera
4467   sq_pushstring(v, "Camera", -1);
4468   if(sq_newclass(v, SQFalse) < 0) {
4469     std::ostringstream msg;
4470     msg << "Couldn't create new class 'Camera'";
4471     throw SquirrelError(v, msg.str());
4472   }
4473   sq_pushstring(v, "reload_config", -1);
4474   sq_newclosure(v, &Camera_reload_config_wrapper, 0);
4475   if(SQ_FAILED(sq_createslot(v, -3))) {
4476     throw SquirrelError(v, "Couldn't register function 'reload_config'");
4477   }
4478
4479   sq_pushstring(v, "shake", -1);
4480   sq_newclosure(v, &Camera_shake_wrapper, 0);
4481   if(SQ_FAILED(sq_createslot(v, -3))) {
4482     throw SquirrelError(v, "Couldn't register function 'shake'");
4483   }
4484
4485   sq_pushstring(v, "set_pos", -1);
4486   sq_newclosure(v, &Camera_set_pos_wrapper, 0);
4487   if(SQ_FAILED(sq_createslot(v, -3))) {
4488     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4489   }
4490
4491   sq_pushstring(v, "set_mode", -1);
4492   sq_newclosure(v, &Camera_set_mode_wrapper, 0);
4493   if(SQ_FAILED(sq_createslot(v, -3))) {
4494     throw SquirrelError(v, "Couldn't register function 'set_mode'");
4495   }
4496
4497   sq_pushstring(v, "scroll_to", -1);
4498   sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
4499   if(SQ_FAILED(sq_createslot(v, -3))) {
4500     throw SquirrelError(v, "Couldn't register function 'scroll_to'");
4501   }
4502
4503   if(SQ_FAILED(sq_createslot(v, -3))) {
4504     throw SquirrelError(v, "Couldn't register class 'Camera'");
4505   }
4506
4507   // Register class Level
4508   sq_pushstring(v, "Level", -1);
4509   if(sq_newclass(v, SQFalse) < 0) {
4510     std::ostringstream msg;
4511     msg << "Couldn't create new class 'Level'";
4512     throw SquirrelError(v, msg.str());
4513   }
4514   sq_pushstring(v, "finish", -1);
4515   sq_newclosure(v, &Level_finish_wrapper, 0);
4516   if(SQ_FAILED(sq_createslot(v, -3))) {
4517     throw SquirrelError(v, "Couldn't register function 'finish'");
4518   }
4519
4520   sq_pushstring(v, "spawn", -1);
4521   sq_newclosure(v, &Level_spawn_wrapper, 0);
4522   if(SQ_FAILED(sq_createslot(v, -3))) {
4523     throw SquirrelError(v, "Couldn't register function 'spawn'");
4524   }
4525
4526   sq_pushstring(v, "flip_vertically", -1);
4527   sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
4528   if(SQ_FAILED(sq_createslot(v, -3))) {
4529     throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
4530   }
4531
4532   sq_pushstring(v, "toggle_pause", -1);
4533   sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
4534   if(SQ_FAILED(sq_createslot(v, -3))) {
4535     throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
4536   }
4537
4538   sq_pushstring(v, "edit", -1);
4539   sq_newclosure(v, &Level_edit_wrapper, 0);
4540   if(SQ_FAILED(sq_createslot(v, -3))) {
4541     throw SquirrelError(v, "Couldn't register function 'edit'");
4542   }
4543
4544   if(SQ_FAILED(sq_createslot(v, -3))) {
4545     throw SquirrelError(v, "Couldn't register class 'Level'");
4546   }
4547
4548   // Register class ScriptedObject
4549   sq_pushstring(v, "ScriptedObject", -1);
4550   if(sq_newclass(v, SQFalse) < 0) {
4551     std::ostringstream msg;
4552     msg << "Couldn't create new class 'ScriptedObject'";
4553     throw SquirrelError(v, msg.str());
4554   }
4555   sq_pushstring(v, "set_action", -1);
4556   sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
4557   if(SQ_FAILED(sq_createslot(v, -3))) {
4558     throw SquirrelError(v, "Couldn't register function 'set_action'");
4559   }
4560
4561   sq_pushstring(v, "get_action", -1);
4562   sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
4563   if(SQ_FAILED(sq_createslot(v, -3))) {
4564     throw SquirrelError(v, "Couldn't register function 'get_action'");
4565   }
4566
4567   sq_pushstring(v, "move", -1);
4568   sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
4569   if(SQ_FAILED(sq_createslot(v, -3))) {
4570     throw SquirrelError(v, "Couldn't register function 'move'");
4571   }
4572
4573   sq_pushstring(v, "set_pos", -1);
4574   sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
4575   if(SQ_FAILED(sq_createslot(v, -3))) {
4576     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4577   }
4578
4579   sq_pushstring(v, "get_pos_x", -1);
4580   sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
4581   if(SQ_FAILED(sq_createslot(v, -3))) {
4582     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4583   }
4584
4585   sq_pushstring(v, "get_pos_y", -1);
4586   sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
4587   if(SQ_FAILED(sq_createslot(v, -3))) {
4588     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4589   }
4590
4591   sq_pushstring(v, "set_velocity", -1);
4592   sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
4593   if(SQ_FAILED(sq_createslot(v, -3))) {
4594     throw SquirrelError(v, "Couldn't register function 'set_velocity'");
4595   }
4596
4597   sq_pushstring(v, "get_velocity_x", -1);
4598   sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
4599   if(SQ_FAILED(sq_createslot(v, -3))) {
4600     throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
4601   }
4602
4603   sq_pushstring(v, "get_velocity_y", -1);
4604   sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
4605   if(SQ_FAILED(sq_createslot(v, -3))) {
4606     throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
4607   }
4608
4609   sq_pushstring(v, "set_visible", -1);
4610   sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
4611   if(SQ_FAILED(sq_createslot(v, -3))) {
4612     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4613   }
4614
4615   sq_pushstring(v, "is_visible", -1);
4616   sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
4617   if(SQ_FAILED(sq_createslot(v, -3))) {
4618     throw SquirrelError(v, "Couldn't register function 'is_visible'");
4619   }
4620
4621   sq_pushstring(v, "set_solid", -1);
4622   sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
4623   if(SQ_FAILED(sq_createslot(v, -3))) {
4624     throw SquirrelError(v, "Couldn't register function 'set_solid'");
4625   }
4626
4627   sq_pushstring(v, "is_solid", -1);
4628   sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
4629   if(SQ_FAILED(sq_createslot(v, -3))) {
4630     throw SquirrelError(v, "Couldn't register function 'is_solid'");
4631   }
4632
4633   sq_pushstring(v, "get_name", -1);
4634   sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
4635   if(SQ_FAILED(sq_createslot(v, -3))) {
4636     throw SquirrelError(v, "Couldn't register function 'get_name'");
4637   }
4638
4639   if(SQ_FAILED(sq_createslot(v, -3))) {
4640     throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
4641   }
4642
4643   // Register class Text
4644   sq_pushstring(v, "Text", -1);
4645   if(sq_newclass(v, SQFalse) < 0) {
4646     std::ostringstream msg;
4647     msg << "Couldn't create new class 'Text'";
4648     throw SquirrelError(v, msg.str());
4649   }
4650   sq_pushstring(v, "set_text", -1);
4651   sq_newclosure(v, &Text_set_text_wrapper, 0);
4652   if(SQ_FAILED(sq_createslot(v, -3))) {
4653     throw SquirrelError(v, "Couldn't register function 'set_text'");
4654   }
4655
4656   sq_pushstring(v, "set_font", -1);
4657   sq_newclosure(v, &Text_set_font_wrapper, 0);
4658   if(SQ_FAILED(sq_createslot(v, -3))) {
4659     throw SquirrelError(v, "Couldn't register function 'set_font'");
4660   }
4661
4662   sq_pushstring(v, "fade_in", -1);
4663   sq_newclosure(v, &Text_fade_in_wrapper, 0);
4664   if(SQ_FAILED(sq_createslot(v, -3))) {
4665     throw SquirrelError(v, "Couldn't register function 'fade_in'");
4666   }
4667
4668   sq_pushstring(v, "fade_out", -1);
4669   sq_newclosure(v, &Text_fade_out_wrapper, 0);
4670   if(SQ_FAILED(sq_createslot(v, -3))) {
4671     throw SquirrelError(v, "Couldn't register function 'fade_out'");
4672   }
4673
4674   sq_pushstring(v, "set_visible", -1);
4675   sq_newclosure(v, &Text_set_visible_wrapper, 0);
4676   if(SQ_FAILED(sq_createslot(v, -3))) {
4677     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4678   }
4679
4680   sq_pushstring(v, "set_centered", -1);
4681   sq_newclosure(v, &Text_set_centered_wrapper, 0);
4682   if(SQ_FAILED(sq_createslot(v, -3))) {
4683     throw SquirrelError(v, "Couldn't register function 'set_centered'");
4684   }
4685
4686   sq_pushstring(v, "set_pos", -1);
4687   sq_newclosure(v, &Text_set_pos_wrapper, 0);
4688   if(SQ_FAILED(sq_createslot(v, -3))) {
4689     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4690   }
4691
4692   sq_pushstring(v, "get_pos_x", -1);
4693   sq_newclosure(v, &Text_get_pos_x_wrapper, 0);
4694   if(SQ_FAILED(sq_createslot(v, -3))) {
4695     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4696   }
4697
4698   sq_pushstring(v, "get_pos_y", -1);
4699   sq_newclosure(v, &Text_get_pos_y_wrapper, 0);
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_anchor_point", -1);
4705   sq_newclosure(v, &Text_set_anchor_point_wrapper, 0);
4706   if(SQ_FAILED(sq_createslot(v, -3))) {
4707     throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
4708   }
4709
4710   sq_pushstring(v, "get_anchor_point", -1);
4711   sq_newclosure(v, &Text_get_anchor_point_wrapper, 0);
4712   if(SQ_FAILED(sq_createslot(v, -3))) {
4713     throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
4714   }
4715
4716   if(SQ_FAILED(sq_createslot(v, -3))) {
4717     throw SquirrelError(v, "Couldn't register class 'Text'");
4718   }
4719
4720   // Register class Player
4721   sq_pushstring(v, "Player", -1);
4722   if(sq_newclass(v, SQFalse) < 0) {
4723     std::ostringstream msg;
4724     msg << "Couldn't create new class 'Player'";
4725     throw SquirrelError(v, msg.str());
4726   }
4727   sq_pushstring(v, "add_bonus", -1);
4728   sq_newclosure(v, &Player_add_bonus_wrapper, 0);
4729   if(SQ_FAILED(sq_createslot(v, -3))) {
4730     throw SquirrelError(v, "Couldn't register function 'add_bonus'");
4731   }
4732
4733   sq_pushstring(v, "add_coins", -1);
4734   sq_newclosure(v, &Player_add_coins_wrapper, 0);
4735   if(SQ_FAILED(sq_createslot(v, -3))) {
4736     throw SquirrelError(v, "Couldn't register function 'add_coins'");
4737   }
4738
4739   sq_pushstring(v, "make_invincible", -1);
4740   sq_newclosure(v, &Player_make_invincible_wrapper, 0);
4741   if(SQ_FAILED(sq_createslot(v, -3))) {
4742     throw SquirrelError(v, "Couldn't register function 'make_invincible'");
4743   }
4744
4745   sq_pushstring(v, "deactivate", -1);
4746   sq_newclosure(v, &Player_deactivate_wrapper, 0);
4747   if(SQ_FAILED(sq_createslot(v, -3))) {
4748     throw SquirrelError(v, "Couldn't register function 'deactivate'");
4749   }
4750
4751   sq_pushstring(v, "activate", -1);
4752   sq_newclosure(v, &Player_activate_wrapper, 0);
4753   if(SQ_FAILED(sq_createslot(v, -3))) {
4754     throw SquirrelError(v, "Couldn't register function 'activate'");
4755   }
4756
4757   sq_pushstring(v, "walk", -1);
4758   sq_newclosure(v, &Player_walk_wrapper, 0);
4759   if(SQ_FAILED(sq_createslot(v, -3))) {
4760     throw SquirrelError(v, "Couldn't register function 'walk'");
4761   }
4762
4763   sq_pushstring(v, "set_visible", -1);
4764   sq_newclosure(v, &Player_set_visible_wrapper, 0);
4765   if(SQ_FAILED(sq_createslot(v, -3))) {
4766     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4767   }
4768
4769   sq_pushstring(v, "get_visible", -1);
4770   sq_newclosure(v, &Player_get_visible_wrapper, 0);
4771   if(SQ_FAILED(sq_createslot(v, -3))) {
4772     throw SquirrelError(v, "Couldn't register function 'get_visible'");
4773   }
4774
4775   sq_pushstring(v, "kill", -1);
4776   sq_newclosure(v, &Player_kill_wrapper, 0);
4777   if(SQ_FAILED(sq_createslot(v, -3))) {
4778     throw SquirrelError(v, "Couldn't register function 'kill'");
4779   }
4780
4781   sq_pushstring(v, "set_ghost_mode", -1);
4782   sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
4783   if(SQ_FAILED(sq_createslot(v, -3))) {
4784     throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
4785   }
4786
4787   sq_pushstring(v, "get_ghost_mode", -1);
4788   sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
4789   if(SQ_FAILED(sq_createslot(v, -3))) {
4790     throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
4791   }
4792
4793   sq_pushstring(v, "do_cheer", -1);
4794   sq_newclosure(v, &Player_do_cheer_wrapper, 0);
4795   if(SQ_FAILED(sq_createslot(v, -3))) {
4796     throw SquirrelError(v, "Couldn't register function 'do_cheer'");
4797   }
4798
4799   sq_pushstring(v, "do_duck", -1);
4800   sq_newclosure(v, &Player_do_duck_wrapper, 0);
4801   if(SQ_FAILED(sq_createslot(v, -3))) {
4802     throw SquirrelError(v, "Couldn't register function 'do_duck'");
4803   }
4804
4805   sq_pushstring(v, "do_standup", -1);
4806   sq_newclosure(v, &Player_do_standup_wrapper, 0);
4807   if(SQ_FAILED(sq_createslot(v, -3))) {
4808     throw SquirrelError(v, "Couldn't register function 'do_standup'");
4809   }
4810
4811   sq_pushstring(v, "do_backflip", -1);
4812   sq_newclosure(v, &Player_do_backflip_wrapper, 0);
4813   if(SQ_FAILED(sq_createslot(v, -3))) {
4814     throw SquirrelError(v, "Couldn't register function 'do_backflip'");
4815   }
4816
4817   sq_pushstring(v, "do_jump", -1);
4818   sq_newclosure(v, &Player_do_jump_wrapper, 0);
4819   if(SQ_FAILED(sq_createslot(v, -3))) {
4820     throw SquirrelError(v, "Couldn't register function 'do_jump'");
4821   }
4822
4823   sq_pushstring(v, "trigger_sequence", -1);
4824   sq_newclosure(v, &Player_trigger_sequence_wrapper, 0);
4825   if(SQ_FAILED(sq_createslot(v, -3))) {
4826     throw SquirrelError(v, "Couldn't register function 'trigger_sequence'");
4827   }
4828
4829   sq_pushstring(v, "use_scripting_controller", -1);
4830   sq_newclosure(v, &Player_use_scripting_controller_wrapper, 0);
4831   if(SQ_FAILED(sq_createslot(v, -3))) {
4832     throw SquirrelError(v, "Couldn't register function 'use_scripting_controller'");
4833   }
4834
4835   sq_pushstring(v, "do_scripting_controller", -1);
4836   sq_newclosure(v, &Player_do_scripting_controller_wrapper, 0);
4837   if(SQ_FAILED(sq_createslot(v, -3))) {
4838     throw SquirrelError(v, "Couldn't register function 'do_scripting_controller'");
4839   }
4840
4841   if(SQ_FAILED(sq_createslot(v, -3))) {
4842     throw SquirrelError(v, "Couldn't register class 'Player'");
4843   }
4844
4845   // Register class FloatingImage
4846   sq_pushstring(v, "FloatingImage", -1);
4847   if(sq_newclass(v, SQFalse) < 0) {
4848     std::ostringstream msg;
4849     msg << "Couldn't create new class 'FloatingImage'";
4850     throw SquirrelError(v, msg.str());
4851   }
4852   sq_pushstring(v, "constructor", -1);
4853   sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
4854   if(SQ_FAILED(sq_createslot(v, -3))) {
4855     throw SquirrelError(v, "Couldn't register function 'constructor'");
4856   }
4857
4858   sq_pushstring(v, "set_layer", -1);
4859   sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
4860   if(SQ_FAILED(sq_createslot(v, -3))) {
4861     throw SquirrelError(v, "Couldn't register function 'set_layer'");
4862   }
4863
4864   sq_pushstring(v, "get_layer", -1);
4865   sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
4866   if(SQ_FAILED(sq_createslot(v, -3))) {
4867     throw SquirrelError(v, "Couldn't register function 'get_layer'");
4868   }
4869
4870   sq_pushstring(v, "set_pos", -1);
4871   sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
4872   if(SQ_FAILED(sq_createslot(v, -3))) {
4873     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4874   }
4875
4876   sq_pushstring(v, "get_pos_x", -1);
4877   sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
4878   if(SQ_FAILED(sq_createslot(v, -3))) {
4879     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4880   }
4881
4882   sq_pushstring(v, "get_pos_y", -1);
4883   sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
4884   if(SQ_FAILED(sq_createslot(v, -3))) {
4885     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4886   }
4887
4888   sq_pushstring(v, "set_anchor_point", -1);
4889   sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
4890   if(SQ_FAILED(sq_createslot(v, -3))) {
4891     throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
4892   }
4893
4894   sq_pushstring(v, "get_anchor_point", -1);
4895   sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
4896   if(SQ_FAILED(sq_createslot(v, -3))) {
4897     throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
4898   }
4899
4900   sq_pushstring(v, "set_visible", -1);
4901   sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
4902   if(SQ_FAILED(sq_createslot(v, -3))) {
4903     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4904   }
4905
4906   sq_pushstring(v, "get_visible", -1);
4907   sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
4908   if(SQ_FAILED(sq_createslot(v, -3))) {
4909     throw SquirrelError(v, "Couldn't register function 'get_visible'");
4910   }
4911
4912   sq_pushstring(v, "set_action", -1);
4913   sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
4914   if(SQ_FAILED(sq_createslot(v, -3))) {
4915     throw SquirrelError(v, "Couldn't register function 'set_action'");
4916   }
4917
4918   sq_pushstring(v, "get_action", -1);
4919   sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
4920   if(SQ_FAILED(sq_createslot(v, -3))) {
4921     throw SquirrelError(v, "Couldn't register function 'get_action'");
4922   }
4923
4924   sq_pushstring(v, "fade_in", -1);
4925   sq_newclosure(v, &FloatingImage_fade_in_wrapper, 0);
4926   if(SQ_FAILED(sq_createslot(v, -3))) {
4927     throw SquirrelError(v, "Couldn't register function 'fade_in'");
4928   }
4929
4930   sq_pushstring(v, "fade_out", -1);
4931   sq_newclosure(v, &FloatingImage_fade_out_wrapper, 0);
4932   if(SQ_FAILED(sq_createslot(v, -3))) {
4933     throw SquirrelError(v, "Couldn't register function 'fade_out'");
4934   }
4935
4936   if(SQ_FAILED(sq_createslot(v, -3))) {
4937     throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
4938   }
4939
4940   // Register class Platform
4941   sq_pushstring(v, "Platform", -1);
4942   if(sq_newclass(v, SQFalse) < 0) {
4943     std::ostringstream msg;
4944     msg << "Couldn't create new class 'Platform'";
4945     throw SquirrelError(v, msg.str());
4946   }
4947   sq_pushstring(v, "goto_node", -1);
4948   sq_newclosure(v, &Platform_goto_node_wrapper, 0);
4949   if(SQ_FAILED(sq_createslot(v, -3))) {
4950     throw SquirrelError(v, "Couldn't register function 'goto_node'");
4951   }
4952
4953   sq_pushstring(v, "start_moving", -1);
4954   sq_newclosure(v, &Platform_start_moving_wrapper, 0);
4955   if(SQ_FAILED(sq_createslot(v, -3))) {
4956     throw SquirrelError(v, "Couldn't register function 'start_moving'");
4957   }
4958
4959   sq_pushstring(v, "stop_moving", -1);
4960   sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
4961   if(SQ_FAILED(sq_createslot(v, -3))) {
4962     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
4963   }
4964
4965   if(SQ_FAILED(sq_createslot(v, -3))) {
4966     throw SquirrelError(v, "Couldn't register class 'Platform'");
4967   }
4968
4969   // Register class Candle
4970   sq_pushstring(v, "Candle", -1);
4971   if(sq_newclass(v, SQFalse) < 0) {
4972     std::ostringstream msg;
4973     msg << "Couldn't create new class 'Candle'";
4974     throw SquirrelError(v, msg.str());
4975   }
4976   sq_pushstring(v, "get_burning", -1);
4977   sq_newclosure(v, &Candle_get_burning_wrapper, 0);
4978   if(SQ_FAILED(sq_createslot(v, -3))) {
4979     throw SquirrelError(v, "Couldn't register function 'get_burning'");
4980   }
4981
4982   sq_pushstring(v, "set_burning", -1);
4983   sq_newclosure(v, &Candle_set_burning_wrapper, 0);
4984   if(SQ_FAILED(sq_createslot(v, -3))) {
4985     throw SquirrelError(v, "Couldn't register function 'set_burning'");
4986   }
4987
4988   if(SQ_FAILED(sq_createslot(v, -3))) {
4989     throw SquirrelError(v, "Couldn't register class 'Candle'");
4990   }
4991
4992   // Register class Wind
4993   sq_pushstring(v, "Wind", -1);
4994   if(sq_newclass(v, SQFalse) < 0) {
4995     std::ostringstream msg;
4996     msg << "Couldn't create new class 'Wind'";
4997     throw SquirrelError(v, msg.str());
4998   }
4999   sq_pushstring(v, "start", -1);
5000   sq_newclosure(v, &Wind_start_wrapper, 0);
5001   if(SQ_FAILED(sq_createslot(v, -3))) {
5002     throw SquirrelError(v, "Couldn't register function 'start'");
5003   }
5004
5005   sq_pushstring(v, "stop", -1);
5006   sq_newclosure(v, &Wind_stop_wrapper, 0);
5007   if(SQ_FAILED(sq_createslot(v, -3))) {
5008     throw SquirrelError(v, "Couldn't register function 'stop'");
5009   }
5010
5011   if(SQ_FAILED(sq_createslot(v, -3))) {
5012     throw SquirrelError(v, "Couldn't register class 'Wind'");
5013   }
5014
5015   // Register class AmbientSound
5016   sq_pushstring(v, "AmbientSound", -1);
5017   if(sq_newclass(v, SQFalse) < 0) {
5018     std::ostringstream msg;
5019     msg << "Couldn't create new class 'AmbientSound'";
5020     throw SquirrelError(v, msg.str());
5021   }
5022   sq_pushstring(v, "set_pos", -1);
5023   sq_newclosure(v, &AmbientSound_set_pos_wrapper, 0);
5024   if(SQ_FAILED(sq_createslot(v, -3))) {
5025     throw SquirrelError(v, "Couldn't register function 'set_pos'");
5026   }
5027
5028   sq_pushstring(v, "get_pos_x", -1);
5029   sq_newclosure(v, &AmbientSound_get_pos_x_wrapper, 0);
5030   if(SQ_FAILED(sq_createslot(v, -3))) {
5031     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
5032   }
5033
5034   sq_pushstring(v, "get_pos_y", -1);
5035   sq_newclosure(v, &AmbientSound_get_pos_y_wrapper, 0);
5036   if(SQ_FAILED(sq_createslot(v, -3))) {
5037     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
5038   }
5039
5040   if(SQ_FAILED(sq_createslot(v, -3))) {
5041     throw SquirrelError(v, "Couldn't register class 'AmbientSound'");
5042   }
5043
5044   // Register class Thunderstorm
5045   sq_pushstring(v, "Thunderstorm", -1);
5046   if(sq_newclass(v, SQFalse) < 0) {
5047     std::ostringstream msg;
5048     msg << "Couldn't create new class 'Thunderstorm'";
5049     throw SquirrelError(v, msg.str());
5050   }
5051   sq_pushstring(v, "start", -1);
5052   sq_newclosure(v, &Thunderstorm_start_wrapper, 0);
5053   if(SQ_FAILED(sq_createslot(v, -3))) {
5054     throw SquirrelError(v, "Couldn't register function 'start'");
5055   }
5056
5057   sq_pushstring(v, "stop", -1);
5058   sq_newclosure(v, &Thunderstorm_stop_wrapper, 0);
5059   if(SQ_FAILED(sq_createslot(v, -3))) {
5060     throw SquirrelError(v, "Couldn't register function 'stop'");
5061   }
5062
5063   sq_pushstring(v, "thunder", -1);
5064   sq_newclosure(v, &Thunderstorm_thunder_wrapper, 0);
5065   if(SQ_FAILED(sq_createslot(v, -3))) {
5066     throw SquirrelError(v, "Couldn't register function 'thunder'");
5067   }
5068
5069   sq_pushstring(v, "lightning", -1);
5070   sq_newclosure(v, &Thunderstorm_lightning_wrapper, 0);
5071   if(SQ_FAILED(sq_createslot(v, -3))) {
5072     throw SquirrelError(v, "Couldn't register function 'lightning'");
5073   }
5074
5075   sq_pushstring(v, "flash", -1);
5076   sq_newclosure(v, &Thunderstorm_flash_wrapper, 0);
5077   if(SQ_FAILED(sq_createslot(v, -3))) {
5078     throw SquirrelError(v, "Couldn't register function 'flash'");
5079   }
5080
5081   sq_pushstring(v, "electrify", -1);
5082   sq_newclosure(v, &Thunderstorm_electrify_wrapper, 0);
5083   if(SQ_FAILED(sq_createslot(v, -3))) {
5084     throw SquirrelError(v, "Couldn't register function 'electrify'");
5085   }
5086
5087   if(SQ_FAILED(sq_createslot(v, -3))) {
5088     throw SquirrelError(v, "Couldn't register class 'Thunderstorm'");
5089   }
5090
5091   // Register class TileMap
5092   sq_pushstring(v, "TileMap", -1);
5093   if(sq_newclass(v, SQFalse) < 0) {
5094     std::ostringstream msg;
5095     msg << "Couldn't create new class 'TileMap'";
5096     throw SquirrelError(v, msg.str());
5097   }
5098   sq_pushstring(v, "goto_node", -1);
5099   sq_newclosure(v, &TileMap_goto_node_wrapper, 0);
5100   if(SQ_FAILED(sq_createslot(v, -3))) {
5101     throw SquirrelError(v, "Couldn't register function 'goto_node'");
5102   }
5103
5104   sq_pushstring(v, "start_moving", -1);
5105   sq_newclosure(v, &TileMap_start_moving_wrapper, 0);
5106   if(SQ_FAILED(sq_createslot(v, -3))) {
5107     throw SquirrelError(v, "Couldn't register function 'start_moving'");
5108   }
5109
5110   sq_pushstring(v, "stop_moving", -1);
5111   sq_newclosure(v, &TileMap_stop_moving_wrapper, 0);
5112   if(SQ_FAILED(sq_createslot(v, -3))) {
5113     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5114   }
5115
5116   sq_pushstring(v, "fade", -1);
5117   sq_newclosure(v, &TileMap_fade_wrapper, 0);
5118   if(SQ_FAILED(sq_createslot(v, -3))) {
5119     throw SquirrelError(v, "Couldn't register function 'fade'");
5120   }
5121
5122   sq_pushstring(v, "set_alpha", -1);
5123   sq_newclosure(v, &TileMap_set_alpha_wrapper, 0);
5124   if(SQ_FAILED(sq_createslot(v, -3))) {
5125     throw SquirrelError(v, "Couldn't register function 'set_alpha'");
5126   }
5127
5128   sq_pushstring(v, "get_alpha", -1);
5129   sq_newclosure(v, &TileMap_get_alpha_wrapper, 0);
5130   if(SQ_FAILED(sq_createslot(v, -3))) {
5131     throw SquirrelError(v, "Couldn't register function 'get_alpha'");
5132   }
5133
5134   if(SQ_FAILED(sq_createslot(v, -3))) {
5135     throw SquirrelError(v, "Couldn't register class 'TileMap'");
5136   }
5137
5138   // Register class SSector
5139   sq_pushstring(v, "SSector", -1);
5140   if(sq_newclass(v, SQFalse) < 0) {
5141     std::ostringstream msg;
5142     msg << "Couldn't create new class 'SSector'";
5143     throw SquirrelError(v, msg.str());
5144   }
5145   sq_pushstring(v, "set_ambient_light", -1);
5146   sq_newclosure(v, &SSector_set_ambient_light_wrapper, 0);
5147   if(SQ_FAILED(sq_createslot(v, -3))) {
5148     throw SquirrelError(v, "Couldn't register function 'set_ambient_light'");
5149   }
5150
5151   sq_pushstring(v, "get_ambient_red", -1);
5152   sq_newclosure(v, &SSector_get_ambient_red_wrapper, 0);
5153   if(SQ_FAILED(sq_createslot(v, -3))) {
5154     throw SquirrelError(v, "Couldn't register function 'get_ambient_red'");
5155   }
5156
5157   sq_pushstring(v, "get_ambient_green", -1);
5158   sq_newclosure(v, &SSector_get_ambient_green_wrapper, 0);
5159   if(SQ_FAILED(sq_createslot(v, -3))) {
5160     throw SquirrelError(v, "Couldn't register function 'get_ambient_green'");
5161   }
5162
5163   sq_pushstring(v, "get_ambient_blue", -1);
5164   sq_newclosure(v, &SSector_get_ambient_blue_wrapper, 0);
5165   if(SQ_FAILED(sq_createslot(v, -3))) {
5166     throw SquirrelError(v, "Couldn't register function 'get_ambient_blue'");
5167   }
5168
5169   if(SQ_FAILED(sq_createslot(v, -3))) {
5170     throw SquirrelError(v, "Couldn't register class 'SSector'");
5171   }
5172
5173   // Register class LevelTime
5174   sq_pushstring(v, "LevelTime", -1);
5175   if(sq_newclass(v, SQFalse) < 0) {
5176     std::ostringstream msg;
5177     msg << "Couldn't create new class 'LevelTime'";
5178     throw SquirrelError(v, msg.str());
5179   }
5180   sq_pushstring(v, "start", -1);
5181   sq_newclosure(v, &LevelTime_start_wrapper, 0);
5182   if(SQ_FAILED(sq_createslot(v, -3))) {
5183     throw SquirrelError(v, "Couldn't register function 'start'");
5184   }
5185
5186   sq_pushstring(v, "stop", -1);
5187   sq_newclosure(v, &LevelTime_stop_wrapper, 0);
5188   if(SQ_FAILED(sq_createslot(v, -3))) {
5189     throw SquirrelError(v, "Couldn't register function 'stop'");
5190   }
5191
5192   sq_pushstring(v, "get_time", -1);
5193   sq_newclosure(v, &LevelTime_get_time_wrapper, 0);
5194   if(SQ_FAILED(sq_createslot(v, -3))) {
5195     throw SquirrelError(v, "Couldn't register function 'get_time'");
5196   }
5197
5198   sq_pushstring(v, "set_time", -1);
5199   sq_newclosure(v, &LevelTime_set_time_wrapper, 0);
5200   if(SQ_FAILED(sq_createslot(v, -3))) {
5201     throw SquirrelError(v, "Couldn't register function 'set_time'");
5202   }
5203
5204   if(SQ_FAILED(sq_createslot(v, -3))) {
5205     throw SquirrelError(v, "Couldn't register class 'LevelTime'");
5206   }
5207
5208   // Register class WillOWisp
5209   sq_pushstring(v, "WillOWisp", -1);
5210   if(sq_newclass(v, SQFalse) < 0) {
5211     std::ostringstream msg;
5212     msg << "Couldn't create new class 'WillOWisp'";
5213     throw SquirrelError(v, msg.str());
5214   }
5215   sq_pushstring(v, "goto_node", -1);
5216   sq_newclosure(v, &WillOWisp_goto_node_wrapper, 0);
5217   if(SQ_FAILED(sq_createslot(v, -3))) {
5218     throw SquirrelError(v, "Couldn't register function 'goto_node'");
5219   }
5220
5221   sq_pushstring(v, "set_state", -1);
5222   sq_newclosure(v, &WillOWisp_set_state_wrapper, 0);
5223   if(SQ_FAILED(sq_createslot(v, -3))) {
5224     throw SquirrelError(v, "Couldn't register function 'set_state'");
5225   }
5226
5227   sq_pushstring(v, "start_moving", -1);
5228   sq_newclosure(v, &WillOWisp_start_moving_wrapper, 0);
5229   if(SQ_FAILED(sq_createslot(v, -3))) {
5230     throw SquirrelError(v, "Couldn't register function 'start_moving'");
5231   }
5232
5233   sq_pushstring(v, "stop_moving", -1);
5234   sq_newclosure(v, &WillOWisp_stop_moving_wrapper, 0);
5235   if(SQ_FAILED(sq_createslot(v, -3))) {
5236     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5237   }
5238
5239   if(SQ_FAILED(sq_createslot(v, -3))) {
5240     throw SquirrelError(v, "Couldn't register class 'WillOWisp'");
5241   }
5242
5243 }
5244
5245 } // end of namespace Scripting