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