X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fscripting%2Fwrapper.cpp;h=90b39e87b9e154ae799478c7730be886de046938;hb=2f9e19ce4e01dc769ae7b2a7129109e0e81a6b5b;hp=60bf5cee6345d014f9fba76cc4c22c3ff4cbaf48;hpb=e5345cbdfe499dff26e2c93107e871bb0af905cd;p=supertux.git diff --git a/src/scripting/wrapper.cpp b/src/scripting/wrapper.cpp index 60bf5cee6..90b39e87b 100644 --- a/src/scripting/wrapper.cpp +++ b/src/scripting/wrapper.cpp @@ -1,14 +1,16 @@ /** - * WARNING: This file is automatically generated from './build/i686-pc-linux-gnu/debug/miniswig.tmp' - do not change + * WARNING: This file is automatically generated from: + * 'src/scripting/wrapper.interface.hpp' + * DO NOT CHANGE */ - #include + #include #include #include #include -#include "wrapper_util.h" -#include "wrapper.interface.h" +#include "wrapper_util.hpp" +#include "wrapper.interface.hpp" using namespace Scripting; @@ -125,6 +127,16 @@ static int Level_spawn_wrapper(HSQUIRRELVM v) return 0; } +static int Level_flip_vertically_wrapper(HSQUIRRELVM v) +{ + Scripting::Level* _this; + sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0); + + _this->flip_vertically(); + + return 0; +} + static int ScriptedObject_set_animation_wrapper(HSQUIRRELVM v) { Scripting::ScriptedObject* _this; @@ -280,14 +292,14 @@ static int Sound_play_music_wrapper(HSQUIRRELVM v) return 0; } -static int Sound_play_sound_wrapper(HSQUIRRELVM v) +static int Sound_play_wrapper(HSQUIRRELVM v) { Scripting::Sound* _this; sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0); const char* arg0; sq_getstring(v, 2, &arg0); - _this->play_sound(arg0); + _this->play(arg0); return 0; } @@ -352,6 +364,60 @@ static int Text_set_visible_wrapper(HSQUIRRELVM v) return 0; } +static int Player_set_bonus_wrapper(HSQUIRRELVM v) +{ + Scripting::Player* _this; + sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0); + const char* arg0; + sq_getstring(v, 2, &arg0); + + _this->set_bonus(arg0); + + return 0; +} + +static int Player_make_invincible_wrapper(HSQUIRRELVM v) +{ + Scripting::Player* _this; + sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0); + + _this->make_invincible(); + + return 0; +} + +static int Player_add_life_wrapper(HSQUIRRELVM v) +{ + Scripting::Player* _this; + sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0); + + _this->add_life(); + + return 0; +} + +static int Player_add_coins_wrapper(HSQUIRRELVM v) +{ + Scripting::Player* _this; + sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0); + int arg0; + sq_getinteger(v, 2, &arg0); + + _this->add_coins(arg0); + + return 0; +} + +static int display_text_file_wrapper(HSQUIRRELVM v) +{ + const char* arg0; + sq_getstring(v, 2, &arg0); + + Scripting::display_text_file(arg0); + + return 0; +} + static int set_wakeup_time_wrapper(HSQUIRRELVM v) { float arg0; @@ -373,12 +439,37 @@ static int translate_wrapper(HSQUIRRELVM v) return 1; } +static int import_wrapper(HSQUIRRELVM v) +{ + HSQUIRRELVM arg0 = v; + const char* arg1; + sq_getstring(v, 2, &arg1); + + Scripting::import(arg0, arg1); + + return 0; +} + WrappedFunction supertux_global_functions[] = { + { "display_text_file", &display_text_file_wrapper }, { "set_wakeup_time", &set_wakeup_time_wrapper }, { "translate", &translate_wrapper }, + { "import", &import_wrapper }, { 0, 0 } }; +WrappedConstant supertux_int_constants[] = { + { 0, 0} +}; + +WrappedConstant supertux_float_constants[] = { + { 0, 0} +}; + +WrappedConstant supertux_string_constants[] = { + { 0, 0} +}; + static WrappedFunction supertux_DisplayEffect_methods[] = { { "fade_out", &DisplayEffect_fade_out_wrapper }, { "fade_in", &DisplayEffect_fade_in_wrapper }, @@ -386,15 +477,52 @@ static WrappedFunction supertux_DisplayEffect_methods[] = { { "is_black", &DisplayEffect_is_black_wrapper }, }; +static WrappedConstant supertux_DisplayEffect_int_consts[] = { + { 0, 0} +}; + +WrappedConstant supertux_DisplayEffect_float_consts[] = { + { 0, 0} +}; + +WrappedConstant supertux_DisplayEffect_string_consts[] = { + { 0, 0} +}; + static WrappedFunction supertux_Camera_methods[] = { { "shake", &Camera_shake_wrapper }, { "set_pos", &Camera_set_pos_wrapper }, { "set_mode", &Camera_set_mode_wrapper }, }; +static WrappedConstant supertux_Camera_int_consts[] = { + { 0, 0} +}; + +WrappedConstant supertux_Camera_float_consts[] = { + { 0, 0} +}; + +WrappedConstant supertux_Camera_string_consts[] = { + { 0, 0} +}; + static WrappedFunction supertux_Level_methods[] = { { "finish", &Level_finish_wrapper }, { "spawn", &Level_spawn_wrapper }, + { "flip_vertically", &Level_flip_vertically_wrapper }, +}; + +static WrappedConstant supertux_Level_int_consts[] = { + { 0, 0} +}; + +WrappedConstant supertux_Level_float_consts[] = { + { 0, 0} +}; + +WrappedConstant supertux_Level_string_consts[] = { + { 0, 0} }; static WrappedFunction supertux_ScriptedObject_methods[] = { @@ -412,9 +540,33 @@ static WrappedFunction supertux_ScriptedObject_methods[] = { { "get_name", &ScriptedObject_get_name_wrapper }, }; +static WrappedConstant supertux_ScriptedObject_int_consts[] = { + { 0, 0} +}; + +WrappedConstant supertux_ScriptedObject_float_consts[] = { + { 0, 0} +}; + +WrappedConstant supertux_ScriptedObject_string_consts[] = { + { 0, 0} +}; + static WrappedFunction supertux_Sound_methods[] = { { "play_music", &Sound_play_music_wrapper }, - { "play_sound", &Sound_play_sound_wrapper }, + { "play", &Sound_play_wrapper }, +}; + +static WrappedConstant supertux_Sound_int_consts[] = { + { 0, 0} +}; + +WrappedConstant supertux_Sound_float_consts[] = { + { 0, 0} +}; + +WrappedConstant supertux_Sound_string_consts[] = { + { 0, 0} }; static WrappedFunction supertux_Text_methods[] = { @@ -425,13 +577,45 @@ static WrappedFunction supertux_Text_methods[] = { { "set_visible", &Text_set_visible_wrapper }, }; +static WrappedConstant supertux_Text_int_consts[] = { + { 0, 0} +}; + +WrappedConstant supertux_Text_float_consts[] = { + { 0, 0} +}; + +WrappedConstant supertux_Text_string_consts[] = { + { 0, 0} +}; + +static WrappedFunction supertux_Player_methods[] = { + { "set_bonus", &Player_set_bonus_wrapper }, + { "make_invincible", &Player_make_invincible_wrapper }, + { "add_life", &Player_add_life_wrapper }, + { "add_coins", &Player_add_coins_wrapper }, +}; + +static WrappedConstant supertux_Player_int_consts[] = { + { 0, 0} +}; + +WrappedConstant supertux_Player_float_consts[] = { + { 0, 0} +}; + +WrappedConstant supertux_Player_string_consts[] = { + { 0, 0} +}; + WrappedClass supertux_classes[] = { - { "DisplayEffect", supertux_DisplayEffect_methods }, - { "Camera", supertux_Camera_methods }, - { "Level", supertux_Level_methods }, - { "ScriptedObject", supertux_ScriptedObject_methods }, - { "Sound", supertux_Sound_methods }, - { "Text", supertux_Text_methods }, - { 0, 0 } + { "DisplayEffect", supertux_DisplayEffect_methods, supertux_DisplayEffect_int_consts, supertux_DisplayEffect_float_consts, supertux_DisplayEffect_string_consts }, + { "Camera", supertux_Camera_methods, supertux_Camera_int_consts, supertux_Camera_float_consts, supertux_Camera_string_consts }, + { "Level", supertux_Level_methods, supertux_Level_int_consts, supertux_Level_float_consts, supertux_Level_string_consts }, + { "ScriptedObject", supertux_ScriptedObject_methods, supertux_ScriptedObject_int_consts, supertux_ScriptedObject_float_consts, supertux_ScriptedObject_string_consts }, + { "Sound", supertux_Sound_methods, supertux_Sound_int_consts, supertux_Sound_float_consts, supertux_Sound_string_consts }, + { "Text", supertux_Text_methods, supertux_Text_int_consts, supertux_Text_float_consts, supertux_Text_string_consts }, + { "Player", supertux_Player_methods, supertux_Player_int_consts, supertux_Player_float_consts, supertux_Player_string_consts }, + { 0, 0, 0, 0, 0 } };