X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fscripting%2Fwrapper.cpp;h=7f5aa4b12e309dd7ffbe8977d9503b842f336000;hb=c81b842f4880cd7b4958e03e983e50bff95d02ef;hp=65e0ce4b51c694607316a141a76d8727f5b8a5e4;hpb=08813a74da6ac1fd045a105e4e8105f1d7f716f0;p=supertux.git diff --git a/src/scripting/wrapper.cpp b/src/scripting/wrapper.cpp index 65e0ce4b5..7f5aa4b12 100644 --- a/src/scripting/wrapper.cpp +++ b/src/scripting/wrapper.cpp @@ -9,12 +9,12 @@ #include "scripting/squirrel_error.hpp" #include "scripting/wrapper.interface.hpp" -namespace Scripting { -namespace Wrapper { +namespace scripting { +namespace wrapper { static SQInteger AmbientSound_release_hook(SQUserPointer ptr, SQInteger ) { - Scripting::AmbientSound* _this = reinterpret_cast (ptr); + scripting::AmbientSound* _this = reinterpret_cast (ptr); delete _this; return 0; } @@ -26,7 +26,7 @@ static SQInteger AmbientSound_set_pos_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_pos' called without instance")); return SQ_ERROR; } - Scripting::AmbientSound* _this = reinterpret_cast (data); + scripting::AmbientSound* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -60,7 +60,7 @@ static SQInteger AmbientSound_get_pos_x_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_pos_x' called without instance")); return SQ_ERROR; } - Scripting::AmbientSound* _this = reinterpret_cast (data); + scripting::AmbientSound* _this = reinterpret_cast (data); try { float return_value = _this->get_pos_x(); @@ -85,7 +85,7 @@ static SQInteger AmbientSound_get_pos_y_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_pos_y' called without instance")); return SQ_ERROR; } - Scripting::AmbientSound* _this = reinterpret_cast (data); + scripting::AmbientSound* _this = reinterpret_cast (data); try { float return_value = _this->get_pos_y(); @@ -105,7 +105,7 @@ static SQInteger AmbientSound_get_pos_y_wrapper(HSQUIRRELVM vm) static SQInteger Camera_release_hook(SQUserPointer ptr, SQInteger ) { - Scripting::Camera* _this = reinterpret_cast (ptr); + scripting::Camera* _this = reinterpret_cast (ptr); delete _this; return 0; } @@ -117,7 +117,7 @@ static SQInteger Camera_reload_config_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'reload_config' called without instance")); return SQ_ERROR; } - Scripting::Camera* _this = reinterpret_cast (data); + scripting::Camera* _this = reinterpret_cast (data); try { _this->reload_config(); @@ -141,7 +141,7 @@ static SQInteger Camera_shake_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'shake' called without instance")); return SQ_ERROR; } - Scripting::Camera* _this = reinterpret_cast (data); + scripting::Camera* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -180,7 +180,7 @@ static SQInteger Camera_set_pos_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_pos' called without instance")); return SQ_ERROR; } - Scripting::Camera* _this = reinterpret_cast (data); + scripting::Camera* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -214,7 +214,7 @@ static SQInteger Camera_set_mode_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_mode' called without instance")); return SQ_ERROR; } - Scripting::Camera* _this = reinterpret_cast (data); + scripting::Camera* _this = reinterpret_cast (data); const SQChar* arg0; if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a string")); @@ -243,7 +243,7 @@ static SQInteger Camera_scroll_to_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'scroll_to' called without instance")); return SQ_ERROR; } - Scripting::Camera* _this = reinterpret_cast (data); + scripting::Camera* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -277,7 +277,7 @@ static SQInteger Camera_scroll_to_wrapper(HSQUIRRELVM vm) static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger ) { - Scripting::Candle* _this = reinterpret_cast (ptr); + scripting::Candle* _this = reinterpret_cast (ptr); delete _this; return 0; } @@ -289,7 +289,7 @@ static SQInteger Candle_get_burning_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_burning' called without instance")); return SQ_ERROR; } - Scripting::Candle* _this = reinterpret_cast (data); + scripting::Candle* _this = reinterpret_cast (data); try { bool return_value = _this->get_burning(); @@ -314,7 +314,7 @@ static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_burning' called without instance")); return SQ_ERROR; } - Scripting::Candle* _this = reinterpret_cast (data); + scripting::Candle* _this = reinterpret_cast (data); SQBool arg0; if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a bool")); @@ -338,7 +338,7 @@ static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm) static SQInteger DisplayEffect_release_hook(SQUserPointer ptr, SQInteger ) { - Scripting::DisplayEffect* _this = reinterpret_cast (ptr); + scripting::DisplayEffect* _this = reinterpret_cast (ptr); delete _this; return 0; } @@ -350,7 +350,7 @@ static SQInteger DisplayEffect_fade_out_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'fade_out' called without instance")); return SQ_ERROR; } - Scripting::DisplayEffect* _this = reinterpret_cast (data); + scripting::DisplayEffect* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -379,7 +379,7 @@ static SQInteger DisplayEffect_fade_in_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'fade_in' called without instance")); return SQ_ERROR; } - Scripting::DisplayEffect* _this = reinterpret_cast (data); + scripting::DisplayEffect* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -408,7 +408,7 @@ static SQInteger DisplayEffect_set_black_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_black' called without instance")); return SQ_ERROR; } - Scripting::DisplayEffect* _this = reinterpret_cast (data); + scripting::DisplayEffect* _this = reinterpret_cast (data); SQBool arg0; if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a bool")); @@ -437,7 +437,7 @@ static SQInteger DisplayEffect_is_black_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'is_black' called without instance")); return SQ_ERROR; } - Scripting::DisplayEffect* _this = reinterpret_cast (data); + scripting::DisplayEffect* _this = reinterpret_cast (data); try { bool return_value = _this->is_black(); @@ -462,7 +462,7 @@ static SQInteger DisplayEffect_sixteen_to_nine_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'sixteen_to_nine' called without instance")); return SQ_ERROR; } - Scripting::DisplayEffect* _this = reinterpret_cast (data); + scripting::DisplayEffect* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -491,7 +491,7 @@ static SQInteger DisplayEffect_four_to_three_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'four_to_three' called without instance")); return SQ_ERROR; } - Scripting::DisplayEffect* _this = reinterpret_cast (data); + scripting::DisplayEffect* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -515,7 +515,7 @@ static SQInteger DisplayEffect_four_to_three_wrapper(HSQUIRRELVM vm) static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger ) { - Scripting::FloatingImage* _this = reinterpret_cast (ptr); + scripting::FloatingImage* _this = reinterpret_cast (ptr); delete _this; return 0; } @@ -529,7 +529,7 @@ static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm) } try { - Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0); + scripting::FloatingImage* _this = new scripting::FloatingImage(arg0); if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) { sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class")); return SQ_ERROR; @@ -555,7 +555,7 @@ static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_layer' called without instance")); return SQ_ERROR; } - Scripting::FloatingImage* _this = reinterpret_cast (data); + scripting::FloatingImage* _this = reinterpret_cast (data); SQInteger arg0; if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not an integer")); @@ -584,7 +584,7 @@ static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_layer' called without instance")); return SQ_ERROR; } - Scripting::FloatingImage* _this = reinterpret_cast (data); + scripting::FloatingImage* _this = reinterpret_cast (data); try { int return_value = _this->get_layer(); @@ -609,7 +609,7 @@ static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_pos' called without instance")); return SQ_ERROR; } - Scripting::FloatingImage* _this = reinterpret_cast (data); + scripting::FloatingImage* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -643,7 +643,7 @@ static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_pos_x' called without instance")); return SQ_ERROR; } - Scripting::FloatingImage* _this = reinterpret_cast (data); + scripting::FloatingImage* _this = reinterpret_cast (data); try { float return_value = _this->get_pos_x(); @@ -668,7 +668,7 @@ static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_pos_y' called without instance")); return SQ_ERROR; } - Scripting::FloatingImage* _this = reinterpret_cast (data); + scripting::FloatingImage* _this = reinterpret_cast (data); try { float return_value = _this->get_pos_y(); @@ -693,7 +693,7 @@ static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_anchor_point' called without instance")); return SQ_ERROR; } - Scripting::FloatingImage* _this = reinterpret_cast (data); + scripting::FloatingImage* _this = reinterpret_cast (data); SQInteger arg0; if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not an integer")); @@ -722,7 +722,7 @@ static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_anchor_point' called without instance")); return SQ_ERROR; } - Scripting::FloatingImage* _this = reinterpret_cast (data); + scripting::FloatingImage* _this = reinterpret_cast (data); try { int return_value = _this->get_anchor_point(); @@ -747,7 +747,7 @@ static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_visible' called without instance")); return SQ_ERROR; } - Scripting::FloatingImage* _this = reinterpret_cast (data); + scripting::FloatingImage* _this = reinterpret_cast (data); SQBool arg0; if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a bool")); @@ -776,7 +776,7 @@ static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_visible' called without instance")); return SQ_ERROR; } - Scripting::FloatingImage* _this = reinterpret_cast (data); + scripting::FloatingImage* _this = reinterpret_cast (data); try { bool return_value = _this->get_visible(); @@ -801,7 +801,7 @@ static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_action' called without instance")); return SQ_ERROR; } - Scripting::FloatingImage* _this = reinterpret_cast (data); + scripting::FloatingImage* _this = reinterpret_cast (data); const SQChar* arg0; if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a string")); @@ -830,7 +830,7 @@ static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_action' called without instance")); return SQ_ERROR; } - Scripting::FloatingImage* _this = reinterpret_cast (data); + scripting::FloatingImage* _this = reinterpret_cast (data); try { std::string return_value = _this->get_action(); @@ -855,7 +855,7 @@ static SQInteger FloatingImage_fade_in_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'fade_in' called without instance")); return SQ_ERROR; } - Scripting::FloatingImage* _this = reinterpret_cast (data); + scripting::FloatingImage* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -884,7 +884,7 @@ static SQInteger FloatingImage_fade_out_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'fade_out' called without instance")); return SQ_ERROR; } - Scripting::FloatingImage* _this = reinterpret_cast (data); + scripting::FloatingImage* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -908,7 +908,7 @@ static SQInteger FloatingImage_fade_out_wrapper(HSQUIRRELVM vm) static SQInteger LevelTime_release_hook(SQUserPointer ptr, SQInteger ) { - Scripting::LevelTime* _this = reinterpret_cast (ptr); + scripting::LevelTime* _this = reinterpret_cast (ptr); delete _this; return 0; } @@ -920,7 +920,7 @@ static SQInteger LevelTime_start_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'start' called without instance")); return SQ_ERROR; } - Scripting::LevelTime* _this = reinterpret_cast (data); + scripting::LevelTime* _this = reinterpret_cast (data); try { _this->start(); @@ -944,7 +944,7 @@ static SQInteger LevelTime_stop_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'stop' called without instance")); return SQ_ERROR; } - Scripting::LevelTime* _this = reinterpret_cast (data); + scripting::LevelTime* _this = reinterpret_cast (data); try { _this->stop(); @@ -968,7 +968,7 @@ static SQInteger LevelTime_get_time_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_time' called without instance")); return SQ_ERROR; } - Scripting::LevelTime* _this = reinterpret_cast (data); + scripting::LevelTime* _this = reinterpret_cast (data); try { float return_value = _this->get_time(); @@ -993,7 +993,7 @@ static SQInteger LevelTime_set_time_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_time' called without instance")); return SQ_ERROR; } - Scripting::LevelTime* _this = reinterpret_cast (data); + scripting::LevelTime* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -1017,7 +1017,7 @@ static SQInteger LevelTime_set_time_wrapper(HSQUIRRELVM vm) static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger ) { - Scripting::Platform* _this = reinterpret_cast (ptr); + scripting::Platform* _this = reinterpret_cast (ptr); delete _this; return 0; } @@ -1029,7 +1029,7 @@ static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'goto_node' called without instance")); return SQ_ERROR; } - Scripting::Platform* _this = reinterpret_cast (data); + scripting::Platform* _this = reinterpret_cast (data); SQInteger arg0; if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not an integer")); @@ -1058,7 +1058,7 @@ static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'start_moving' called without instance")); return SQ_ERROR; } - Scripting::Platform* _this = reinterpret_cast (data); + scripting::Platform* _this = reinterpret_cast (data); try { _this->start_moving(); @@ -1082,7 +1082,7 @@ static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'stop_moving' called without instance")); return SQ_ERROR; } - Scripting::Platform* _this = reinterpret_cast (data); + scripting::Platform* _this = reinterpret_cast (data); try { _this->stop_moving(); @@ -1101,7 +1101,7 @@ static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm) static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger ) { - Scripting::Player* _this = reinterpret_cast (ptr); + scripting::Player* _this = reinterpret_cast (ptr); delete _this; return 0; } @@ -1113,7 +1113,7 @@ static SQInteger Player_add_bonus_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'add_bonus' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); const SQChar* arg0; if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a string")); @@ -1143,7 +1143,7 @@ static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'add_coins' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); SQInteger arg0; if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not an integer")); @@ -1172,7 +1172,7 @@ static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'make_invincible' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); try { _this->make_invincible(); @@ -1196,7 +1196,7 @@ static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'deactivate' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); try { _this->deactivate(); @@ -1220,7 +1220,7 @@ static SQInteger Player_activate_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'activate' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); try { _this->activate(); @@ -1244,7 +1244,7 @@ static SQInteger Player_walk_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'walk' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -1266,6 +1266,35 @@ static SQInteger Player_walk_wrapper(HSQUIRRELVM vm) } +static SQInteger Player_set_dir_wrapper(HSQUIRRELVM vm) +{ + SQUserPointer data; + if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) { + sq_throwerror(vm, _SC("'set_dir' called without instance")); + return SQ_ERROR; + } + scripting::Player* _this = reinterpret_cast (data); + SQBool arg0; + if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { + sq_throwerror(vm, _SC("Argument 1 not a bool")); + return SQ_ERROR; + } + + try { + _this->set_dir(arg0 == SQTrue); + + return 0; + + } catch(std::exception& e) { + sq_throwerror(vm, e.what()); + return SQ_ERROR; + } catch(...) { + sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_dir'")); + return SQ_ERROR; + } + +} + static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm) { SQUserPointer data; @@ -1273,7 +1302,7 @@ static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_visible' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); SQBool arg0; if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a bool")); @@ -1302,7 +1331,7 @@ static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_visible' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); try { bool return_value = _this->get_visible(); @@ -1327,7 +1356,7 @@ static SQInteger Player_kill_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'kill' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); SQBool arg0; if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a bool")); @@ -1356,7 +1385,7 @@ static SQInteger Player_set_ghost_mode_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_ghost_mode' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); SQBool arg0; if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a bool")); @@ -1385,7 +1414,7 @@ static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_ghost_mode' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); try { bool return_value = _this->get_ghost_mode(); @@ -1403,6 +1432,30 @@ static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm) } +static SQInteger Player_kick_wrapper(HSQUIRRELVM vm) +{ + SQUserPointer data; + if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) { + sq_throwerror(vm, _SC("'kick' called without instance")); + return SQ_ERROR; + } + scripting::Player* _this = reinterpret_cast (data); + + try { + _this->kick(); + + return 0; + + } catch(std::exception& e) { + sq_throwerror(vm, e.what()); + return SQ_ERROR; + } catch(...) { + sq_throwerror(vm, _SC("Unexpected exception while executing function 'kick'")); + return SQ_ERROR; + } + +} + static SQInteger Player_do_cheer_wrapper(HSQUIRRELVM vm) { SQUserPointer data; @@ -1410,7 +1463,7 @@ static SQInteger Player_do_cheer_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'do_cheer' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); try { _this->do_cheer(); @@ -1434,7 +1487,7 @@ static SQInteger Player_do_duck_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'do_duck' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); try { _this->do_duck(); @@ -1458,7 +1511,7 @@ static SQInteger Player_do_standup_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'do_standup' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); try { _this->do_standup(); @@ -1482,7 +1535,7 @@ static SQInteger Player_do_backflip_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'do_backflip' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); try { _this->do_backflip(); @@ -1506,7 +1559,7 @@ static SQInteger Player_do_jump_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'do_jump' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -1535,7 +1588,7 @@ static SQInteger Player_trigger_sequence_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'trigger_sequence' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); const SQChar* arg0; if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a string")); @@ -1564,7 +1617,7 @@ static SQInteger Player_use_scripting_controller_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'use_scripting_controller' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); SQBool arg0; if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a bool")); @@ -1593,7 +1646,7 @@ static SQInteger Player_do_scripting_controller_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'do_scripting_controller' called without instance")); return SQ_ERROR; } - Scripting::Player* _this = reinterpret_cast (data); + scripting::Player* _this = reinterpret_cast (data); const SQChar* arg0; if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a string")); @@ -1622,7 +1675,7 @@ static SQInteger Player_do_scripting_controller_wrapper(HSQUIRRELVM vm) static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger ) { - Scripting::ScriptedObject* _this = reinterpret_cast (ptr); + scripting::ScriptedObject* _this = reinterpret_cast (ptr); delete _this; return 0; } @@ -1634,7 +1687,7 @@ static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_action' called without instance")); return SQ_ERROR; } - Scripting::ScriptedObject* _this = reinterpret_cast (data); + scripting::ScriptedObject* _this = reinterpret_cast (data); const SQChar* arg0; if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a string")); @@ -1663,7 +1716,7 @@ static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_action' called without instance")); return SQ_ERROR; } - Scripting::ScriptedObject* _this = reinterpret_cast (data); + scripting::ScriptedObject* _this = reinterpret_cast (data); try { std::string return_value = _this->get_action(); @@ -1688,7 +1741,7 @@ static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'move' called without instance")); return SQ_ERROR; } - Scripting::ScriptedObject* _this = reinterpret_cast (data); + scripting::ScriptedObject* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -1722,7 +1775,7 @@ static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_pos' called without instance")); return SQ_ERROR; } - Scripting::ScriptedObject* _this = reinterpret_cast (data); + scripting::ScriptedObject* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -1756,7 +1809,7 @@ static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_pos_x' called without instance")); return SQ_ERROR; } - Scripting::ScriptedObject* _this = reinterpret_cast (data); + scripting::ScriptedObject* _this = reinterpret_cast (data); try { float return_value = _this->get_pos_x(); @@ -1781,7 +1834,7 @@ static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_pos_y' called without instance")); return SQ_ERROR; } - Scripting::ScriptedObject* _this = reinterpret_cast (data); + scripting::ScriptedObject* _this = reinterpret_cast (data); try { float return_value = _this->get_pos_y(); @@ -1806,7 +1859,7 @@ static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_velocity' called without instance")); return SQ_ERROR; } - Scripting::ScriptedObject* _this = reinterpret_cast (data); + scripting::ScriptedObject* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -1840,7 +1893,7 @@ static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_velocity_x' called without instance")); return SQ_ERROR; } - Scripting::ScriptedObject* _this = reinterpret_cast (data); + scripting::ScriptedObject* _this = reinterpret_cast (data); try { float return_value = _this->get_velocity_x(); @@ -1865,7 +1918,7 @@ static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_velocity_y' called without instance")); return SQ_ERROR; } - Scripting::ScriptedObject* _this = reinterpret_cast (data); + scripting::ScriptedObject* _this = reinterpret_cast (data); try { float return_value = _this->get_velocity_y(); @@ -1883,6 +1936,60 @@ static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm) } +static SQInteger ScriptedObject_enable_gravity_wrapper(HSQUIRRELVM vm) +{ + SQUserPointer data; + if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) { + sq_throwerror(vm, _SC("'enable_gravity' called without instance")); + return SQ_ERROR; + } + scripting::ScriptedObject* _this = reinterpret_cast (data); + SQBool arg0; + if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { + sq_throwerror(vm, _SC("Argument 1 not a bool")); + return SQ_ERROR; + } + + try { + _this->enable_gravity(arg0 == SQTrue); + + return 0; + + } catch(std::exception& e) { + sq_throwerror(vm, e.what()); + return SQ_ERROR; + } catch(...) { + sq_throwerror(vm, _SC("Unexpected exception while executing function 'enable_gravity'")); + return SQ_ERROR; + } + +} + +static SQInteger ScriptedObject_gravity_enabled_wrapper(HSQUIRRELVM vm) +{ + SQUserPointer data; + if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) { + sq_throwerror(vm, _SC("'gravity_enabled' called without instance")); + return SQ_ERROR; + } + scripting::ScriptedObject* _this = reinterpret_cast (data); + + try { + bool return_value = _this->gravity_enabled(); + + sq_pushbool(vm, return_value); + return 1; + + } catch(std::exception& e) { + sq_throwerror(vm, e.what()); + return SQ_ERROR; + } catch(...) { + sq_throwerror(vm, _SC("Unexpected exception while executing function 'gravity_enabled'")); + return SQ_ERROR; + } + +} + static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm) { SQUserPointer data; @@ -1890,7 +1997,7 @@ static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_visible' called without instance")); return SQ_ERROR; } - Scripting::ScriptedObject* _this = reinterpret_cast (data); + scripting::ScriptedObject* _this = reinterpret_cast (data); SQBool arg0; if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a bool")); @@ -1919,7 +2026,7 @@ static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'is_visible' called without instance")); return SQ_ERROR; } - Scripting::ScriptedObject* _this = reinterpret_cast (data); + scripting::ScriptedObject* _this = reinterpret_cast (data); try { bool return_value = _this->is_visible(); @@ -1944,7 +2051,7 @@ static SQInteger ScriptedObject_set_solid_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_solid' called without instance")); return SQ_ERROR; } - Scripting::ScriptedObject* _this = reinterpret_cast (data); + scripting::ScriptedObject* _this = reinterpret_cast (data); SQBool arg0; if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a bool")); @@ -1973,7 +2080,7 @@ static SQInteger ScriptedObject_is_solid_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'is_solid' called without instance")); return SQ_ERROR; } - Scripting::ScriptedObject* _this = reinterpret_cast (data); + scripting::ScriptedObject* _this = reinterpret_cast (data); try { bool return_value = _this->is_solid(); @@ -1998,7 +2105,7 @@ static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_name' called without instance")); return SQ_ERROR; } - Scripting::ScriptedObject* _this = reinterpret_cast (data); + scripting::ScriptedObject* _this = reinterpret_cast (data); try { std::string return_value = _this->get_name(); @@ -2018,7 +2125,7 @@ static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm) static SQInteger SSector_release_hook(SQUserPointer ptr, SQInteger ) { - Scripting::SSector* _this = reinterpret_cast (ptr); + scripting::SSector* _this = reinterpret_cast (ptr); delete _this; return 0; } @@ -2030,7 +2137,7 @@ static SQInteger SSector_set_ambient_light_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_ambient_light' called without instance")); return SQ_ERROR; } - Scripting::SSector* _this = reinterpret_cast (data); + scripting::SSector* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -2069,7 +2176,7 @@ static SQInteger SSector_get_ambient_red_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_ambient_red' called without instance")); return SQ_ERROR; } - Scripting::SSector* _this = reinterpret_cast (data); + scripting::SSector* _this = reinterpret_cast (data); try { float return_value = _this->get_ambient_red(); @@ -2094,7 +2201,7 @@ static SQInteger SSector_get_ambient_green_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_ambient_green' called without instance")); return SQ_ERROR; } - Scripting::SSector* _this = reinterpret_cast (data); + scripting::SSector* _this = reinterpret_cast (data); try { float return_value = _this->get_ambient_green(); @@ -2119,7 +2226,7 @@ static SQInteger SSector_get_ambient_blue_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_ambient_blue' called without instance")); return SQ_ERROR; } - Scripting::SSector* _this = reinterpret_cast (data); + scripting::SSector* _this = reinterpret_cast (data); try { float return_value = _this->get_ambient_blue(); @@ -2144,7 +2251,7 @@ static SQInteger SSector_set_gravity_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_gravity' called without instance")); return SQ_ERROR; } - Scripting::SSector* _this = reinterpret_cast (data); + scripting::SSector* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -2168,7 +2275,7 @@ static SQInteger SSector_set_gravity_wrapper(HSQUIRRELVM vm) static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger ) { - Scripting::Text* _this = reinterpret_cast (ptr); + scripting::Text* _this = reinterpret_cast (ptr); delete _this; return 0; } @@ -2180,7 +2287,7 @@ static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_text' called without instance")); return SQ_ERROR; } - Scripting::Text* _this = reinterpret_cast (data); + scripting::Text* _this = reinterpret_cast (data); const SQChar* arg0; if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a string")); @@ -2209,7 +2316,7 @@ static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_font' called without instance")); return SQ_ERROR; } - Scripting::Text* _this = reinterpret_cast (data); + scripting::Text* _this = reinterpret_cast (data); const SQChar* arg0; if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a string")); @@ -2238,7 +2345,7 @@ static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'fade_in' called without instance")); return SQ_ERROR; } - Scripting::Text* _this = reinterpret_cast (data); + scripting::Text* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -2267,7 +2374,7 @@ static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'fade_out' called without instance")); return SQ_ERROR; } - Scripting::Text* _this = reinterpret_cast (data); + scripting::Text* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -2296,7 +2403,7 @@ static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_visible' called without instance")); return SQ_ERROR; } - Scripting::Text* _this = reinterpret_cast (data); + scripting::Text* _this = reinterpret_cast (data); SQBool arg0; if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a bool")); @@ -2325,7 +2432,7 @@ static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_centered' called without instance")); return SQ_ERROR; } - Scripting::Text* _this = reinterpret_cast (data); + scripting::Text* _this = reinterpret_cast (data); SQBool arg0; if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a bool")); @@ -2354,7 +2461,7 @@ static SQInteger Text_set_pos_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_pos' called without instance")); return SQ_ERROR; } - Scripting::Text* _this = reinterpret_cast (data); + scripting::Text* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -2388,7 +2495,7 @@ static SQInteger Text_get_pos_x_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_pos_x' called without instance")); return SQ_ERROR; } - Scripting::Text* _this = reinterpret_cast (data); + scripting::Text* _this = reinterpret_cast (data); try { float return_value = _this->get_pos_x(); @@ -2413,7 +2520,7 @@ static SQInteger Text_get_pos_y_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_pos_y' called without instance")); return SQ_ERROR; } - Scripting::Text* _this = reinterpret_cast (data); + scripting::Text* _this = reinterpret_cast (data); try { float return_value = _this->get_pos_y(); @@ -2438,7 +2545,7 @@ static SQInteger Text_set_anchor_point_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_anchor_point' called without instance")); return SQ_ERROR; } - Scripting::Text* _this = reinterpret_cast (data); + scripting::Text* _this = reinterpret_cast (data); SQInteger arg0; if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not an integer")); @@ -2467,7 +2574,7 @@ static SQInteger Text_get_anchor_point_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_anchor_point' called without instance")); return SQ_ERROR; } - Scripting::Text* _this = reinterpret_cast (data); + scripting::Text* _this = reinterpret_cast (data); try { int return_value = _this->get_anchor_point(); @@ -2487,7 +2594,7 @@ static SQInteger Text_get_anchor_point_wrapper(HSQUIRRELVM vm) static SQInteger Thunderstorm_release_hook(SQUserPointer ptr, SQInteger ) { - Scripting::Thunderstorm* _this = reinterpret_cast (ptr); + scripting::Thunderstorm* _this = reinterpret_cast (ptr); delete _this; return 0; } @@ -2499,7 +2606,7 @@ static SQInteger Thunderstorm_start_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'start' called without instance")); return SQ_ERROR; } - Scripting::Thunderstorm* _this = reinterpret_cast (data); + scripting::Thunderstorm* _this = reinterpret_cast (data); try { _this->start(); @@ -2523,7 +2630,7 @@ static SQInteger Thunderstorm_stop_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'stop' called without instance")); return SQ_ERROR; } - Scripting::Thunderstorm* _this = reinterpret_cast (data); + scripting::Thunderstorm* _this = reinterpret_cast (data); try { _this->stop(); @@ -2547,7 +2654,7 @@ static SQInteger Thunderstorm_thunder_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'thunder' called without instance")); return SQ_ERROR; } - Scripting::Thunderstorm* _this = reinterpret_cast (data); + scripting::Thunderstorm* _this = reinterpret_cast (data); try { _this->thunder(); @@ -2571,7 +2678,7 @@ static SQInteger Thunderstorm_lightning_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'lightning' called without instance")); return SQ_ERROR; } - Scripting::Thunderstorm* _this = reinterpret_cast (data); + scripting::Thunderstorm* _this = reinterpret_cast (data); try { _this->lightning(); @@ -2595,7 +2702,7 @@ static SQInteger Thunderstorm_flash_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'flash' called without instance")); return SQ_ERROR; } - Scripting::Thunderstorm* _this = reinterpret_cast (data); + scripting::Thunderstorm* _this = reinterpret_cast (data); try { _this->flash(); @@ -2619,7 +2726,7 @@ static SQInteger Thunderstorm_electrify_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'electrify' called without instance")); return SQ_ERROR; } - Scripting::Thunderstorm* _this = reinterpret_cast (data); + scripting::Thunderstorm* _this = reinterpret_cast (data); try { _this->electrify(); @@ -2638,7 +2745,7 @@ static SQInteger Thunderstorm_electrify_wrapper(HSQUIRRELVM vm) static SQInteger TileMap_release_hook(SQUserPointer ptr, SQInteger ) { - Scripting::TileMap* _this = reinterpret_cast (ptr); + scripting::TileMap* _this = reinterpret_cast (ptr); delete _this; return 0; } @@ -2650,7 +2757,7 @@ static SQInteger TileMap_goto_node_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'goto_node' called without instance")); return SQ_ERROR; } - Scripting::TileMap* _this = reinterpret_cast (data); + scripting::TileMap* _this = reinterpret_cast (data); SQInteger arg0; if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not an integer")); @@ -2679,7 +2786,7 @@ static SQInteger TileMap_start_moving_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'start_moving' called without instance")); return SQ_ERROR; } - Scripting::TileMap* _this = reinterpret_cast (data); + scripting::TileMap* _this = reinterpret_cast (data); try { _this->start_moving(); @@ -2703,7 +2810,7 @@ static SQInteger TileMap_stop_moving_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'stop_moving' called without instance")); return SQ_ERROR; } - Scripting::TileMap* _this = reinterpret_cast (data); + scripting::TileMap* _this = reinterpret_cast (data); try { _this->stop_moving(); @@ -2727,7 +2834,7 @@ static SQInteger TileMap_fade_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'fade' called without instance")); return SQ_ERROR; } - Scripting::TileMap* _this = reinterpret_cast (data); + scripting::TileMap* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -2761,7 +2868,7 @@ static SQInteger TileMap_set_alpha_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_alpha' called without instance")); return SQ_ERROR; } - Scripting::TileMap* _this = reinterpret_cast (data); + scripting::TileMap* _this = reinterpret_cast (data); SQFloat arg0; if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a float")); @@ -2790,7 +2897,7 @@ static SQInteger TileMap_get_alpha_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'get_alpha' called without instance")); return SQ_ERROR; } - Scripting::TileMap* _this = reinterpret_cast (data); + scripting::TileMap* _this = reinterpret_cast (data); try { float return_value = _this->get_alpha(); @@ -2810,7 +2917,7 @@ static SQInteger TileMap_get_alpha_wrapper(HSQUIRRELVM vm) static SQInteger WillOWisp_release_hook(SQUserPointer ptr, SQInteger ) { - Scripting::WillOWisp* _this = reinterpret_cast (ptr); + scripting::WillOWisp* _this = reinterpret_cast (ptr); delete _this; return 0; } @@ -2822,7 +2929,7 @@ static SQInteger WillOWisp_goto_node_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'goto_node' called without instance")); return SQ_ERROR; } - Scripting::WillOWisp* _this = reinterpret_cast (data); + scripting::WillOWisp* _this = reinterpret_cast (data); SQInteger arg0; if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not an integer")); @@ -2851,7 +2958,7 @@ static SQInteger WillOWisp_set_state_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'set_state' called without instance")); return SQ_ERROR; } - Scripting::WillOWisp* _this = reinterpret_cast (data); + scripting::WillOWisp* _this = reinterpret_cast (data); const SQChar* arg0; if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { sq_throwerror(vm, _SC("Argument 1 not a string")); @@ -2880,7 +2987,7 @@ static SQInteger WillOWisp_start_moving_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'start_moving' called without instance")); return SQ_ERROR; } - Scripting::WillOWisp* _this = reinterpret_cast (data); + scripting::WillOWisp* _this = reinterpret_cast (data); try { _this->start_moving(); @@ -2904,7 +3011,7 @@ static SQInteger WillOWisp_stop_moving_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'stop_moving' called without instance")); return SQ_ERROR; } - Scripting::WillOWisp* _this = reinterpret_cast (data); + scripting::WillOWisp* _this = reinterpret_cast (data); try { _this->stop_moving(); @@ -2923,7 +3030,7 @@ static SQInteger WillOWisp_stop_moving_wrapper(HSQUIRRELVM vm) static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger ) { - Scripting::Wind* _this = reinterpret_cast (ptr); + scripting::Wind* _this = reinterpret_cast (ptr); delete _this; return 0; } @@ -2935,7 +3042,7 @@ static SQInteger Wind_start_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'start' called without instance")); return SQ_ERROR; } - Scripting::Wind* _this = reinterpret_cast (data); + scripting::Wind* _this = reinterpret_cast (data); try { _this->start(); @@ -2959,7 +3066,7 @@ static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, _SC("'stop' called without instance")); return SQ_ERROR; } - Scripting::Wind* _this = reinterpret_cast (data); + scripting::Wind* _this = reinterpret_cast (data); try { _this->stop(); @@ -2978,7 +3085,7 @@ static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm) static SQInteger display_wrapper(HSQUIRRELVM vm) { - return Scripting::display(vm); + return scripting::display(vm); } static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm) @@ -2986,7 +3093,7 @@ static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm) HSQUIRRELVM arg0 = vm; try { - Scripting::print_stacktrace(arg0); + scripting::print_stacktrace(arg0); return 0; @@ -3002,7 +3109,7 @@ static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm) static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm) { - return Scripting::get_current_thread(vm); + return scripting::get_current_thread(vm); } static SQInteger display_text_file_wrapper(HSQUIRRELVM vm) @@ -3014,7 +3121,7 @@ static SQInteger display_text_file_wrapper(HSQUIRRELVM vm) } try { - Scripting::display_text_file(arg0); + scripting::display_text_file(arg0); return 0; @@ -3028,52 +3135,6 @@ static SQInteger display_text_file_wrapper(HSQUIRRELVM vm) } -static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm) -{ - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - Scripting::load_worldmap(arg0); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'")); - return SQ_ERROR; - } - -} - -static SQInteger load_level_wrapper(HSQUIRRELVM vm) -{ - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - Scripting::load_level(arg0); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'")); - return SQ_ERROR; - } - -} - static SQInteger wait_wrapper(HSQUIRRELVM vm) { HSQUIRRELVM arg0 = vm; @@ -3084,7 +3145,7 @@ static SQInteger wait_wrapper(HSQUIRRELVM vm) } try { - Scripting::wait(arg0, static_cast (arg1)); + scripting::wait(arg0, static_cast (arg1)); return sq_suspendvm(vm); @@ -3103,7 +3164,7 @@ static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm) HSQUIRRELVM arg0 = vm; try { - Scripting::wait_for_screenswitch(arg0); + scripting::wait_for_screenswitch(arg0); return sq_suspendvm(vm); @@ -3122,7 +3183,7 @@ static SQInteger exit_screen_wrapper(HSQUIRRELVM vm) (void) vm; try { - Scripting::exit_screen(); + scripting::exit_screen(); return 0; @@ -3145,7 +3206,7 @@ static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm) } try { - Scripting::fadeout_screen(static_cast (arg0)); + scripting::fadeout_screen(static_cast (arg0)); return 0; @@ -3178,7 +3239,7 @@ static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm) } try { - Scripting::shrink_screen(static_cast (arg0), static_cast (arg1), static_cast (arg2)); + scripting::shrink_screen(static_cast (arg0), static_cast (arg1), static_cast (arg2)); return 0; @@ -3197,7 +3258,7 @@ static SQInteger abort_screenfade_wrapper(HSQUIRRELVM vm) (void) vm; try { - Scripting::abort_screenfade(); + scripting::abort_screenfade(); return 0; @@ -3220,7 +3281,7 @@ static SQInteger translate_wrapper(HSQUIRRELVM vm) } try { - std::string return_value = Scripting::translate(arg0); + std::string return_value = scripting::translate(arg0); sq_pushstring(vm, return_value.c_str(), return_value.size()); return 1; @@ -3245,7 +3306,7 @@ static SQInteger import_wrapper(HSQUIRRELVM vm) } try { - Scripting::import(arg0, arg1); + scripting::import(arg0, arg1); return 0; @@ -3259,31 +3320,16 @@ static SQInteger import_wrapper(HSQUIRRELVM vm) } -static SQInteger save_state_wrapper(HSQUIRRELVM vm) +static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm) { - (void) vm; - - try { - Scripting::save_state(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'")); + SQBool arg0; + if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { + sq_throwerror(vm, _SC("Argument 1 not a bool")); return SQ_ERROR; } -} - -static SQInteger update_worldmap_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - try { - Scripting::update_worldmap(); + scripting::debug_collrects(arg0 == SQTrue); return 0; @@ -3291,13 +3337,13 @@ static SQInteger update_worldmap_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, e.what()); return SQ_ERROR; } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'update_worldmap'")); + sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'")); return SQ_ERROR; } } -static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm) +static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm) { SQBool arg0; if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { @@ -3306,7 +3352,7 @@ static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm) } try { - Scripting::debug_collrects(arg0 == SQTrue); + scripting::debug_show_fps(arg0 == SQTrue); return 0; @@ -3314,13 +3360,13 @@ static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, e.what()); return SQ_ERROR; } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'")); + sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'")); return SQ_ERROR; } } -static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm) +static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm) { SQBool arg0; if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { @@ -3329,7 +3375,7 @@ static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm) } try { - Scripting::debug_show_fps(arg0 == SQTrue); + scripting::debug_draw_solids_only(arg0 == SQTrue); return 0; @@ -3337,13 +3383,13 @@ static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, e.what()); return SQ_ERROR; } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'")); + sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'")); return SQ_ERROR; } } -static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm) +static SQInteger debug_draw_editor_images_wrapper(HSQUIRRELVM vm) { SQBool arg0; if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { @@ -3352,7 +3398,7 @@ static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm) } try { - Scripting::debug_draw_solids_only(arg0 == SQTrue); + scripting::debug_draw_editor_images(arg0 == SQTrue); return 0; @@ -3360,7 +3406,7 @@ static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm) sq_throwerror(vm, e.what()); return SQ_ERROR; } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'")); + sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_editor_images'")); return SQ_ERROR; } @@ -3375,7 +3421,7 @@ static SQInteger debug_worldmap_ghost_wrapper(HSQUIRRELVM vm) } try { - Scripting::debug_worldmap_ghost(arg0 == SQTrue); + scripting::debug_worldmap_ghost(arg0 == SQTrue); return 0; @@ -3398,7 +3444,7 @@ static SQInteger play_music_wrapper(HSQUIRRELVM vm) } try { - Scripting::play_music(arg0); + scripting::play_music(arg0); return 0; @@ -3421,7 +3467,7 @@ static SQInteger play_sound_wrapper(HSQUIRRELVM vm) } try { - Scripting::play_sound(arg0); + scripting::play_sound(arg0); return 0; @@ -3444,7 +3490,7 @@ static SQInteger set_game_speed_wrapper(HSQUIRRELVM vm) } try { - Scripting::set_game_speed(static_cast (arg0)); + scripting::set_game_speed(static_cast (arg0)); return 0; @@ -3463,7 +3509,7 @@ static SQInteger grease_wrapper(HSQUIRRELVM vm) (void) vm; try { - Scripting::grease(); + scripting::grease(); return 0; @@ -3482,7 +3528,7 @@ static SQInteger invincible_wrapper(HSQUIRRELVM vm) (void) vm; try { - Scripting::invincible(); + scripting::invincible(); return 0; @@ -3501,7 +3547,7 @@ static SQInteger ghost_wrapper(HSQUIRRELVM vm) (void) vm; try { - Scripting::ghost(); + scripting::ghost(); return 0; @@ -3520,7 +3566,7 @@ static SQInteger mortal_wrapper(HSQUIRRELVM vm) (void) vm; try { - Scripting::mortal(); + scripting::mortal(); return 0; @@ -3539,7 +3585,7 @@ static SQInteger restart_wrapper(HSQUIRRELVM vm) (void) vm; try { - Scripting::restart(); + scripting::restart(); return 0; @@ -3558,7 +3604,7 @@ static SQInteger whereami_wrapper(HSQUIRRELVM vm) (void) vm; try { - Scripting::whereami(); + scripting::whereami(); return 0; @@ -3577,7 +3623,7 @@ static SQInteger gotoend_wrapper(HSQUIRRELVM vm) (void) vm; try { - Scripting::gotoend(); + scripting::gotoend(); return 0; @@ -3596,7 +3642,7 @@ static SQInteger camera_wrapper(HSQUIRRELVM vm) (void) vm; try { - Scripting::camera(); + scripting::camera(); return 0; @@ -3619,7 +3665,7 @@ static SQInteger set_gamma_wrapper(HSQUIRRELVM vm) } try { - Scripting::set_gamma(static_cast (arg0)); + scripting::set_gamma(static_cast (arg0)); return 0; @@ -3638,7 +3684,7 @@ static SQInteger quit_wrapper(HSQUIRRELVM vm) (void) vm; try { - Scripting::quit(); + scripting::quit(); return 0; @@ -3656,7 +3702,7 @@ static SQInteger rand_wrapper(HSQUIRRELVM vm) { try { - int return_value = Scripting::rand(); + int return_value = scripting::rand(); sq_pushinteger(vm, return_value); return 1; @@ -3680,7 +3726,7 @@ static SQInteger record_demo_wrapper(HSQUIRRELVM vm) } try { - Scripting::record_demo(arg0); + scripting::record_demo(arg0); return 0; @@ -3703,7 +3749,7 @@ static SQInteger play_demo_wrapper(HSQUIRRELVM vm) } try { - Scripting::play_demo(arg0); + scripting::play_demo(arg0); return 0; @@ -3726,7 +3772,7 @@ static SQInteger Level_finish_wrapper(HSQUIRRELVM vm) } try { - Scripting::Level_finish(arg0 == SQTrue); + scripting::Level_finish(arg0 == SQTrue); return 0; @@ -3754,7 +3800,7 @@ static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm) } try { - Scripting::Level_spawn(arg0, arg1); + scripting::Level_spawn(arg0, arg1); return 0; @@ -3773,7 +3819,7 @@ static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm) (void) vm; try { - Scripting::Level_flip_vertically(); + scripting::Level_flip_vertically(); return 0; @@ -3792,7 +3838,7 @@ static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm) (void) vm; try { - Scripting::Level_toggle_pause(); + scripting::Level_toggle_pause(); return 0; @@ -3815,7 +3861,7 @@ static SQInteger Level_edit_wrapper(HSQUIRRELVM vm) } try { - Scripting::Level_edit(arg0 == SQTrue); + scripting::Level_edit(arg0 == SQTrue); return 0; @@ -3829,10 +3875,10 @@ static SQInteger Level_edit_wrapper(HSQUIRRELVM vm) } -} // end of namespace Wrapper -void create_squirrel_instance(HSQUIRRELVM v, Scripting::AmbientSound* object, bool setup_releasehook) +} // namespace wrapper +void create_squirrel_instance(HSQUIRRELVM v, scripting::AmbientSound* object, bool setup_releasehook) { - using namespace Wrapper; + using namespace wrapper; sq_pushroottable(v); sq_pushstring(v, "AmbientSound", -1); @@ -3856,9 +3902,9 @@ void create_squirrel_instance(HSQUIRRELVM v, Scripting::AmbientSound* object, bo sq_remove(v, -2); // remove root table } -void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook) +void create_squirrel_instance(HSQUIRRELVM v, scripting::Camera* object, bool setup_releasehook) { - using namespace Wrapper; + using namespace wrapper; sq_pushroottable(v); sq_pushstring(v, "Camera", -1); @@ -3882,9 +3928,9 @@ void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool set sq_remove(v, -2); // remove root table } -void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook) +void create_squirrel_instance(HSQUIRRELVM v, scripting::Candle* object, bool setup_releasehook) { - using namespace Wrapper; + using namespace wrapper; sq_pushroottable(v); sq_pushstring(v, "Candle", -1); @@ -3908,9 +3954,9 @@ void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool set sq_remove(v, -2); // remove root table } -void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook) +void create_squirrel_instance(HSQUIRRELVM v, scripting::DisplayEffect* object, bool setup_releasehook) { - using namespace Wrapper; + using namespace wrapper; sq_pushroottable(v); sq_pushstring(v, "DisplayEffect", -1); @@ -3934,9 +3980,9 @@ void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, b sq_remove(v, -2); // remove root table } -void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook) +void create_squirrel_instance(HSQUIRRELVM v, scripting::FloatingImage* object, bool setup_releasehook) { - using namespace Wrapper; + using namespace wrapper; sq_pushroottable(v); sq_pushstring(v, "FloatingImage", -1); @@ -3960,9 +4006,9 @@ void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, b sq_remove(v, -2); // remove root table } -void create_squirrel_instance(HSQUIRRELVM v, Scripting::LevelTime* object, bool setup_releasehook) +void create_squirrel_instance(HSQUIRRELVM v, scripting::LevelTime* object, bool setup_releasehook) { - using namespace Wrapper; + using namespace wrapper; sq_pushroottable(v); sq_pushstring(v, "LevelTime", -1); @@ -3986,9 +4032,9 @@ void create_squirrel_instance(HSQUIRRELVM v, Scripting::LevelTime* object, bool sq_remove(v, -2); // remove root table } -void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook) +void create_squirrel_instance(HSQUIRRELVM v, scripting::Platform* object, bool setup_releasehook) { - using namespace Wrapper; + using namespace wrapper; sq_pushroottable(v); sq_pushstring(v, "Platform", -1); @@ -4012,9 +4058,9 @@ void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool s sq_remove(v, -2); // remove root table } -void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook) +void create_squirrel_instance(HSQUIRRELVM v, scripting::Player* object, bool setup_releasehook) { - using namespace Wrapper; + using namespace wrapper; sq_pushroottable(v); sq_pushstring(v, "Player", -1); @@ -4038,9 +4084,9 @@ void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool set sq_remove(v, -2); // remove root table } -void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook) +void create_squirrel_instance(HSQUIRRELVM v, scripting::ScriptedObject* object, bool setup_releasehook) { - using namespace Wrapper; + using namespace wrapper; sq_pushroottable(v); sq_pushstring(v, "ScriptedObject", -1); @@ -4064,9 +4110,9 @@ void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, sq_remove(v, -2); // remove root table } -void create_squirrel_instance(HSQUIRRELVM v, Scripting::SSector* object, bool setup_releasehook) +void create_squirrel_instance(HSQUIRRELVM v, scripting::SSector* object, bool setup_releasehook) { - using namespace Wrapper; + using namespace wrapper; sq_pushroottable(v); sq_pushstring(v, "SSector", -1); @@ -4090,9 +4136,9 @@ void create_squirrel_instance(HSQUIRRELVM v, Scripting::SSector* object, bool se sq_remove(v, -2); // remove root table } -void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook) +void create_squirrel_instance(HSQUIRRELVM v, scripting::Text* object, bool setup_releasehook) { - using namespace Wrapper; + using namespace wrapper; sq_pushroottable(v); sq_pushstring(v, "Text", -1); @@ -4116,9 +4162,9 @@ void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup sq_remove(v, -2); // remove root table } -void create_squirrel_instance(HSQUIRRELVM v, Scripting::Thunderstorm* object, bool setup_releasehook) +void create_squirrel_instance(HSQUIRRELVM v, scripting::Thunderstorm* object, bool setup_releasehook) { - using namespace Wrapper; + using namespace wrapper; sq_pushroottable(v); sq_pushstring(v, "Thunderstorm", -1); @@ -4142,9 +4188,9 @@ void create_squirrel_instance(HSQUIRRELVM v, Scripting::Thunderstorm* object, bo sq_remove(v, -2); // remove root table } -void create_squirrel_instance(HSQUIRRELVM v, Scripting::TileMap* object, bool setup_releasehook) +void create_squirrel_instance(HSQUIRRELVM v, scripting::TileMap* object, bool setup_releasehook) { - using namespace Wrapper; + using namespace wrapper; sq_pushroottable(v); sq_pushstring(v, "TileMap", -1); @@ -4168,9 +4214,9 @@ void create_squirrel_instance(HSQUIRRELVM v, Scripting::TileMap* object, bool se sq_remove(v, -2); // remove root table } -void create_squirrel_instance(HSQUIRRELVM v, Scripting::WillOWisp* object, bool setup_releasehook) +void create_squirrel_instance(HSQUIRRELVM v, scripting::WillOWisp* object, bool setup_releasehook) { - using namespace Wrapper; + using namespace wrapper; sq_pushroottable(v); sq_pushstring(v, "WillOWisp", -1); @@ -4194,9 +4240,9 @@ void create_squirrel_instance(HSQUIRRELVM v, Scripting::WillOWisp* object, bool sq_remove(v, -2); // remove root table } -void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup_releasehook) +void create_squirrel_instance(HSQUIRRELVM v, scripting::Wind* object, bool setup_releasehook) { - using namespace Wrapper; + using namespace wrapper; sq_pushroottable(v); sq_pushstring(v, "Wind", -1); @@ -4222,7 +4268,7 @@ void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup void register_supertux_wrapper(HSQUIRRELVM v) { - using namespace Wrapper; + using namespace wrapper; sq_pushstring(v, "ANCHOR_TOP", -1); sq_pushinteger(v, 16); @@ -4306,20 +4352,6 @@ void register_supertux_wrapper(HSQUIRRELVM v) throw SquirrelError(v, "Couldn't register function 'display_text_file'"); } - sq_pushstring(v, "load_worldmap", -1); - sq_newclosure(v, &load_worldmap_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'load_worldmap'"); - } - - sq_pushstring(v, "load_level", -1); - sq_newclosure(v, &load_level_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'load_level'"); - } - sq_pushstring(v, "wait", -1); sq_newclosure(v, &wait_wrapper, 0); sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn"); @@ -4376,20 +4408,6 @@ void register_supertux_wrapper(HSQUIRRELVM v) throw SquirrelError(v, "Couldn't register function 'import'"); } - sq_pushstring(v, "save_state", -1); - sq_newclosure(v, &save_state_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'save_state'"); - } - - sq_pushstring(v, "update_worldmap", -1); - sq_newclosure(v, &update_worldmap_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'update_worldmap'"); - } - sq_pushstring(v, "debug_collrects", -1); sq_newclosure(v, &debug_collrects_wrapper, 0); sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb"); @@ -4411,6 +4429,13 @@ void register_supertux_wrapper(HSQUIRRELVM v) throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'"); } + sq_pushstring(v, "debug_draw_editor_images", -1); + sq_newclosure(v, &debug_draw_editor_images_wrapper, 0); + sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb"); + if(SQ_FAILED(sq_createslot(v, -3))) { + throw SquirrelError(v, "Couldn't register function 'debug_draw_editor_images'"); + } + sq_pushstring(v, "debug_worldmap_ghost", -1); sq_newclosure(v, &debug_worldmap_ghost_wrapper, 0); sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb"); @@ -4950,6 +4975,13 @@ void register_supertux_wrapper(HSQUIRRELVM v) throw SquirrelError(v, "Couldn't register function 'walk'"); } + sq_pushstring(v, "set_dir", -1); + sq_newclosure(v, &Player_set_dir_wrapper, 0); + sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb"); + if(SQ_FAILED(sq_createslot(v, -3))) { + throw SquirrelError(v, "Couldn't register function 'set_dir'"); + } + sq_pushstring(v, "set_visible", -1); sq_newclosure(v, &Player_set_visible_wrapper, 0); sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb"); @@ -4985,6 +5017,13 @@ void register_supertux_wrapper(HSQUIRRELVM v) throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'"); } + sq_pushstring(v, "kick", -1); + sq_newclosure(v, &Player_kick_wrapper, 0); + sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t"); + if(SQ_FAILED(sq_createslot(v, -3))) { + throw SquirrelError(v, "Couldn't register function 'kick'"); + } + sq_pushstring(v, "do_cheer", -1); sq_newclosure(v, &Player_do_cheer_wrapper, 0); sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t"); @@ -5115,6 +5154,20 @@ void register_supertux_wrapper(HSQUIRRELVM v) throw SquirrelError(v, "Couldn't register function 'get_velocity_y'"); } + sq_pushstring(v, "enable_gravity", -1); + sq_newclosure(v, &ScriptedObject_enable_gravity_wrapper, 0); + sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb"); + if(SQ_FAILED(sq_createslot(v, -3))) { + throw SquirrelError(v, "Couldn't register function 'enable_gravity'"); + } + + sq_pushstring(v, "gravity_enabled", -1); + sq_newclosure(v, &ScriptedObject_gravity_enabled_wrapper, 0); + sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t"); + if(SQ_FAILED(sq_createslot(v, -3))) { + throw SquirrelError(v, "Couldn't register function 'gravity_enabled'"); + } + sq_pushstring(v, "set_visible", -1); sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0); sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb"); @@ -5460,6 +5513,6 @@ void register_supertux_wrapper(HSQUIRRELVM v) } -} // end of namespace Scripting +} // namespace scripting /* EOF */