4dccd32643b7f52d4cb46349025f7b6973ed684c
[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_enable_gravity_wrapper(HSQUIRRELVM vm)
1887 {
1888   SQUserPointer data;
1889   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1890     sq_throwerror(vm, _SC("'enable_gravity' 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->enable_gravity(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 'enable_gravity'"));
1910     return SQ_ERROR;
1911   }
1912
1913 }
1914
1915 static SQInteger ScriptedObject_gravity_enabled_wrapper(HSQUIRRELVM vm)
1916 {
1917   SQUserPointer data;
1918   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1919     sq_throwerror(vm, _SC("'gravity_enabled' 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->gravity_enabled();
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 'gravity_enabled'"));
1935     return SQ_ERROR;
1936   }
1937
1938 }
1939
1940 static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
1941 {
1942   SQUserPointer data;
1943   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1944     sq_throwerror(vm, _SC("'set_visible' 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_visible(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_visible'"));
1964     return SQ_ERROR;
1965   }
1966
1967 }
1968
1969 static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
1970 {
1971   SQUserPointer data;
1972   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1973     sq_throwerror(vm, _SC("'is_visible' 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_visible();
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_visible'"));
1989     return SQ_ERROR;
1990   }
1991
1992 }
1993
1994 static SQInteger ScriptedObject_set_solid_wrapper(HSQUIRRELVM vm)
1995 {
1996   SQUserPointer data;
1997   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1998     sq_throwerror(vm, _SC("'set_solid' called without instance"));
1999     return SQ_ERROR;
2000   }
2001   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
2002   SQBool arg0;
2003   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2004     sq_throwerror(vm, _SC("Argument 1 not a bool"));
2005     return SQ_ERROR;
2006   }
2007
2008   try {
2009     _this->set_solid(arg0 == SQTrue);
2010
2011     return 0;
2012
2013   } catch(std::exception& e) {
2014     sq_throwerror(vm, e.what());
2015     return SQ_ERROR;
2016   } catch(...) {
2017     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_solid'"));
2018     return SQ_ERROR;
2019   }
2020
2021 }
2022
2023 static SQInteger ScriptedObject_is_solid_wrapper(HSQUIRRELVM vm)
2024 {
2025   SQUserPointer data;
2026   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2027     sq_throwerror(vm, _SC("'is_solid' called without instance"));
2028     return SQ_ERROR;
2029   }
2030   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
2031
2032   try {
2033     bool return_value = _this->is_solid();
2034
2035     sq_pushbool(vm, return_value);
2036     return 1;
2037
2038   } catch(std::exception& e) {
2039     sq_throwerror(vm, e.what());
2040     return SQ_ERROR;
2041   } catch(...) {
2042     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_solid'"));
2043     return SQ_ERROR;
2044   }
2045
2046 }
2047
2048 static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
2049 {
2050   SQUserPointer data;
2051   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2052     sq_throwerror(vm, _SC("'get_name' called without instance"));
2053     return SQ_ERROR;
2054   }
2055   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
2056
2057   try {
2058     std::string return_value = _this->get_name();
2059
2060     sq_pushstring(vm, return_value.c_str(), return_value.size());
2061     return 1;
2062
2063   } catch(std::exception& e) {
2064     sq_throwerror(vm, e.what());
2065     return SQ_ERROR;
2066   } catch(...) {
2067     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
2068     return SQ_ERROR;
2069   }
2070
2071 }
2072
2073 static SQInteger SSector_release_hook(SQUserPointer ptr, SQInteger )
2074 {
2075   scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (ptr);
2076   delete _this;
2077   return 0;
2078 }
2079
2080 static SQInteger SSector_set_ambient_light_wrapper(HSQUIRRELVM vm)
2081 {
2082   SQUserPointer data;
2083   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2084     sq_throwerror(vm, _SC("'set_ambient_light' called without instance"));
2085     return SQ_ERROR;
2086   }
2087   scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2088   SQFloat arg0;
2089   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2090     sq_throwerror(vm, _SC("Argument 1 not a float"));
2091     return SQ_ERROR;
2092   }
2093   SQFloat arg1;
2094   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2095     sq_throwerror(vm, _SC("Argument 2 not a float"));
2096     return SQ_ERROR;
2097   }
2098   SQFloat arg2;
2099   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2100     sq_throwerror(vm, _SC("Argument 3 not a float"));
2101     return SQ_ERROR;
2102   }
2103
2104   try {
2105     _this->set_ambient_light(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2106
2107     return 0;
2108
2109   } catch(std::exception& e) {
2110     sq_throwerror(vm, e.what());
2111     return SQ_ERROR;
2112   } catch(...) {
2113     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ambient_light'"));
2114     return SQ_ERROR;
2115   }
2116
2117 }
2118
2119 static SQInteger SSector_get_ambient_red_wrapper(HSQUIRRELVM vm)
2120 {
2121   SQUserPointer data;
2122   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2123     sq_throwerror(vm, _SC("'get_ambient_red' called without instance"));
2124     return SQ_ERROR;
2125   }
2126   scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2127
2128   try {
2129     float return_value = _this->get_ambient_red();
2130
2131     sq_pushfloat(vm, return_value);
2132     return 1;
2133
2134   } catch(std::exception& e) {
2135     sq_throwerror(vm, e.what());
2136     return SQ_ERROR;
2137   } catch(...) {
2138     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_red'"));
2139     return SQ_ERROR;
2140   }
2141
2142 }
2143
2144 static SQInteger SSector_get_ambient_green_wrapper(HSQUIRRELVM vm)
2145 {
2146   SQUserPointer data;
2147   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2148     sq_throwerror(vm, _SC("'get_ambient_green' called without instance"));
2149     return SQ_ERROR;
2150   }
2151   scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2152
2153   try {
2154     float return_value = _this->get_ambient_green();
2155
2156     sq_pushfloat(vm, return_value);
2157     return 1;
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 'get_ambient_green'"));
2164     return SQ_ERROR;
2165   }
2166
2167 }
2168
2169 static SQInteger SSector_get_ambient_blue_wrapper(HSQUIRRELVM vm)
2170 {
2171   SQUserPointer data;
2172   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2173     sq_throwerror(vm, _SC("'get_ambient_blue' called without instance"));
2174     return SQ_ERROR;
2175   }
2176   scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2177
2178   try {
2179     float return_value = _this->get_ambient_blue();
2180
2181     sq_pushfloat(vm, return_value);
2182     return 1;
2183
2184   } catch(std::exception& e) {
2185     sq_throwerror(vm, e.what());
2186     return SQ_ERROR;
2187   } catch(...) {
2188     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_blue'"));
2189     return SQ_ERROR;
2190   }
2191
2192 }
2193
2194 static SQInteger SSector_set_gravity_wrapper(HSQUIRRELVM vm)
2195 {
2196   SQUserPointer data;
2197   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2198     sq_throwerror(vm, _SC("'set_gravity' called without instance"));
2199     return SQ_ERROR;
2200   }
2201   scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2202   SQFloat arg0;
2203   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2204     sq_throwerror(vm, _SC("Argument 1 not a float"));
2205     return SQ_ERROR;
2206   }
2207
2208   try {
2209     _this->set_gravity(static_cast<float> (arg0));
2210
2211     return 0;
2212
2213   } catch(std::exception& e) {
2214     sq_throwerror(vm, e.what());
2215     return SQ_ERROR;
2216   } catch(...) {
2217     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_gravity'"));
2218     return SQ_ERROR;
2219   }
2220
2221 }
2222
2223 static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
2224 {
2225   scripting::Text* _this = reinterpret_cast<scripting::Text*> (ptr);
2226   delete _this;
2227   return 0;
2228 }
2229
2230 static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm)
2231 {
2232   SQUserPointer data;
2233   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2234     sq_throwerror(vm, _SC("'set_text' called without instance"));
2235     return SQ_ERROR;
2236   }
2237   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2238   const SQChar* arg0;
2239   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2240     sq_throwerror(vm, _SC("Argument 1 not a string"));
2241     return SQ_ERROR;
2242   }
2243
2244   try {
2245     _this->set_text(arg0);
2246
2247     return 0;
2248
2249   } catch(std::exception& e) {
2250     sq_throwerror(vm, e.what());
2251     return SQ_ERROR;
2252   } catch(...) {
2253     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
2254     return SQ_ERROR;
2255   }
2256
2257 }
2258
2259 static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm)
2260 {
2261   SQUserPointer data;
2262   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2263     sq_throwerror(vm, _SC("'set_font' called without instance"));
2264     return SQ_ERROR;
2265   }
2266   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2267   const SQChar* arg0;
2268   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2269     sq_throwerror(vm, _SC("Argument 1 not a string"));
2270     return SQ_ERROR;
2271   }
2272
2273   try {
2274     _this->set_font(arg0);
2275
2276     return 0;
2277
2278   } catch(std::exception& e) {
2279     sq_throwerror(vm, e.what());
2280     return SQ_ERROR;
2281   } catch(...) {
2282     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_font'"));
2283     return SQ_ERROR;
2284   }
2285
2286 }
2287
2288 static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm)
2289 {
2290   SQUserPointer data;
2291   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2292     sq_throwerror(vm, _SC("'fade_in' called without instance"));
2293     return SQ_ERROR;
2294   }
2295   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2296   SQFloat arg0;
2297   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2298     sq_throwerror(vm, _SC("Argument 1 not a float"));
2299     return SQ_ERROR;
2300   }
2301
2302   try {
2303     _this->fade_in(static_cast<float> (arg0));
2304
2305     return 0;
2306
2307   } catch(std::exception& e) {
2308     sq_throwerror(vm, e.what());
2309     return SQ_ERROR;
2310   } catch(...) {
2311     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
2312     return SQ_ERROR;
2313   }
2314
2315 }
2316
2317 static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm)
2318 {
2319   SQUserPointer data;
2320   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2321     sq_throwerror(vm, _SC("'fade_out' called without instance"));
2322     return SQ_ERROR;
2323   }
2324   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2325   SQFloat arg0;
2326   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2327     sq_throwerror(vm, _SC("Argument 1 not a float"));
2328     return SQ_ERROR;
2329   }
2330
2331   try {
2332     _this->fade_out(static_cast<float> (arg0));
2333
2334     return 0;
2335
2336   } catch(std::exception& e) {
2337     sq_throwerror(vm, e.what());
2338     return SQ_ERROR;
2339   } catch(...) {
2340     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
2341     return SQ_ERROR;
2342   }
2343
2344 }
2345
2346 static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm)
2347 {
2348   SQUserPointer data;
2349   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2350     sq_throwerror(vm, _SC("'set_visible' called without instance"));
2351     return SQ_ERROR;
2352   }
2353   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2354   SQBool arg0;
2355   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2356     sq_throwerror(vm, _SC("Argument 1 not a bool"));
2357     return SQ_ERROR;
2358   }
2359
2360   try {
2361     _this->set_visible(arg0 == SQTrue);
2362
2363     return 0;
2364
2365   } catch(std::exception& e) {
2366     sq_throwerror(vm, e.what());
2367     return SQ_ERROR;
2368   } catch(...) {
2369     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
2370     return SQ_ERROR;
2371   }
2372
2373 }
2374
2375 static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
2376 {
2377   SQUserPointer data;
2378   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2379     sq_throwerror(vm, _SC("'set_centered' called without instance"));
2380     return SQ_ERROR;
2381   }
2382   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2383   SQBool arg0;
2384   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2385     sq_throwerror(vm, _SC("Argument 1 not a bool"));
2386     return SQ_ERROR;
2387   }
2388
2389   try {
2390     _this->set_centered(arg0 == SQTrue);
2391
2392     return 0;
2393
2394   } catch(std::exception& e) {
2395     sq_throwerror(vm, e.what());
2396     return SQ_ERROR;
2397   } catch(...) {
2398     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_centered'"));
2399     return SQ_ERROR;
2400   }
2401
2402 }
2403
2404 static SQInteger Text_set_pos_wrapper(HSQUIRRELVM vm)
2405 {
2406   SQUserPointer data;
2407   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2408     sq_throwerror(vm, _SC("'set_pos' called without instance"));
2409     return SQ_ERROR;
2410   }
2411   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2412   SQFloat arg0;
2413   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2414     sq_throwerror(vm, _SC("Argument 1 not a float"));
2415     return SQ_ERROR;
2416   }
2417   SQFloat arg1;
2418   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2419     sq_throwerror(vm, _SC("Argument 2 not a float"));
2420     return SQ_ERROR;
2421   }
2422
2423   try {
2424     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
2425
2426     return 0;
2427
2428   } catch(std::exception& e) {
2429     sq_throwerror(vm, e.what());
2430     return SQ_ERROR;
2431   } catch(...) {
2432     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
2433     return SQ_ERROR;
2434   }
2435
2436 }
2437
2438 static SQInteger Text_get_pos_x_wrapper(HSQUIRRELVM vm)
2439 {
2440   SQUserPointer data;
2441   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2442     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
2443     return SQ_ERROR;
2444   }
2445   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2446
2447   try {
2448     float return_value = _this->get_pos_x();
2449
2450     sq_pushfloat(vm, return_value);
2451     return 1;
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 'get_pos_x'"));
2458     return SQ_ERROR;
2459   }
2460
2461 }
2462
2463 static SQInteger Text_get_pos_y_wrapper(HSQUIRRELVM vm)
2464 {
2465   SQUserPointer data;
2466   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2467     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
2468     return SQ_ERROR;
2469   }
2470   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2471
2472   try {
2473     float return_value = _this->get_pos_y();
2474
2475     sq_pushfloat(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_pos_y'"));
2483     return SQ_ERROR;
2484   }
2485
2486 }
2487
2488 static SQInteger Text_set_anchor_point_wrapper(HSQUIRRELVM vm)
2489 {
2490   SQUserPointer data;
2491   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2492     sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
2493     return SQ_ERROR;
2494   }
2495   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2496   SQInteger arg0;
2497   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2498     sq_throwerror(vm, _SC("Argument 1 not an integer"));
2499     return SQ_ERROR;
2500   }
2501
2502   try {
2503     _this->set_anchor_point(static_cast<int> (arg0));
2504
2505     return 0;
2506
2507   } catch(std::exception& e) {
2508     sq_throwerror(vm, e.what());
2509     return SQ_ERROR;
2510   } catch(...) {
2511     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
2512     return SQ_ERROR;
2513   }
2514
2515 }
2516
2517 static SQInteger Text_get_anchor_point_wrapper(HSQUIRRELVM vm)
2518 {
2519   SQUserPointer data;
2520   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2521     sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
2522     return SQ_ERROR;
2523   }
2524   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2525
2526   try {
2527     int return_value = _this->get_anchor_point();
2528
2529     sq_pushinteger(vm, return_value);
2530     return 1;
2531
2532   } catch(std::exception& e) {
2533     sq_throwerror(vm, e.what());
2534     return SQ_ERROR;
2535   } catch(...) {
2536     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
2537     return SQ_ERROR;
2538   }
2539
2540 }
2541
2542 static SQInteger Thunderstorm_release_hook(SQUserPointer ptr, SQInteger )
2543 {
2544   scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (ptr);
2545   delete _this;
2546   return 0;
2547 }
2548
2549 static SQInteger Thunderstorm_start_wrapper(HSQUIRRELVM vm)
2550 {
2551   SQUserPointer data;
2552   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2553     sq_throwerror(vm, _SC("'start' called without instance"));
2554     return SQ_ERROR;
2555   }
2556   scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2557
2558   try {
2559     _this->start();
2560
2561     return 0;
2562
2563   } catch(std::exception& e) {
2564     sq_throwerror(vm, e.what());
2565     return SQ_ERROR;
2566   } catch(...) {
2567     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2568     return SQ_ERROR;
2569   }
2570
2571 }
2572
2573 static SQInteger Thunderstorm_stop_wrapper(HSQUIRRELVM vm)
2574 {
2575   SQUserPointer data;
2576   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2577     sq_throwerror(vm, _SC("'stop' called without instance"));
2578     return SQ_ERROR;
2579   }
2580   scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2581
2582   try {
2583     _this->stop();
2584
2585     return 0;
2586
2587   } catch(std::exception& e) {
2588     sq_throwerror(vm, e.what());
2589     return SQ_ERROR;
2590   } catch(...) {
2591     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2592     return SQ_ERROR;
2593   }
2594
2595 }
2596
2597 static SQInteger Thunderstorm_thunder_wrapper(HSQUIRRELVM vm)
2598 {
2599   SQUserPointer data;
2600   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2601     sq_throwerror(vm, _SC("'thunder' called without instance"));
2602     return SQ_ERROR;
2603   }
2604   scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2605
2606   try {
2607     _this->thunder();
2608
2609     return 0;
2610
2611   } catch(std::exception& e) {
2612     sq_throwerror(vm, e.what());
2613     return SQ_ERROR;
2614   } catch(...) {
2615     sq_throwerror(vm, _SC("Unexpected exception while executing function 'thunder'"));
2616     return SQ_ERROR;
2617   }
2618
2619 }
2620
2621 static SQInteger Thunderstorm_lightning_wrapper(HSQUIRRELVM vm)
2622 {
2623   SQUserPointer data;
2624   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2625     sq_throwerror(vm, _SC("'lightning' called without instance"));
2626     return SQ_ERROR;
2627   }
2628   scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2629
2630   try {
2631     _this->lightning();
2632
2633     return 0;
2634
2635   } catch(std::exception& e) {
2636     sq_throwerror(vm, e.what());
2637     return SQ_ERROR;
2638   } catch(...) {
2639     sq_throwerror(vm, _SC("Unexpected exception while executing function 'lightning'"));
2640     return SQ_ERROR;
2641   }
2642
2643 }
2644
2645 static SQInteger Thunderstorm_flash_wrapper(HSQUIRRELVM vm)
2646 {
2647   SQUserPointer data;
2648   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2649     sq_throwerror(vm, _SC("'flash' called without instance"));
2650     return SQ_ERROR;
2651   }
2652   scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2653
2654   try {
2655     _this->flash();
2656
2657     return 0;
2658
2659   } catch(std::exception& e) {
2660     sq_throwerror(vm, e.what());
2661     return SQ_ERROR;
2662   } catch(...) {
2663     sq_throwerror(vm, _SC("Unexpected exception while executing function 'flash'"));
2664     return SQ_ERROR;
2665   }
2666
2667 }
2668
2669 static SQInteger Thunderstorm_electrify_wrapper(HSQUIRRELVM vm)
2670 {
2671   SQUserPointer data;
2672   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2673     sq_throwerror(vm, _SC("'electrify' called without instance"));
2674     return SQ_ERROR;
2675   }
2676   scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2677
2678   try {
2679     _this->electrify();
2680
2681     return 0;
2682
2683   } catch(std::exception& e) {
2684     sq_throwerror(vm, e.what());
2685     return SQ_ERROR;
2686   } catch(...) {
2687     sq_throwerror(vm, _SC("Unexpected exception while executing function 'electrify'"));
2688     return SQ_ERROR;
2689   }
2690
2691 }
2692
2693 static SQInteger TileMap_release_hook(SQUserPointer ptr, SQInteger )
2694 {
2695   scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (ptr);
2696   delete _this;
2697   return 0;
2698 }
2699
2700 static SQInteger TileMap_goto_node_wrapper(HSQUIRRELVM vm)
2701 {
2702   SQUserPointer data;
2703   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2704     sq_throwerror(vm, _SC("'goto_node' called without instance"));
2705     return SQ_ERROR;
2706   }
2707   scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2708   SQInteger arg0;
2709   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2710     sq_throwerror(vm, _SC("Argument 1 not an integer"));
2711     return SQ_ERROR;
2712   }
2713
2714   try {
2715     _this->goto_node(static_cast<int> (arg0));
2716
2717     return 0;
2718
2719   } catch(std::exception& e) {
2720     sq_throwerror(vm, e.what());
2721     return SQ_ERROR;
2722   } catch(...) {
2723     sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2724     return SQ_ERROR;
2725   }
2726
2727 }
2728
2729 static SQInteger TileMap_start_moving_wrapper(HSQUIRRELVM vm)
2730 {
2731   SQUserPointer data;
2732   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2733     sq_throwerror(vm, _SC("'start_moving' called without instance"));
2734     return SQ_ERROR;
2735   }
2736   scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2737
2738   try {
2739     _this->start_moving();
2740
2741     return 0;
2742
2743   } catch(std::exception& e) {
2744     sq_throwerror(vm, e.what());
2745     return SQ_ERROR;
2746   } catch(...) {
2747     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
2748     return SQ_ERROR;
2749   }
2750
2751 }
2752
2753 static SQInteger TileMap_stop_moving_wrapper(HSQUIRRELVM vm)
2754 {
2755   SQUserPointer data;
2756   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2757     sq_throwerror(vm, _SC("'stop_moving' called without instance"));
2758     return SQ_ERROR;
2759   }
2760   scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2761
2762   try {
2763     _this->stop_moving();
2764
2765     return 0;
2766
2767   } catch(std::exception& e) {
2768     sq_throwerror(vm, e.what());
2769     return SQ_ERROR;
2770   } catch(...) {
2771     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
2772     return SQ_ERROR;
2773   }
2774
2775 }
2776
2777 static SQInteger TileMap_fade_wrapper(HSQUIRRELVM vm)
2778 {
2779   SQUserPointer data;
2780   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2781     sq_throwerror(vm, _SC("'fade' called without instance"));
2782     return SQ_ERROR;
2783   }
2784   scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2785   SQFloat arg0;
2786   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2787     sq_throwerror(vm, _SC("Argument 1 not a float"));
2788     return SQ_ERROR;
2789   }
2790   SQFloat arg1;
2791   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2792     sq_throwerror(vm, _SC("Argument 2 not a float"));
2793     return SQ_ERROR;
2794   }
2795
2796   try {
2797     _this->fade(static_cast<float> (arg0), static_cast<float> (arg1));
2798
2799     return 0;
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 'fade'"));
2806     return SQ_ERROR;
2807   }
2808
2809 }
2810
2811 static SQInteger TileMap_set_alpha_wrapper(HSQUIRRELVM vm)
2812 {
2813   SQUserPointer data;
2814   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2815     sq_throwerror(vm, _SC("'set_alpha' called without instance"));
2816     return SQ_ERROR;
2817   }
2818   scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2819   SQFloat arg0;
2820   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2821     sq_throwerror(vm, _SC("Argument 1 not a float"));
2822     return SQ_ERROR;
2823   }
2824
2825   try {
2826     _this->set_alpha(static_cast<float> (arg0));
2827
2828     return 0;
2829
2830   } catch(std::exception& e) {
2831     sq_throwerror(vm, e.what());
2832     return SQ_ERROR;
2833   } catch(...) {
2834     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_alpha'"));
2835     return SQ_ERROR;
2836   }
2837
2838 }
2839
2840 static SQInteger TileMap_get_alpha_wrapper(HSQUIRRELVM vm)
2841 {
2842   SQUserPointer data;
2843   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2844     sq_throwerror(vm, _SC("'get_alpha' called without instance"));
2845     return SQ_ERROR;
2846   }
2847   scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2848
2849   try {
2850     float return_value = _this->get_alpha();
2851
2852     sq_pushfloat(vm, return_value);
2853     return 1;
2854
2855   } catch(std::exception& e) {
2856     sq_throwerror(vm, e.what());
2857     return SQ_ERROR;
2858   } catch(...) {
2859     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_alpha'"));
2860     return SQ_ERROR;
2861   }
2862
2863 }
2864
2865 static SQInteger WillOWisp_release_hook(SQUserPointer ptr, SQInteger )
2866 {
2867   scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (ptr);
2868   delete _this;
2869   return 0;
2870 }
2871
2872 static SQInteger WillOWisp_goto_node_wrapper(HSQUIRRELVM vm)
2873 {
2874   SQUserPointer data;
2875   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2876     sq_throwerror(vm, _SC("'goto_node' called without instance"));
2877     return SQ_ERROR;
2878   }
2879   scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
2880   SQInteger arg0;
2881   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2882     sq_throwerror(vm, _SC("Argument 1 not an integer"));
2883     return SQ_ERROR;
2884   }
2885
2886   try {
2887     _this->goto_node(static_cast<int> (arg0));
2888
2889     return 0;
2890
2891   } catch(std::exception& e) {
2892     sq_throwerror(vm, e.what());
2893     return SQ_ERROR;
2894   } catch(...) {
2895     sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2896     return SQ_ERROR;
2897   }
2898
2899 }
2900
2901 static SQInteger WillOWisp_set_state_wrapper(HSQUIRRELVM vm)
2902 {
2903   SQUserPointer data;
2904   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2905     sq_throwerror(vm, _SC("'set_state' called without instance"));
2906     return SQ_ERROR;
2907   }
2908   scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
2909   const SQChar* arg0;
2910   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2911     sq_throwerror(vm, _SC("Argument 1 not a string"));
2912     return SQ_ERROR;
2913   }
2914
2915   try {
2916     _this->set_state(arg0);
2917
2918     return 0;
2919
2920   } catch(std::exception& e) {
2921     sq_throwerror(vm, e.what());
2922     return SQ_ERROR;
2923   } catch(...) {
2924     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_state'"));
2925     return SQ_ERROR;
2926   }
2927
2928 }
2929
2930 static SQInteger WillOWisp_start_moving_wrapper(HSQUIRRELVM vm)
2931 {
2932   SQUserPointer data;
2933   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2934     sq_throwerror(vm, _SC("'start_moving' called without instance"));
2935     return SQ_ERROR;
2936   }
2937   scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
2938
2939   try {
2940     _this->start_moving();
2941
2942     return 0;
2943
2944   } catch(std::exception& e) {
2945     sq_throwerror(vm, e.what());
2946     return SQ_ERROR;
2947   } catch(...) {
2948     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
2949     return SQ_ERROR;
2950   }
2951
2952 }
2953
2954 static SQInteger WillOWisp_stop_moving_wrapper(HSQUIRRELVM vm)
2955 {
2956   SQUserPointer data;
2957   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2958     sq_throwerror(vm, _SC("'stop_moving' called without instance"));
2959     return SQ_ERROR;
2960   }
2961   scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
2962
2963   try {
2964     _this->stop_moving();
2965
2966     return 0;
2967
2968   } catch(std::exception& e) {
2969     sq_throwerror(vm, e.what());
2970     return SQ_ERROR;
2971   } catch(...) {
2972     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
2973     return SQ_ERROR;
2974   }
2975
2976 }
2977
2978 static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger )
2979 {
2980   scripting::Wind* _this = reinterpret_cast<scripting::Wind*> (ptr);
2981   delete _this;
2982   return 0;
2983 }
2984
2985 static SQInteger Wind_start_wrapper(HSQUIRRELVM vm)
2986 {
2987   SQUserPointer data;
2988   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2989     sq_throwerror(vm, _SC("'start' called without instance"));
2990     return SQ_ERROR;
2991   }
2992   scripting::Wind* _this = reinterpret_cast<scripting::Wind*> (data);
2993
2994   try {
2995     _this->start();
2996
2997     return 0;
2998
2999   } catch(std::exception& e) {
3000     sq_throwerror(vm, e.what());
3001     return SQ_ERROR;
3002   } catch(...) {
3003     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
3004     return SQ_ERROR;
3005   }
3006
3007 }
3008
3009 static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm)
3010 {
3011   SQUserPointer data;
3012   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
3013     sq_throwerror(vm, _SC("'stop' called without instance"));
3014     return SQ_ERROR;
3015   }
3016   scripting::Wind* _this = reinterpret_cast<scripting::Wind*> (data);
3017
3018   try {
3019     _this->stop();
3020
3021     return 0;
3022
3023   } catch(std::exception& e) {
3024     sq_throwerror(vm, e.what());
3025     return SQ_ERROR;
3026   } catch(...) {
3027     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
3028     return SQ_ERROR;
3029   }
3030
3031 }
3032
3033 static SQInteger display_wrapper(HSQUIRRELVM vm)
3034 {
3035   return scripting::display(vm);
3036 }
3037
3038 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
3039 {
3040   HSQUIRRELVM arg0 = vm;
3041
3042   try {
3043     scripting::print_stacktrace(arg0);
3044
3045     return 0;
3046
3047   } catch(std::exception& e) {
3048     sq_throwerror(vm, e.what());
3049     return SQ_ERROR;
3050   } catch(...) {
3051     sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
3052     return SQ_ERROR;
3053   }
3054
3055 }
3056
3057 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
3058 {
3059   return scripting::get_current_thread(vm);
3060 }
3061
3062 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
3063 {
3064   const SQChar* arg0;
3065   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3066     sq_throwerror(vm, _SC("Argument 1 not a string"));
3067     return SQ_ERROR;
3068   }
3069
3070   try {
3071     scripting::display_text_file(arg0);
3072
3073     return 0;
3074
3075   } catch(std::exception& e) {
3076     sq_throwerror(vm, e.what());
3077     return SQ_ERROR;
3078   } catch(...) {
3079     sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
3080     return SQ_ERROR;
3081   }
3082
3083 }
3084
3085 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
3086 {
3087   const SQChar* arg0;
3088   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3089     sq_throwerror(vm, _SC("Argument 1 not a string"));
3090     return SQ_ERROR;
3091   }
3092
3093   try {
3094     scripting::load_worldmap(arg0);
3095
3096     return 0;
3097
3098   } catch(std::exception& e) {
3099     sq_throwerror(vm, e.what());
3100     return SQ_ERROR;
3101   } catch(...) {
3102     sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
3103     return SQ_ERROR;
3104   }
3105
3106 }
3107
3108 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
3109 {
3110   const SQChar* arg0;
3111   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3112     sq_throwerror(vm, _SC("Argument 1 not a string"));
3113     return SQ_ERROR;
3114   }
3115
3116   try {
3117     scripting::load_level(arg0);
3118
3119     return 0;
3120
3121   } catch(std::exception& e) {
3122     sq_throwerror(vm, e.what());
3123     return SQ_ERROR;
3124   } catch(...) {
3125     sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
3126     return SQ_ERROR;
3127   }
3128
3129 }
3130
3131 static SQInteger wait_wrapper(HSQUIRRELVM vm)
3132 {
3133   HSQUIRRELVM arg0 = vm;
3134   SQFloat arg1;
3135   if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
3136     sq_throwerror(vm, _SC("Argument 1 not a float"));
3137     return SQ_ERROR;
3138   }
3139
3140   try {
3141     scripting::wait(arg0, static_cast<float> (arg1));
3142
3143     return sq_suspendvm(vm);
3144
3145   } catch(std::exception& e) {
3146     sq_throwerror(vm, e.what());
3147     return SQ_ERROR;
3148   } catch(...) {
3149     sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
3150     return SQ_ERROR;
3151   }
3152
3153 }
3154
3155 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
3156 {
3157   HSQUIRRELVM arg0 = vm;
3158
3159   try {
3160     scripting::wait_for_screenswitch(arg0);
3161
3162     return sq_suspendvm(vm);
3163
3164   } catch(std::exception& e) {
3165     sq_throwerror(vm, e.what());
3166     return SQ_ERROR;
3167   } catch(...) {
3168     sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
3169     return SQ_ERROR;
3170   }
3171
3172 }
3173
3174 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
3175 {
3176   (void) vm;
3177
3178   try {
3179     scripting::exit_screen();
3180
3181     return 0;
3182
3183   } catch(std::exception& e) {
3184     sq_throwerror(vm, e.what());
3185     return SQ_ERROR;
3186   } catch(...) {
3187     sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
3188     return SQ_ERROR;
3189   }
3190
3191 }
3192
3193 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
3194 {
3195   SQFloat arg0;
3196   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3197     sq_throwerror(vm, _SC("Argument 1 not a float"));
3198     return SQ_ERROR;
3199   }
3200
3201   try {
3202     scripting::fadeout_screen(static_cast<float> (arg0));
3203
3204     return 0;
3205
3206   } catch(std::exception& e) {
3207     sq_throwerror(vm, e.what());
3208     return SQ_ERROR;
3209   } catch(...) {
3210     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
3211     return SQ_ERROR;
3212   }
3213
3214 }
3215
3216 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
3217 {
3218   SQFloat arg0;
3219   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3220     sq_throwerror(vm, _SC("Argument 1 not a float"));
3221     return SQ_ERROR;
3222   }
3223   SQFloat arg1;
3224   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
3225     sq_throwerror(vm, _SC("Argument 2 not a float"));
3226     return SQ_ERROR;
3227   }
3228   SQFloat arg2;
3229   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
3230     sq_throwerror(vm, _SC("Argument 3 not a float"));
3231     return SQ_ERROR;
3232   }
3233
3234   try {
3235     scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
3236
3237     return 0;
3238
3239   } catch(std::exception& e) {
3240     sq_throwerror(vm, e.what());
3241     return SQ_ERROR;
3242   } catch(...) {
3243     sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
3244     return SQ_ERROR;
3245   }
3246
3247 }
3248
3249 static SQInteger abort_screenfade_wrapper(HSQUIRRELVM vm)
3250 {
3251   (void) vm;
3252
3253   try {
3254     scripting::abort_screenfade();
3255
3256     return 0;
3257
3258   } catch(std::exception& e) {
3259     sq_throwerror(vm, e.what());
3260     return SQ_ERROR;
3261   } catch(...) {
3262     sq_throwerror(vm, _SC("Unexpected exception while executing function 'abort_screenfade'"));
3263     return SQ_ERROR;
3264   }
3265
3266 }
3267
3268 static SQInteger translate_wrapper(HSQUIRRELVM vm)
3269 {
3270   const SQChar* arg0;
3271   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3272     sq_throwerror(vm, _SC("Argument 1 not a string"));
3273     return SQ_ERROR;
3274   }
3275
3276   try {
3277     std::string return_value = scripting::translate(arg0);
3278
3279     sq_pushstring(vm, return_value.c_str(), return_value.size());
3280     return 1;
3281
3282   } catch(std::exception& e) {
3283     sq_throwerror(vm, e.what());
3284     return SQ_ERROR;
3285   } catch(...) {
3286     sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
3287     return SQ_ERROR;
3288   }
3289
3290 }
3291
3292 static SQInteger import_wrapper(HSQUIRRELVM vm)
3293 {
3294   HSQUIRRELVM arg0 = vm;
3295   const SQChar* arg1;
3296   if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
3297     sq_throwerror(vm, _SC("Argument 1 not a string"));
3298     return SQ_ERROR;
3299   }
3300
3301   try {
3302     scripting::import(arg0, arg1);
3303
3304     return 0;
3305
3306   } catch(std::exception& e) {
3307     sq_throwerror(vm, e.what());
3308     return SQ_ERROR;
3309   } catch(...) {
3310     sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
3311     return SQ_ERROR;
3312   }
3313
3314 }
3315
3316 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
3317 {
3318   (void) vm;
3319
3320   try {
3321     scripting::save_state();
3322
3323     return 0;
3324
3325   } catch(std::exception& e) {
3326     sq_throwerror(vm, e.what());
3327     return SQ_ERROR;
3328   } catch(...) {
3329     sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
3330     return SQ_ERROR;
3331   }
3332
3333 }
3334
3335 static SQInteger update_worldmap_wrapper(HSQUIRRELVM vm)
3336 {
3337   (void) vm;
3338
3339   try {
3340     scripting::update_worldmap();
3341
3342     return 0;
3343
3344   } catch(std::exception& e) {
3345     sq_throwerror(vm, e.what());
3346     return SQ_ERROR;
3347   } catch(...) {
3348     sq_throwerror(vm, _SC("Unexpected exception while executing function 'update_worldmap'"));
3349     return SQ_ERROR;
3350   }
3351
3352 }
3353
3354 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
3355 {
3356   SQBool arg0;
3357   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3358     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3359     return SQ_ERROR;
3360   }
3361
3362   try {
3363     scripting::debug_collrects(arg0 == SQTrue);
3364
3365     return 0;
3366
3367   } catch(std::exception& e) {
3368     sq_throwerror(vm, e.what());
3369     return SQ_ERROR;
3370   } catch(...) {
3371     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
3372     return SQ_ERROR;
3373   }
3374
3375 }
3376
3377 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
3378 {
3379   SQBool arg0;
3380   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3381     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3382     return SQ_ERROR;
3383   }
3384
3385   try {
3386     scripting::debug_show_fps(arg0 == SQTrue);
3387
3388     return 0;
3389
3390   } catch(std::exception& e) {
3391     sq_throwerror(vm, e.what());
3392     return SQ_ERROR;
3393   } catch(...) {
3394     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
3395     return SQ_ERROR;
3396   }
3397
3398 }
3399
3400 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
3401 {
3402   SQBool arg0;
3403   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3404     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3405     return SQ_ERROR;
3406   }
3407
3408   try {
3409     scripting::debug_draw_solids_only(arg0 == SQTrue);
3410
3411     return 0;
3412
3413   } catch(std::exception& e) {
3414     sq_throwerror(vm, e.what());
3415     return SQ_ERROR;
3416   } catch(...) {
3417     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
3418     return SQ_ERROR;
3419   }
3420
3421 }
3422
3423 static SQInteger debug_draw_editor_images_wrapper(HSQUIRRELVM vm)
3424 {
3425   SQBool arg0;
3426   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3427     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3428     return SQ_ERROR;
3429   }
3430
3431   try {
3432     scripting::debug_draw_editor_images(arg0 == SQTrue);
3433
3434     return 0;
3435
3436   } catch(std::exception& e) {
3437     sq_throwerror(vm, e.what());
3438     return SQ_ERROR;
3439   } catch(...) {
3440     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_editor_images'"));
3441     return SQ_ERROR;
3442   }
3443
3444 }
3445
3446 static SQInteger debug_worldmap_ghost_wrapper(HSQUIRRELVM vm)
3447 {
3448   SQBool arg0;
3449   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3450     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3451     return SQ_ERROR;
3452   }
3453
3454   try {
3455     scripting::debug_worldmap_ghost(arg0 == SQTrue);
3456
3457     return 0;
3458
3459   } catch(std::exception& e) {
3460     sq_throwerror(vm, e.what());
3461     return SQ_ERROR;
3462   } catch(...) {
3463     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_worldmap_ghost'"));
3464     return SQ_ERROR;
3465   }
3466
3467 }
3468
3469 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
3470 {
3471   const SQChar* arg0;
3472   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3473     sq_throwerror(vm, _SC("Argument 1 not a string"));
3474     return SQ_ERROR;
3475   }
3476
3477   try {
3478     scripting::play_music(arg0);
3479
3480     return 0;
3481
3482   } catch(std::exception& e) {
3483     sq_throwerror(vm, e.what());
3484     return SQ_ERROR;
3485   } catch(...) {
3486     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
3487     return SQ_ERROR;
3488   }
3489
3490 }
3491
3492 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
3493 {
3494   const SQChar* arg0;
3495   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3496     sq_throwerror(vm, _SC("Argument 1 not a string"));
3497     return SQ_ERROR;
3498   }
3499
3500   try {
3501     scripting::play_sound(arg0);
3502
3503     return 0;
3504
3505   } catch(std::exception& e) {
3506     sq_throwerror(vm, e.what());
3507     return SQ_ERROR;
3508   } catch(...) {
3509     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
3510     return SQ_ERROR;
3511   }
3512
3513 }
3514
3515 static SQInteger set_game_speed_wrapper(HSQUIRRELVM vm)
3516 {
3517   SQFloat arg0;
3518   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3519     sq_throwerror(vm, _SC("Argument 1 not a float"));
3520     return SQ_ERROR;
3521   }
3522
3523   try {
3524     scripting::set_game_speed(static_cast<float> (arg0));
3525
3526     return 0;
3527
3528   } catch(std::exception& e) {
3529     sq_throwerror(vm, e.what());
3530     return SQ_ERROR;
3531   } catch(...) {
3532     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_game_speed'"));
3533     return SQ_ERROR;
3534   }
3535
3536 }
3537
3538 static SQInteger grease_wrapper(HSQUIRRELVM vm)
3539 {
3540   (void) vm;
3541
3542   try {
3543     scripting::grease();
3544
3545     return 0;
3546
3547   } catch(std::exception& e) {
3548     sq_throwerror(vm, e.what());
3549     return SQ_ERROR;
3550   } catch(...) {
3551     sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
3552     return SQ_ERROR;
3553   }
3554
3555 }
3556
3557 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
3558 {
3559   (void) vm;
3560
3561   try {
3562     scripting::invincible();
3563
3564     return 0;
3565
3566   } catch(std::exception& e) {
3567     sq_throwerror(vm, e.what());
3568     return SQ_ERROR;
3569   } catch(...) {
3570     sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
3571     return SQ_ERROR;
3572   }
3573
3574 }
3575
3576 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
3577 {
3578   (void) vm;
3579
3580   try {
3581     scripting::ghost();
3582
3583     return 0;
3584
3585   } catch(std::exception& e) {
3586     sq_throwerror(vm, e.what());
3587     return SQ_ERROR;
3588   } catch(...) {
3589     sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
3590     return SQ_ERROR;
3591   }
3592
3593 }
3594
3595 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
3596 {
3597   (void) vm;
3598
3599   try {
3600     scripting::mortal();
3601
3602     return 0;
3603
3604   } catch(std::exception& e) {
3605     sq_throwerror(vm, e.what());
3606     return SQ_ERROR;
3607   } catch(...) {
3608     sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
3609     return SQ_ERROR;
3610   }
3611
3612 }
3613
3614 static SQInteger restart_wrapper(HSQUIRRELVM vm)
3615 {
3616   (void) vm;
3617
3618   try {
3619     scripting::restart();
3620
3621     return 0;
3622
3623   } catch(std::exception& e) {
3624     sq_throwerror(vm, e.what());
3625     return SQ_ERROR;
3626   } catch(...) {
3627     sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
3628     return SQ_ERROR;
3629   }
3630
3631 }
3632
3633 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
3634 {
3635   (void) vm;
3636
3637   try {
3638     scripting::whereami();
3639
3640     return 0;
3641
3642   } catch(std::exception& e) {
3643     sq_throwerror(vm, e.what());
3644     return SQ_ERROR;
3645   } catch(...) {
3646     sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
3647     return SQ_ERROR;
3648   }
3649
3650 }
3651
3652 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
3653 {
3654   (void) vm;
3655
3656   try {
3657     scripting::gotoend();
3658
3659     return 0;
3660
3661   } catch(std::exception& e) {
3662     sq_throwerror(vm, e.what());
3663     return SQ_ERROR;
3664   } catch(...) {
3665     sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
3666     return SQ_ERROR;
3667   }
3668
3669 }
3670
3671 static SQInteger camera_wrapper(HSQUIRRELVM vm)
3672 {
3673   (void) vm;
3674
3675   try {
3676     scripting::camera();
3677
3678     return 0;
3679
3680   } catch(std::exception& e) {
3681     sq_throwerror(vm, e.what());
3682     return SQ_ERROR;
3683   } catch(...) {
3684     sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
3685     return SQ_ERROR;
3686   }
3687
3688 }
3689
3690 static SQInteger set_gamma_wrapper(HSQUIRRELVM vm)
3691 {
3692   SQFloat arg0;
3693   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3694     sq_throwerror(vm, _SC("Argument 1 not a float"));
3695     return SQ_ERROR;
3696   }
3697
3698   try {
3699     scripting::set_gamma(static_cast<float> (arg0));
3700
3701     return 0;
3702
3703   } catch(std::exception& e) {
3704     sq_throwerror(vm, e.what());
3705     return SQ_ERROR;
3706   } catch(...) {
3707     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_gamma'"));
3708     return SQ_ERROR;
3709   }
3710
3711 }
3712
3713 static SQInteger quit_wrapper(HSQUIRRELVM vm)
3714 {
3715   (void) vm;
3716
3717   try {
3718     scripting::quit();
3719
3720     return 0;
3721
3722   } catch(std::exception& e) {
3723     sq_throwerror(vm, e.what());
3724     return SQ_ERROR;
3725   } catch(...) {
3726     sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
3727     return SQ_ERROR;
3728   }
3729
3730 }
3731
3732 static SQInteger rand_wrapper(HSQUIRRELVM vm)
3733 {
3734
3735   try {
3736     int return_value = scripting::rand();
3737
3738     sq_pushinteger(vm, return_value);
3739     return 1;
3740
3741   } catch(std::exception& e) {
3742     sq_throwerror(vm, e.what());
3743     return SQ_ERROR;
3744   } catch(...) {
3745     sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
3746     return SQ_ERROR;
3747   }
3748
3749 }
3750
3751 static SQInteger record_demo_wrapper(HSQUIRRELVM vm)
3752 {
3753   const SQChar* arg0;
3754   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3755     sq_throwerror(vm, _SC("Argument 1 not a string"));
3756     return SQ_ERROR;
3757   }
3758
3759   try {
3760     scripting::record_demo(arg0);
3761
3762     return 0;
3763
3764   } catch(std::exception& e) {
3765     sq_throwerror(vm, e.what());
3766     return SQ_ERROR;
3767   } catch(...) {
3768     sq_throwerror(vm, _SC("Unexpected exception while executing function 'record_demo'"));
3769     return SQ_ERROR;
3770   }
3771
3772 }
3773
3774 static SQInteger play_demo_wrapper(HSQUIRRELVM vm)
3775 {
3776   const SQChar* arg0;
3777   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3778     sq_throwerror(vm, _SC("Argument 1 not a string"));
3779     return SQ_ERROR;
3780   }
3781
3782   try {
3783     scripting::play_demo(arg0);
3784
3785     return 0;
3786
3787   } catch(std::exception& e) {
3788     sq_throwerror(vm, e.what());
3789     return SQ_ERROR;
3790   } catch(...) {
3791     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_demo'"));
3792     return SQ_ERROR;
3793   }
3794
3795 }
3796
3797 static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
3798 {
3799   SQBool arg0;
3800   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3801     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3802     return SQ_ERROR;
3803   }
3804
3805   try {
3806     scripting::Level_finish(arg0 == SQTrue);
3807
3808     return 0;
3809
3810   } catch(std::exception& e) {
3811     sq_throwerror(vm, e.what());
3812     return SQ_ERROR;
3813   } catch(...) {
3814     sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_finish'"));
3815     return SQ_ERROR;
3816   }
3817
3818 }
3819
3820 static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
3821 {
3822   const SQChar* arg0;
3823   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3824     sq_throwerror(vm, _SC("Argument 1 not a string"));
3825     return SQ_ERROR;
3826   }
3827   const SQChar* arg1;
3828   if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
3829     sq_throwerror(vm, _SC("Argument 2 not a string"));
3830     return SQ_ERROR;
3831   }
3832
3833   try {
3834     scripting::Level_spawn(arg0, arg1);
3835
3836     return 0;
3837
3838   } catch(std::exception& e) {
3839     sq_throwerror(vm, e.what());
3840     return SQ_ERROR;
3841   } catch(...) {
3842     sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_spawn'"));
3843     return SQ_ERROR;
3844   }
3845
3846 }
3847
3848 static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
3849 {
3850   (void) vm;
3851
3852   try {
3853     scripting::Level_flip_vertically();
3854
3855     return 0;
3856
3857   } catch(std::exception& e) {
3858     sq_throwerror(vm, e.what());
3859     return SQ_ERROR;
3860   } catch(...) {
3861     sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_flip_vertically'"));
3862     return SQ_ERROR;
3863   }
3864
3865 }
3866
3867 static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
3868 {
3869   (void) vm;
3870
3871   try {
3872     scripting::Level_toggle_pause();
3873
3874     return 0;
3875
3876   } catch(std::exception& e) {
3877     sq_throwerror(vm, e.what());
3878     return SQ_ERROR;
3879   } catch(...) {
3880     sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_toggle_pause'"));
3881     return SQ_ERROR;
3882   }
3883
3884 }
3885
3886 static SQInteger Level_edit_wrapper(HSQUIRRELVM vm)
3887 {
3888   SQBool arg0;
3889   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3890     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3891     return SQ_ERROR;
3892   }
3893
3894   try {
3895     scripting::Level_edit(arg0 == SQTrue);
3896
3897     return 0;
3898
3899   } catch(std::exception& e) {
3900     sq_throwerror(vm, e.what());
3901     return SQ_ERROR;
3902   } catch(...) {
3903     sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_edit'"));
3904     return SQ_ERROR;
3905   }
3906
3907 }
3908
3909 } // namespace wrapper
3910 void create_squirrel_instance(HSQUIRRELVM v, scripting::AmbientSound* object, bool setup_releasehook)
3911 {
3912   using namespace wrapper;
3913
3914   sq_pushroottable(v);
3915   sq_pushstring(v, "AmbientSound", -1);
3916   if(SQ_FAILED(sq_get(v, -2))) {
3917     std::ostringstream msg;
3918     msg << "Couldn't resolved squirrel type 'AmbientSound'";
3919     throw SquirrelError(v, msg.str());
3920   }
3921
3922   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3923     std::ostringstream msg;
3924     msg << "Couldn't setup squirrel instance for object of type 'AmbientSound'";
3925     throw SquirrelError(v, msg.str());
3926   }
3927   sq_remove(v, -2); // remove object name
3928
3929   if(setup_releasehook) {
3930     sq_setreleasehook(v, -1, AmbientSound_release_hook);
3931   }
3932
3933   sq_remove(v, -2); // remove root table
3934 }
3935
3936 void create_squirrel_instance(HSQUIRRELVM v, scripting::Camera* object, bool setup_releasehook)
3937 {
3938   using namespace wrapper;
3939
3940   sq_pushroottable(v);
3941   sq_pushstring(v, "Camera", -1);
3942   if(SQ_FAILED(sq_get(v, -2))) {
3943     std::ostringstream msg;
3944     msg << "Couldn't resolved squirrel type 'Camera'";
3945     throw SquirrelError(v, msg.str());
3946   }
3947
3948   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3949     std::ostringstream msg;
3950     msg << "Couldn't setup squirrel instance for object of type 'Camera'";
3951     throw SquirrelError(v, msg.str());
3952   }
3953   sq_remove(v, -2); // remove object name
3954
3955   if(setup_releasehook) {
3956     sq_setreleasehook(v, -1, Camera_release_hook);
3957   }
3958
3959   sq_remove(v, -2); // remove root table
3960 }
3961
3962 void create_squirrel_instance(HSQUIRRELVM v, scripting::Candle* object, bool setup_releasehook)
3963 {
3964   using namespace wrapper;
3965
3966   sq_pushroottable(v);
3967   sq_pushstring(v, "Candle", -1);
3968   if(SQ_FAILED(sq_get(v, -2))) {
3969     std::ostringstream msg;
3970     msg << "Couldn't resolved squirrel type 'Candle'";
3971     throw SquirrelError(v, msg.str());
3972   }
3973
3974   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3975     std::ostringstream msg;
3976     msg << "Couldn't setup squirrel instance for object of type 'Candle'";
3977     throw SquirrelError(v, msg.str());
3978   }
3979   sq_remove(v, -2); // remove object name
3980
3981   if(setup_releasehook) {
3982     sq_setreleasehook(v, -1, Candle_release_hook);
3983   }
3984
3985   sq_remove(v, -2); // remove root table
3986 }
3987
3988 void create_squirrel_instance(HSQUIRRELVM v, scripting::DisplayEffect* object, bool setup_releasehook)
3989 {
3990   using namespace wrapper;
3991
3992   sq_pushroottable(v);
3993   sq_pushstring(v, "DisplayEffect", -1);
3994   if(SQ_FAILED(sq_get(v, -2))) {
3995     std::ostringstream msg;
3996     msg << "Couldn't resolved squirrel type 'DisplayEffect'";
3997     throw SquirrelError(v, msg.str());
3998   }
3999
4000   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4001     std::ostringstream msg;
4002     msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
4003     throw SquirrelError(v, msg.str());
4004   }
4005   sq_remove(v, -2); // remove object name
4006
4007   if(setup_releasehook) {
4008     sq_setreleasehook(v, -1, DisplayEffect_release_hook);
4009   }
4010
4011   sq_remove(v, -2); // remove root table
4012 }
4013
4014 void create_squirrel_instance(HSQUIRRELVM v, scripting::FloatingImage* object, bool setup_releasehook)
4015 {
4016   using namespace wrapper;
4017
4018   sq_pushroottable(v);
4019   sq_pushstring(v, "FloatingImage", -1);
4020   if(SQ_FAILED(sq_get(v, -2))) {
4021     std::ostringstream msg;
4022     msg << "Couldn't resolved squirrel type 'FloatingImage'";
4023     throw SquirrelError(v, msg.str());
4024   }
4025
4026   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4027     std::ostringstream msg;
4028     msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
4029     throw SquirrelError(v, msg.str());
4030   }
4031   sq_remove(v, -2); // remove object name
4032
4033   if(setup_releasehook) {
4034     sq_setreleasehook(v, -1, FloatingImage_release_hook);
4035   }
4036
4037   sq_remove(v, -2); // remove root table
4038 }
4039
4040 void create_squirrel_instance(HSQUIRRELVM v, scripting::LevelTime* object, bool setup_releasehook)
4041 {
4042   using namespace wrapper;
4043
4044   sq_pushroottable(v);
4045   sq_pushstring(v, "LevelTime", -1);
4046   if(SQ_FAILED(sq_get(v, -2))) {
4047     std::ostringstream msg;
4048     msg << "Couldn't resolved squirrel type 'LevelTime'";
4049     throw SquirrelError(v, msg.str());
4050   }
4051
4052   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4053     std::ostringstream msg;
4054     msg << "Couldn't setup squirrel instance for object of type 'LevelTime'";
4055     throw SquirrelError(v, msg.str());
4056   }
4057   sq_remove(v, -2); // remove object name
4058
4059   if(setup_releasehook) {
4060     sq_setreleasehook(v, -1, LevelTime_release_hook);
4061   }
4062
4063   sq_remove(v, -2); // remove root table
4064 }
4065
4066 void create_squirrel_instance(HSQUIRRELVM v, scripting::Platform* object, bool setup_releasehook)
4067 {
4068   using namespace wrapper;
4069
4070   sq_pushroottable(v);
4071   sq_pushstring(v, "Platform", -1);
4072   if(SQ_FAILED(sq_get(v, -2))) {
4073     std::ostringstream msg;
4074     msg << "Couldn't resolved squirrel type 'Platform'";
4075     throw SquirrelError(v, msg.str());
4076   }
4077
4078   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4079     std::ostringstream msg;
4080     msg << "Couldn't setup squirrel instance for object of type 'Platform'";
4081     throw SquirrelError(v, msg.str());
4082   }
4083   sq_remove(v, -2); // remove object name
4084
4085   if(setup_releasehook) {
4086     sq_setreleasehook(v, -1, Platform_release_hook);
4087   }
4088
4089   sq_remove(v, -2); // remove root table
4090 }
4091
4092 void create_squirrel_instance(HSQUIRRELVM v, scripting::Player* object, bool setup_releasehook)
4093 {
4094   using namespace wrapper;
4095
4096   sq_pushroottable(v);
4097   sq_pushstring(v, "Player", -1);
4098   if(SQ_FAILED(sq_get(v, -2))) {
4099     std::ostringstream msg;
4100     msg << "Couldn't resolved squirrel type 'Player'";
4101     throw SquirrelError(v, msg.str());
4102   }
4103
4104   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4105     std::ostringstream msg;
4106     msg << "Couldn't setup squirrel instance for object of type 'Player'";
4107     throw SquirrelError(v, msg.str());
4108   }
4109   sq_remove(v, -2); // remove object name
4110
4111   if(setup_releasehook) {
4112     sq_setreleasehook(v, -1, Player_release_hook);
4113   }
4114
4115   sq_remove(v, -2); // remove root table
4116 }
4117
4118 void create_squirrel_instance(HSQUIRRELVM v, scripting::ScriptedObject* object, bool setup_releasehook)
4119 {
4120   using namespace wrapper;
4121
4122   sq_pushroottable(v);
4123   sq_pushstring(v, "ScriptedObject", -1);
4124   if(SQ_FAILED(sq_get(v, -2))) {
4125     std::ostringstream msg;
4126     msg << "Couldn't resolved squirrel type 'ScriptedObject'";
4127     throw SquirrelError(v, msg.str());
4128   }
4129
4130   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4131     std::ostringstream msg;
4132     msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
4133     throw SquirrelError(v, msg.str());
4134   }
4135   sq_remove(v, -2); // remove object name
4136
4137   if(setup_releasehook) {
4138     sq_setreleasehook(v, -1, ScriptedObject_release_hook);
4139   }
4140
4141   sq_remove(v, -2); // remove root table
4142 }
4143
4144 void create_squirrel_instance(HSQUIRRELVM v, scripting::SSector* object, bool setup_releasehook)
4145 {
4146   using namespace wrapper;
4147
4148   sq_pushroottable(v);
4149   sq_pushstring(v, "SSector", -1);
4150   if(SQ_FAILED(sq_get(v, -2))) {
4151     std::ostringstream msg;
4152     msg << "Couldn't resolved squirrel type 'SSector'";
4153     throw SquirrelError(v, msg.str());
4154   }
4155
4156   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4157     std::ostringstream msg;
4158     msg << "Couldn't setup squirrel instance for object of type 'SSector'";
4159     throw SquirrelError(v, msg.str());
4160   }
4161   sq_remove(v, -2); // remove object name
4162
4163   if(setup_releasehook) {
4164     sq_setreleasehook(v, -1, SSector_release_hook);
4165   }
4166
4167   sq_remove(v, -2); // remove root table
4168 }
4169
4170 void create_squirrel_instance(HSQUIRRELVM v, scripting::Text* object, bool setup_releasehook)
4171 {
4172   using namespace wrapper;
4173
4174   sq_pushroottable(v);
4175   sq_pushstring(v, "Text", -1);
4176   if(SQ_FAILED(sq_get(v, -2))) {
4177     std::ostringstream msg;
4178     msg << "Couldn't resolved squirrel type 'Text'";
4179     throw SquirrelError(v, msg.str());
4180   }
4181
4182   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4183     std::ostringstream msg;
4184     msg << "Couldn't setup squirrel instance for object of type 'Text'";
4185     throw SquirrelError(v, msg.str());
4186   }
4187   sq_remove(v, -2); // remove object name
4188
4189   if(setup_releasehook) {
4190     sq_setreleasehook(v, -1, Text_release_hook);
4191   }
4192
4193   sq_remove(v, -2); // remove root table
4194 }
4195
4196 void create_squirrel_instance(HSQUIRRELVM v, scripting::Thunderstorm* object, bool setup_releasehook)
4197 {
4198   using namespace wrapper;
4199
4200   sq_pushroottable(v);
4201   sq_pushstring(v, "Thunderstorm", -1);
4202   if(SQ_FAILED(sq_get(v, -2))) {
4203     std::ostringstream msg;
4204     msg << "Couldn't resolved squirrel type 'Thunderstorm'";
4205     throw SquirrelError(v, msg.str());
4206   }
4207
4208   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4209     std::ostringstream msg;
4210     msg << "Couldn't setup squirrel instance for object of type 'Thunderstorm'";
4211     throw SquirrelError(v, msg.str());
4212   }
4213   sq_remove(v, -2); // remove object name
4214
4215   if(setup_releasehook) {
4216     sq_setreleasehook(v, -1, Thunderstorm_release_hook);
4217   }
4218
4219   sq_remove(v, -2); // remove root table
4220 }
4221
4222 void create_squirrel_instance(HSQUIRRELVM v, scripting::TileMap* object, bool setup_releasehook)
4223 {
4224   using namespace wrapper;
4225
4226   sq_pushroottable(v);
4227   sq_pushstring(v, "TileMap", -1);
4228   if(SQ_FAILED(sq_get(v, -2))) {
4229     std::ostringstream msg;
4230     msg << "Couldn't resolved squirrel type 'TileMap'";
4231     throw SquirrelError(v, msg.str());
4232   }
4233
4234   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4235     std::ostringstream msg;
4236     msg << "Couldn't setup squirrel instance for object of type 'TileMap'";
4237     throw SquirrelError(v, msg.str());
4238   }
4239   sq_remove(v, -2); // remove object name
4240
4241   if(setup_releasehook) {
4242     sq_setreleasehook(v, -1, TileMap_release_hook);
4243   }
4244
4245   sq_remove(v, -2); // remove root table
4246 }
4247
4248 void create_squirrel_instance(HSQUIRRELVM v, scripting::WillOWisp* object, bool setup_releasehook)
4249 {
4250   using namespace wrapper;
4251
4252   sq_pushroottable(v);
4253   sq_pushstring(v, "WillOWisp", -1);
4254   if(SQ_FAILED(sq_get(v, -2))) {
4255     std::ostringstream msg;
4256     msg << "Couldn't resolved squirrel type 'WillOWisp'";
4257     throw SquirrelError(v, msg.str());
4258   }
4259
4260   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4261     std::ostringstream msg;
4262     msg << "Couldn't setup squirrel instance for object of type 'WillOWisp'";
4263     throw SquirrelError(v, msg.str());
4264   }
4265   sq_remove(v, -2); // remove object name
4266
4267   if(setup_releasehook) {
4268     sq_setreleasehook(v, -1, WillOWisp_release_hook);
4269   }
4270
4271   sq_remove(v, -2); // remove root table
4272 }
4273
4274 void create_squirrel_instance(HSQUIRRELVM v, scripting::Wind* object, bool setup_releasehook)
4275 {
4276   using namespace wrapper;
4277
4278   sq_pushroottable(v);
4279   sq_pushstring(v, "Wind", -1);
4280   if(SQ_FAILED(sq_get(v, -2))) {
4281     std::ostringstream msg;
4282     msg << "Couldn't resolved squirrel type 'Wind'";
4283     throw SquirrelError(v, msg.str());
4284   }
4285
4286   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4287     std::ostringstream msg;
4288     msg << "Couldn't setup squirrel instance for object of type 'Wind'";
4289     throw SquirrelError(v, msg.str());
4290   }
4291   sq_remove(v, -2); // remove object name
4292
4293   if(setup_releasehook) {
4294     sq_setreleasehook(v, -1, Wind_release_hook);
4295   }
4296
4297   sq_remove(v, -2); // remove root table
4298 }
4299
4300 void register_supertux_wrapper(HSQUIRRELVM v)
4301 {
4302   using namespace wrapper;
4303
4304   sq_pushstring(v, "ANCHOR_TOP", -1);
4305   sq_pushinteger(v, 16);
4306   if(SQ_FAILED(sq_createslot(v, -3))) {
4307     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
4308   }
4309
4310   sq_pushstring(v, "ANCHOR_BOTTOM", -1);
4311   sq_pushinteger(v, 32);
4312   if(SQ_FAILED(sq_createslot(v, -3))) {
4313     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
4314   }
4315
4316   sq_pushstring(v, "ANCHOR_LEFT", -1);
4317   sq_pushinteger(v, 1);
4318   if(SQ_FAILED(sq_createslot(v, -3))) {
4319     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
4320   }
4321
4322   sq_pushstring(v, "ANCHOR_RIGHT", -1);
4323   sq_pushinteger(v, 2);
4324   if(SQ_FAILED(sq_createslot(v, -3))) {
4325     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
4326   }
4327
4328   sq_pushstring(v, "ANCHOR_MIDDLE", -1);
4329   sq_pushinteger(v, 0);
4330   if(SQ_FAILED(sq_createslot(v, -3))) {
4331     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
4332   }
4333
4334   sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
4335   sq_pushinteger(v, 17);
4336   if(SQ_FAILED(sq_createslot(v, -3))) {
4337     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
4338   }
4339
4340   sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
4341   sq_pushinteger(v, 18);
4342   if(SQ_FAILED(sq_createslot(v, -3))) {
4343     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
4344   }
4345
4346   sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
4347   sq_pushinteger(v, 33);
4348   if(SQ_FAILED(sq_createslot(v, -3))) {
4349     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
4350   }
4351
4352   sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
4353   sq_pushinteger(v, 34);
4354   if(SQ_FAILED(sq_createslot(v, -3))) {
4355     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
4356   }
4357
4358   sq_pushstring(v, "display", -1);
4359   sq_newclosure(v, &display_wrapper, 0);
4360   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "t.");
4361   if(SQ_FAILED(sq_createslot(v, -3))) {
4362     throw SquirrelError(v, "Couldn't register function 'display'");
4363   }
4364
4365   sq_pushstring(v, "print_stacktrace", -1);
4366   sq_newclosure(v, &print_stacktrace_wrapper, 0);
4367   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4368   if(SQ_FAILED(sq_createslot(v, -3))) {
4369     throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
4370   }
4371
4372   sq_pushstring(v, "get_current_thread", -1);
4373   sq_newclosure(v, &get_current_thread_wrapper, 0);
4374   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "t");
4375   if(SQ_FAILED(sq_createslot(v, -3))) {
4376     throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
4377   }
4378
4379   sq_pushstring(v, "display_text_file", -1);
4380   sq_newclosure(v, &display_text_file_wrapper, 0);
4381   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4382   if(SQ_FAILED(sq_createslot(v, -3))) {
4383     throw SquirrelError(v, "Couldn't register function 'display_text_file'");
4384   }
4385
4386   sq_pushstring(v, "load_worldmap", -1);
4387   sq_newclosure(v, &load_worldmap_wrapper, 0);
4388   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4389   if(SQ_FAILED(sq_createslot(v, -3))) {
4390     throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
4391   }
4392
4393   sq_pushstring(v, "load_level", -1);
4394   sq_newclosure(v, &load_level_wrapper, 0);
4395   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4396   if(SQ_FAILED(sq_createslot(v, -3))) {
4397     throw SquirrelError(v, "Couldn't register function 'load_level'");
4398   }
4399
4400   sq_pushstring(v, "wait", -1);
4401   sq_newclosure(v, &wait_wrapper, 0);
4402   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4403   if(SQ_FAILED(sq_createslot(v, -3))) {
4404     throw SquirrelError(v, "Couldn't register function 'wait'");
4405   }
4406
4407   sq_pushstring(v, "wait_for_screenswitch", -1);
4408   sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
4409   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4410   if(SQ_FAILED(sq_createslot(v, -3))) {
4411     throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
4412   }
4413
4414   sq_pushstring(v, "exit_screen", -1);
4415   sq_newclosure(v, &exit_screen_wrapper, 0);
4416   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4417   if(SQ_FAILED(sq_createslot(v, -3))) {
4418     throw SquirrelError(v, "Couldn't register function 'exit_screen'");
4419   }
4420
4421   sq_pushstring(v, "fadeout_screen", -1);
4422   sq_newclosure(v, &fadeout_screen_wrapper, 0);
4423   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4424   if(SQ_FAILED(sq_createslot(v, -3))) {
4425     throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
4426   }
4427
4428   sq_pushstring(v, "shrink_screen", -1);
4429   sq_newclosure(v, &shrink_screen_wrapper, 0);
4430   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4431   if(SQ_FAILED(sq_createslot(v, -3))) {
4432     throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
4433   }
4434
4435   sq_pushstring(v, "abort_screenfade", -1);
4436   sq_newclosure(v, &abort_screenfade_wrapper, 0);
4437   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4438   if(SQ_FAILED(sq_createslot(v, -3))) {
4439     throw SquirrelError(v, "Couldn't register function 'abort_screenfade'");
4440   }
4441
4442   sq_pushstring(v, "translate", -1);
4443   sq_newclosure(v, &translate_wrapper, 0);
4444   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4445   if(SQ_FAILED(sq_createslot(v, -3))) {
4446     throw SquirrelError(v, "Couldn't register function 'translate'");
4447   }
4448
4449   sq_pushstring(v, "import", -1);
4450   sq_newclosure(v, &import_wrapper, 0);
4451   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4452   if(SQ_FAILED(sq_createslot(v, -3))) {
4453     throw SquirrelError(v, "Couldn't register function 'import'");
4454   }
4455
4456   sq_pushstring(v, "save_state", -1);
4457   sq_newclosure(v, &save_state_wrapper, 0);
4458   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4459   if(SQ_FAILED(sq_createslot(v, -3))) {
4460     throw SquirrelError(v, "Couldn't register function 'save_state'");
4461   }
4462
4463   sq_pushstring(v, "update_worldmap", -1);
4464   sq_newclosure(v, &update_worldmap_wrapper, 0);
4465   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4466   if(SQ_FAILED(sq_createslot(v, -3))) {
4467     throw SquirrelError(v, "Couldn't register function 'update_worldmap'");
4468   }
4469
4470   sq_pushstring(v, "debug_collrects", -1);
4471   sq_newclosure(v, &debug_collrects_wrapper, 0);
4472   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4473   if(SQ_FAILED(sq_createslot(v, -3))) {
4474     throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
4475   }
4476
4477   sq_pushstring(v, "debug_show_fps", -1);
4478   sq_newclosure(v, &debug_show_fps_wrapper, 0);
4479   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4480   if(SQ_FAILED(sq_createslot(v, -3))) {
4481     throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
4482   }
4483
4484   sq_pushstring(v, "debug_draw_solids_only", -1);
4485   sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
4486   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4487   if(SQ_FAILED(sq_createslot(v, -3))) {
4488     throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
4489   }
4490
4491   sq_pushstring(v, "debug_draw_editor_images", -1);
4492   sq_newclosure(v, &debug_draw_editor_images_wrapper, 0);
4493   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4494   if(SQ_FAILED(sq_createslot(v, -3))) {
4495     throw SquirrelError(v, "Couldn't register function 'debug_draw_editor_images'");
4496   }
4497
4498   sq_pushstring(v, "debug_worldmap_ghost", -1);
4499   sq_newclosure(v, &debug_worldmap_ghost_wrapper, 0);
4500   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4501   if(SQ_FAILED(sq_createslot(v, -3))) {
4502     throw SquirrelError(v, "Couldn't register function 'debug_worldmap_ghost'");
4503   }
4504
4505   sq_pushstring(v, "play_music", -1);
4506   sq_newclosure(v, &play_music_wrapper, 0);
4507   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4508   if(SQ_FAILED(sq_createslot(v, -3))) {
4509     throw SquirrelError(v, "Couldn't register function 'play_music'");
4510   }
4511
4512   sq_pushstring(v, "play_sound", -1);
4513   sq_newclosure(v, &play_sound_wrapper, 0);
4514   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4515   if(SQ_FAILED(sq_createslot(v, -3))) {
4516     throw SquirrelError(v, "Couldn't register function 'play_sound'");
4517   }
4518
4519   sq_pushstring(v, "set_game_speed", -1);
4520   sq_newclosure(v, &set_game_speed_wrapper, 0);
4521   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4522   if(SQ_FAILED(sq_createslot(v, -3))) {
4523     throw SquirrelError(v, "Couldn't register function 'set_game_speed'");
4524   }
4525
4526   sq_pushstring(v, "grease", -1);
4527   sq_newclosure(v, &grease_wrapper, 0);
4528   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4529   if(SQ_FAILED(sq_createslot(v, -3))) {
4530     throw SquirrelError(v, "Couldn't register function 'grease'");
4531   }
4532
4533   sq_pushstring(v, "invincible", -1);
4534   sq_newclosure(v, &invincible_wrapper, 0);
4535   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4536   if(SQ_FAILED(sq_createslot(v, -3))) {
4537     throw SquirrelError(v, "Couldn't register function 'invincible'");
4538   }
4539
4540   sq_pushstring(v, "ghost", -1);
4541   sq_newclosure(v, &ghost_wrapper, 0);
4542   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4543   if(SQ_FAILED(sq_createslot(v, -3))) {
4544     throw SquirrelError(v, "Couldn't register function 'ghost'");
4545   }
4546
4547   sq_pushstring(v, "mortal", -1);
4548   sq_newclosure(v, &mortal_wrapper, 0);
4549   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4550   if(SQ_FAILED(sq_createslot(v, -3))) {
4551     throw SquirrelError(v, "Couldn't register function 'mortal'");
4552   }
4553
4554   sq_pushstring(v, "restart", -1);
4555   sq_newclosure(v, &restart_wrapper, 0);
4556   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4557   if(SQ_FAILED(sq_createslot(v, -3))) {
4558     throw SquirrelError(v, "Couldn't register function 'restart'");
4559   }
4560
4561   sq_pushstring(v, "whereami", -1);
4562   sq_newclosure(v, &whereami_wrapper, 0);
4563   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4564   if(SQ_FAILED(sq_createslot(v, -3))) {
4565     throw SquirrelError(v, "Couldn't register function 'whereami'");
4566   }
4567
4568   sq_pushstring(v, "gotoend", -1);
4569   sq_newclosure(v, &gotoend_wrapper, 0);
4570   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4571   if(SQ_FAILED(sq_createslot(v, -3))) {
4572     throw SquirrelError(v, "Couldn't register function 'gotoend'");
4573   }
4574
4575   sq_pushstring(v, "camera", -1);
4576   sq_newclosure(v, &camera_wrapper, 0);
4577   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4578   if(SQ_FAILED(sq_createslot(v, -3))) {
4579     throw SquirrelError(v, "Couldn't register function 'camera'");
4580   }
4581
4582   sq_pushstring(v, "set_gamma", -1);
4583   sq_newclosure(v, &set_gamma_wrapper, 0);
4584   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4585   if(SQ_FAILED(sq_createslot(v, -3))) {
4586     throw SquirrelError(v, "Couldn't register function 'set_gamma'");
4587   }
4588
4589   sq_pushstring(v, "quit", -1);
4590   sq_newclosure(v, &quit_wrapper, 0);
4591   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4592   if(SQ_FAILED(sq_createslot(v, -3))) {
4593     throw SquirrelError(v, "Couldn't register function 'quit'");
4594   }
4595
4596   sq_pushstring(v, "rand", -1);
4597   sq_newclosure(v, &rand_wrapper, 0);
4598   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4599   if(SQ_FAILED(sq_createslot(v, -3))) {
4600     throw SquirrelError(v, "Couldn't register function 'rand'");
4601   }
4602
4603   sq_pushstring(v, "record_demo", -1);
4604   sq_newclosure(v, &record_demo_wrapper, 0);
4605   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4606   if(SQ_FAILED(sq_createslot(v, -3))) {
4607     throw SquirrelError(v, "Couldn't register function 'record_demo'");
4608   }
4609
4610   sq_pushstring(v, "play_demo", -1);
4611   sq_newclosure(v, &play_demo_wrapper, 0);
4612   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4613   if(SQ_FAILED(sq_createslot(v, -3))) {
4614     throw SquirrelError(v, "Couldn't register function 'play_demo'");
4615   }
4616
4617   sq_pushstring(v, "Level_finish", -1);
4618   sq_newclosure(v, &Level_finish_wrapper, 0);
4619   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4620   if(SQ_FAILED(sq_createslot(v, -3))) {
4621     throw SquirrelError(v, "Couldn't register function 'Level_finish'");
4622   }
4623
4624   sq_pushstring(v, "Level_spawn", -1);
4625   sq_newclosure(v, &Level_spawn_wrapper, 0);
4626   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tss");
4627   if(SQ_FAILED(sq_createslot(v, -3))) {
4628     throw SquirrelError(v, "Couldn't register function 'Level_spawn'");
4629   }
4630
4631   sq_pushstring(v, "Level_flip_vertically", -1);
4632   sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
4633   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4634   if(SQ_FAILED(sq_createslot(v, -3))) {
4635     throw SquirrelError(v, "Couldn't register function 'Level_flip_vertically'");
4636   }
4637
4638   sq_pushstring(v, "Level_toggle_pause", -1);
4639   sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
4640   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4641   if(SQ_FAILED(sq_createslot(v, -3))) {
4642     throw SquirrelError(v, "Couldn't register function 'Level_toggle_pause'");
4643   }
4644
4645   sq_pushstring(v, "Level_edit", -1);
4646   sq_newclosure(v, &Level_edit_wrapper, 0);
4647   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4648   if(SQ_FAILED(sq_createslot(v, -3))) {
4649     throw SquirrelError(v, "Couldn't register function 'Level_edit'");
4650   }
4651
4652   // Register class AmbientSound
4653   sq_pushstring(v, "AmbientSound", -1);
4654   if(sq_newclass(v, SQFalse) < 0) {
4655     std::ostringstream msg;
4656     msg << "Couldn't create new class 'AmbientSound'";
4657     throw SquirrelError(v, msg.str());
4658   }
4659   sq_pushstring(v, "set_pos", -1);
4660   sq_newclosure(v, &AmbientSound_set_pos_wrapper, 0);
4661   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4662   if(SQ_FAILED(sq_createslot(v, -3))) {
4663     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4664   }
4665
4666   sq_pushstring(v, "get_pos_x", -1);
4667   sq_newclosure(v, &AmbientSound_get_pos_x_wrapper, 0);
4668   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4669   if(SQ_FAILED(sq_createslot(v, -3))) {
4670     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4671   }
4672
4673   sq_pushstring(v, "get_pos_y", -1);
4674   sq_newclosure(v, &AmbientSound_get_pos_y_wrapper, 0);
4675   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4676   if(SQ_FAILED(sq_createslot(v, -3))) {
4677     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4678   }
4679
4680   if(SQ_FAILED(sq_createslot(v, -3))) {
4681     throw SquirrelError(v, "Couldn't register class 'AmbientSound'");
4682   }
4683
4684   // Register class Camera
4685   sq_pushstring(v, "Camera", -1);
4686   if(sq_newclass(v, SQFalse) < 0) {
4687     std::ostringstream msg;
4688     msg << "Couldn't create new class 'Camera'";
4689     throw SquirrelError(v, msg.str());
4690   }
4691   sq_pushstring(v, "reload_config", -1);
4692   sq_newclosure(v, &Camera_reload_config_wrapper, 0);
4693   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4694   if(SQ_FAILED(sq_createslot(v, -3))) {
4695     throw SquirrelError(v, "Couldn't register function 'reload_config'");
4696   }
4697
4698   sq_pushstring(v, "shake", -1);
4699   sq_newclosure(v, &Camera_shake_wrapper, 0);
4700   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4701   if(SQ_FAILED(sq_createslot(v, -3))) {
4702     throw SquirrelError(v, "Couldn't register function 'shake'");
4703   }
4704
4705   sq_pushstring(v, "set_pos", -1);
4706   sq_newclosure(v, &Camera_set_pos_wrapper, 0);
4707   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4708   if(SQ_FAILED(sq_createslot(v, -3))) {
4709     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4710   }
4711
4712   sq_pushstring(v, "set_mode", -1);
4713   sq_newclosure(v, &Camera_set_mode_wrapper, 0);
4714   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4715   if(SQ_FAILED(sq_createslot(v, -3))) {
4716     throw SquirrelError(v, "Couldn't register function 'set_mode'");
4717   }
4718
4719   sq_pushstring(v, "scroll_to", -1);
4720   sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
4721   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4722   if(SQ_FAILED(sq_createslot(v, -3))) {
4723     throw SquirrelError(v, "Couldn't register function 'scroll_to'");
4724   }
4725
4726   if(SQ_FAILED(sq_createslot(v, -3))) {
4727     throw SquirrelError(v, "Couldn't register class 'Camera'");
4728   }
4729
4730   // Register class Candle
4731   sq_pushstring(v, "Candle", -1);
4732   if(sq_newclass(v, SQFalse) < 0) {
4733     std::ostringstream msg;
4734     msg << "Couldn't create new class 'Candle'";
4735     throw SquirrelError(v, msg.str());
4736   }
4737   sq_pushstring(v, "get_burning", -1);
4738   sq_newclosure(v, &Candle_get_burning_wrapper, 0);
4739   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4740   if(SQ_FAILED(sq_createslot(v, -3))) {
4741     throw SquirrelError(v, "Couldn't register function 'get_burning'");
4742   }
4743
4744   sq_pushstring(v, "set_burning", -1);
4745   sq_newclosure(v, &Candle_set_burning_wrapper, 0);
4746   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4747   if(SQ_FAILED(sq_createslot(v, -3))) {
4748     throw SquirrelError(v, "Couldn't register function 'set_burning'");
4749   }
4750
4751   if(SQ_FAILED(sq_createslot(v, -3))) {
4752     throw SquirrelError(v, "Couldn't register class 'Candle'");
4753   }
4754
4755   // Register class DisplayEffect
4756   sq_pushstring(v, "DisplayEffect", -1);
4757   if(sq_newclass(v, SQFalse) < 0) {
4758     std::ostringstream msg;
4759     msg << "Couldn't create new class 'DisplayEffect'";
4760     throw SquirrelError(v, msg.str());
4761   }
4762   sq_pushstring(v, "fade_out", -1);
4763   sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
4764   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4765   if(SQ_FAILED(sq_createslot(v, -3))) {
4766     throw SquirrelError(v, "Couldn't register function 'fade_out'");
4767   }
4768
4769   sq_pushstring(v, "fade_in", -1);
4770   sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
4771   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4772   if(SQ_FAILED(sq_createslot(v, -3))) {
4773     throw SquirrelError(v, "Couldn't register function 'fade_in'");
4774   }
4775
4776   sq_pushstring(v, "set_black", -1);
4777   sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
4778   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4779   if(SQ_FAILED(sq_createslot(v, -3))) {
4780     throw SquirrelError(v, "Couldn't register function 'set_black'");
4781   }
4782
4783   sq_pushstring(v, "is_black", -1);
4784   sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
4785   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4786   if(SQ_FAILED(sq_createslot(v, -3))) {
4787     throw SquirrelError(v, "Couldn't register function 'is_black'");
4788   }
4789
4790   sq_pushstring(v, "sixteen_to_nine", -1);
4791   sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
4792   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4793   if(SQ_FAILED(sq_createslot(v, -3))) {
4794     throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
4795   }
4796
4797   sq_pushstring(v, "four_to_three", -1);
4798   sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
4799   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4800   if(SQ_FAILED(sq_createslot(v, -3))) {
4801     throw SquirrelError(v, "Couldn't register function 'four_to_three'");
4802   }
4803
4804   if(SQ_FAILED(sq_createslot(v, -3))) {
4805     throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
4806   }
4807
4808   // Register class FloatingImage
4809   sq_pushstring(v, "FloatingImage", -1);
4810   if(sq_newclass(v, SQFalse) < 0) {
4811     std::ostringstream msg;
4812     msg << "Couldn't create new class 'FloatingImage'";
4813     throw SquirrelError(v, msg.str());
4814   }
4815   sq_pushstring(v, "constructor", -1);
4816   sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
4817   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4818   if(SQ_FAILED(sq_createslot(v, -3))) {
4819     throw SquirrelError(v, "Couldn't register function 'constructor'");
4820   }
4821
4822   sq_pushstring(v, "set_layer", -1);
4823   sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
4824   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4825   if(SQ_FAILED(sq_createslot(v, -3))) {
4826     throw SquirrelError(v, "Couldn't register function 'set_layer'");
4827   }
4828
4829   sq_pushstring(v, "get_layer", -1);
4830   sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
4831   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4832   if(SQ_FAILED(sq_createslot(v, -3))) {
4833     throw SquirrelError(v, "Couldn't register function 'get_layer'");
4834   }
4835
4836   sq_pushstring(v, "set_pos", -1);
4837   sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
4838   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4839   if(SQ_FAILED(sq_createslot(v, -3))) {
4840     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4841   }
4842
4843   sq_pushstring(v, "get_pos_x", -1);
4844   sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
4845   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4846   if(SQ_FAILED(sq_createslot(v, -3))) {
4847     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4848   }
4849
4850   sq_pushstring(v, "get_pos_y", -1);
4851   sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
4852   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4853   if(SQ_FAILED(sq_createslot(v, -3))) {
4854     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4855   }
4856
4857   sq_pushstring(v, "set_anchor_point", -1);
4858   sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
4859   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4860   if(SQ_FAILED(sq_createslot(v, -3))) {
4861     throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
4862   }
4863
4864   sq_pushstring(v, "get_anchor_point", -1);
4865   sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
4866   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4867   if(SQ_FAILED(sq_createslot(v, -3))) {
4868     throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
4869   }
4870
4871   sq_pushstring(v, "set_visible", -1);
4872   sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
4873   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4874   if(SQ_FAILED(sq_createslot(v, -3))) {
4875     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4876   }
4877
4878   sq_pushstring(v, "get_visible", -1);
4879   sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
4880   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4881   if(SQ_FAILED(sq_createslot(v, -3))) {
4882     throw SquirrelError(v, "Couldn't register function 'get_visible'");
4883   }
4884
4885   sq_pushstring(v, "set_action", -1);
4886   sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
4887   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4888   if(SQ_FAILED(sq_createslot(v, -3))) {
4889     throw SquirrelError(v, "Couldn't register function 'set_action'");
4890   }
4891
4892   sq_pushstring(v, "get_action", -1);
4893   sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
4894   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4895   if(SQ_FAILED(sq_createslot(v, -3))) {
4896     throw SquirrelError(v, "Couldn't register function 'get_action'");
4897   }
4898
4899   sq_pushstring(v, "fade_in", -1);
4900   sq_newclosure(v, &FloatingImage_fade_in_wrapper, 0);
4901   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4902   if(SQ_FAILED(sq_createslot(v, -3))) {
4903     throw SquirrelError(v, "Couldn't register function 'fade_in'");
4904   }
4905
4906   sq_pushstring(v, "fade_out", -1);
4907   sq_newclosure(v, &FloatingImage_fade_out_wrapper, 0);
4908   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4909   if(SQ_FAILED(sq_createslot(v, -3))) {
4910     throw SquirrelError(v, "Couldn't register function 'fade_out'");
4911   }
4912
4913   if(SQ_FAILED(sq_createslot(v, -3))) {
4914     throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
4915   }
4916
4917   // Register class LevelTime
4918   sq_pushstring(v, "LevelTime", -1);
4919   if(sq_newclass(v, SQFalse) < 0) {
4920     std::ostringstream msg;
4921     msg << "Couldn't create new class 'LevelTime'";
4922     throw SquirrelError(v, msg.str());
4923   }
4924   sq_pushstring(v, "start", -1);
4925   sq_newclosure(v, &LevelTime_start_wrapper, 0);
4926   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4927   if(SQ_FAILED(sq_createslot(v, -3))) {
4928     throw SquirrelError(v, "Couldn't register function 'start'");
4929   }
4930
4931   sq_pushstring(v, "stop", -1);
4932   sq_newclosure(v, &LevelTime_stop_wrapper, 0);
4933   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4934   if(SQ_FAILED(sq_createslot(v, -3))) {
4935     throw SquirrelError(v, "Couldn't register function 'stop'");
4936   }
4937
4938   sq_pushstring(v, "get_time", -1);
4939   sq_newclosure(v, &LevelTime_get_time_wrapper, 0);
4940   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4941   if(SQ_FAILED(sq_createslot(v, -3))) {
4942     throw SquirrelError(v, "Couldn't register function 'get_time'");
4943   }
4944
4945   sq_pushstring(v, "set_time", -1);
4946   sq_newclosure(v, &LevelTime_set_time_wrapper, 0);
4947   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4948   if(SQ_FAILED(sq_createslot(v, -3))) {
4949     throw SquirrelError(v, "Couldn't register function 'set_time'");
4950   }
4951
4952   if(SQ_FAILED(sq_createslot(v, -3))) {
4953     throw SquirrelError(v, "Couldn't register class 'LevelTime'");
4954   }
4955
4956   // Register class Platform
4957   sq_pushstring(v, "Platform", -1);
4958   if(sq_newclass(v, SQFalse) < 0) {
4959     std::ostringstream msg;
4960     msg << "Couldn't create new class 'Platform'";
4961     throw SquirrelError(v, msg.str());
4962   }
4963   sq_pushstring(v, "goto_node", -1);
4964   sq_newclosure(v, &Platform_goto_node_wrapper, 0);
4965   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4966   if(SQ_FAILED(sq_createslot(v, -3))) {
4967     throw SquirrelError(v, "Couldn't register function 'goto_node'");
4968   }
4969
4970   sq_pushstring(v, "start_moving", -1);
4971   sq_newclosure(v, &Platform_start_moving_wrapper, 0);
4972   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4973   if(SQ_FAILED(sq_createslot(v, -3))) {
4974     throw SquirrelError(v, "Couldn't register function 'start_moving'");
4975   }
4976
4977   sq_pushstring(v, "stop_moving", -1);
4978   sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
4979   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4980   if(SQ_FAILED(sq_createslot(v, -3))) {
4981     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
4982   }
4983
4984   if(SQ_FAILED(sq_createslot(v, -3))) {
4985     throw SquirrelError(v, "Couldn't register class 'Platform'");
4986   }
4987
4988   // Register class Player
4989   sq_pushstring(v, "Player", -1);
4990   if(sq_newclass(v, SQFalse) < 0) {
4991     std::ostringstream msg;
4992     msg << "Couldn't create new class 'Player'";
4993     throw SquirrelError(v, msg.str());
4994   }
4995   sq_pushstring(v, "add_bonus", -1);
4996   sq_newclosure(v, &Player_add_bonus_wrapper, 0);
4997   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4998   if(SQ_FAILED(sq_createslot(v, -3))) {
4999     throw SquirrelError(v, "Couldn't register function 'add_bonus'");
5000   }
5001
5002   sq_pushstring(v, "add_coins", -1);
5003   sq_newclosure(v, &Player_add_coins_wrapper, 0);
5004   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5005   if(SQ_FAILED(sq_createslot(v, -3))) {
5006     throw SquirrelError(v, "Couldn't register function 'add_coins'");
5007   }
5008
5009   sq_pushstring(v, "make_invincible", -1);
5010   sq_newclosure(v, &Player_make_invincible_wrapper, 0);
5011   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5012   if(SQ_FAILED(sq_createslot(v, -3))) {
5013     throw SquirrelError(v, "Couldn't register function 'make_invincible'");
5014   }
5015
5016   sq_pushstring(v, "deactivate", -1);
5017   sq_newclosure(v, &Player_deactivate_wrapper, 0);
5018   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5019   if(SQ_FAILED(sq_createslot(v, -3))) {
5020     throw SquirrelError(v, "Couldn't register function 'deactivate'");
5021   }
5022
5023   sq_pushstring(v, "activate", -1);
5024   sq_newclosure(v, &Player_activate_wrapper, 0);
5025   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5026   if(SQ_FAILED(sq_createslot(v, -3))) {
5027     throw SquirrelError(v, "Couldn't register function 'activate'");
5028   }
5029
5030   sq_pushstring(v, "walk", -1);
5031   sq_newclosure(v, &Player_walk_wrapper, 0);
5032   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5033   if(SQ_FAILED(sq_createslot(v, -3))) {
5034     throw SquirrelError(v, "Couldn't register function 'walk'");
5035   }
5036
5037   sq_pushstring(v, "set_visible", -1);
5038   sq_newclosure(v, &Player_set_visible_wrapper, 0);
5039   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5040   if(SQ_FAILED(sq_createslot(v, -3))) {
5041     throw SquirrelError(v, "Couldn't register function 'set_visible'");
5042   }
5043
5044   sq_pushstring(v, "get_visible", -1);
5045   sq_newclosure(v, &Player_get_visible_wrapper, 0);
5046   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5047   if(SQ_FAILED(sq_createslot(v, -3))) {
5048     throw SquirrelError(v, "Couldn't register function 'get_visible'");
5049   }
5050
5051   sq_pushstring(v, "kill", -1);
5052   sq_newclosure(v, &Player_kill_wrapper, 0);
5053   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5054   if(SQ_FAILED(sq_createslot(v, -3))) {
5055     throw SquirrelError(v, "Couldn't register function 'kill'");
5056   }
5057
5058   sq_pushstring(v, "set_ghost_mode", -1);
5059   sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
5060   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5061   if(SQ_FAILED(sq_createslot(v, -3))) {
5062     throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
5063   }
5064
5065   sq_pushstring(v, "get_ghost_mode", -1);
5066   sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
5067   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5068   if(SQ_FAILED(sq_createslot(v, -3))) {
5069     throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
5070   }
5071
5072   sq_pushstring(v, "do_cheer", -1);
5073   sq_newclosure(v, &Player_do_cheer_wrapper, 0);
5074   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5075   if(SQ_FAILED(sq_createslot(v, -3))) {
5076     throw SquirrelError(v, "Couldn't register function 'do_cheer'");
5077   }
5078
5079   sq_pushstring(v, "do_duck", -1);
5080   sq_newclosure(v, &Player_do_duck_wrapper, 0);
5081   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5082   if(SQ_FAILED(sq_createslot(v, -3))) {
5083     throw SquirrelError(v, "Couldn't register function 'do_duck'");
5084   }
5085
5086   sq_pushstring(v, "do_standup", -1);
5087   sq_newclosure(v, &Player_do_standup_wrapper, 0);
5088   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5089   if(SQ_FAILED(sq_createslot(v, -3))) {
5090     throw SquirrelError(v, "Couldn't register function 'do_standup'");
5091   }
5092
5093   sq_pushstring(v, "do_backflip", -1);
5094   sq_newclosure(v, &Player_do_backflip_wrapper, 0);
5095   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5096   if(SQ_FAILED(sq_createslot(v, -3))) {
5097     throw SquirrelError(v, "Couldn't register function 'do_backflip'");
5098   }
5099
5100   sq_pushstring(v, "do_jump", -1);
5101   sq_newclosure(v, &Player_do_jump_wrapper, 0);
5102   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5103   if(SQ_FAILED(sq_createslot(v, -3))) {
5104     throw SquirrelError(v, "Couldn't register function 'do_jump'");
5105   }
5106
5107   sq_pushstring(v, "trigger_sequence", -1);
5108   sq_newclosure(v, &Player_trigger_sequence_wrapper, 0);
5109   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5110   if(SQ_FAILED(sq_createslot(v, -3))) {
5111     throw SquirrelError(v, "Couldn't register function 'trigger_sequence'");
5112   }
5113
5114   sq_pushstring(v, "use_scripting_controller", -1);
5115   sq_newclosure(v, &Player_use_scripting_controller_wrapper, 0);
5116   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5117   if(SQ_FAILED(sq_createslot(v, -3))) {
5118     throw SquirrelError(v, "Couldn't register function 'use_scripting_controller'");
5119   }
5120
5121   sq_pushstring(v, "do_scripting_controller", -1);
5122   sq_newclosure(v, &Player_do_scripting_controller_wrapper, 0);
5123   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tsb");
5124   if(SQ_FAILED(sq_createslot(v, -3))) {
5125     throw SquirrelError(v, "Couldn't register function 'do_scripting_controller'");
5126   }
5127
5128   if(SQ_FAILED(sq_createslot(v, -3))) {
5129     throw SquirrelError(v, "Couldn't register class 'Player'");
5130   }
5131
5132   // Register class ScriptedObject
5133   sq_pushstring(v, "ScriptedObject", -1);
5134   if(sq_newclass(v, SQFalse) < 0) {
5135     std::ostringstream msg;
5136     msg << "Couldn't create new class 'ScriptedObject'";
5137     throw SquirrelError(v, msg.str());
5138   }
5139   sq_pushstring(v, "set_action", -1);
5140   sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
5141   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5142   if(SQ_FAILED(sq_createslot(v, -3))) {
5143     throw SquirrelError(v, "Couldn't register function 'set_action'");
5144   }
5145
5146   sq_pushstring(v, "get_action", -1);
5147   sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
5148   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5149   if(SQ_FAILED(sq_createslot(v, -3))) {
5150     throw SquirrelError(v, "Couldn't register function 'get_action'");
5151   }
5152
5153   sq_pushstring(v, "move", -1);
5154   sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
5155   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5156   if(SQ_FAILED(sq_createslot(v, -3))) {
5157     throw SquirrelError(v, "Couldn't register function 'move'");
5158   }
5159
5160   sq_pushstring(v, "set_pos", -1);
5161   sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
5162   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5163   if(SQ_FAILED(sq_createslot(v, -3))) {
5164     throw SquirrelError(v, "Couldn't register function 'set_pos'");
5165   }
5166
5167   sq_pushstring(v, "get_pos_x", -1);
5168   sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
5169   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5170   if(SQ_FAILED(sq_createslot(v, -3))) {
5171     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
5172   }
5173
5174   sq_pushstring(v, "get_pos_y", -1);
5175   sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
5176   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5177   if(SQ_FAILED(sq_createslot(v, -3))) {
5178     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
5179   }
5180
5181   sq_pushstring(v, "set_velocity", -1);
5182   sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
5183   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5184   if(SQ_FAILED(sq_createslot(v, -3))) {
5185     throw SquirrelError(v, "Couldn't register function 'set_velocity'");
5186   }
5187
5188   sq_pushstring(v, "get_velocity_x", -1);
5189   sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
5190   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5191   if(SQ_FAILED(sq_createslot(v, -3))) {
5192     throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
5193   }
5194
5195   sq_pushstring(v, "get_velocity_y", -1);
5196   sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
5197   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5198   if(SQ_FAILED(sq_createslot(v, -3))) {
5199     throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
5200   }
5201
5202   sq_pushstring(v, "enable_gravity", -1);
5203   sq_newclosure(v, &ScriptedObject_enable_gravity_wrapper, 0);
5204   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5205   if(SQ_FAILED(sq_createslot(v, -3))) {
5206     throw SquirrelError(v, "Couldn't register function 'enable_gravity'");
5207   }
5208
5209   sq_pushstring(v, "gravity_enabled", -1);
5210   sq_newclosure(v, &ScriptedObject_gravity_enabled_wrapper, 0);
5211   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5212   if(SQ_FAILED(sq_createslot(v, -3))) {
5213     throw SquirrelError(v, "Couldn't register function 'gravity_enabled'");
5214   }
5215
5216   sq_pushstring(v, "set_visible", -1);
5217   sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
5218   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5219   if(SQ_FAILED(sq_createslot(v, -3))) {
5220     throw SquirrelError(v, "Couldn't register function 'set_visible'");
5221   }
5222
5223   sq_pushstring(v, "is_visible", -1);
5224   sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
5225   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5226   if(SQ_FAILED(sq_createslot(v, -3))) {
5227     throw SquirrelError(v, "Couldn't register function 'is_visible'");
5228   }
5229
5230   sq_pushstring(v, "set_solid", -1);
5231   sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
5232   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5233   if(SQ_FAILED(sq_createslot(v, -3))) {
5234     throw SquirrelError(v, "Couldn't register function 'set_solid'");
5235   }
5236
5237   sq_pushstring(v, "is_solid", -1);
5238   sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
5239   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5240   if(SQ_FAILED(sq_createslot(v, -3))) {
5241     throw SquirrelError(v, "Couldn't register function 'is_solid'");
5242   }
5243
5244   sq_pushstring(v, "get_name", -1);
5245   sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
5246   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5247   if(SQ_FAILED(sq_createslot(v, -3))) {
5248     throw SquirrelError(v, "Couldn't register function 'get_name'");
5249   }
5250
5251   if(SQ_FAILED(sq_createslot(v, -3))) {
5252     throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
5253   }
5254
5255   // Register class SSector
5256   sq_pushstring(v, "SSector", -1);
5257   if(sq_newclass(v, SQFalse) < 0) {
5258     std::ostringstream msg;
5259     msg << "Couldn't create new class 'SSector'";
5260     throw SquirrelError(v, msg.str());
5261   }
5262   sq_pushstring(v, "set_ambient_light", -1);
5263   sq_newclosure(v, &SSector_set_ambient_light_wrapper, 0);
5264   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
5265   if(SQ_FAILED(sq_createslot(v, -3))) {
5266     throw SquirrelError(v, "Couldn't register function 'set_ambient_light'");
5267   }
5268
5269   sq_pushstring(v, "get_ambient_red", -1);
5270   sq_newclosure(v, &SSector_get_ambient_red_wrapper, 0);
5271   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5272   if(SQ_FAILED(sq_createslot(v, -3))) {
5273     throw SquirrelError(v, "Couldn't register function 'get_ambient_red'");
5274   }
5275
5276   sq_pushstring(v, "get_ambient_green", -1);
5277   sq_newclosure(v, &SSector_get_ambient_green_wrapper, 0);
5278   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5279   if(SQ_FAILED(sq_createslot(v, -3))) {
5280     throw SquirrelError(v, "Couldn't register function 'get_ambient_green'");
5281   }
5282
5283   sq_pushstring(v, "get_ambient_blue", -1);
5284   sq_newclosure(v, &SSector_get_ambient_blue_wrapper, 0);
5285   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5286   if(SQ_FAILED(sq_createslot(v, -3))) {
5287     throw SquirrelError(v, "Couldn't register function 'get_ambient_blue'");
5288   }
5289
5290   sq_pushstring(v, "set_gravity", -1);
5291   sq_newclosure(v, &SSector_set_gravity_wrapper, 0);
5292   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5293   if(SQ_FAILED(sq_createslot(v, -3))) {
5294     throw SquirrelError(v, "Couldn't register function 'set_gravity'");
5295   }
5296
5297   if(SQ_FAILED(sq_createslot(v, -3))) {
5298     throw SquirrelError(v, "Couldn't register class 'SSector'");
5299   }
5300
5301   // Register class Text
5302   sq_pushstring(v, "Text", -1);
5303   if(sq_newclass(v, SQFalse) < 0) {
5304     std::ostringstream msg;
5305     msg << "Couldn't create new class 'Text'";
5306     throw SquirrelError(v, msg.str());
5307   }
5308   sq_pushstring(v, "set_text", -1);
5309   sq_newclosure(v, &Text_set_text_wrapper, 0);
5310   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5311   if(SQ_FAILED(sq_createslot(v, -3))) {
5312     throw SquirrelError(v, "Couldn't register function 'set_text'");
5313   }
5314
5315   sq_pushstring(v, "set_font", -1);
5316   sq_newclosure(v, &Text_set_font_wrapper, 0);
5317   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5318   if(SQ_FAILED(sq_createslot(v, -3))) {
5319     throw SquirrelError(v, "Couldn't register function 'set_font'");
5320   }
5321
5322   sq_pushstring(v, "fade_in", -1);
5323   sq_newclosure(v, &Text_fade_in_wrapper, 0);
5324   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5325   if(SQ_FAILED(sq_createslot(v, -3))) {
5326     throw SquirrelError(v, "Couldn't register function 'fade_in'");
5327   }
5328
5329   sq_pushstring(v, "fade_out", -1);
5330   sq_newclosure(v, &Text_fade_out_wrapper, 0);
5331   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5332   if(SQ_FAILED(sq_createslot(v, -3))) {
5333     throw SquirrelError(v, "Couldn't register function 'fade_out'");
5334   }
5335
5336   sq_pushstring(v, "set_visible", -1);
5337   sq_newclosure(v, &Text_set_visible_wrapper, 0);
5338   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5339   if(SQ_FAILED(sq_createslot(v, -3))) {
5340     throw SquirrelError(v, "Couldn't register function 'set_visible'");
5341   }
5342
5343   sq_pushstring(v, "set_centered", -1);
5344   sq_newclosure(v, &Text_set_centered_wrapper, 0);
5345   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5346   if(SQ_FAILED(sq_createslot(v, -3))) {
5347     throw SquirrelError(v, "Couldn't register function 'set_centered'");
5348   }
5349
5350   sq_pushstring(v, "set_pos", -1);
5351   sq_newclosure(v, &Text_set_pos_wrapper, 0);
5352   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5353   if(SQ_FAILED(sq_createslot(v, -3))) {
5354     throw SquirrelError(v, "Couldn't register function 'set_pos'");
5355   }
5356
5357   sq_pushstring(v, "get_pos_x", -1);
5358   sq_newclosure(v, &Text_get_pos_x_wrapper, 0);
5359   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5360   if(SQ_FAILED(sq_createslot(v, -3))) {
5361     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
5362   }
5363
5364   sq_pushstring(v, "get_pos_y", -1);
5365   sq_newclosure(v, &Text_get_pos_y_wrapper, 0);
5366   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5367   if(SQ_FAILED(sq_createslot(v, -3))) {
5368     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
5369   }
5370
5371   sq_pushstring(v, "set_anchor_point", -1);
5372   sq_newclosure(v, &Text_set_anchor_point_wrapper, 0);
5373   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5374   if(SQ_FAILED(sq_createslot(v, -3))) {
5375     throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
5376   }
5377
5378   sq_pushstring(v, "get_anchor_point", -1);
5379   sq_newclosure(v, &Text_get_anchor_point_wrapper, 0);
5380   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5381   if(SQ_FAILED(sq_createslot(v, -3))) {
5382     throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
5383   }
5384
5385   if(SQ_FAILED(sq_createslot(v, -3))) {
5386     throw SquirrelError(v, "Couldn't register class 'Text'");
5387   }
5388
5389   // Register class Thunderstorm
5390   sq_pushstring(v, "Thunderstorm", -1);
5391   if(sq_newclass(v, SQFalse) < 0) {
5392     std::ostringstream msg;
5393     msg << "Couldn't create new class 'Thunderstorm'";
5394     throw SquirrelError(v, msg.str());
5395   }
5396   sq_pushstring(v, "start", -1);
5397   sq_newclosure(v, &Thunderstorm_start_wrapper, 0);
5398   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5399   if(SQ_FAILED(sq_createslot(v, -3))) {
5400     throw SquirrelError(v, "Couldn't register function 'start'");
5401   }
5402
5403   sq_pushstring(v, "stop", -1);
5404   sq_newclosure(v, &Thunderstorm_stop_wrapper, 0);
5405   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5406   if(SQ_FAILED(sq_createslot(v, -3))) {
5407     throw SquirrelError(v, "Couldn't register function 'stop'");
5408   }
5409
5410   sq_pushstring(v, "thunder", -1);
5411   sq_newclosure(v, &Thunderstorm_thunder_wrapper, 0);
5412   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5413   if(SQ_FAILED(sq_createslot(v, -3))) {
5414     throw SquirrelError(v, "Couldn't register function 'thunder'");
5415   }
5416
5417   sq_pushstring(v, "lightning", -1);
5418   sq_newclosure(v, &Thunderstorm_lightning_wrapper, 0);
5419   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5420   if(SQ_FAILED(sq_createslot(v, -3))) {
5421     throw SquirrelError(v, "Couldn't register function 'lightning'");
5422   }
5423
5424   sq_pushstring(v, "flash", -1);
5425   sq_newclosure(v, &Thunderstorm_flash_wrapper, 0);
5426   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5427   if(SQ_FAILED(sq_createslot(v, -3))) {
5428     throw SquirrelError(v, "Couldn't register function 'flash'");
5429   }
5430
5431   sq_pushstring(v, "electrify", -1);
5432   sq_newclosure(v, &Thunderstorm_electrify_wrapper, 0);
5433   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5434   if(SQ_FAILED(sq_createslot(v, -3))) {
5435     throw SquirrelError(v, "Couldn't register function 'electrify'");
5436   }
5437
5438   if(SQ_FAILED(sq_createslot(v, -3))) {
5439     throw SquirrelError(v, "Couldn't register class 'Thunderstorm'");
5440   }
5441
5442   // Register class TileMap
5443   sq_pushstring(v, "TileMap", -1);
5444   if(sq_newclass(v, SQFalse) < 0) {
5445     std::ostringstream msg;
5446     msg << "Couldn't create new class 'TileMap'";
5447     throw SquirrelError(v, msg.str());
5448   }
5449   sq_pushstring(v, "goto_node", -1);
5450   sq_newclosure(v, &TileMap_goto_node_wrapper, 0);
5451   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5452   if(SQ_FAILED(sq_createslot(v, -3))) {
5453     throw SquirrelError(v, "Couldn't register function 'goto_node'");
5454   }
5455
5456   sq_pushstring(v, "start_moving", -1);
5457   sq_newclosure(v, &TileMap_start_moving_wrapper, 0);
5458   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5459   if(SQ_FAILED(sq_createslot(v, -3))) {
5460     throw SquirrelError(v, "Couldn't register function 'start_moving'");
5461   }
5462
5463   sq_pushstring(v, "stop_moving", -1);
5464   sq_newclosure(v, &TileMap_stop_moving_wrapper, 0);
5465   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5466   if(SQ_FAILED(sq_createslot(v, -3))) {
5467     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5468   }
5469
5470   sq_pushstring(v, "fade", -1);
5471   sq_newclosure(v, &TileMap_fade_wrapper, 0);
5472   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5473   if(SQ_FAILED(sq_createslot(v, -3))) {
5474     throw SquirrelError(v, "Couldn't register function 'fade'");
5475   }
5476
5477   sq_pushstring(v, "set_alpha", -1);
5478   sq_newclosure(v, &TileMap_set_alpha_wrapper, 0);
5479   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5480   if(SQ_FAILED(sq_createslot(v, -3))) {
5481     throw SquirrelError(v, "Couldn't register function 'set_alpha'");
5482   }
5483
5484   sq_pushstring(v, "get_alpha", -1);
5485   sq_newclosure(v, &TileMap_get_alpha_wrapper, 0);
5486   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5487   if(SQ_FAILED(sq_createslot(v, -3))) {
5488     throw SquirrelError(v, "Couldn't register function 'get_alpha'");
5489   }
5490
5491   if(SQ_FAILED(sq_createslot(v, -3))) {
5492     throw SquirrelError(v, "Couldn't register class 'TileMap'");
5493   }
5494
5495   // Register class WillOWisp
5496   sq_pushstring(v, "WillOWisp", -1);
5497   if(sq_newclass(v, SQFalse) < 0) {
5498     std::ostringstream msg;
5499     msg << "Couldn't create new class 'WillOWisp'";
5500     throw SquirrelError(v, msg.str());
5501   }
5502   sq_pushstring(v, "goto_node", -1);
5503   sq_newclosure(v, &WillOWisp_goto_node_wrapper, 0);
5504   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5505   if(SQ_FAILED(sq_createslot(v, -3))) {
5506     throw SquirrelError(v, "Couldn't register function 'goto_node'");
5507   }
5508
5509   sq_pushstring(v, "set_state", -1);
5510   sq_newclosure(v, &WillOWisp_set_state_wrapper, 0);
5511   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5512   if(SQ_FAILED(sq_createslot(v, -3))) {
5513     throw SquirrelError(v, "Couldn't register function 'set_state'");
5514   }
5515
5516   sq_pushstring(v, "start_moving", -1);
5517   sq_newclosure(v, &WillOWisp_start_moving_wrapper, 0);
5518   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5519   if(SQ_FAILED(sq_createslot(v, -3))) {
5520     throw SquirrelError(v, "Couldn't register function 'start_moving'");
5521   }
5522
5523   sq_pushstring(v, "stop_moving", -1);
5524   sq_newclosure(v, &WillOWisp_stop_moving_wrapper, 0);
5525   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5526   if(SQ_FAILED(sq_createslot(v, -3))) {
5527     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5528   }
5529
5530   if(SQ_FAILED(sq_createslot(v, -3))) {
5531     throw SquirrelError(v, "Couldn't register class 'WillOWisp'");
5532   }
5533
5534   // Register class Wind
5535   sq_pushstring(v, "Wind", -1);
5536   if(sq_newclass(v, SQFalse) < 0) {
5537     std::ostringstream msg;
5538     msg << "Couldn't create new class 'Wind'";
5539     throw SquirrelError(v, msg.str());
5540   }
5541   sq_pushstring(v, "start", -1);
5542   sq_newclosure(v, &Wind_start_wrapper, 0);
5543   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5544   if(SQ_FAILED(sq_createslot(v, -3))) {
5545     throw SquirrelError(v, "Couldn't register function 'start'");
5546   }
5547
5548   sq_pushstring(v, "stop", -1);
5549   sq_newclosure(v, &Wind_stop_wrapper, 0);
5550   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5551   if(SQ_FAILED(sq_createslot(v, -3))) {
5552     throw SquirrelError(v, "Couldn't register function 'stop'");
5553   }
5554
5555   if(SQ_FAILED(sq_createslot(v, -3))) {
5556     throw SquirrelError(v, "Couldn't register class 'Wind'");
5557   }
5558
5559 }
5560
5561 } // namespace scripting
5562
5563 /* EOF */