Allow scripted inputs to Tux GameObject with a CodeController
[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 ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
489 {
490   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
491   delete _this;
492   return 0;
493 }
494
495 static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm)
496 {
497   SQUserPointer data;
498   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
499     sq_throwerror(vm, _SC("'set_action' called without instance"));
500     return SQ_ERROR;
501   }
502   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
503   const SQChar* arg0;
504   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
505     sq_throwerror(vm, _SC("Argument 1 not a string"));
506     return SQ_ERROR;
507   }
508
509   try {
510     _this->set_action(arg0);
511
512     return 0;
513
514   } catch(std::exception& e) {
515     sq_throwerror(vm, e.what());
516     return SQ_ERROR;
517   } catch(...) {
518     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
519     return SQ_ERROR;
520   }
521
522 }
523
524 static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm)
525 {
526   SQUserPointer data;
527   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
528     sq_throwerror(vm, _SC("'get_action' called without instance"));
529     return SQ_ERROR;
530   }
531   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
532
533   try {
534     std::string return_value = _this->get_action();
535
536     sq_pushstring(vm, return_value.c_str(), return_value.size());
537     return 1;
538
539   } catch(std::exception& e) {
540     sq_throwerror(vm, e.what());
541     return SQ_ERROR;
542   } catch(...) {
543     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
544     return SQ_ERROR;
545   }
546
547 }
548
549 static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm)
550 {
551   SQUserPointer data;
552   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
553     sq_throwerror(vm, _SC("'move' called without instance"));
554     return SQ_ERROR;
555   }
556   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
557   SQFloat arg0;
558   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
559     sq_throwerror(vm, _SC("Argument 1 not a float"));
560     return SQ_ERROR;
561   }
562   SQFloat arg1;
563   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
564     sq_throwerror(vm, _SC("Argument 2 not a float"));
565     return SQ_ERROR;
566   }
567
568   try {
569     _this->move(static_cast<float> (arg0), static_cast<float> (arg1));
570
571     return 0;
572
573   } catch(std::exception& e) {
574     sq_throwerror(vm, e.what());
575     return SQ_ERROR;
576   } catch(...) {
577     sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'"));
578     return SQ_ERROR;
579   }
580
581 }
582
583 static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm)
584 {
585   SQUserPointer data;
586   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
587     sq_throwerror(vm, _SC("'set_pos' called without instance"));
588     return SQ_ERROR;
589   }
590   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
591   SQFloat arg0;
592   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
593     sq_throwerror(vm, _SC("Argument 1 not a float"));
594     return SQ_ERROR;
595   }
596   SQFloat arg1;
597   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
598     sq_throwerror(vm, _SC("Argument 2 not a float"));
599     return SQ_ERROR;
600   }
601
602   try {
603     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
604
605     return 0;
606
607   } catch(std::exception& e) {
608     sq_throwerror(vm, e.what());
609     return SQ_ERROR;
610   } catch(...) {
611     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
612     return SQ_ERROR;
613   }
614
615 }
616
617 static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm)
618 {
619   SQUserPointer data;
620   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
621     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
622     return SQ_ERROR;
623   }
624   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
625
626   try {
627     float return_value = _this->get_pos_x();
628
629     sq_pushfloat(vm, return_value);
630     return 1;
631
632   } catch(std::exception& e) {
633     sq_throwerror(vm, e.what());
634     return SQ_ERROR;
635   } catch(...) {
636     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
637     return SQ_ERROR;
638   }
639
640 }
641
642 static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm)
643 {
644   SQUserPointer data;
645   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
646     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
647     return SQ_ERROR;
648   }
649   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
650
651   try {
652     float return_value = _this->get_pos_y();
653
654     sq_pushfloat(vm, return_value);
655     return 1;
656
657   } catch(std::exception& e) {
658     sq_throwerror(vm, e.what());
659     return SQ_ERROR;
660   } catch(...) {
661     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
662     return SQ_ERROR;
663   }
664
665 }
666
667 static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm)
668 {
669   SQUserPointer data;
670   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
671     sq_throwerror(vm, _SC("'set_velocity' called without instance"));
672     return SQ_ERROR;
673   }
674   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
675   SQFloat arg0;
676   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
677     sq_throwerror(vm, _SC("Argument 1 not a float"));
678     return SQ_ERROR;
679   }
680   SQFloat arg1;
681   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
682     sq_throwerror(vm, _SC("Argument 2 not a float"));
683     return SQ_ERROR;
684   }
685
686   try {
687     _this->set_velocity(static_cast<float> (arg0), static_cast<float> (arg1));
688
689     return 0;
690
691   } catch(std::exception& e) {
692     sq_throwerror(vm, e.what());
693     return SQ_ERROR;
694   } catch(...) {
695     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_velocity'"));
696     return SQ_ERROR;
697   }
698
699 }
700
701 static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm)
702 {
703   SQUserPointer data;
704   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
705     sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
706     return SQ_ERROR;
707   }
708   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
709
710   try {
711     float return_value = _this->get_velocity_x();
712
713     sq_pushfloat(vm, return_value);
714     return 1;
715
716   } catch(std::exception& e) {
717     sq_throwerror(vm, e.what());
718     return SQ_ERROR;
719   } catch(...) {
720     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_x'"));
721     return SQ_ERROR;
722   }
723
724 }
725
726 static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm)
727 {
728   SQUserPointer data;
729   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
730     sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
731     return SQ_ERROR;
732   }
733   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
734
735   try {
736     float return_value = _this->get_velocity_y();
737
738     sq_pushfloat(vm, return_value);
739     return 1;
740
741   } catch(std::exception& e) {
742     sq_throwerror(vm, e.what());
743     return SQ_ERROR;
744   } catch(...) {
745     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_y'"));
746     return SQ_ERROR;
747   }
748
749 }
750
751 static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
752 {
753   SQUserPointer data;
754   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
755     sq_throwerror(vm, _SC("'set_visible' called without instance"));
756     return SQ_ERROR;
757   }
758   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
759   SQBool arg0;
760   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
761     sq_throwerror(vm, _SC("Argument 1 not a bool"));
762     return SQ_ERROR;
763   }
764
765   try {
766     _this->set_visible(arg0 == SQTrue);
767
768     return 0;
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 'set_visible'"));
775     return SQ_ERROR;
776   }
777
778 }
779
780 static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
781 {
782   SQUserPointer data;
783   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
784     sq_throwerror(vm, _SC("'is_visible' called without instance"));
785     return SQ_ERROR;
786   }
787   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
788
789   try {
790     bool return_value = _this->is_visible();
791
792     sq_pushbool(vm, return_value);
793     return 1;
794
795   } catch(std::exception& e) {
796     sq_throwerror(vm, e.what());
797     return SQ_ERROR;
798   } catch(...) {
799     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_visible'"));
800     return SQ_ERROR;
801   }
802
803 }
804
805 static SQInteger ScriptedObject_set_solid_wrapper(HSQUIRRELVM vm)
806 {
807   SQUserPointer data;
808   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
809     sq_throwerror(vm, _SC("'set_solid' called without instance"));
810     return SQ_ERROR;
811   }
812   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
813   SQBool arg0;
814   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
815     sq_throwerror(vm, _SC("Argument 1 not a bool"));
816     return SQ_ERROR;
817   }
818
819   try {
820     _this->set_solid(arg0 == SQTrue);
821
822     return 0;
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 'set_solid'"));
829     return SQ_ERROR;
830   }
831
832 }
833
834 static SQInteger ScriptedObject_is_solid_wrapper(HSQUIRRELVM vm)
835 {
836   SQUserPointer data;
837   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
838     sq_throwerror(vm, _SC("'is_solid' called without instance"));
839     return SQ_ERROR;
840   }
841   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
842
843   try {
844     bool return_value = _this->is_solid();
845
846     sq_pushbool(vm, return_value);
847     return 1;
848
849   } catch(std::exception& e) {
850     sq_throwerror(vm, e.what());
851     return SQ_ERROR;
852   } catch(...) {
853     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_solid'"));
854     return SQ_ERROR;
855   }
856
857 }
858
859 static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
860 {
861   SQUserPointer data;
862   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
863     sq_throwerror(vm, _SC("'get_name' called without instance"));
864     return SQ_ERROR;
865   }
866   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
867
868   try {
869     std::string return_value = _this->get_name();
870
871     sq_pushstring(vm, return_value.c_str(), return_value.size());
872     return 1;
873
874   } catch(std::exception& e) {
875     sq_throwerror(vm, e.what());
876     return SQ_ERROR;
877   } catch(...) {
878     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
879     return SQ_ERROR;
880   }
881
882 }
883
884 static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
885 {
886   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (ptr);
887   delete _this;
888   return 0;
889 }
890
891 static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm)
892 {
893   SQUserPointer data;
894   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
895     sq_throwerror(vm, _SC("'set_text' called without instance"));
896     return SQ_ERROR;
897   }
898   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
899   const SQChar* arg0;
900   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
901     sq_throwerror(vm, _SC("Argument 1 not a string"));
902     return SQ_ERROR;
903   }
904
905   try {
906     _this->set_text(arg0);
907
908     return 0;
909
910   } catch(std::exception& e) {
911     sq_throwerror(vm, e.what());
912     return SQ_ERROR;
913   } catch(...) {
914     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
915     return SQ_ERROR;
916   }
917
918 }
919
920 static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm)
921 {
922   SQUserPointer data;
923   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
924     sq_throwerror(vm, _SC("'set_font' 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_font(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_font'"));
944     return SQ_ERROR;
945   }
946
947 }
948
949 static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm)
950 {
951   SQUserPointer data;
952   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
953     sq_throwerror(vm, _SC("'fade_in' called without instance"));
954     return SQ_ERROR;
955   }
956   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
957   SQFloat arg0;
958   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
959     sq_throwerror(vm, _SC("Argument 1 not a float"));
960     return SQ_ERROR;
961   }
962
963   try {
964     _this->fade_in(static_cast<float> (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 'fade_in'"));
973     return SQ_ERROR;
974   }
975
976 }
977
978 static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm)
979 {
980   SQUserPointer data;
981   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
982     sq_throwerror(vm, _SC("'fade_out' 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_out(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_out'"));
1002     return SQ_ERROR;
1003   }
1004
1005 }
1006
1007 static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm)
1008 {
1009   SQUserPointer data;
1010   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1011     sq_throwerror(vm, _SC("'set_visible' called without instance"));
1012     return SQ_ERROR;
1013   }
1014   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1015   SQBool arg0;
1016   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1017     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1018     return SQ_ERROR;
1019   }
1020
1021   try {
1022     _this->set_visible(arg0 == SQTrue);
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 'set_visible'"));
1031     return SQ_ERROR;
1032   }
1033
1034 }
1035
1036 static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
1037 {
1038   SQUserPointer data;
1039   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1040     sq_throwerror(vm, _SC("'set_centered' 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_centered(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_centered'"));
1060     return SQ_ERROR;
1061   }
1062
1063 }
1064
1065 static SQInteger Text_set_pos_wrapper(HSQUIRRELVM vm)
1066 {
1067   SQUserPointer data;
1068   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1069     sq_throwerror(vm, _SC("'set_pos' called without instance"));
1070     return SQ_ERROR;
1071   }
1072   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1073   SQFloat arg0;
1074   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1075     sq_throwerror(vm, _SC("Argument 1 not a float"));
1076     return SQ_ERROR;
1077   }
1078   SQFloat arg1;
1079   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1080     sq_throwerror(vm, _SC("Argument 2 not a float"));
1081     return SQ_ERROR;
1082   }
1083
1084   try {
1085     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1086
1087     return 0;
1088
1089   } catch(std::exception& e) {
1090     sq_throwerror(vm, e.what());
1091     return SQ_ERROR;
1092   } catch(...) {
1093     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1094     return SQ_ERROR;
1095   }
1096
1097 }
1098
1099 static SQInteger Text_get_pos_x_wrapper(HSQUIRRELVM vm)
1100 {
1101   SQUserPointer data;
1102   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1103     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1104     return SQ_ERROR;
1105   }
1106   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1107
1108   try {
1109     float return_value = _this->get_pos_x();
1110
1111     sq_pushfloat(vm, return_value);
1112     return 1;
1113
1114   } catch(std::exception& e) {
1115     sq_throwerror(vm, e.what());
1116     return SQ_ERROR;
1117   } catch(...) {
1118     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1119     return SQ_ERROR;
1120   }
1121
1122 }
1123
1124 static SQInteger Text_get_pos_y_wrapper(HSQUIRRELVM vm)
1125 {
1126   SQUserPointer data;
1127   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1128     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1129     return SQ_ERROR;
1130   }
1131   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1132
1133   try {
1134     float return_value = _this->get_pos_y();
1135
1136     sq_pushfloat(vm, return_value);
1137     return 1;
1138
1139   } catch(std::exception& e) {
1140     sq_throwerror(vm, e.what());
1141     return SQ_ERROR;
1142   } catch(...) {
1143     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1144     return SQ_ERROR;
1145   }
1146
1147 }
1148
1149 static SQInteger Text_set_anchor_point_wrapper(HSQUIRRELVM vm)
1150 {
1151   SQUserPointer data;
1152   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1153     sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1154     return SQ_ERROR;
1155   }
1156   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1157   SQInteger arg0;
1158   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1159     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1160     return SQ_ERROR;
1161   }
1162
1163   try {
1164     _this->set_anchor_point(static_cast<int> (arg0));
1165
1166     return 0;
1167
1168   } catch(std::exception& e) {
1169     sq_throwerror(vm, e.what());
1170     return SQ_ERROR;
1171   } catch(...) {
1172     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1173     return SQ_ERROR;
1174   }
1175
1176 }
1177
1178 static SQInteger Text_get_anchor_point_wrapper(HSQUIRRELVM vm)
1179 {
1180   SQUserPointer data;
1181   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1182     sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1183     return SQ_ERROR;
1184   }
1185   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1186
1187   try {
1188     int return_value = _this->get_anchor_point();
1189
1190     sq_pushinteger(vm, return_value);
1191     return 1;
1192
1193   } catch(std::exception& e) {
1194     sq_throwerror(vm, e.what());
1195     return SQ_ERROR;
1196   } catch(...) {
1197     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1198     return SQ_ERROR;
1199   }
1200
1201 }
1202
1203 static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger )
1204 {
1205   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
1206   delete _this;
1207   return 0;
1208 }
1209
1210 static SQInteger Player_add_bonus_wrapper(HSQUIRRELVM vm)
1211 {
1212   SQUserPointer data;
1213   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1214     sq_throwerror(vm, _SC("'add_bonus' called without instance"));
1215     return SQ_ERROR;
1216   }
1217   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1218   const SQChar* arg0;
1219   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1220     sq_throwerror(vm, _SC("Argument 1 not a string"));
1221     return SQ_ERROR;
1222   }
1223
1224   try {
1225     bool return_value = _this->add_bonus(arg0);
1226
1227     sq_pushbool(vm, return_value);
1228     return 1;
1229
1230   } catch(std::exception& e) {
1231     sq_throwerror(vm, e.what());
1232     return SQ_ERROR;
1233   } catch(...) {
1234     sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_bonus'"));
1235     return SQ_ERROR;
1236   }
1237
1238 }
1239
1240 static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm)
1241 {
1242   SQUserPointer data;
1243   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1244     sq_throwerror(vm, _SC("'add_coins' called without instance"));
1245     return SQ_ERROR;
1246   }
1247   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1248   SQInteger arg0;
1249   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1250     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1251     return SQ_ERROR;
1252   }
1253
1254   try {
1255     _this->add_coins(static_cast<int> (arg0));
1256
1257     return 0;
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_coins'"));
1264     return SQ_ERROR;
1265   }
1266
1267 }
1268
1269 static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm)
1270 {
1271   SQUserPointer data;
1272   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1273     sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1274     return SQ_ERROR;
1275   }
1276   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1277
1278   try {
1279     _this->make_invincible();
1280
1281     return 0;
1282
1283   } catch(std::exception& e) {
1284     sq_throwerror(vm, e.what());
1285     return SQ_ERROR;
1286   } catch(...) {
1287     sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1288     return SQ_ERROR;
1289   }
1290
1291 }
1292
1293 static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm)
1294 {
1295   SQUserPointer data;
1296   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1297     sq_throwerror(vm, _SC("'deactivate' called without instance"));
1298     return SQ_ERROR;
1299   }
1300   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1301
1302   try {
1303     _this->deactivate();
1304
1305     return 0;
1306
1307   } catch(std::exception& e) {
1308     sq_throwerror(vm, e.what());
1309     return SQ_ERROR;
1310   } catch(...) {
1311     sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1312     return SQ_ERROR;
1313   }
1314
1315 }
1316
1317 static SQInteger Player_activate_wrapper(HSQUIRRELVM vm)
1318 {
1319   SQUserPointer data;
1320   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1321     sq_throwerror(vm, _SC("'activate' called without instance"));
1322     return SQ_ERROR;
1323   }
1324   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1325
1326   try {
1327     _this->activate();
1328
1329     return 0;
1330
1331   } catch(std::exception& e) {
1332     sq_throwerror(vm, e.what());
1333     return SQ_ERROR;
1334   } catch(...) {
1335     sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1336     return SQ_ERROR;
1337   }
1338
1339 }
1340
1341 static SQInteger Player_walk_wrapper(HSQUIRRELVM vm)
1342 {
1343   SQUserPointer data;
1344   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1345     sq_throwerror(vm, _SC("'walk' called without instance"));
1346     return SQ_ERROR;
1347   }
1348   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1349   SQFloat arg0;
1350   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1351     sq_throwerror(vm, _SC("Argument 1 not a float"));
1352     return SQ_ERROR;
1353   }
1354
1355   try {
1356     _this->walk(static_cast<float> (arg0));
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 'walk'"));
1365     return SQ_ERROR;
1366   }
1367
1368 }
1369
1370 static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm)
1371 {
1372   SQUserPointer data;
1373   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1374     sq_throwerror(vm, _SC("'set_visible' called without instance"));
1375     return SQ_ERROR;
1376   }
1377   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1378   SQBool arg0;
1379   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1380     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1381     return SQ_ERROR;
1382   }
1383
1384   try {
1385     _this->set_visible(arg0 == SQTrue);
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 'set_visible'"));
1394     return SQ_ERROR;
1395   }
1396
1397 }
1398
1399 static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm)
1400 {
1401   SQUserPointer data;
1402   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1403     sq_throwerror(vm, _SC("'get_visible' called without instance"));
1404     return SQ_ERROR;
1405   }
1406   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1407
1408   try {
1409     bool return_value = _this->get_visible();
1410
1411     sq_pushbool(vm, return_value);
1412     return 1;
1413
1414   } catch(std::exception& e) {
1415     sq_throwerror(vm, e.what());
1416     return SQ_ERROR;
1417   } catch(...) {
1418     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1419     return SQ_ERROR;
1420   }
1421
1422 }
1423
1424 static SQInteger Player_kill_wrapper(HSQUIRRELVM vm)
1425 {
1426   SQUserPointer data;
1427   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1428     sq_throwerror(vm, _SC("'kill' called without instance"));
1429     return SQ_ERROR;
1430   }
1431   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1432   SQBool arg0;
1433   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1434     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1435     return SQ_ERROR;
1436   }
1437
1438   try {
1439     _this->kill(arg0 == SQTrue);
1440
1441     return 0;
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 'kill'"));
1448     return SQ_ERROR;
1449   }
1450
1451 }
1452
1453 static SQInteger Player_set_ghost_mode_wrapper(HSQUIRRELVM vm)
1454 {
1455   SQUserPointer data;
1456   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1457     sq_throwerror(vm, _SC("'set_ghost_mode' 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->set_ghost_mode(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 'set_ghost_mode'"));
1477     return SQ_ERROR;
1478   }
1479
1480 }
1481
1482 static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm)
1483 {
1484   SQUserPointer data;
1485   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1486     sq_throwerror(vm, _SC("'get_ghost_mode' called without instance"));
1487     return SQ_ERROR;
1488   }
1489   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1490
1491   try {
1492     bool return_value = _this->get_ghost_mode();
1493
1494     sq_pushbool(vm, return_value);
1495     return 1;
1496
1497   } catch(std::exception& e) {
1498     sq_throwerror(vm, e.what());
1499     return SQ_ERROR;
1500   } catch(...) {
1501     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ghost_mode'"));
1502     return SQ_ERROR;
1503   }
1504
1505 }
1506
1507 static SQInteger Player_do_cheer_wrapper(HSQUIRRELVM vm)
1508 {
1509   SQUserPointer data;
1510   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1511     sq_throwerror(vm, _SC("'do_cheer' called without instance"));
1512     return SQ_ERROR;
1513   }
1514   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1515
1516   try {
1517     _this->do_cheer();
1518
1519     return 0;
1520
1521   } catch(std::exception& e) {
1522     sq_throwerror(vm, e.what());
1523     return SQ_ERROR;
1524   } catch(...) {
1525     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_cheer'"));
1526     return SQ_ERROR;
1527   }
1528
1529 }
1530
1531 static SQInteger Player_do_duck_wrapper(HSQUIRRELVM vm)
1532 {
1533   SQUserPointer data;
1534   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1535     sq_throwerror(vm, _SC("'do_duck' called without instance"));
1536     return SQ_ERROR;
1537   }
1538   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1539
1540   try {
1541     _this->do_duck();
1542
1543     return 0;
1544
1545   } catch(std::exception& e) {
1546     sq_throwerror(vm, e.what());
1547     return SQ_ERROR;
1548   } catch(...) {
1549     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_duck'"));
1550     return SQ_ERROR;
1551   }
1552
1553 }
1554
1555 static SQInteger Player_do_standup_wrapper(HSQUIRRELVM vm)
1556 {
1557   SQUserPointer data;
1558   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1559     sq_throwerror(vm, _SC("'do_standup' called without instance"));
1560     return SQ_ERROR;
1561   }
1562   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1563
1564   try {
1565     _this->do_standup();
1566
1567     return 0;
1568
1569   } catch(std::exception& e) {
1570     sq_throwerror(vm, e.what());
1571     return SQ_ERROR;
1572   } catch(...) {
1573     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_standup'"));
1574     return SQ_ERROR;
1575   }
1576
1577 }
1578
1579 static SQInteger Player_do_backflip_wrapper(HSQUIRRELVM vm)
1580 {
1581   SQUserPointer data;
1582   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1583     sq_throwerror(vm, _SC("'do_backflip' called without instance"));
1584     return SQ_ERROR;
1585   }
1586   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1587
1588   try {
1589     _this->do_backflip();
1590
1591     return 0;
1592
1593   } catch(std::exception& e) {
1594     sq_throwerror(vm, e.what());
1595     return SQ_ERROR;
1596   } catch(...) {
1597     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_backflip'"));
1598     return SQ_ERROR;
1599   }
1600
1601 }
1602
1603 static SQInteger Player_do_jump_wrapper(HSQUIRRELVM vm)
1604 {
1605   SQUserPointer data;
1606   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1607     sq_throwerror(vm, _SC("'do_jump' called without instance"));
1608     return SQ_ERROR;
1609   }
1610   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1611   SQFloat arg0;
1612   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1613     sq_throwerror(vm, _SC("Argument 1 not a float"));
1614     return SQ_ERROR;
1615   }
1616
1617   try {
1618     _this->do_jump(static_cast<float> (arg0));
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_jump'"));
1627     return SQ_ERROR;
1628   }
1629
1630 }
1631
1632 static SQInteger Player_trigger_sequence_wrapper(HSQUIRRELVM vm)
1633 {
1634   SQUserPointer data;
1635   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1636     sq_throwerror(vm, _SC("'trigger_sequence' called without instance"));
1637     return SQ_ERROR;
1638   }
1639   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1640   const SQChar* arg0;
1641   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1642     sq_throwerror(vm, _SC("Argument 1 not a string"));
1643     return SQ_ERROR;
1644   }
1645
1646   try {
1647     _this->trigger_sequence(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 'trigger_sequence'"));
1656     return SQ_ERROR;
1657   }
1658
1659 }
1660
1661 static SQInteger Player_use_scripting_controller_wrapper(HSQUIRRELVM vm)
1662 {
1663   SQUserPointer data;
1664   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1665     sq_throwerror(vm, _SC("'use_scripting_controller' called without instance"));
1666     return SQ_ERROR;
1667   }
1668   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1669   SQBool arg0;
1670   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1671     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1672     return SQ_ERROR;
1673   }
1674
1675   try {
1676     _this->use_scripting_controller(arg0 == SQTrue);
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 'use_scripting_controller'"));
1685     return SQ_ERROR;
1686   }
1687
1688 }
1689
1690 static SQInteger Player_do_scripting_controller_wrapper(HSQUIRRELVM vm)
1691 {
1692   SQUserPointer data;
1693   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1694     sq_throwerror(vm, _SC("'do_scripting_controller' called without instance"));
1695     return SQ_ERROR;
1696   }
1697   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1698   const SQChar* arg0;
1699   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1700     sq_throwerror(vm, _SC("Argument 1 not a string"));
1701     return SQ_ERROR;
1702   }
1703   SQBool arg1;
1704   if(SQ_FAILED(sq_getbool(vm, 3, &arg1))) {
1705     sq_throwerror(vm, _SC("Argument 2 not a bool"));
1706     return SQ_ERROR;
1707   }
1708
1709   try {
1710     _this->do_scripting_controller(arg0, arg1 == SQTrue);
1711
1712     return 0;
1713
1714   } catch(std::exception& e) {
1715     sq_throwerror(vm, e.what());
1716     return SQ_ERROR;
1717   } catch(...) {
1718     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_scripting_controller'"));
1719     return SQ_ERROR;
1720   }
1721
1722 }
1723
1724 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
1725 {
1726   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1727   delete _this;
1728   return 0;
1729 }
1730
1731 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1732 {
1733   const SQChar* arg0;
1734   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1735     sq_throwerror(vm, _SC("Argument 1 not a string"));
1736     return SQ_ERROR;
1737   }
1738
1739   try {
1740     Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1741   if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1742     sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1743     return SQ_ERROR;
1744   }
1745   sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1746
1747     return 0;
1748
1749   } catch(std::exception& e) {
1750     sq_throwerror(vm, e.what());
1751     return SQ_ERROR;
1752   } catch(...) {
1753     sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1754     return SQ_ERROR;
1755   }
1756
1757 }
1758
1759 static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
1760 {
1761   SQUserPointer data;
1762   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1763     sq_throwerror(vm, _SC("'set_layer' called without instance"));
1764     return SQ_ERROR;
1765   }
1766   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1767   SQInteger arg0;
1768   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1769     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1770     return SQ_ERROR;
1771   }
1772
1773   try {
1774     _this->set_layer(static_cast<int> (arg0));
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 'set_layer'"));
1783     return SQ_ERROR;
1784   }
1785
1786 }
1787
1788 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1789 {
1790   SQUserPointer data;
1791   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1792     sq_throwerror(vm, _SC("'get_layer' called without instance"));
1793     return SQ_ERROR;
1794   }
1795   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1796
1797   try {
1798     int return_value = _this->get_layer();
1799
1800     sq_pushinteger(vm, return_value);
1801     return 1;
1802
1803   } catch(std::exception& e) {
1804     sq_throwerror(vm, e.what());
1805     return SQ_ERROR;
1806   } catch(...) {
1807     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1808     return SQ_ERROR;
1809   }
1810
1811 }
1812
1813 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1814 {
1815   SQUserPointer data;
1816   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1817     sq_throwerror(vm, _SC("'set_pos' called without instance"));
1818     return SQ_ERROR;
1819   }
1820   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1821   SQFloat arg0;
1822   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1823     sq_throwerror(vm, _SC("Argument 1 not a float"));
1824     return SQ_ERROR;
1825   }
1826   SQFloat arg1;
1827   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1828     sq_throwerror(vm, _SC("Argument 2 not a float"));
1829     return SQ_ERROR;
1830   }
1831
1832   try {
1833     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1834
1835     return 0;
1836
1837   } catch(std::exception& e) {
1838     sq_throwerror(vm, e.what());
1839     return SQ_ERROR;
1840   } catch(...) {
1841     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1842     return SQ_ERROR;
1843   }
1844
1845 }
1846
1847 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1848 {
1849   SQUserPointer data;
1850   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1851     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1852     return SQ_ERROR;
1853   }
1854   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1855
1856   try {
1857     float return_value = _this->get_pos_x();
1858
1859     sq_pushfloat(vm, return_value);
1860     return 1;
1861
1862   } catch(std::exception& e) {
1863     sq_throwerror(vm, e.what());
1864     return SQ_ERROR;
1865   } catch(...) {
1866     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1867     return SQ_ERROR;
1868   }
1869
1870 }
1871
1872 static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
1873 {
1874   SQUserPointer data;
1875   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1876     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1877     return SQ_ERROR;
1878   }
1879   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1880
1881   try {
1882     float return_value = _this->get_pos_y();
1883
1884     sq_pushfloat(vm, return_value);
1885     return 1;
1886
1887   } catch(std::exception& e) {
1888     sq_throwerror(vm, e.what());
1889     return SQ_ERROR;
1890   } catch(...) {
1891     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1892     return SQ_ERROR;
1893   }
1894
1895 }
1896
1897 static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
1898 {
1899   SQUserPointer data;
1900   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1901     sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1902     return SQ_ERROR;
1903   }
1904   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1905   SQInteger arg0;
1906   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1907     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1908     return SQ_ERROR;
1909   }
1910
1911   try {
1912     _this->set_anchor_point(static_cast<int> (arg0));
1913
1914     return 0;
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 'set_anchor_point'"));
1921     return SQ_ERROR;
1922   }
1923
1924 }
1925
1926 static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
1927 {
1928   SQUserPointer data;
1929   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1930     sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1931     return SQ_ERROR;
1932   }
1933   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1934
1935   try {
1936     int return_value = _this->get_anchor_point();
1937
1938     sq_pushinteger(vm, return_value);
1939     return 1;
1940
1941   } catch(std::exception& e) {
1942     sq_throwerror(vm, e.what());
1943     return SQ_ERROR;
1944   } catch(...) {
1945     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1946     return SQ_ERROR;
1947   }
1948
1949 }
1950
1951 static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
1952 {
1953   SQUserPointer data;
1954   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1955     sq_throwerror(vm, _SC("'set_visible' called without instance"));
1956     return SQ_ERROR;
1957   }
1958   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1959   SQBool arg0;
1960   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1961     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1962     return SQ_ERROR;
1963   }
1964
1965   try {
1966     _this->set_visible(arg0 == SQTrue);
1967
1968     return 0;
1969
1970   } catch(std::exception& e) {
1971     sq_throwerror(vm, e.what());
1972     return SQ_ERROR;
1973   } catch(...) {
1974     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1975     return SQ_ERROR;
1976   }
1977
1978 }
1979
1980 static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
1981 {
1982   SQUserPointer data;
1983   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1984     sq_throwerror(vm, _SC("'get_visible' called without instance"));
1985     return SQ_ERROR;
1986   }
1987   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1988
1989   try {
1990     bool return_value = _this->get_visible();
1991
1992     sq_pushbool(vm, return_value);
1993     return 1;
1994
1995   } catch(std::exception& e) {
1996     sq_throwerror(vm, e.what());
1997     return SQ_ERROR;
1998   } catch(...) {
1999     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
2000     return SQ_ERROR;
2001   }
2002
2003 }
2004
2005 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
2006 {
2007   SQUserPointer data;
2008   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2009     sq_throwerror(vm, _SC("'set_action' called without instance"));
2010     return SQ_ERROR;
2011   }
2012   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
2013   const SQChar* arg0;
2014   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2015     sq_throwerror(vm, _SC("Argument 1 not a string"));
2016     return SQ_ERROR;
2017   }
2018
2019   try {
2020     _this->set_action(arg0);
2021
2022     return 0;
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 'set_action'"));
2029     return SQ_ERROR;
2030   }
2031
2032 }
2033
2034 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
2035 {
2036   SQUserPointer data;
2037   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2038     sq_throwerror(vm, _SC("'get_action' called without instance"));
2039     return SQ_ERROR;
2040   }
2041   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
2042
2043   try {
2044     std::string return_value = _this->get_action();
2045
2046     sq_pushstring(vm, return_value.c_str(), return_value.size());
2047     return 1;
2048
2049   } catch(std::exception& e) {
2050     sq_throwerror(vm, e.what());
2051     return SQ_ERROR;
2052   } catch(...) {
2053     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
2054     return SQ_ERROR;
2055   }
2056
2057 }
2058
2059 static SQInteger FloatingImage_fade_in_wrapper(HSQUIRRELVM vm)
2060 {
2061   SQUserPointer data;
2062   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2063     sq_throwerror(vm, _SC("'fade_in' called without instance"));
2064     return SQ_ERROR;
2065   }
2066   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
2067   SQFloat arg0;
2068   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2069     sq_throwerror(vm, _SC("Argument 1 not a float"));
2070     return SQ_ERROR;
2071   }
2072
2073   try {
2074     _this->fade_in(static_cast<float> (arg0));
2075
2076     return 0;
2077
2078   } catch(std::exception& e) {
2079     sq_throwerror(vm, e.what());
2080     return SQ_ERROR;
2081   } catch(...) {
2082     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
2083     return SQ_ERROR;
2084   }
2085
2086 }
2087
2088 static SQInteger FloatingImage_fade_out_wrapper(HSQUIRRELVM vm)
2089 {
2090   SQUserPointer data;
2091   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2092     sq_throwerror(vm, _SC("'fade_out' 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_out(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_out'"));
2112     return SQ_ERROR;
2113   }
2114
2115 }
2116
2117 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
2118 {
2119   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (ptr);
2120   delete _this;
2121   return 0;
2122 }
2123
2124 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
2125 {
2126   SQUserPointer data;
2127   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2128     sq_throwerror(vm, _SC("'goto_node' called without instance"));
2129     return SQ_ERROR;
2130   }
2131   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
2132   SQInteger arg0;
2133   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2134     sq_throwerror(vm, _SC("Argument 1 not an integer"));
2135     return SQ_ERROR;
2136   }
2137
2138   try {
2139     _this->goto_node(static_cast<int> (arg0));
2140
2141     return 0;
2142
2143   } catch(std::exception& e) {
2144     sq_throwerror(vm, e.what());
2145     return SQ_ERROR;
2146   } catch(...) {
2147     sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2148     return SQ_ERROR;
2149   }
2150
2151 }
2152
2153 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
2154 {
2155   SQUserPointer data;
2156   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2157     sq_throwerror(vm, _SC("'start_moving' called without instance"));
2158     return SQ_ERROR;
2159   }
2160   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
2161
2162   try {
2163     _this->start_moving();
2164
2165     return 0;
2166
2167   } catch(std::exception& e) {
2168     sq_throwerror(vm, e.what());
2169     return SQ_ERROR;
2170   } catch(...) {
2171     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
2172     return SQ_ERROR;
2173   }
2174
2175 }
2176
2177 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
2178 {
2179   SQUserPointer data;
2180   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2181     sq_throwerror(vm, _SC("'stop_moving' called without instance"));
2182     return SQ_ERROR;
2183   }
2184   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
2185
2186   try {
2187     _this->stop_moving();
2188
2189     return 0;
2190
2191   } catch(std::exception& e) {
2192     sq_throwerror(vm, e.what());
2193     return SQ_ERROR;
2194   } catch(...) {
2195     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
2196     return SQ_ERROR;
2197   }
2198
2199 }
2200
2201 static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger )
2202 {
2203   Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (ptr);
2204   delete _this;
2205   return 0;
2206 }
2207
2208 static SQInteger Candle_get_burning_wrapper(HSQUIRRELVM vm)
2209 {
2210   SQUserPointer data;
2211   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2212     sq_throwerror(vm, _SC("'get_burning' called without instance"));
2213     return SQ_ERROR;
2214   }
2215   Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
2216
2217   try {
2218     bool return_value = _this->get_burning();
2219
2220     sq_pushbool(vm, return_value);
2221     return 1;
2222
2223   } catch(std::exception& e) {
2224     sq_throwerror(vm, e.what());
2225     return SQ_ERROR;
2226   } catch(...) {
2227     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_burning'"));
2228     return SQ_ERROR;
2229   }
2230
2231 }
2232
2233 static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm)
2234 {
2235   SQUserPointer data;
2236   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2237     sq_throwerror(vm, _SC("'set_burning' called without instance"));
2238     return SQ_ERROR;
2239   }
2240   Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
2241   SQBool arg0;
2242   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2243     sq_throwerror(vm, _SC("Argument 1 not a bool"));
2244     return SQ_ERROR;
2245   }
2246
2247   try {
2248     _this->set_burning(arg0 == SQTrue);
2249
2250     return 0;
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 'set_burning'"));
2257     return SQ_ERROR;
2258   }
2259
2260 }
2261
2262 static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger )
2263 {
2264   Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (ptr);
2265   delete _this;
2266   return 0;
2267 }
2268
2269 static SQInteger Wind_start_wrapper(HSQUIRRELVM vm)
2270 {
2271   SQUserPointer data;
2272   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2273     sq_throwerror(vm, _SC("'start' called without instance"));
2274     return SQ_ERROR;
2275   }
2276   Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
2277
2278   try {
2279     _this->start();
2280
2281     return 0;
2282
2283   } catch(std::exception& e) {
2284     sq_throwerror(vm, e.what());
2285     return SQ_ERROR;
2286   } catch(...) {
2287     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2288     return SQ_ERROR;
2289   }
2290
2291 }
2292
2293 static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm)
2294 {
2295   SQUserPointer data;
2296   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2297     sq_throwerror(vm, _SC("'stop' called without instance"));
2298     return SQ_ERROR;
2299   }
2300   Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
2301
2302   try {
2303     _this->stop();
2304
2305     return 0;
2306
2307   } catch(std::exception& e) {
2308     sq_throwerror(vm, e.what());
2309     return SQ_ERROR;
2310   } catch(...) {
2311     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2312     return SQ_ERROR;
2313   }
2314
2315 }
2316
2317 static SQInteger AmbientSound_release_hook(SQUserPointer ptr, SQInteger )
2318 {
2319   Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (ptr);
2320   delete _this;
2321   return 0;
2322 }
2323
2324 static SQInteger AmbientSound_set_pos_wrapper(HSQUIRRELVM vm)
2325 {
2326   SQUserPointer data;
2327   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2328     sq_throwerror(vm, _SC("'set_pos' called without instance"));
2329     return SQ_ERROR;
2330   }
2331   Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2332   SQFloat arg0;
2333   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2334     sq_throwerror(vm, _SC("Argument 1 not a float"));
2335     return SQ_ERROR;
2336   }
2337   SQFloat arg1;
2338   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2339     sq_throwerror(vm, _SC("Argument 2 not a float"));
2340     return SQ_ERROR;
2341   }
2342
2343   try {
2344     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
2345
2346     return 0;
2347
2348   } catch(std::exception& e) {
2349     sq_throwerror(vm, e.what());
2350     return SQ_ERROR;
2351   } catch(...) {
2352     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
2353     return SQ_ERROR;
2354   }
2355
2356 }
2357
2358 static SQInteger AmbientSound_get_pos_x_wrapper(HSQUIRRELVM vm)
2359 {
2360   SQUserPointer data;
2361   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2362     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
2363     return SQ_ERROR;
2364   }
2365   Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2366
2367   try {
2368     float return_value = _this->get_pos_x();
2369
2370     sq_pushfloat(vm, return_value);
2371     return 1;
2372
2373   } catch(std::exception& e) {
2374     sq_throwerror(vm, e.what());
2375     return SQ_ERROR;
2376   } catch(...) {
2377     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
2378     return SQ_ERROR;
2379   }
2380
2381 }
2382
2383 static SQInteger AmbientSound_get_pos_y_wrapper(HSQUIRRELVM vm)
2384 {
2385   SQUserPointer data;
2386   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2387     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
2388     return SQ_ERROR;
2389   }
2390   Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2391
2392   try {
2393     float return_value = _this->get_pos_y();
2394
2395     sq_pushfloat(vm, return_value);
2396     return 1;
2397
2398   } catch(std::exception& e) {
2399     sq_throwerror(vm, e.what());
2400     return SQ_ERROR;
2401   } catch(...) {
2402     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
2403     return SQ_ERROR;
2404   }
2405
2406 }
2407
2408 static SQInteger Thunderstorm_release_hook(SQUserPointer ptr, SQInteger )
2409 {
2410   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (ptr);
2411   delete _this;
2412   return 0;
2413 }
2414
2415 static SQInteger Thunderstorm_start_wrapper(HSQUIRRELVM vm)
2416 {
2417   SQUserPointer data;
2418   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2419     sq_throwerror(vm, _SC("'start' called without instance"));
2420     return SQ_ERROR;
2421   }
2422   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2423
2424   try {
2425     _this->start();
2426
2427     return 0;
2428
2429   } catch(std::exception& e) {
2430     sq_throwerror(vm, e.what());
2431     return SQ_ERROR;
2432   } catch(...) {
2433     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2434     return SQ_ERROR;
2435   }
2436
2437 }
2438
2439 static SQInteger Thunderstorm_stop_wrapper(HSQUIRRELVM vm)
2440 {
2441   SQUserPointer data;
2442   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2443     sq_throwerror(vm, _SC("'stop' called without instance"));
2444     return SQ_ERROR;
2445   }
2446   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2447
2448   try {
2449     _this->stop();
2450
2451     return 0;
2452
2453   } catch(std::exception& e) {
2454     sq_throwerror(vm, e.what());
2455     return SQ_ERROR;
2456   } catch(...) {
2457     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2458     return SQ_ERROR;
2459   }
2460
2461 }
2462
2463 static SQInteger Thunderstorm_thunder_wrapper(HSQUIRRELVM vm)
2464 {
2465   SQUserPointer data;
2466   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2467     sq_throwerror(vm, _SC("'thunder' called without instance"));
2468     return SQ_ERROR;
2469   }
2470   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2471
2472   try {
2473     _this->thunder();
2474
2475     return 0;
2476
2477   } catch(std::exception& e) {
2478     sq_throwerror(vm, e.what());
2479     return SQ_ERROR;
2480   } catch(...) {
2481     sq_throwerror(vm, _SC("Unexpected exception while executing function 'thunder'"));
2482     return SQ_ERROR;
2483   }
2484
2485 }
2486
2487 static SQInteger Thunderstorm_lightning_wrapper(HSQUIRRELVM vm)
2488 {
2489   SQUserPointer data;
2490   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2491     sq_throwerror(vm, _SC("'lightning' called without instance"));
2492     return SQ_ERROR;
2493   }
2494   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2495
2496   try {
2497     _this->lightning();
2498
2499     return 0;
2500
2501   } catch(std::exception& e) {
2502     sq_throwerror(vm, e.what());
2503     return SQ_ERROR;
2504   } catch(...) {
2505     sq_throwerror(vm, _SC("Unexpected exception while executing function 'lightning'"));
2506     return SQ_ERROR;
2507   }
2508
2509 }
2510
2511 static SQInteger Thunderstorm_flash_wrapper(HSQUIRRELVM vm)
2512 {
2513   SQUserPointer data;
2514   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2515     sq_throwerror(vm, _SC("'flash' called without instance"));
2516     return SQ_ERROR;
2517   }
2518   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2519
2520   try {
2521     _this->flash();
2522
2523     return 0;
2524
2525   } catch(std::exception& e) {
2526     sq_throwerror(vm, e.what());
2527     return SQ_ERROR;
2528   } catch(...) {
2529     sq_throwerror(vm, _SC("Unexpected exception while executing function 'flash'"));
2530     return SQ_ERROR;
2531   }
2532
2533 }
2534
2535 static SQInteger Thunderstorm_electrify_wrapper(HSQUIRRELVM vm)
2536 {
2537   SQUserPointer data;
2538   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2539     sq_throwerror(vm, _SC("'electrify' called without instance"));
2540     return SQ_ERROR;
2541   }
2542   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2543
2544   try {
2545     _this->electrify();
2546
2547     return 0;
2548
2549   } catch(std::exception& e) {
2550     sq_throwerror(vm, e.what());
2551     return SQ_ERROR;
2552   } catch(...) {
2553     sq_throwerror(vm, _SC("Unexpected exception while executing function 'electrify'"));
2554     return SQ_ERROR;
2555   }
2556
2557 }
2558
2559 static SQInteger TileMap_release_hook(SQUserPointer ptr, SQInteger )
2560 {
2561   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (ptr);
2562   delete _this;
2563   return 0;
2564 }
2565
2566 static SQInteger TileMap_goto_node_wrapper(HSQUIRRELVM vm)
2567 {
2568   SQUserPointer data;
2569   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2570     sq_throwerror(vm, _SC("'goto_node' called without instance"));
2571     return SQ_ERROR;
2572   }
2573   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2574   SQInteger arg0;
2575   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2576     sq_throwerror(vm, _SC("Argument 1 not an integer"));
2577     return SQ_ERROR;
2578   }
2579
2580   try {
2581     _this->goto_node(static_cast<int> (arg0));
2582
2583     return 0;
2584
2585   } catch(std::exception& e) {
2586     sq_throwerror(vm, e.what());
2587     return SQ_ERROR;
2588   } catch(...) {
2589     sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2590     return SQ_ERROR;
2591   }
2592
2593 }
2594
2595 static SQInteger TileMap_start_moving_wrapper(HSQUIRRELVM vm)
2596 {
2597   SQUserPointer data;
2598   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2599     sq_throwerror(vm, _SC("'start_moving' called without instance"));
2600     return SQ_ERROR;
2601   }
2602   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2603
2604   try {
2605     _this->start_moving();
2606
2607     return 0;
2608
2609   } catch(std::exception& e) {
2610     sq_throwerror(vm, e.what());
2611     return SQ_ERROR;
2612   } catch(...) {
2613     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
2614     return SQ_ERROR;
2615   }
2616
2617 }
2618
2619 static SQInteger TileMap_stop_moving_wrapper(HSQUIRRELVM vm)
2620 {
2621   SQUserPointer data;
2622   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2623     sq_throwerror(vm, _SC("'stop_moving' called without instance"));
2624     return SQ_ERROR;
2625   }
2626   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2627
2628   try {
2629     _this->stop_moving();
2630
2631     return 0;
2632
2633   } catch(std::exception& e) {
2634     sq_throwerror(vm, e.what());
2635     return SQ_ERROR;
2636   } catch(...) {
2637     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
2638     return SQ_ERROR;
2639   }
2640
2641 }
2642
2643 static SQInteger TileMap_fade_wrapper(HSQUIRRELVM vm)
2644 {
2645   SQUserPointer data;
2646   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2647     sq_throwerror(vm, _SC("'fade' called without instance"));
2648     return SQ_ERROR;
2649   }
2650   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2651   SQFloat arg0;
2652   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2653     sq_throwerror(vm, _SC("Argument 1 not a float"));
2654     return SQ_ERROR;
2655   }
2656   SQFloat arg1;
2657   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2658     sq_throwerror(vm, _SC("Argument 2 not a float"));
2659     return SQ_ERROR;
2660   }
2661
2662   try {
2663     _this->fade(static_cast<float> (arg0), static_cast<float> (arg1));
2664
2665     return 0;
2666
2667   } catch(std::exception& e) {
2668     sq_throwerror(vm, e.what());
2669     return SQ_ERROR;
2670   } catch(...) {
2671     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade'"));
2672     return SQ_ERROR;
2673   }
2674
2675 }
2676
2677 static SQInteger TileMap_set_alpha_wrapper(HSQUIRRELVM vm)
2678 {
2679   SQUserPointer data;
2680   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2681     sq_throwerror(vm, _SC("'set_alpha' called without instance"));
2682     return SQ_ERROR;
2683   }
2684   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2685   SQFloat arg0;
2686   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2687     sq_throwerror(vm, _SC("Argument 1 not a float"));
2688     return SQ_ERROR;
2689   }
2690
2691   try {
2692     _this->set_alpha(static_cast<float> (arg0));
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 'set_alpha'"));
2701     return SQ_ERROR;
2702   }
2703
2704 }
2705
2706 static SQInteger TileMap_get_alpha_wrapper(HSQUIRRELVM vm)
2707 {
2708   SQUserPointer data;
2709   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2710     sq_throwerror(vm, _SC("'get_alpha' called without instance"));
2711     return SQ_ERROR;
2712   }
2713   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2714
2715   try {
2716     float return_value = _this->get_alpha();
2717
2718     sq_pushfloat(vm, return_value);
2719     return 1;
2720
2721   } catch(std::exception& e) {
2722     sq_throwerror(vm, e.what());
2723     return SQ_ERROR;
2724   } catch(...) {
2725     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_alpha'"));
2726     return SQ_ERROR;
2727   }
2728
2729 }
2730
2731 static SQInteger SSector_release_hook(SQUserPointer ptr, SQInteger )
2732 {
2733   Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (ptr);
2734   delete _this;
2735   return 0;
2736 }
2737
2738 static SQInteger SSector_set_ambient_light_wrapper(HSQUIRRELVM vm)
2739 {
2740   SQUserPointer data;
2741   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2742     sq_throwerror(vm, _SC("'set_ambient_light' called without instance"));
2743     return SQ_ERROR;
2744   }
2745   Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2746   SQFloat arg0;
2747   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2748     sq_throwerror(vm, _SC("Argument 1 not a float"));
2749     return SQ_ERROR;
2750   }
2751   SQFloat arg1;
2752   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2753     sq_throwerror(vm, _SC("Argument 2 not a float"));
2754     return SQ_ERROR;
2755   }
2756   SQFloat arg2;
2757   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2758     sq_throwerror(vm, _SC("Argument 3 not a float"));
2759     return SQ_ERROR;
2760   }
2761
2762   try {
2763     _this->set_ambient_light(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2764
2765     return 0;
2766
2767   } catch(std::exception& e) {
2768     sq_throwerror(vm, e.what());
2769     return SQ_ERROR;
2770   } catch(...) {
2771     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ambient_light'"));
2772     return SQ_ERROR;
2773   }
2774
2775 }
2776
2777 static SQInteger SSector_get_ambient_red_wrapper(HSQUIRRELVM vm)
2778 {
2779   SQUserPointer data;
2780   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2781     sq_throwerror(vm, _SC("'get_ambient_red' called without instance"));
2782     return SQ_ERROR;
2783   }
2784   Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2785
2786   try {
2787     float return_value = _this->get_ambient_red();
2788
2789     sq_pushfloat(vm, return_value);
2790     return 1;
2791
2792   } catch(std::exception& e) {
2793     sq_throwerror(vm, e.what());
2794     return SQ_ERROR;
2795   } catch(...) {
2796     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_red'"));
2797     return SQ_ERROR;
2798   }
2799
2800 }
2801
2802 static SQInteger SSector_get_ambient_green_wrapper(HSQUIRRELVM vm)
2803 {
2804   SQUserPointer data;
2805   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2806     sq_throwerror(vm, _SC("'get_ambient_green' called without instance"));
2807     return SQ_ERROR;
2808   }
2809   Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2810
2811   try {
2812     float return_value = _this->get_ambient_green();
2813
2814     sq_pushfloat(vm, return_value);
2815     return 1;
2816
2817   } catch(std::exception& e) {
2818     sq_throwerror(vm, e.what());
2819     return SQ_ERROR;
2820   } catch(...) {
2821     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_green'"));
2822     return SQ_ERROR;
2823   }
2824
2825 }
2826
2827 static SQInteger SSector_get_ambient_blue_wrapper(HSQUIRRELVM vm)
2828 {
2829   SQUserPointer data;
2830   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2831     sq_throwerror(vm, _SC("'get_ambient_blue' called without instance"));
2832     return SQ_ERROR;
2833   }
2834   Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2835
2836   try {
2837     float return_value = _this->get_ambient_blue();
2838
2839     sq_pushfloat(vm, return_value);
2840     return 1;
2841
2842   } catch(std::exception& e) {
2843     sq_throwerror(vm, e.what());
2844     return SQ_ERROR;
2845   } catch(...) {
2846     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_blue'"));
2847     return SQ_ERROR;
2848   }
2849
2850 }
2851
2852 static SQInteger LevelTime_release_hook(SQUserPointer ptr, SQInteger )
2853 {
2854   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (ptr);
2855   delete _this;
2856   return 0;
2857 }
2858
2859 static SQInteger LevelTime_start_wrapper(HSQUIRRELVM vm)
2860 {
2861   SQUserPointer data;
2862   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2863     sq_throwerror(vm, _SC("'start' called without instance"));
2864     return SQ_ERROR;
2865   }
2866   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2867
2868   try {
2869     _this->start();
2870
2871     return 0;
2872
2873   } catch(std::exception& e) {
2874     sq_throwerror(vm, e.what());
2875     return SQ_ERROR;
2876   } catch(...) {
2877     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2878     return SQ_ERROR;
2879   }
2880
2881 }
2882
2883 static SQInteger LevelTime_stop_wrapper(HSQUIRRELVM vm)
2884 {
2885   SQUserPointer data;
2886   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2887     sq_throwerror(vm, _SC("'stop' called without instance"));
2888     return SQ_ERROR;
2889   }
2890   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2891
2892   try {
2893     _this->stop();
2894
2895     return 0;
2896
2897   } catch(std::exception& e) {
2898     sq_throwerror(vm, e.what());
2899     return SQ_ERROR;
2900   } catch(...) {
2901     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2902     return SQ_ERROR;
2903   }
2904
2905 }
2906
2907 static SQInteger LevelTime_get_time_wrapper(HSQUIRRELVM vm)
2908 {
2909   SQUserPointer data;
2910   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2911     sq_throwerror(vm, _SC("'get_time' called without instance"));
2912     return SQ_ERROR;
2913   }
2914   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2915
2916   try {
2917     float return_value = _this->get_time();
2918
2919     sq_pushfloat(vm, return_value);
2920     return 1;
2921
2922   } catch(std::exception& e) {
2923     sq_throwerror(vm, e.what());
2924     return SQ_ERROR;
2925   } catch(...) {
2926     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_time'"));
2927     return SQ_ERROR;
2928   }
2929
2930 }
2931
2932 static SQInteger LevelTime_set_time_wrapper(HSQUIRRELVM vm)
2933 {
2934   SQUserPointer data;
2935   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2936     sq_throwerror(vm, _SC("'set_time' called without instance"));
2937     return SQ_ERROR;
2938   }
2939   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2940   SQFloat arg0;
2941   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2942     sq_throwerror(vm, _SC("Argument 1 not a float"));
2943     return SQ_ERROR;
2944   }
2945
2946   try {
2947     _this->set_time(static_cast<float> (arg0));
2948
2949     return 0;
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 'set_time'"));
2956     return SQ_ERROR;
2957   }
2958
2959 }
2960
2961 static SQInteger WillOWisp_release_hook(SQUserPointer ptr, SQInteger )
2962 {
2963   Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (ptr);
2964   delete _this;
2965   return 0;
2966 }
2967
2968 static SQInteger WillOWisp_goto_node_wrapper(HSQUIRRELVM vm)
2969 {
2970   SQUserPointer data;
2971   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2972     sq_throwerror(vm, _SC("'goto_node' called without instance"));
2973     return SQ_ERROR;
2974   }
2975   Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
2976   SQInteger arg0;
2977   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2978     sq_throwerror(vm, _SC("Argument 1 not an integer"));
2979     return SQ_ERROR;
2980   }
2981
2982   try {
2983     _this->goto_node(static_cast<int> (arg0));
2984
2985     return 0;
2986
2987   } catch(std::exception& e) {
2988     sq_throwerror(vm, e.what());
2989     return SQ_ERROR;
2990   } catch(...) {
2991     sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2992     return SQ_ERROR;
2993   }
2994
2995 }
2996
2997 static SQInteger WillOWisp_set_state_wrapper(HSQUIRRELVM vm)
2998 {
2999   SQUserPointer data;
3000   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
3001     sq_throwerror(vm, _SC("'set_state' called without instance"));
3002     return SQ_ERROR;
3003   }
3004   Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
3005   const SQChar* arg0;
3006   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3007     sq_throwerror(vm, _SC("Argument 1 not a string"));
3008     return SQ_ERROR;
3009   }
3010
3011   try {
3012     _this->set_state(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 'set_state'"));
3021     return SQ_ERROR;
3022   }
3023
3024 }
3025
3026 static SQInteger WillOWisp_start_moving_wrapper(HSQUIRRELVM vm)
3027 {
3028   SQUserPointer data;
3029   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
3030     sq_throwerror(vm, _SC("'start_moving' called without instance"));
3031     return SQ_ERROR;
3032   }
3033   Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
3034
3035   try {
3036     _this->start_moving();
3037
3038     return 0;
3039
3040   } catch(std::exception& e) {
3041     sq_throwerror(vm, e.what());
3042     return SQ_ERROR;
3043   } catch(...) {
3044     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
3045     return SQ_ERROR;
3046   }
3047
3048 }
3049
3050 static SQInteger WillOWisp_stop_moving_wrapper(HSQUIRRELVM vm)
3051 {
3052   SQUserPointer data;
3053   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
3054     sq_throwerror(vm, _SC("'stop_moving' called without instance"));
3055     return SQ_ERROR;
3056   }
3057   Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
3058
3059   try {
3060     _this->stop_moving();
3061
3062     return 0;
3063
3064   } catch(std::exception& e) {
3065     sq_throwerror(vm, e.what());
3066     return SQ_ERROR;
3067   } catch(...) {
3068     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
3069     return SQ_ERROR;
3070   }
3071
3072 }
3073
3074 static SQInteger display_wrapper(HSQUIRRELVM vm)
3075 {
3076   return Scripting::display(vm);
3077 }
3078
3079 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
3080 {
3081   HSQUIRRELVM arg0 = vm;
3082
3083   try {
3084     Scripting::print_stacktrace(arg0);
3085
3086     return 0;
3087
3088   } catch(std::exception& e) {
3089     sq_throwerror(vm, e.what());
3090     return SQ_ERROR;
3091   } catch(...) {
3092     sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
3093     return SQ_ERROR;
3094   }
3095
3096 }
3097
3098 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
3099 {
3100   return Scripting::get_current_thread(vm);
3101 }
3102
3103 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
3104 {
3105   const SQChar* arg0;
3106   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3107     sq_throwerror(vm, _SC("Argument 1 not a string"));
3108     return SQ_ERROR;
3109   }
3110
3111   try {
3112     Scripting::display_text_file(arg0);
3113
3114     return 0;
3115
3116   } catch(std::exception& e) {
3117     sq_throwerror(vm, e.what());
3118     return SQ_ERROR;
3119   } catch(...) {
3120     sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
3121     return SQ_ERROR;
3122   }
3123
3124 }
3125
3126 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
3127 {
3128   const SQChar* arg0;
3129   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3130     sq_throwerror(vm, _SC("Argument 1 not a string"));
3131     return SQ_ERROR;
3132   }
3133
3134   try {
3135     Scripting::load_worldmap(arg0);
3136
3137     return 0;
3138
3139   } catch(std::exception& e) {
3140     sq_throwerror(vm, e.what());
3141     return SQ_ERROR;
3142   } catch(...) {
3143     sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
3144     return SQ_ERROR;
3145   }
3146
3147 }
3148
3149 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
3150 {
3151   const SQChar* arg0;
3152   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3153     sq_throwerror(vm, _SC("Argument 1 not a string"));
3154     return SQ_ERROR;
3155   }
3156
3157   try {
3158     Scripting::load_level(arg0);
3159
3160     return 0;
3161
3162   } catch(std::exception& e) {
3163     sq_throwerror(vm, e.what());
3164     return SQ_ERROR;
3165   } catch(...) {
3166     sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
3167     return SQ_ERROR;
3168   }
3169
3170 }
3171
3172 static SQInteger wait_wrapper(HSQUIRRELVM vm)
3173 {
3174   HSQUIRRELVM arg0 = vm;
3175   SQFloat arg1;
3176   if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
3177     sq_throwerror(vm, _SC("Argument 1 not a float"));
3178     return SQ_ERROR;
3179   }
3180
3181   try {
3182     Scripting::wait(arg0, static_cast<float> (arg1));
3183
3184     return sq_suspendvm(vm);
3185
3186   } catch(std::exception& e) {
3187     sq_throwerror(vm, e.what());
3188     return SQ_ERROR;
3189   } catch(...) {
3190     sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
3191     return SQ_ERROR;
3192   }
3193
3194 }
3195
3196 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
3197 {
3198   HSQUIRRELVM arg0 = vm;
3199
3200   try {
3201     Scripting::wait_for_screenswitch(arg0);
3202
3203     return sq_suspendvm(vm);
3204
3205   } catch(std::exception& e) {
3206     sq_throwerror(vm, e.what());
3207     return SQ_ERROR;
3208   } catch(...) {
3209     sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
3210     return SQ_ERROR;
3211   }
3212
3213 }
3214
3215 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
3216 {
3217   (void) vm;
3218
3219   try {
3220     Scripting::exit_screen();
3221
3222     return 0;
3223
3224   } catch(std::exception& e) {
3225     sq_throwerror(vm, e.what());
3226     return SQ_ERROR;
3227   } catch(...) {
3228     sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
3229     return SQ_ERROR;
3230   }
3231
3232 }
3233
3234 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
3235 {
3236   SQFloat arg0;
3237   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3238     sq_throwerror(vm, _SC("Argument 1 not a float"));
3239     return SQ_ERROR;
3240   }
3241
3242   try {
3243     Scripting::fadeout_screen(static_cast<float> (arg0));
3244
3245     return 0;
3246
3247   } catch(std::exception& e) {
3248     sq_throwerror(vm, e.what());
3249     return SQ_ERROR;
3250   } catch(...) {
3251     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
3252     return SQ_ERROR;
3253   }
3254
3255 }
3256
3257 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
3258 {
3259   SQFloat arg0;
3260   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3261     sq_throwerror(vm, _SC("Argument 1 not a float"));
3262     return SQ_ERROR;
3263   }
3264   SQFloat arg1;
3265   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
3266     sq_throwerror(vm, _SC("Argument 2 not a float"));
3267     return SQ_ERROR;
3268   }
3269   SQFloat arg2;
3270   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
3271     sq_throwerror(vm, _SC("Argument 3 not a float"));
3272     return SQ_ERROR;
3273   }
3274
3275   try {
3276     Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
3277
3278     return 0;
3279
3280   } catch(std::exception& e) {
3281     sq_throwerror(vm, e.what());
3282     return SQ_ERROR;
3283   } catch(...) {
3284     sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
3285     return SQ_ERROR;
3286   }
3287
3288 }
3289
3290 static SQInteger abort_screenfade_wrapper(HSQUIRRELVM vm)
3291 {
3292   (void) vm;
3293
3294   try {
3295     Scripting::abort_screenfade();
3296
3297     return 0;
3298
3299   } catch(std::exception& e) {
3300     sq_throwerror(vm, e.what());
3301     return SQ_ERROR;
3302   } catch(...) {
3303     sq_throwerror(vm, _SC("Unexpected exception while executing function 'abort_screenfade'"));
3304     return SQ_ERROR;
3305   }
3306
3307 }
3308
3309 static SQInteger translate_wrapper(HSQUIRRELVM vm)
3310 {
3311   const SQChar* arg0;
3312   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3313     sq_throwerror(vm, _SC("Argument 1 not a string"));
3314     return SQ_ERROR;
3315   }
3316
3317   try {
3318     std::string return_value = Scripting::translate(arg0);
3319
3320     sq_pushstring(vm, return_value.c_str(), return_value.size());
3321     return 1;
3322
3323   } catch(std::exception& e) {
3324     sq_throwerror(vm, e.what());
3325     return SQ_ERROR;
3326   } catch(...) {
3327     sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
3328     return SQ_ERROR;
3329   }
3330
3331 }
3332
3333 static SQInteger import_wrapper(HSQUIRRELVM vm)
3334 {
3335   HSQUIRRELVM arg0 = vm;
3336   const SQChar* arg1;
3337   if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
3338     sq_throwerror(vm, _SC("Argument 1 not a string"));
3339     return SQ_ERROR;
3340   }
3341
3342   try {
3343     Scripting::import(arg0, arg1);
3344
3345     return 0;
3346
3347   } catch(std::exception& e) {
3348     sq_throwerror(vm, e.what());
3349     return SQ_ERROR;
3350   } catch(...) {
3351     sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
3352     return SQ_ERROR;
3353   }
3354
3355 }
3356
3357 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
3358 {
3359   (void) vm;
3360
3361   try {
3362     Scripting::save_state();
3363
3364     return 0;
3365
3366   } catch(std::exception& e) {
3367     sq_throwerror(vm, e.what());
3368     return SQ_ERROR;
3369   } catch(...) {
3370     sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
3371     return SQ_ERROR;
3372   }
3373
3374 }
3375
3376 static SQInteger update_worldmap_wrapper(HSQUIRRELVM vm)
3377 {
3378   (void) vm;
3379
3380   try {
3381     Scripting::update_worldmap();
3382
3383     return 0;
3384
3385   } catch(std::exception& e) {
3386     sq_throwerror(vm, e.what());
3387     return SQ_ERROR;
3388   } catch(...) {
3389     sq_throwerror(vm, _SC("Unexpected exception while executing function 'update_worldmap'"));
3390     return SQ_ERROR;
3391   }
3392
3393 }
3394
3395 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
3396 {
3397   SQBool arg0;
3398   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3399     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3400     return SQ_ERROR;
3401   }
3402
3403   try {
3404     Scripting::debug_collrects(arg0 == SQTrue);
3405
3406     return 0;
3407
3408   } catch(std::exception& e) {
3409     sq_throwerror(vm, e.what());
3410     return SQ_ERROR;
3411   } catch(...) {
3412     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
3413     return SQ_ERROR;
3414   }
3415
3416 }
3417
3418 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
3419 {
3420   SQBool arg0;
3421   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3422     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3423     return SQ_ERROR;
3424   }
3425
3426   try {
3427     Scripting::debug_show_fps(arg0 == SQTrue);
3428
3429     return 0;
3430
3431   } catch(std::exception& e) {
3432     sq_throwerror(vm, e.what());
3433     return SQ_ERROR;
3434   } catch(...) {
3435     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
3436     return SQ_ERROR;
3437   }
3438
3439 }
3440
3441 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
3442 {
3443   SQBool arg0;
3444   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3445     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3446     return SQ_ERROR;
3447   }
3448
3449   try {
3450     Scripting::debug_draw_solids_only(arg0 == SQTrue);
3451
3452     return 0;
3453
3454   } catch(std::exception& e) {
3455     sq_throwerror(vm, e.what());
3456     return SQ_ERROR;
3457   } catch(...) {
3458     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
3459     return SQ_ERROR;
3460   }
3461
3462 }
3463
3464 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
3465 {
3466   const SQChar* arg0;
3467   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3468     sq_throwerror(vm, _SC("Argument 1 not a string"));
3469     return SQ_ERROR;
3470   }
3471
3472   try {
3473     Scripting::play_music(arg0);
3474
3475     return 0;
3476
3477   } catch(std::exception& e) {
3478     sq_throwerror(vm, e.what());
3479     return SQ_ERROR;
3480   } catch(...) {
3481     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
3482     return SQ_ERROR;
3483   }
3484
3485 }
3486
3487 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
3488 {
3489   const SQChar* arg0;
3490   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3491     sq_throwerror(vm, _SC("Argument 1 not a string"));
3492     return SQ_ERROR;
3493   }
3494
3495   try {
3496     Scripting::play_sound(arg0);
3497
3498     return 0;
3499
3500   } catch(std::exception& e) {
3501     sq_throwerror(vm, e.what());
3502     return SQ_ERROR;
3503   } catch(...) {
3504     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
3505     return SQ_ERROR;
3506   }
3507
3508 }
3509
3510 static SQInteger grease_wrapper(HSQUIRRELVM vm)
3511 {
3512   (void) vm;
3513
3514   try {
3515     Scripting::grease();
3516
3517     return 0;
3518
3519   } catch(std::exception& e) {
3520     sq_throwerror(vm, e.what());
3521     return SQ_ERROR;
3522   } catch(...) {
3523     sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
3524     return SQ_ERROR;
3525   }
3526
3527 }
3528
3529 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
3530 {
3531   (void) vm;
3532
3533   try {
3534     Scripting::invincible();
3535
3536     return 0;
3537
3538   } catch(std::exception& e) {
3539     sq_throwerror(vm, e.what());
3540     return SQ_ERROR;
3541   } catch(...) {
3542     sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
3543     return SQ_ERROR;
3544   }
3545
3546 }
3547
3548 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
3549 {
3550   (void) vm;
3551
3552   try {
3553     Scripting::ghost();
3554
3555     return 0;
3556
3557   } catch(std::exception& e) {
3558     sq_throwerror(vm, e.what());
3559     return SQ_ERROR;
3560   } catch(...) {
3561     sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
3562     return SQ_ERROR;
3563   }
3564
3565 }
3566
3567 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
3568 {
3569   (void) vm;
3570
3571   try {
3572     Scripting::mortal();
3573
3574     return 0;
3575
3576   } catch(std::exception& e) {
3577     sq_throwerror(vm, e.what());
3578     return SQ_ERROR;
3579   } catch(...) {
3580     sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
3581     return SQ_ERROR;
3582   }
3583
3584 }
3585
3586 static SQInteger restart_wrapper(HSQUIRRELVM vm)
3587 {
3588   (void) vm;
3589
3590   try {
3591     Scripting::restart();
3592
3593     return 0;
3594
3595   } catch(std::exception& e) {
3596     sq_throwerror(vm, e.what());
3597     return SQ_ERROR;
3598   } catch(...) {
3599     sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
3600     return SQ_ERROR;
3601   }
3602
3603 }
3604
3605 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
3606 {
3607   (void) vm;
3608
3609   try {
3610     Scripting::whereami();
3611
3612     return 0;
3613
3614   } catch(std::exception& e) {
3615     sq_throwerror(vm, e.what());
3616     return SQ_ERROR;
3617   } catch(...) {
3618     sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
3619     return SQ_ERROR;
3620   }
3621
3622 }
3623
3624 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
3625 {
3626   (void) vm;
3627
3628   try {
3629     Scripting::gotoend();
3630
3631     return 0;
3632
3633   } catch(std::exception& e) {
3634     sq_throwerror(vm, e.what());
3635     return SQ_ERROR;
3636   } catch(...) {
3637     sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
3638     return SQ_ERROR;
3639   }
3640
3641 }
3642
3643 static SQInteger camera_wrapper(HSQUIRRELVM vm)
3644 {
3645   (void) vm;
3646
3647   try {
3648     Scripting::camera();
3649
3650     return 0;
3651
3652   } catch(std::exception& e) {
3653     sq_throwerror(vm, e.what());
3654     return SQ_ERROR;
3655   } catch(...) {
3656     sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
3657     return SQ_ERROR;
3658   }
3659
3660 }
3661
3662 static SQInteger quit_wrapper(HSQUIRRELVM vm)
3663 {
3664   (void) vm;
3665
3666   try {
3667     Scripting::quit();
3668
3669     return 0;
3670
3671   } catch(std::exception& e) {
3672     sq_throwerror(vm, e.what());
3673     return SQ_ERROR;
3674   } catch(...) {
3675     sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
3676     return SQ_ERROR;
3677   }
3678
3679 }
3680
3681 static SQInteger rand_wrapper(HSQUIRRELVM vm)
3682 {
3683
3684   try {
3685     int return_value = Scripting::rand();
3686
3687     sq_pushinteger(vm, return_value);
3688     return 1;
3689
3690   } catch(std::exception& e) {
3691     sq_throwerror(vm, e.what());
3692     return SQ_ERROR;
3693   } catch(...) {
3694     sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
3695     return SQ_ERROR;
3696   }
3697
3698 }
3699
3700 } // end of namespace Wrapper
3701 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
3702 {
3703   using namespace Wrapper;
3704
3705   sq_pushroottable(v);
3706   sq_pushstring(v, "DisplayEffect", -1);
3707   if(SQ_FAILED(sq_get(v, -2))) {
3708     std::ostringstream msg;
3709     msg << "Couldn't resolved squirrel type 'DisplayEffect'";
3710     throw SquirrelError(v, msg.str());
3711   }
3712
3713   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3714     std::ostringstream msg;
3715     msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
3716     throw SquirrelError(v, msg.str());
3717   }
3718   sq_remove(v, -2); // remove object name
3719
3720   if(setup_releasehook) {
3721     sq_setreleasehook(v, -1, DisplayEffect_release_hook);
3722   }
3723
3724   sq_remove(v, -2); // remove root table
3725 }
3726
3727 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
3728 {
3729   using namespace Wrapper;
3730
3731   sq_pushroottable(v);
3732   sq_pushstring(v, "Camera", -1);
3733   if(SQ_FAILED(sq_get(v, -2))) {
3734     std::ostringstream msg;
3735     msg << "Couldn't resolved squirrel type 'Camera'";
3736     throw SquirrelError(v, msg.str());
3737   }
3738
3739   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3740     std::ostringstream msg;
3741     msg << "Couldn't setup squirrel instance for object of type 'Camera'";
3742     throw SquirrelError(v, msg.str());
3743   }
3744   sq_remove(v, -2); // remove object name
3745
3746   if(setup_releasehook) {
3747     sq_setreleasehook(v, -1, Camera_release_hook);
3748   }
3749
3750   sq_remove(v, -2); // remove root table
3751 }
3752
3753 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
3754 {
3755   using namespace Wrapper;
3756
3757   sq_pushroottable(v);
3758   sq_pushstring(v, "Level", -1);
3759   if(SQ_FAILED(sq_get(v, -2))) {
3760     std::ostringstream msg;
3761     msg << "Couldn't resolved squirrel type 'Level'";
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 'Level'";
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, Level_release_hook);
3774   }
3775
3776   sq_remove(v, -2); // remove root table
3777 }
3778
3779 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
3780 {
3781   using namespace Wrapper;
3782
3783   sq_pushroottable(v);
3784   sq_pushstring(v, "ScriptedObject", -1);
3785   if(SQ_FAILED(sq_get(v, -2))) {
3786     std::ostringstream msg;
3787     msg << "Couldn't resolved squirrel type 'ScriptedObject'";
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 'ScriptedObject'";
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, ScriptedObject_release_hook);
3800   }
3801
3802   sq_remove(v, -2); // remove root table
3803 }
3804
3805 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
3806 {
3807   using namespace Wrapper;
3808
3809   sq_pushroottable(v);
3810   sq_pushstring(v, "Text", -1);
3811   if(SQ_FAILED(sq_get(v, -2))) {
3812     std::ostringstream msg;
3813     msg << "Couldn't resolved squirrel type 'Text'";
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 'Text'";
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, Text_release_hook);
3826   }
3827
3828   sq_remove(v, -2); // remove root table
3829 }
3830
3831 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
3832 {
3833   using namespace Wrapper;
3834
3835   sq_pushroottable(v);
3836   sq_pushstring(v, "Player", -1);
3837   if(SQ_FAILED(sq_get(v, -2))) {
3838     std::ostringstream msg;
3839     msg << "Couldn't resolved squirrel type 'Player'";
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 'Player'";
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, Player_release_hook);
3852   }
3853
3854   sq_remove(v, -2); // remove root table
3855 }
3856
3857 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
3858 {
3859   using namespace Wrapper;
3860
3861   sq_pushroottable(v);
3862   sq_pushstring(v, "FloatingImage", -1);
3863   if(SQ_FAILED(sq_get(v, -2))) {
3864     std::ostringstream msg;
3865     msg << "Couldn't resolved squirrel type 'FloatingImage'";
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 'FloatingImage'";
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, FloatingImage_release_hook);
3878   }
3879
3880   sq_remove(v, -2); // remove root table
3881 }
3882
3883 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
3884 {
3885   using namespace Wrapper;
3886
3887   sq_pushroottable(v);
3888   sq_pushstring(v, "Platform", -1);
3889   if(SQ_FAILED(sq_get(v, -2))) {
3890     std::ostringstream msg;
3891     msg << "Couldn't resolved squirrel type 'Platform'";
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 'Platform'";
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, Platform_release_hook);
3904   }
3905
3906   sq_remove(v, -2); // remove root table
3907 }
3908
3909 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook)
3910 {
3911   using namespace Wrapper;
3912
3913   sq_pushroottable(v);
3914   sq_pushstring(v, "Candle", -1);
3915   if(SQ_FAILED(sq_get(v, -2))) {
3916     std::ostringstream msg;
3917     msg << "Couldn't resolved squirrel type 'Candle'";
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 'Candle'";
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, Candle_release_hook);
3930   }
3931
3932   sq_remove(v, -2); // remove root table
3933 }
3934
3935 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup_releasehook)
3936 {
3937   using namespace Wrapper;
3938
3939   sq_pushroottable(v);
3940   sq_pushstring(v, "Wind", -1);
3941   if(SQ_FAILED(sq_get(v, -2))) {
3942     std::ostringstream msg;
3943     msg << "Couldn't resolved squirrel type 'Wind'";
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 'Wind'";
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, Wind_release_hook);
3956   }
3957
3958   sq_remove(v, -2); // remove root table
3959 }
3960
3961 void create_squirrel_instance(HSQUIRRELVM v, Scripting::AmbientSound* object, bool setup_releasehook)
3962 {
3963   using namespace Wrapper;
3964
3965   sq_pushroottable(v);
3966   sq_pushstring(v, "AmbientSound", -1);
3967   if(SQ_FAILED(sq_get(v, -2))) {
3968     std::ostringstream msg;
3969     msg << "Couldn't resolved squirrel type 'AmbientSound'";
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 'AmbientSound'";
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, AmbientSound_release_hook);
3982   }
3983
3984   sq_remove(v, -2); // remove root table
3985 }
3986
3987 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Thunderstorm* object, bool setup_releasehook)
3988 {
3989   using namespace Wrapper;
3990
3991   sq_pushroottable(v);
3992   sq_pushstring(v, "Thunderstorm", -1);
3993   if(SQ_FAILED(sq_get(v, -2))) {
3994     std::ostringstream msg;
3995     msg << "Couldn't resolved squirrel type 'Thunderstorm'";
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 'Thunderstorm'";
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, Thunderstorm_release_hook);
4008   }
4009
4010   sq_remove(v, -2); // remove root table
4011 }
4012
4013 void create_squirrel_instance(HSQUIRRELVM v, Scripting::TileMap* object, bool setup_releasehook)
4014 {
4015   using namespace Wrapper;
4016
4017   sq_pushroottable(v);
4018   sq_pushstring(v, "TileMap", -1);
4019   if(SQ_FAILED(sq_get(v, -2))) {
4020     std::ostringstream msg;
4021     msg << "Couldn't resolved squirrel type 'TileMap'";
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 'TileMap'";
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, TileMap_release_hook);
4034   }
4035
4036   sq_remove(v, -2); // remove root table
4037 }
4038
4039 void create_squirrel_instance(HSQUIRRELVM v, Scripting::SSector* object, bool setup_releasehook)
4040 {
4041   using namespace Wrapper;
4042
4043   sq_pushroottable(v);
4044   sq_pushstring(v, "SSector", -1);
4045   if(SQ_FAILED(sq_get(v, -2))) {
4046     std::ostringstream msg;
4047     msg << "Couldn't resolved squirrel type 'SSector'";
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 'SSector'";
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, SSector_release_hook);
4060   }
4061
4062   sq_remove(v, -2); // remove root table
4063 }
4064
4065 void create_squirrel_instance(HSQUIRRELVM v, Scripting::LevelTime* object, bool setup_releasehook)
4066 {
4067   using namespace Wrapper;
4068
4069   sq_pushroottable(v);
4070   sq_pushstring(v, "LevelTime", -1);
4071   if(SQ_FAILED(sq_get(v, -2))) {
4072     std::ostringstream msg;
4073     msg << "Couldn't resolved squirrel type 'LevelTime'";
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 'LevelTime'";
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, LevelTime_release_hook);
4086   }
4087
4088   sq_remove(v, -2); // remove root table
4089 }
4090
4091 void create_squirrel_instance(HSQUIRRELVM v, Scripting::WillOWisp* object, bool setup_releasehook)
4092 {
4093   using namespace Wrapper;
4094
4095   sq_pushroottable(v);
4096   sq_pushstring(v, "WillOWisp", -1);
4097   if(SQ_FAILED(sq_get(v, -2))) {
4098     std::ostringstream msg;
4099     msg << "Couldn't resolved squirrel type 'WillOWisp'";
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 'WillOWisp'";
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, WillOWisp_release_hook);
4112   }
4113
4114   sq_remove(v, -2); // remove root table
4115 }
4116
4117 void register_supertux_wrapper(HSQUIRRELVM v)
4118 {
4119   using namespace Wrapper;
4120
4121   sq_pushstring(v, "ANCHOR_TOP", -1);
4122   sq_pushinteger(v, 16);
4123   if(SQ_FAILED(sq_createslot(v, -3))) {
4124     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
4125   }
4126
4127   sq_pushstring(v, "ANCHOR_BOTTOM", -1);
4128   sq_pushinteger(v, 32);
4129   if(SQ_FAILED(sq_createslot(v, -3))) {
4130     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
4131   }
4132
4133   sq_pushstring(v, "ANCHOR_LEFT", -1);
4134   sq_pushinteger(v, 1);
4135   if(SQ_FAILED(sq_createslot(v, -3))) {
4136     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
4137   }
4138
4139   sq_pushstring(v, "ANCHOR_RIGHT", -1);
4140   sq_pushinteger(v, 2);
4141   if(SQ_FAILED(sq_createslot(v, -3))) {
4142     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
4143   }
4144
4145   sq_pushstring(v, "ANCHOR_MIDDLE", -1);
4146   sq_pushinteger(v, 0);
4147   if(SQ_FAILED(sq_createslot(v, -3))) {
4148     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
4149   }
4150
4151   sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
4152   sq_pushinteger(v, 17);
4153   if(SQ_FAILED(sq_createslot(v, -3))) {
4154     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
4155   }
4156
4157   sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
4158   sq_pushinteger(v, 18);
4159   if(SQ_FAILED(sq_createslot(v, -3))) {
4160     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
4161   }
4162
4163   sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
4164   sq_pushinteger(v, 33);
4165   if(SQ_FAILED(sq_createslot(v, -3))) {
4166     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
4167   }
4168
4169   sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
4170   sq_pushinteger(v, 34);
4171   if(SQ_FAILED(sq_createslot(v, -3))) {
4172     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
4173   }
4174
4175   sq_pushstring(v, "display", -1);
4176   sq_newclosure(v, &display_wrapper, 0);
4177   if(SQ_FAILED(sq_createslot(v, -3))) {
4178     throw SquirrelError(v, "Couldn't register function 'display'");
4179   }
4180
4181   sq_pushstring(v, "print_stacktrace", -1);
4182   sq_newclosure(v, &print_stacktrace_wrapper, 0);
4183   if(SQ_FAILED(sq_createslot(v, -3))) {
4184     throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
4185   }
4186
4187   sq_pushstring(v, "get_current_thread", -1);
4188   sq_newclosure(v, &get_current_thread_wrapper, 0);
4189   if(SQ_FAILED(sq_createslot(v, -3))) {
4190     throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
4191   }
4192
4193   sq_pushstring(v, "display_text_file", -1);
4194   sq_newclosure(v, &display_text_file_wrapper, 0);
4195   if(SQ_FAILED(sq_createslot(v, -3))) {
4196     throw SquirrelError(v, "Couldn't register function 'display_text_file'");
4197   }
4198
4199   sq_pushstring(v, "load_worldmap", -1);
4200   sq_newclosure(v, &load_worldmap_wrapper, 0);
4201   if(SQ_FAILED(sq_createslot(v, -3))) {
4202     throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
4203   }
4204
4205   sq_pushstring(v, "load_level", -1);
4206   sq_newclosure(v, &load_level_wrapper, 0);
4207   if(SQ_FAILED(sq_createslot(v, -3))) {
4208     throw SquirrelError(v, "Couldn't register function 'load_level'");
4209   }
4210
4211   sq_pushstring(v, "wait", -1);
4212   sq_newclosure(v, &wait_wrapper, 0);
4213   if(SQ_FAILED(sq_createslot(v, -3))) {
4214     throw SquirrelError(v, "Couldn't register function 'wait'");
4215   }
4216
4217   sq_pushstring(v, "wait_for_screenswitch", -1);
4218   sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
4219   if(SQ_FAILED(sq_createslot(v, -3))) {
4220     throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
4221   }
4222
4223   sq_pushstring(v, "exit_screen", -1);
4224   sq_newclosure(v, &exit_screen_wrapper, 0);
4225   if(SQ_FAILED(sq_createslot(v, -3))) {
4226     throw SquirrelError(v, "Couldn't register function 'exit_screen'");
4227   }
4228
4229   sq_pushstring(v, "fadeout_screen", -1);
4230   sq_newclosure(v, &fadeout_screen_wrapper, 0);
4231   if(SQ_FAILED(sq_createslot(v, -3))) {
4232     throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
4233   }
4234
4235   sq_pushstring(v, "shrink_screen", -1);
4236   sq_newclosure(v, &shrink_screen_wrapper, 0);
4237   if(SQ_FAILED(sq_createslot(v, -3))) {
4238     throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
4239   }
4240
4241   sq_pushstring(v, "abort_screenfade", -1);
4242   sq_newclosure(v, &abort_screenfade_wrapper, 0);
4243   if(SQ_FAILED(sq_createslot(v, -3))) {
4244     throw SquirrelError(v, "Couldn't register function 'abort_screenfade'");
4245   }
4246
4247   sq_pushstring(v, "translate", -1);
4248   sq_newclosure(v, &translate_wrapper, 0);
4249   if(SQ_FAILED(sq_createslot(v, -3))) {
4250     throw SquirrelError(v, "Couldn't register function 'translate'");
4251   }
4252
4253   sq_pushstring(v, "import", -1);
4254   sq_newclosure(v, &import_wrapper, 0);
4255   if(SQ_FAILED(sq_createslot(v, -3))) {
4256     throw SquirrelError(v, "Couldn't register function 'import'");
4257   }
4258
4259   sq_pushstring(v, "save_state", -1);
4260   sq_newclosure(v, &save_state_wrapper, 0);
4261   if(SQ_FAILED(sq_createslot(v, -3))) {
4262     throw SquirrelError(v, "Couldn't register function 'save_state'");
4263   }
4264
4265   sq_pushstring(v, "update_worldmap", -1);
4266   sq_newclosure(v, &update_worldmap_wrapper, 0);
4267   if(SQ_FAILED(sq_createslot(v, -3))) {
4268     throw SquirrelError(v, "Couldn't register function 'update_worldmap'");
4269   }
4270
4271   sq_pushstring(v, "debug_collrects", -1);
4272   sq_newclosure(v, &debug_collrects_wrapper, 0);
4273   if(SQ_FAILED(sq_createslot(v, -3))) {
4274     throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
4275   }
4276
4277   sq_pushstring(v, "debug_show_fps", -1);
4278   sq_newclosure(v, &debug_show_fps_wrapper, 0);
4279   if(SQ_FAILED(sq_createslot(v, -3))) {
4280     throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
4281   }
4282
4283   sq_pushstring(v, "debug_draw_solids_only", -1);
4284   sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
4285   if(SQ_FAILED(sq_createslot(v, -3))) {
4286     throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
4287   }
4288
4289   sq_pushstring(v, "play_music", -1);
4290   sq_newclosure(v, &play_music_wrapper, 0);
4291   if(SQ_FAILED(sq_createslot(v, -3))) {
4292     throw SquirrelError(v, "Couldn't register function 'play_music'");
4293   }
4294
4295   sq_pushstring(v, "play_sound", -1);
4296   sq_newclosure(v, &play_sound_wrapper, 0);
4297   if(SQ_FAILED(sq_createslot(v, -3))) {
4298     throw SquirrelError(v, "Couldn't register function 'play_sound'");
4299   }
4300
4301   sq_pushstring(v, "grease", -1);
4302   sq_newclosure(v, &grease_wrapper, 0);
4303   if(SQ_FAILED(sq_createslot(v, -3))) {
4304     throw SquirrelError(v, "Couldn't register function 'grease'");
4305   }
4306
4307   sq_pushstring(v, "invincible", -1);
4308   sq_newclosure(v, &invincible_wrapper, 0);
4309   if(SQ_FAILED(sq_createslot(v, -3))) {
4310     throw SquirrelError(v, "Couldn't register function 'invincible'");
4311   }
4312
4313   sq_pushstring(v, "ghost", -1);
4314   sq_newclosure(v, &ghost_wrapper, 0);
4315   if(SQ_FAILED(sq_createslot(v, -3))) {
4316     throw SquirrelError(v, "Couldn't register function 'ghost'");
4317   }
4318
4319   sq_pushstring(v, "mortal", -1);
4320   sq_newclosure(v, &mortal_wrapper, 0);
4321   if(SQ_FAILED(sq_createslot(v, -3))) {
4322     throw SquirrelError(v, "Couldn't register function 'mortal'");
4323   }
4324
4325   sq_pushstring(v, "restart", -1);
4326   sq_newclosure(v, &restart_wrapper, 0);
4327   if(SQ_FAILED(sq_createslot(v, -3))) {
4328     throw SquirrelError(v, "Couldn't register function 'restart'");
4329   }
4330
4331   sq_pushstring(v, "whereami", -1);
4332   sq_newclosure(v, &whereami_wrapper, 0);
4333   if(SQ_FAILED(sq_createslot(v, -3))) {
4334     throw SquirrelError(v, "Couldn't register function 'whereami'");
4335   }
4336
4337   sq_pushstring(v, "gotoend", -1);
4338   sq_newclosure(v, &gotoend_wrapper, 0);
4339   if(SQ_FAILED(sq_createslot(v, -3))) {
4340     throw SquirrelError(v, "Couldn't register function 'gotoend'");
4341   }
4342
4343   sq_pushstring(v, "camera", -1);
4344   sq_newclosure(v, &camera_wrapper, 0);
4345   if(SQ_FAILED(sq_createslot(v, -3))) {
4346     throw SquirrelError(v, "Couldn't register function 'camera'");
4347   }
4348
4349   sq_pushstring(v, "quit", -1);
4350   sq_newclosure(v, &quit_wrapper, 0);
4351   if(SQ_FAILED(sq_createslot(v, -3))) {
4352     throw SquirrelError(v, "Couldn't register function 'quit'");
4353   }
4354
4355   sq_pushstring(v, "rand", -1);
4356   sq_newclosure(v, &rand_wrapper, 0);
4357   if(SQ_FAILED(sq_createslot(v, -3))) {
4358     throw SquirrelError(v, "Couldn't register function 'rand'");
4359   }
4360
4361   // Register class DisplayEffect
4362   sq_pushstring(v, "DisplayEffect", -1);
4363   if(sq_newclass(v, SQFalse) < 0) {
4364     std::ostringstream msg;
4365     msg << "Couldn't create new class 'DisplayEffect'";
4366     throw SquirrelError(v, msg.str());
4367   }
4368   sq_pushstring(v, "fade_out", -1);
4369   sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
4370   if(SQ_FAILED(sq_createslot(v, -3))) {
4371     throw SquirrelError(v, "Couldn't register function 'fade_out'");
4372   }
4373
4374   sq_pushstring(v, "fade_in", -1);
4375   sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
4376   if(SQ_FAILED(sq_createslot(v, -3))) {
4377     throw SquirrelError(v, "Couldn't register function 'fade_in'");
4378   }
4379
4380   sq_pushstring(v, "set_black", -1);
4381   sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
4382   if(SQ_FAILED(sq_createslot(v, -3))) {
4383     throw SquirrelError(v, "Couldn't register function 'set_black'");
4384   }
4385
4386   sq_pushstring(v, "is_black", -1);
4387   sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
4388   if(SQ_FAILED(sq_createslot(v, -3))) {
4389     throw SquirrelError(v, "Couldn't register function 'is_black'");
4390   }
4391
4392   sq_pushstring(v, "sixteen_to_nine", -1);
4393   sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
4394   if(SQ_FAILED(sq_createslot(v, -3))) {
4395     throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
4396   }
4397
4398   sq_pushstring(v, "four_to_three", -1);
4399   sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
4400   if(SQ_FAILED(sq_createslot(v, -3))) {
4401     throw SquirrelError(v, "Couldn't register function 'four_to_three'");
4402   }
4403
4404   if(SQ_FAILED(sq_createslot(v, -3))) {
4405     throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
4406   }
4407
4408   // Register class Camera
4409   sq_pushstring(v, "Camera", -1);
4410   if(sq_newclass(v, SQFalse) < 0) {
4411     std::ostringstream msg;
4412     msg << "Couldn't create new class 'Camera'";
4413     throw SquirrelError(v, msg.str());
4414   }
4415   sq_pushstring(v, "reload_config", -1);
4416   sq_newclosure(v, &Camera_reload_config_wrapper, 0);
4417   if(SQ_FAILED(sq_createslot(v, -3))) {
4418     throw SquirrelError(v, "Couldn't register function 'reload_config'");
4419   }
4420
4421   sq_pushstring(v, "shake", -1);
4422   sq_newclosure(v, &Camera_shake_wrapper, 0);
4423   if(SQ_FAILED(sq_createslot(v, -3))) {
4424     throw SquirrelError(v, "Couldn't register function 'shake'");
4425   }
4426
4427   sq_pushstring(v, "set_pos", -1);
4428   sq_newclosure(v, &Camera_set_pos_wrapper, 0);
4429   if(SQ_FAILED(sq_createslot(v, -3))) {
4430     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4431   }
4432
4433   sq_pushstring(v, "set_mode", -1);
4434   sq_newclosure(v, &Camera_set_mode_wrapper, 0);
4435   if(SQ_FAILED(sq_createslot(v, -3))) {
4436     throw SquirrelError(v, "Couldn't register function 'set_mode'");
4437   }
4438
4439   sq_pushstring(v, "scroll_to", -1);
4440   sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
4441   if(SQ_FAILED(sq_createslot(v, -3))) {
4442     throw SquirrelError(v, "Couldn't register function 'scroll_to'");
4443   }
4444
4445   if(SQ_FAILED(sq_createslot(v, -3))) {
4446     throw SquirrelError(v, "Couldn't register class 'Camera'");
4447   }
4448
4449   // Register class Level
4450   sq_pushstring(v, "Level", -1);
4451   if(sq_newclass(v, SQFalse) < 0) {
4452     std::ostringstream msg;
4453     msg << "Couldn't create new class 'Level'";
4454     throw SquirrelError(v, msg.str());
4455   }
4456   sq_pushstring(v, "finish", -1);
4457   sq_newclosure(v, &Level_finish_wrapper, 0);
4458   if(SQ_FAILED(sq_createslot(v, -3))) {
4459     throw SquirrelError(v, "Couldn't register function 'finish'");
4460   }
4461
4462   sq_pushstring(v, "spawn", -1);
4463   sq_newclosure(v, &Level_spawn_wrapper, 0);
4464   if(SQ_FAILED(sq_createslot(v, -3))) {
4465     throw SquirrelError(v, "Couldn't register function 'spawn'");
4466   }
4467
4468   sq_pushstring(v, "flip_vertically", -1);
4469   sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
4470   if(SQ_FAILED(sq_createslot(v, -3))) {
4471     throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
4472   }
4473
4474   sq_pushstring(v, "toggle_pause", -1);
4475   sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
4476   if(SQ_FAILED(sq_createslot(v, -3))) {
4477     throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
4478   }
4479
4480   if(SQ_FAILED(sq_createslot(v, -3))) {
4481     throw SquirrelError(v, "Couldn't register class 'Level'");
4482   }
4483
4484   // Register class ScriptedObject
4485   sq_pushstring(v, "ScriptedObject", -1);
4486   if(sq_newclass(v, SQFalse) < 0) {
4487     std::ostringstream msg;
4488     msg << "Couldn't create new class 'ScriptedObject'";
4489     throw SquirrelError(v, msg.str());
4490   }
4491   sq_pushstring(v, "set_action", -1);
4492   sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
4493   if(SQ_FAILED(sq_createslot(v, -3))) {
4494     throw SquirrelError(v, "Couldn't register function 'set_action'");
4495   }
4496
4497   sq_pushstring(v, "get_action", -1);
4498   sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
4499   if(SQ_FAILED(sq_createslot(v, -3))) {
4500     throw SquirrelError(v, "Couldn't register function 'get_action'");
4501   }
4502
4503   sq_pushstring(v, "move", -1);
4504   sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
4505   if(SQ_FAILED(sq_createslot(v, -3))) {
4506     throw SquirrelError(v, "Couldn't register function 'move'");
4507   }
4508
4509   sq_pushstring(v, "set_pos", -1);
4510   sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
4511   if(SQ_FAILED(sq_createslot(v, -3))) {
4512     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4513   }
4514
4515   sq_pushstring(v, "get_pos_x", -1);
4516   sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
4517   if(SQ_FAILED(sq_createslot(v, -3))) {
4518     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4519   }
4520
4521   sq_pushstring(v, "get_pos_y", -1);
4522   sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
4523   if(SQ_FAILED(sq_createslot(v, -3))) {
4524     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4525   }
4526
4527   sq_pushstring(v, "set_velocity", -1);
4528   sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
4529   if(SQ_FAILED(sq_createslot(v, -3))) {
4530     throw SquirrelError(v, "Couldn't register function 'set_velocity'");
4531   }
4532
4533   sq_pushstring(v, "get_velocity_x", -1);
4534   sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
4535   if(SQ_FAILED(sq_createslot(v, -3))) {
4536     throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
4537   }
4538
4539   sq_pushstring(v, "get_velocity_y", -1);
4540   sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
4541   if(SQ_FAILED(sq_createslot(v, -3))) {
4542     throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
4543   }
4544
4545   sq_pushstring(v, "set_visible", -1);
4546   sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
4547   if(SQ_FAILED(sq_createslot(v, -3))) {
4548     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4549   }
4550
4551   sq_pushstring(v, "is_visible", -1);
4552   sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
4553   if(SQ_FAILED(sq_createslot(v, -3))) {
4554     throw SquirrelError(v, "Couldn't register function 'is_visible'");
4555   }
4556
4557   sq_pushstring(v, "set_solid", -1);
4558   sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
4559   if(SQ_FAILED(sq_createslot(v, -3))) {
4560     throw SquirrelError(v, "Couldn't register function 'set_solid'");
4561   }
4562
4563   sq_pushstring(v, "is_solid", -1);
4564   sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
4565   if(SQ_FAILED(sq_createslot(v, -3))) {
4566     throw SquirrelError(v, "Couldn't register function 'is_solid'");
4567   }
4568
4569   sq_pushstring(v, "get_name", -1);
4570   sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
4571   if(SQ_FAILED(sq_createslot(v, -3))) {
4572     throw SquirrelError(v, "Couldn't register function 'get_name'");
4573   }
4574
4575   if(SQ_FAILED(sq_createslot(v, -3))) {
4576     throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
4577   }
4578
4579   // Register class Text
4580   sq_pushstring(v, "Text", -1);
4581   if(sq_newclass(v, SQFalse) < 0) {
4582     std::ostringstream msg;
4583     msg << "Couldn't create new class 'Text'";
4584     throw SquirrelError(v, msg.str());
4585   }
4586   sq_pushstring(v, "set_text", -1);
4587   sq_newclosure(v, &Text_set_text_wrapper, 0);
4588   if(SQ_FAILED(sq_createslot(v, -3))) {
4589     throw SquirrelError(v, "Couldn't register function 'set_text'");
4590   }
4591
4592   sq_pushstring(v, "set_font", -1);
4593   sq_newclosure(v, &Text_set_font_wrapper, 0);
4594   if(SQ_FAILED(sq_createslot(v, -3))) {
4595     throw SquirrelError(v, "Couldn't register function 'set_font'");
4596   }
4597
4598   sq_pushstring(v, "fade_in", -1);
4599   sq_newclosure(v, &Text_fade_in_wrapper, 0);
4600   if(SQ_FAILED(sq_createslot(v, -3))) {
4601     throw SquirrelError(v, "Couldn't register function 'fade_in'");
4602   }
4603
4604   sq_pushstring(v, "fade_out", -1);
4605   sq_newclosure(v, &Text_fade_out_wrapper, 0);
4606   if(SQ_FAILED(sq_createslot(v, -3))) {
4607     throw SquirrelError(v, "Couldn't register function 'fade_out'");
4608   }
4609
4610   sq_pushstring(v, "set_visible", -1);
4611   sq_newclosure(v, &Text_set_visible_wrapper, 0);
4612   if(SQ_FAILED(sq_createslot(v, -3))) {
4613     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4614   }
4615
4616   sq_pushstring(v, "set_centered", -1);
4617   sq_newclosure(v, &Text_set_centered_wrapper, 0);
4618   if(SQ_FAILED(sq_createslot(v, -3))) {
4619     throw SquirrelError(v, "Couldn't register function 'set_centered'");
4620   }
4621
4622   sq_pushstring(v, "set_pos", -1);
4623   sq_newclosure(v, &Text_set_pos_wrapper, 0);
4624   if(SQ_FAILED(sq_createslot(v, -3))) {
4625     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4626   }
4627
4628   sq_pushstring(v, "get_pos_x", -1);
4629   sq_newclosure(v, &Text_get_pos_x_wrapper, 0);
4630   if(SQ_FAILED(sq_createslot(v, -3))) {
4631     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4632   }
4633
4634   sq_pushstring(v, "get_pos_y", -1);
4635   sq_newclosure(v, &Text_get_pos_y_wrapper, 0);
4636   if(SQ_FAILED(sq_createslot(v, -3))) {
4637     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4638   }
4639
4640   sq_pushstring(v, "set_anchor_point", -1);
4641   sq_newclosure(v, &Text_set_anchor_point_wrapper, 0);
4642   if(SQ_FAILED(sq_createslot(v, -3))) {
4643     throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
4644   }
4645
4646   sq_pushstring(v, "get_anchor_point", -1);
4647   sq_newclosure(v, &Text_get_anchor_point_wrapper, 0);
4648   if(SQ_FAILED(sq_createslot(v, -3))) {
4649     throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
4650   }
4651
4652   if(SQ_FAILED(sq_createslot(v, -3))) {
4653     throw SquirrelError(v, "Couldn't register class 'Text'");
4654   }
4655
4656   // Register class Player
4657   sq_pushstring(v, "Player", -1);
4658   if(sq_newclass(v, SQFalse) < 0) {
4659     std::ostringstream msg;
4660     msg << "Couldn't create new class 'Player'";
4661     throw SquirrelError(v, msg.str());
4662   }
4663   sq_pushstring(v, "add_bonus", -1);
4664   sq_newclosure(v, &Player_add_bonus_wrapper, 0);
4665   if(SQ_FAILED(sq_createslot(v, -3))) {
4666     throw SquirrelError(v, "Couldn't register function 'add_bonus'");
4667   }
4668
4669   sq_pushstring(v, "add_coins", -1);
4670   sq_newclosure(v, &Player_add_coins_wrapper, 0);
4671   if(SQ_FAILED(sq_createslot(v, -3))) {
4672     throw SquirrelError(v, "Couldn't register function 'add_coins'");
4673   }
4674
4675   sq_pushstring(v, "make_invincible", -1);
4676   sq_newclosure(v, &Player_make_invincible_wrapper, 0);
4677   if(SQ_FAILED(sq_createslot(v, -3))) {
4678     throw SquirrelError(v, "Couldn't register function 'make_invincible'");
4679   }
4680
4681   sq_pushstring(v, "deactivate", -1);
4682   sq_newclosure(v, &Player_deactivate_wrapper, 0);
4683   if(SQ_FAILED(sq_createslot(v, -3))) {
4684     throw SquirrelError(v, "Couldn't register function 'deactivate'");
4685   }
4686
4687   sq_pushstring(v, "activate", -1);
4688   sq_newclosure(v, &Player_activate_wrapper, 0);
4689   if(SQ_FAILED(sq_createslot(v, -3))) {
4690     throw SquirrelError(v, "Couldn't register function 'activate'");
4691   }
4692
4693   sq_pushstring(v, "walk", -1);
4694   sq_newclosure(v, &Player_walk_wrapper, 0);
4695   if(SQ_FAILED(sq_createslot(v, -3))) {
4696     throw SquirrelError(v, "Couldn't register function 'walk'");
4697   }
4698
4699   sq_pushstring(v, "set_visible", -1);
4700   sq_newclosure(v, &Player_set_visible_wrapper, 0);
4701   if(SQ_FAILED(sq_createslot(v, -3))) {
4702     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4703   }
4704
4705   sq_pushstring(v, "get_visible", -1);
4706   sq_newclosure(v, &Player_get_visible_wrapper, 0);
4707   if(SQ_FAILED(sq_createslot(v, -3))) {
4708     throw SquirrelError(v, "Couldn't register function 'get_visible'");
4709   }
4710
4711   sq_pushstring(v, "kill", -1);
4712   sq_newclosure(v, &Player_kill_wrapper, 0);
4713   if(SQ_FAILED(sq_createslot(v, -3))) {
4714     throw SquirrelError(v, "Couldn't register function 'kill'");
4715   }
4716
4717   sq_pushstring(v, "set_ghost_mode", -1);
4718   sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
4719   if(SQ_FAILED(sq_createslot(v, -3))) {
4720     throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
4721   }
4722
4723   sq_pushstring(v, "get_ghost_mode", -1);
4724   sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
4725   if(SQ_FAILED(sq_createslot(v, -3))) {
4726     throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
4727   }
4728
4729   sq_pushstring(v, "do_cheer", -1);
4730   sq_newclosure(v, &Player_do_cheer_wrapper, 0);
4731   if(SQ_FAILED(sq_createslot(v, -3))) {
4732     throw SquirrelError(v, "Couldn't register function 'do_cheer'");
4733   }
4734
4735   sq_pushstring(v, "do_duck", -1);
4736   sq_newclosure(v, &Player_do_duck_wrapper, 0);
4737   if(SQ_FAILED(sq_createslot(v, -3))) {
4738     throw SquirrelError(v, "Couldn't register function 'do_duck'");
4739   }
4740
4741   sq_pushstring(v, "do_standup", -1);
4742   sq_newclosure(v, &Player_do_standup_wrapper, 0);
4743   if(SQ_FAILED(sq_createslot(v, -3))) {
4744     throw SquirrelError(v, "Couldn't register function 'do_standup'");
4745   }
4746
4747   sq_pushstring(v, "do_backflip", -1);
4748   sq_newclosure(v, &Player_do_backflip_wrapper, 0);
4749   if(SQ_FAILED(sq_createslot(v, -3))) {
4750     throw SquirrelError(v, "Couldn't register function 'do_backflip'");
4751   }
4752
4753   sq_pushstring(v, "do_jump", -1);
4754   sq_newclosure(v, &Player_do_jump_wrapper, 0);
4755   if(SQ_FAILED(sq_createslot(v, -3))) {
4756     throw SquirrelError(v, "Couldn't register function 'do_jump'");
4757   }
4758
4759   sq_pushstring(v, "trigger_sequence", -1);
4760   sq_newclosure(v, &Player_trigger_sequence_wrapper, 0);
4761   if(SQ_FAILED(sq_createslot(v, -3))) {
4762     throw SquirrelError(v, "Couldn't register function 'trigger_sequence'");
4763   }
4764
4765   sq_pushstring(v, "use_scripting_controller", -1);
4766   sq_newclosure(v, &Player_use_scripting_controller_wrapper, 0);
4767   if(SQ_FAILED(sq_createslot(v, -3))) {
4768     throw SquirrelError(v, "Couldn't register function 'use_scripting_controller'");
4769   }
4770
4771   sq_pushstring(v, "do_scripting_controller", -1);
4772   sq_newclosure(v, &Player_do_scripting_controller_wrapper, 0);
4773   if(SQ_FAILED(sq_createslot(v, -3))) {
4774     throw SquirrelError(v, "Couldn't register function 'do_scripting_controller'");
4775   }
4776
4777   if(SQ_FAILED(sq_createslot(v, -3))) {
4778     throw SquirrelError(v, "Couldn't register class 'Player'");
4779   }
4780
4781   // Register class FloatingImage
4782   sq_pushstring(v, "FloatingImage", -1);
4783   if(sq_newclass(v, SQFalse) < 0) {
4784     std::ostringstream msg;
4785     msg << "Couldn't create new class 'FloatingImage'";
4786     throw SquirrelError(v, msg.str());
4787   }
4788   sq_pushstring(v, "constructor", -1);
4789   sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
4790   if(SQ_FAILED(sq_createslot(v, -3))) {
4791     throw SquirrelError(v, "Couldn't register function 'constructor'");
4792   }
4793
4794   sq_pushstring(v, "set_layer", -1);
4795   sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
4796   if(SQ_FAILED(sq_createslot(v, -3))) {
4797     throw SquirrelError(v, "Couldn't register function 'set_layer'");
4798   }
4799
4800   sq_pushstring(v, "get_layer", -1);
4801   sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
4802   if(SQ_FAILED(sq_createslot(v, -3))) {
4803     throw SquirrelError(v, "Couldn't register function 'get_layer'");
4804   }
4805
4806   sq_pushstring(v, "set_pos", -1);
4807   sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
4808   if(SQ_FAILED(sq_createslot(v, -3))) {
4809     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4810   }
4811
4812   sq_pushstring(v, "get_pos_x", -1);
4813   sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
4814   if(SQ_FAILED(sq_createslot(v, -3))) {
4815     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4816   }
4817
4818   sq_pushstring(v, "get_pos_y", -1);
4819   sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
4820   if(SQ_FAILED(sq_createslot(v, -3))) {
4821     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4822   }
4823
4824   sq_pushstring(v, "set_anchor_point", -1);
4825   sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
4826   if(SQ_FAILED(sq_createslot(v, -3))) {
4827     throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
4828   }
4829
4830   sq_pushstring(v, "get_anchor_point", -1);
4831   sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
4832   if(SQ_FAILED(sq_createslot(v, -3))) {
4833     throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
4834   }
4835
4836   sq_pushstring(v, "set_visible", -1);
4837   sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
4838   if(SQ_FAILED(sq_createslot(v, -3))) {
4839     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4840   }
4841
4842   sq_pushstring(v, "get_visible", -1);
4843   sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
4844   if(SQ_FAILED(sq_createslot(v, -3))) {
4845     throw SquirrelError(v, "Couldn't register function 'get_visible'");
4846   }
4847
4848   sq_pushstring(v, "set_action", -1);
4849   sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
4850   if(SQ_FAILED(sq_createslot(v, -3))) {
4851     throw SquirrelError(v, "Couldn't register function 'set_action'");
4852   }
4853
4854   sq_pushstring(v, "get_action", -1);
4855   sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
4856   if(SQ_FAILED(sq_createslot(v, -3))) {
4857     throw SquirrelError(v, "Couldn't register function 'get_action'");
4858   }
4859
4860   sq_pushstring(v, "fade_in", -1);
4861   sq_newclosure(v, &FloatingImage_fade_in_wrapper, 0);
4862   if(SQ_FAILED(sq_createslot(v, -3))) {
4863     throw SquirrelError(v, "Couldn't register function 'fade_in'");
4864   }
4865
4866   sq_pushstring(v, "fade_out", -1);
4867   sq_newclosure(v, &FloatingImage_fade_out_wrapper, 0);
4868   if(SQ_FAILED(sq_createslot(v, -3))) {
4869     throw SquirrelError(v, "Couldn't register function 'fade_out'");
4870   }
4871
4872   if(SQ_FAILED(sq_createslot(v, -3))) {
4873     throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
4874   }
4875
4876   // Register class Platform
4877   sq_pushstring(v, "Platform", -1);
4878   if(sq_newclass(v, SQFalse) < 0) {
4879     std::ostringstream msg;
4880     msg << "Couldn't create new class 'Platform'";
4881     throw SquirrelError(v, msg.str());
4882   }
4883   sq_pushstring(v, "goto_node", -1);
4884   sq_newclosure(v, &Platform_goto_node_wrapper, 0);
4885   if(SQ_FAILED(sq_createslot(v, -3))) {
4886     throw SquirrelError(v, "Couldn't register function 'goto_node'");
4887   }
4888
4889   sq_pushstring(v, "start_moving", -1);
4890   sq_newclosure(v, &Platform_start_moving_wrapper, 0);
4891   if(SQ_FAILED(sq_createslot(v, -3))) {
4892     throw SquirrelError(v, "Couldn't register function 'start_moving'");
4893   }
4894
4895   sq_pushstring(v, "stop_moving", -1);
4896   sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
4897   if(SQ_FAILED(sq_createslot(v, -3))) {
4898     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
4899   }
4900
4901   if(SQ_FAILED(sq_createslot(v, -3))) {
4902     throw SquirrelError(v, "Couldn't register class 'Platform'");
4903   }
4904
4905   // Register class Candle
4906   sq_pushstring(v, "Candle", -1);
4907   if(sq_newclass(v, SQFalse) < 0) {
4908     std::ostringstream msg;
4909     msg << "Couldn't create new class 'Candle'";
4910     throw SquirrelError(v, msg.str());
4911   }
4912   sq_pushstring(v, "get_burning", -1);
4913   sq_newclosure(v, &Candle_get_burning_wrapper, 0);
4914   if(SQ_FAILED(sq_createslot(v, -3))) {
4915     throw SquirrelError(v, "Couldn't register function 'get_burning'");
4916   }
4917
4918   sq_pushstring(v, "set_burning", -1);
4919   sq_newclosure(v, &Candle_set_burning_wrapper, 0);
4920   if(SQ_FAILED(sq_createslot(v, -3))) {
4921     throw SquirrelError(v, "Couldn't register function 'set_burning'");
4922   }
4923
4924   if(SQ_FAILED(sq_createslot(v, -3))) {
4925     throw SquirrelError(v, "Couldn't register class 'Candle'");
4926   }
4927
4928   // Register class Wind
4929   sq_pushstring(v, "Wind", -1);
4930   if(sq_newclass(v, SQFalse) < 0) {
4931     std::ostringstream msg;
4932     msg << "Couldn't create new class 'Wind'";
4933     throw SquirrelError(v, msg.str());
4934   }
4935   sq_pushstring(v, "start", -1);
4936   sq_newclosure(v, &Wind_start_wrapper, 0);
4937   if(SQ_FAILED(sq_createslot(v, -3))) {
4938     throw SquirrelError(v, "Couldn't register function 'start'");
4939   }
4940
4941   sq_pushstring(v, "stop", -1);
4942   sq_newclosure(v, &Wind_stop_wrapper, 0);
4943   if(SQ_FAILED(sq_createslot(v, -3))) {
4944     throw SquirrelError(v, "Couldn't register function 'stop'");
4945   }
4946
4947   if(SQ_FAILED(sq_createslot(v, -3))) {
4948     throw SquirrelError(v, "Couldn't register class 'Wind'");
4949   }
4950
4951   // Register class AmbientSound
4952   sq_pushstring(v, "AmbientSound", -1);
4953   if(sq_newclass(v, SQFalse) < 0) {
4954     std::ostringstream msg;
4955     msg << "Couldn't create new class 'AmbientSound'";
4956     throw SquirrelError(v, msg.str());
4957   }
4958   sq_pushstring(v, "set_pos", -1);
4959   sq_newclosure(v, &AmbientSound_set_pos_wrapper, 0);
4960   if(SQ_FAILED(sq_createslot(v, -3))) {
4961     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4962   }
4963
4964   sq_pushstring(v, "get_pos_x", -1);
4965   sq_newclosure(v, &AmbientSound_get_pos_x_wrapper, 0);
4966   if(SQ_FAILED(sq_createslot(v, -3))) {
4967     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4968   }
4969
4970   sq_pushstring(v, "get_pos_y", -1);
4971   sq_newclosure(v, &AmbientSound_get_pos_y_wrapper, 0);
4972   if(SQ_FAILED(sq_createslot(v, -3))) {
4973     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4974   }
4975
4976   if(SQ_FAILED(sq_createslot(v, -3))) {
4977     throw SquirrelError(v, "Couldn't register class 'AmbientSound'");
4978   }
4979
4980   // Register class Thunderstorm
4981   sq_pushstring(v, "Thunderstorm", -1);
4982   if(sq_newclass(v, SQFalse) < 0) {
4983     std::ostringstream msg;
4984     msg << "Couldn't create new class 'Thunderstorm'";
4985     throw SquirrelError(v, msg.str());
4986   }
4987   sq_pushstring(v, "start", -1);
4988   sq_newclosure(v, &Thunderstorm_start_wrapper, 0);
4989   if(SQ_FAILED(sq_createslot(v, -3))) {
4990     throw SquirrelError(v, "Couldn't register function 'start'");
4991   }
4992
4993   sq_pushstring(v, "stop", -1);
4994   sq_newclosure(v, &Thunderstorm_stop_wrapper, 0);
4995   if(SQ_FAILED(sq_createslot(v, -3))) {
4996     throw SquirrelError(v, "Couldn't register function 'stop'");
4997   }
4998
4999   sq_pushstring(v, "thunder", -1);
5000   sq_newclosure(v, &Thunderstorm_thunder_wrapper, 0);
5001   if(SQ_FAILED(sq_createslot(v, -3))) {
5002     throw SquirrelError(v, "Couldn't register function 'thunder'");
5003   }
5004
5005   sq_pushstring(v, "lightning", -1);
5006   sq_newclosure(v, &Thunderstorm_lightning_wrapper, 0);
5007   if(SQ_FAILED(sq_createslot(v, -3))) {
5008     throw SquirrelError(v, "Couldn't register function 'lightning'");
5009   }
5010
5011   sq_pushstring(v, "flash", -1);
5012   sq_newclosure(v, &Thunderstorm_flash_wrapper, 0);
5013   if(SQ_FAILED(sq_createslot(v, -3))) {
5014     throw SquirrelError(v, "Couldn't register function 'flash'");
5015   }
5016
5017   sq_pushstring(v, "electrify", -1);
5018   sq_newclosure(v, &Thunderstorm_electrify_wrapper, 0);
5019   if(SQ_FAILED(sq_createslot(v, -3))) {
5020     throw SquirrelError(v, "Couldn't register function 'electrify'");
5021   }
5022
5023   if(SQ_FAILED(sq_createslot(v, -3))) {
5024     throw SquirrelError(v, "Couldn't register class 'Thunderstorm'");
5025   }
5026
5027   // Register class TileMap
5028   sq_pushstring(v, "TileMap", -1);
5029   if(sq_newclass(v, SQFalse) < 0) {
5030     std::ostringstream msg;
5031     msg << "Couldn't create new class 'TileMap'";
5032     throw SquirrelError(v, msg.str());
5033   }
5034   sq_pushstring(v, "goto_node", -1);
5035   sq_newclosure(v, &TileMap_goto_node_wrapper, 0);
5036   if(SQ_FAILED(sq_createslot(v, -3))) {
5037     throw SquirrelError(v, "Couldn't register function 'goto_node'");
5038   }
5039
5040   sq_pushstring(v, "start_moving", -1);
5041   sq_newclosure(v, &TileMap_start_moving_wrapper, 0);
5042   if(SQ_FAILED(sq_createslot(v, -3))) {
5043     throw SquirrelError(v, "Couldn't register function 'start_moving'");
5044   }
5045
5046   sq_pushstring(v, "stop_moving", -1);
5047   sq_newclosure(v, &TileMap_stop_moving_wrapper, 0);
5048   if(SQ_FAILED(sq_createslot(v, -3))) {
5049     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5050   }
5051
5052   sq_pushstring(v, "fade", -1);
5053   sq_newclosure(v, &TileMap_fade_wrapper, 0);
5054   if(SQ_FAILED(sq_createslot(v, -3))) {
5055     throw SquirrelError(v, "Couldn't register function 'fade'");
5056   }
5057
5058   sq_pushstring(v, "set_alpha", -1);
5059   sq_newclosure(v, &TileMap_set_alpha_wrapper, 0);
5060   if(SQ_FAILED(sq_createslot(v, -3))) {
5061     throw SquirrelError(v, "Couldn't register function 'set_alpha'");
5062   }
5063
5064   sq_pushstring(v, "get_alpha", -1);
5065   sq_newclosure(v, &TileMap_get_alpha_wrapper, 0);
5066   if(SQ_FAILED(sq_createslot(v, -3))) {
5067     throw SquirrelError(v, "Couldn't register function 'get_alpha'");
5068   }
5069
5070   if(SQ_FAILED(sq_createslot(v, -3))) {
5071     throw SquirrelError(v, "Couldn't register class 'TileMap'");
5072   }
5073
5074   // Register class SSector
5075   sq_pushstring(v, "SSector", -1);
5076   if(sq_newclass(v, SQFalse) < 0) {
5077     std::ostringstream msg;
5078     msg << "Couldn't create new class 'SSector'";
5079     throw SquirrelError(v, msg.str());
5080   }
5081   sq_pushstring(v, "set_ambient_light", -1);
5082   sq_newclosure(v, &SSector_set_ambient_light_wrapper, 0);
5083   if(SQ_FAILED(sq_createslot(v, -3))) {
5084     throw SquirrelError(v, "Couldn't register function 'set_ambient_light'");
5085   }
5086
5087   sq_pushstring(v, "get_ambient_red", -1);
5088   sq_newclosure(v, &SSector_get_ambient_red_wrapper, 0);
5089   if(SQ_FAILED(sq_createslot(v, -3))) {
5090     throw SquirrelError(v, "Couldn't register function 'get_ambient_red'");
5091   }
5092
5093   sq_pushstring(v, "get_ambient_green", -1);
5094   sq_newclosure(v, &SSector_get_ambient_green_wrapper, 0);
5095   if(SQ_FAILED(sq_createslot(v, -3))) {
5096     throw SquirrelError(v, "Couldn't register function 'get_ambient_green'");
5097   }
5098
5099   sq_pushstring(v, "get_ambient_blue", -1);
5100   sq_newclosure(v, &SSector_get_ambient_blue_wrapper, 0);
5101   if(SQ_FAILED(sq_createslot(v, -3))) {
5102     throw SquirrelError(v, "Couldn't register function 'get_ambient_blue'");
5103   }
5104
5105   if(SQ_FAILED(sq_createslot(v, -3))) {
5106     throw SquirrelError(v, "Couldn't register class 'SSector'");
5107   }
5108
5109   // Register class LevelTime
5110   sq_pushstring(v, "LevelTime", -1);
5111   if(sq_newclass(v, SQFalse) < 0) {
5112     std::ostringstream msg;
5113     msg << "Couldn't create new class 'LevelTime'";
5114     throw SquirrelError(v, msg.str());
5115   }
5116   sq_pushstring(v, "start", -1);
5117   sq_newclosure(v, &LevelTime_start_wrapper, 0);
5118   if(SQ_FAILED(sq_createslot(v, -3))) {
5119     throw SquirrelError(v, "Couldn't register function 'start'");
5120   }
5121
5122   sq_pushstring(v, "stop", -1);
5123   sq_newclosure(v, &LevelTime_stop_wrapper, 0);
5124   if(SQ_FAILED(sq_createslot(v, -3))) {
5125     throw SquirrelError(v, "Couldn't register function 'stop'");
5126   }
5127
5128   sq_pushstring(v, "get_time", -1);
5129   sq_newclosure(v, &LevelTime_get_time_wrapper, 0);
5130   if(SQ_FAILED(sq_createslot(v, -3))) {
5131     throw SquirrelError(v, "Couldn't register function 'get_time'");
5132   }
5133
5134   sq_pushstring(v, "set_time", -1);
5135   sq_newclosure(v, &LevelTime_set_time_wrapper, 0);
5136   if(SQ_FAILED(sq_createslot(v, -3))) {
5137     throw SquirrelError(v, "Couldn't register function 'set_time'");
5138   }
5139
5140   if(SQ_FAILED(sq_createslot(v, -3))) {
5141     throw SquirrelError(v, "Couldn't register class 'LevelTime'");
5142   }
5143
5144   // Register class WillOWisp
5145   sq_pushstring(v, "WillOWisp", -1);
5146   if(sq_newclass(v, SQFalse) < 0) {
5147     std::ostringstream msg;
5148     msg << "Couldn't create new class 'WillOWisp'";
5149     throw SquirrelError(v, msg.str());
5150   }
5151   sq_pushstring(v, "goto_node", -1);
5152   sq_newclosure(v, &WillOWisp_goto_node_wrapper, 0);
5153   if(SQ_FAILED(sq_createslot(v, -3))) {
5154     throw SquirrelError(v, "Couldn't register function 'goto_node'");
5155   }
5156
5157   sq_pushstring(v, "set_state", -1);
5158   sq_newclosure(v, &WillOWisp_set_state_wrapper, 0);
5159   if(SQ_FAILED(sq_createslot(v, -3))) {
5160     throw SquirrelError(v, "Couldn't register function 'set_state'");
5161   }
5162
5163   sq_pushstring(v, "start_moving", -1);
5164   sq_newclosure(v, &WillOWisp_start_moving_wrapper, 0);
5165   if(SQ_FAILED(sq_createslot(v, -3))) {
5166     throw SquirrelError(v, "Couldn't register function 'start_moving'");
5167   }
5168
5169   sq_pushstring(v, "stop_moving", -1);
5170   sq_newclosure(v, &WillOWisp_stop_moving_wrapper, 0);
5171   if(SQ_FAILED(sq_createslot(v, -3))) {
5172     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5173   }
5174
5175   if(SQ_FAILED(sq_createslot(v, -3))) {
5176     throw SquirrelError(v, "Couldn't register class 'WillOWisp'");
5177   }
5178
5179 }
5180
5181 } // end of namespace Scripting