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