From d4d88e83d74665042e744726514ec8d7b87128a0 Mon Sep 17 00:00:00 2001 From: SuperTux Bot Date: Wed, 3 Jul 2024 01:35:42 +0000 Subject: [PATCH 01/33] Update translations --- data/levels/bonus1/ja.po | 2 +- data/levels/bonus3/ja.po | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/levels/bonus1/ja.po b/data/levels/bonus1/ja.po index d7cbdbba2f8..305c2a8c784 100644 --- a/data/levels/bonus1/ja.po +++ b/data/levels/bonus1/ja.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # 515ce455fbf38ec9585626e8d26b6324_7a9a6ef, 2017 # Ryo Nakano, 2019,2021,2024 # Sanshiro sumita, 2015-2016 diff --git a/data/levels/bonus3/ja.po b/data/levels/bonus3/ja.po index c91b8ad6799..a3d7c7cd697 100644 --- a/data/levels/bonus3/ja.po +++ b/data/levels/bonus3/ja.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # Ryo Nakano, 2019,2021,2024 # b1e11c107ebf1f339ff7adfc86b9dbe0_2e3e89d, 2016 # Sanshiro sumita, 2015 From da8ed28d5ba9dcc77f174d1589c9ae6cd939a676 Mon Sep 17 00:00:00 2001 From: Marty <85036874+MatusGuy@users.noreply.github.com> Date: Fri, 5 Jul 2024 13:54:45 +0100 Subject: [PATCH 02/33] Package game zip on Windows as an alternative (#2968) This packages a portable version of the game and uploads it to the artifacts. --- .github/workflows/windows.yml | 31 ++++++++++++++++++++++--- mk/cmake/SuperTux/BuildInstall.cmake | 16 ++++++++----- mk/cmake/SuperTux/ProvideSquirrel.cmake | 3 --- mk/msvc/run_supertux.bat | 2 ++ mk/msvc/run_supertux.bat.in | 4 ---- mk/msvc/run_supertux_portable.bat | 3 +++ 6 files changed, 43 insertions(+), 16 deletions(-) create mode 100644 mk/msvc/run_supertux.bat delete mode 100644 mk/msvc/run_supertux.bat.in create mode 100644 mk/msvc/run_supertux_portable.bat diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5b4077a1c87..f19582e26e7 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -104,7 +104,7 @@ jobs: run: | "./$Env:BUILD_TYPE/run_tests.exe" - - name: Package + - name: Package MSI Installer working-directory: build env: BUILD_TYPE: ${{ matrix.build_type }} @@ -113,12 +113,37 @@ jobs: mkdir upload mv *.msi upload/ - - uses: actions/upload-artifact@v4 + - name: Upload MSI Installer + uses: actions/upload-artifact@v4 with: name: "windows-${{ matrix.arch }}-${{ matrix.build_type }}${{ matrix.glbinding == 'ON' && '-glbinding' || '' }}-installer" path: build/upload/*.msi if-no-files-found: ignore + - name: Package Portable Archive + working-directory: build + env: + BUILD_TYPE: ${{ matrix.build_type }} + run: | + mkdir -Force SuperTux-${{ github.sha }}-portable + cmake --install . --config $Env:BUILD_TYPE --prefix .\SuperTux-${{ github.sha }}-portable + + # Because github puts assets in zips, if you upload a zip, + # it will upload another zip. I have disabled this code because + # of that, but in case you wanted to know how to generate a portable release, + # here it is. + <# + cpack -C $Env:BUILD_TYPE -G ZIP + mv *.zip SuperTux-${{ github.sha }}-portable/ + #> + + - name: Upload Portable Package + uses: actions/upload-artifact@v4 + with: + name: "windows-${{ matrix.arch }}-${{ matrix.build_type }}${{ matrix.glbinding == 'ON' && '-glbinding' || '' }}-portable" + path: build/SuperTux-${{ github.sha }}-portable + if-no-files-found: ignore + - uses: anshulrgoyal/upload-s3-action@master if: matrix.release && env.CI_KEY != null env: @@ -147,5 +172,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - files: 'build/upload/SuperTux-*' + files: 'build/upload/SuperTux-*.msi' draft: true diff --git a/mk/cmake/SuperTux/BuildInstall.cmake b/mk/cmake/SuperTux/BuildInstall.cmake index 8158dd44c03..ae28707251a 100644 --- a/mk/cmake/SuperTux/BuildInstall.cmake +++ b/mk/cmake/SuperTux/BuildInstall.cmake @@ -1,11 +1,15 @@ if(WIN32 AND NOT UNIX) - if(VCPKG_BUILD) - install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}/" DESTINATION ${INSTALL_SUBDIR_BIN} FILES_MATCHING PATTERN "*.dll") - else() - install(FILES ${DLLS} DESTINATION ${INSTALL_SUBDIR_BIN}) - endif() + install(DIRECTORY $/ + DESTINATION ${INSTALL_SUBDIR_BIN} + FILES_MATCHING PATTERN "*.dll") + + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.png + ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.ico + DESTINATION ".") - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.png ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.ico DESTINATION ".") + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mk/msvc/run_supertux.bat + ${CMAKE_CURRENT_SOURCE_DIR}/mk/msvc/run_supertux_portable.bat + DESTINATION ".") option(PACKAGE_VCREDIST "Package the VCREDIST libraries with the program" OFF) diff --git a/mk/cmake/SuperTux/ProvideSquirrel.cmake b/mk/cmake/SuperTux/ProvideSquirrel.cmake index 06598261908..128dca1d0c2 100644 --- a/mk/cmake/SuperTux/ProvideSquirrel.cmake +++ b/mk/cmake/SuperTux/ProvideSquirrel.cmake @@ -60,9 +60,6 @@ else() IMPORTED_LOCATION "${SQUIRREL_PREFIX}/bin/${CMAKE_SHARED_LIBRARY_PREFIX}sqstdlib${CMAKE_SHARED_LIBRARY_SUFFIX}" IMPORTED_IMPLIB "${SQUIRREL_PREFIX}/lib/sqstdlib${CMAKE_LINK_LIBRARY_SUFFIX}" INTERFACE_INCLUDE_DIRECTORIES "${SQUIRREL_PREFIX}/include") - - #For debug run purposes - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mk/msvc/run_supertux.bat.in" "${CMAKE_CURRENT_BINARY_DIR}/run_supertux.bat") else() add_library(LibSquirrel STATIC IMPORTED) set_target_properties(LibSquirrel PROPERTIES diff --git a/mk/msvc/run_supertux.bat b/mk/msvc/run_supertux.bat new file mode 100644 index 00000000000..d7b3ef52143 --- /dev/null +++ b/mk/msvc/run_supertux.bat @@ -0,0 +1,2 @@ +@echo off +start %~dp0\bin\supertux2.exe %* diff --git a/mk/msvc/run_supertux.bat.in b/mk/msvc/run_supertux.bat.in deleted file mode 100644 index b3a1025f5c7..00000000000 --- a/mk/msvc/run_supertux.bat.in +++ /dev/null @@ -1,4 +0,0 @@ -@echo off -set PATH=@SQUIRREL_PREFIX@\bin;@PHYSFS_PREFIX@\bin;@DEPENDENCY_FOLDER@\dll;%PATH% - -start supertux2.exe %* \ No newline at end of file diff --git a/mk/msvc/run_supertux_portable.bat b/mk/msvc/run_supertux_portable.bat new file mode 100644 index 00000000000..48ffb48fbad --- /dev/null +++ b/mk/msvc/run_supertux_portable.bat @@ -0,0 +1,3 @@ +@echo off +set SUPERTUX2_USER_DIR=%~dp0\user\ +start %~dp0\bin\supertux2.exe %* From c83cc2ff64d1007333062769a1f7f394c182a6ef Mon Sep 17 00:00:00 2001 From: Vankata453 <78196474+Vankata453@users.noreply.github.com> Date: Fri, 5 Jul 2024 22:48:09 +0300 Subject: [PATCH 03/33] Camera: Customizable peek multiplier (#2827) Allows for customizing the fractional distance towards the camera peek position to move each frame, from "Options" -> "Video". Additionally removes a peek cap, which was the reason peeking caused a slightly offset position on return, the offset being bigger the smaller the peek multiplier is. --- src/object/camera.cpp | 20 +++++--------------- src/supertux/gameconfig.cpp | 14 ++++++++++++++ src/supertux/gameconfig.hpp | 4 ++++ src/supertux/menu/options_menu.cpp | 6 +++++- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/object/camera.cpp b/src/object/camera.cpp index 306ba03e55b..3f3a92eddfa 100644 --- a/src/object/camera.cpp +++ b/src/object/camera.cpp @@ -22,6 +22,8 @@ #include "math/random.hpp" #include "math/util.hpp" #include "object/player.hpp" +#include "supertux/gameconfig.hpp" +#include "supertux/globals.hpp" #include "supertux/level.hpp" #include "supertux/sector.hpp" #include "util/reader_mapping.hpp" @@ -32,11 +34,6 @@ /* Very small value, used in Camera checks. */ static const float CAMERA_EPSILON = .00001f; -/* This is the fractional distance toward the peek - position to move each frame; lower is slower, - 0 is never get there, 1 is instant. */ -static const float PEEK_ARRIVE_RATIO = 0.03f; - /** * For the multiplayer camera, the camera will ensure all players are visible. * These variables allow establishing a minimum zone around them that will also @@ -487,11 +484,8 @@ Camera::update_scroll_normal(float dt_sec) else if (player.peeking_direction_y() == Direction::DOWN) peek_to_y = top_edge - translation_compensation_y; - float peek_move_y = (peek_to_y - m_peek_pos.y) * PEEK_ARRIVE_RATIO; - if (fabsf(peek_move_y) < 1.0f) - peek_move_y = 0.0; - - m_peek_pos.y += peek_move_y; + if (m_translation.y + m_screen_size.height < get_parent()->get_height()) + m_peek_pos.y += (peek_to_y - m_peek_pos.y) * g_config->camera_peek_multiplier; m_translation.y -= m_peek_pos.y; m_translation.y = math::clamp(m_translation.y, @@ -550,11 +544,7 @@ Camera::update_scroll_normal(float dt_sec) else if (player.peeking_direction_x() == Direction::RIGHT) peek_to_x = left_edge - translation_compensation_x; - float peek_move_x = (peek_to_x - m_peek_pos.x) * PEEK_ARRIVE_RATIO; - if (fabsf(peek_move_x) < 1.0f) - peek_move_x = 0.0f; - - m_peek_pos.x += peek_move_x; + m_peek_pos.x += (peek_to_x - m_peek_pos.x) * g_config->camera_peek_multiplier; m_translation.x -= m_peek_pos.x; m_translation.x = math::clamp(m_translation.x, diff --git a/src/supertux/gameconfig.cpp b/src/supertux/gameconfig.cpp index 8f1080d0621..520a6c96da0 100644 --- a/src/supertux/gameconfig.cpp +++ b/src/supertux/gameconfig.cpp @@ -19,6 +19,7 @@ #include #include "editor/overlay_widget.hpp" +#include "math/util.hpp" #include "supertux/colorscheme.hpp" #include "util/reader_collection.hpp" #include "util/reader_document.hpp" @@ -56,6 +57,7 @@ Config::Config() : show_fps(false), show_player_pos(false), show_controller(false), + camera_peek_multiplier(0.03f), sound_enabled(true), music_enabled(true), sound_volume(100), @@ -145,6 +147,7 @@ Config::load() config_mapping.get("show_fps", show_fps); config_mapping.get("show_player_pos", show_player_pos); config_mapping.get("show_controller", show_controller); + config_mapping.get("camera_peek_multiplier", camera_peek_multiplier); config_mapping.get("developer", developer_mode); config_mapping.get("confirmation_dialog", confirmation_dialog); config_mapping.get("pause_on_focusloss", pause_on_focusloss); @@ -344,11 +347,15 @@ Config::load() } } } + + check_values(); } void Config::save() { + check_values(); + Writer writer("config"); writer.start_list("supertux-config"); @@ -359,6 +366,7 @@ Config::save() writer.write("show_fps", show_fps); writer.write("show_player_pos", show_player_pos); writer.write("show_controller", show_controller); + writer.write("camera_peek_multiplier", camera_peek_multiplier); writer.write("developer", developer_mode); writer.write("confirmation_dialog", confirmation_dialog); writer.write("pause_on_focusloss", pause_on_focusloss); @@ -494,6 +502,12 @@ Config::save() writer.end_list("supertux-config"); } +void +Config::check_values() +{ + camera_peek_multiplier = math::clamp(camera_peek_multiplier, 0.f, 1.f); +} + bool Config::is_christmas() const diff --git a/src/supertux/gameconfig.hpp b/src/supertux/gameconfig.hpp index f4ca84a408f..5b780ea63e2 100644 --- a/src/supertux/gameconfig.hpp +++ b/src/supertux/gameconfig.hpp @@ -34,6 +34,9 @@ class Config final void load(); void save(); + void check_values(); + +public: int profile; /** the width/height to be used to display the game in fullscreen */ @@ -65,6 +68,7 @@ class Config final bool show_fps; bool show_player_pos; bool show_controller; + float camera_peek_multiplier; bool sound_enabled; bool music_enabled; int sound_volume; diff --git a/src/supertux/menu/options_menu.cpp b/src/supertux/menu/options_menu.cpp index a0a0eb34545..b4c18de77c4 100644 --- a/src/supertux/menu/options_menu.cpp +++ b/src/supertux/menu/options_menu.cpp @@ -19,6 +19,7 @@ #include "audio/sound_manager.hpp" #include "gui/dialog.hpp" +#include "gui/item_floatfield.hpp" #include "gui/item_goto.hpp" #include "gui/item_stringselect.hpp" #include "gui/item_toggle.hpp" @@ -116,9 +117,11 @@ OptionsMenu::OptionsMenu(Type type, bool complete) : add_aspect_ratio(); #endif + add_floatfield(_("Camera Peek Multiplier"), &g_config->camera_peek_multiplier) + .set_help(_("The fractional distance towards the camera peek position to move each frame.\n\n0 = No Peek, 1 = Instant Peek")); + add_submenu(_("Change Video System"), MenuStorage::MenuId::VIDEO_SYSTEM_MENU) .set_help(_("Change video system used to render graphics")); - break; } @@ -230,6 +233,7 @@ OptionsMenu::OptionsMenu(Type type, bool complete) : OptionsMenu::~OptionsMenu() { + g_config->save(); } void From c62ffdd3cf6d4ea001a0af5379cc329f6e971d4c Mon Sep 17 00:00:00 2001 From: Daniel Ward <39805490+weluvgoatz@users.noreply.github.com> Date: Sat, 6 Jul 2024 09:06:21 -0700 Subject: [PATCH 04/33] Update platforms to match new tiles [ci skip] --- data/images/objects/platforms/big.png | Bin 8444 -> 17968 bytes data/images/objects/platforms/small.png | Bin 3229 -> 13426 bytes .../objects/platforms/vertical-wood.png | Bin 4645 -> 12045 bytes .../objects/platforms/wood-fivetiles.png | Bin 4587 -> 11734 bytes data/images/objects/platforms/wood-tiny.png | Bin 1969 -> 9549 bytes 5 files changed, 0 insertions(+), 0 deletions(-) diff --git a/data/images/objects/platforms/big.png b/data/images/objects/platforms/big.png index 61f59fc07da0fa8d8c267d6c51ed7a023e82b93f..ab7e91031c5b90c8f1b6c2ea9591fabe30ad6867 100644 GIT binary patch literal 17968 zcmeIYWl&t*wl<11?(Wby1b6o)xD(tOXx!Z$f_s4A!95Tp1a}F+-QC>+1iQTN-e;eE z>V8$XPSySX?XFtgYmGU^Gsk%5n4{L5J)=~WWzdj`k)fcV(Bx!6>Tkb6Zx;{|{_T5- z%83>V3J1+cQ^!pm>9Rpb+YepA}=lw?z3MX&L5u$jDKW^{g~NX6}kB2d&cWE z(X(&cCT2EtK7MyRukiHxeV^j-Hsn%s%k$4maNzpu@x#4q@c7s6!YfAto8!lxr|0n8 z&Uwc`g9G3FBD}-P7o)O3w$zhr$tNQdzb3r4?|;tqGxo22Uzg+_pL}nqzptl1r@v}f zd`G#Hv!L(Cz5kr-kDqwMCT4w+-yxR67csLwIH00%>C1t9<>~(C;i&4sru@Ni{YGCq zfc$x~+L3l)iDLEVZ-0e9g+njbkB)hPrVrcUH?Dz?r(>s&Lji#uEBA(z6tnZ4zMie; zxr_Zn%H_|k<;MDc6qg;tEN;iYYq>E#1%@lk+_he>ir>N@3stc{7}d!X8uINmZ%6Xw z-rYsV&{_y3d?3$Y(JP|Yub8u+{GRcxW4lqF-qXg-x!rzzIA9KYeff87?wv!N(D{%) zi%Z>5-qZH^e%?!WJ8?LnF)+}kzvY*vUD}tiLwd*Q$~*m;EByQUyFB9~+btXE4|9=j z$U&8&1yFqH48N2lxQ9YVaW zPWo3XV{m1Zc*Ghtzcw~49b1*}YGr<3(mS?yJ4TvfUiCe#z7vJNBQ@~8m=EQP<*+aL zZ0TJxF1UQ+%Dhp3^=?Gl(EgUE>9k=p;k5Ov>5-hCJm2k#aZp9%^oEO7we|4FL)!88 zHIGL!F~i5ETekJreA~-q9$%qizPY@bOS|e$RxD|HX^}$k?;Y8}N$ynY>XwQ!2=V~Ny2C2cHfg}HTSdE+3%%$>whd>=f^~BR>e+Mj30k{8ZIY) zx%D{V3V&xKtGFH)CBzw!yId8}Yrirw&9J8J?>D9tbwvK4eCOQWpLDmlGIOoC>#<-p zS=Hh#Lz=}>bAq{W5>S4Z(|-DF(Bv(@zW8`nmoDsc$-CFszAb2rF0bLi?63E^Tw0bt zjBC*WvL+n9`e^k0nVG5d%y}%}J6e`uy>HLYSzp1{JSD?Jxn(l~%sMUN(;6Q-xPpVG z$D2PzTiYj}@3Qk5QggLbzF~T^t@@t3Pj#gDW{Y;Kg)8~992H?VrYyCXJ;E}hJ6;}E z{M4IvU_IW`z_DfHj`L4TV!4C0W2K%jwP7Z2c4x}6kGI-BtR4PAo!)HIGKyh{28%nH z!F{CnWsP$wS0O)c@XlXo=uU2z`?{5S!w(9}aJWpW#Fb^;NS!6e$crV_Dk!)9t9F_i zgHmRrqy=?DIsW=u^A_`ORMadjkXYO&nI$4dy~?bZ$%*0UF~G!g+lp10cIKlj8LjH_ zI}(*UXGi+liy5XA47llR$#HLcUom$|>(H?fa^&>ImxV?_&LI<*1fyx_Uj%s8z-8S_ z#GV;IC^vuHByq8DB|84l`s$pFK$f9Py@7+A?T>RSgox(HMZ(f*j)WCt2P;(mjp8$< zEc1{e3)Moo!10_F@K>}=hV#gAOAkzYxMClD( zs;s`}q?Yh7bQ^gBu4ej9*DO%1$oUC|Kb7bQI|UyoNEl;Axc73Hsxq^rn_z}Tafsdt zBb}Dc6HK%a6Zl|^oFChhLsxag_3e8 z_$7(t0X>~K*706x;m)B}w%xl(1m8)e+-xcr#-Y_`TVQ=V&JO08;|>Oc3zc$p#be~N z&!VOTJ#6|F_s@F$l@WUjU;O4IOT5O02YaAxQT^uv$5z+6dr!h+CdVQi`hAQ?FYcT8*MC@Dmi=)wi9=||q+(#zN#k&ft8a%ZHJXsqq`H?656MEFKZ z@V`_dDpW%pt*!0QQ349APue9ZXLx=s<+keeRkDxb!a|gN(?5CY9~oC`l5Z6LTt?I9 zBWM{@q#Nx&8)XI229zfxa&*mBFGIs=$V;L)p*Bmn979Q^3RAE9@>VJaKtu%@Y}w1p zE!~bqofY2kaknojO3h8GW)KFol+|$Dzr@m0bM)A$tGM4MaR|2g z&&T3(F7JcGbUEH7J+X6Uc<|Gmc7c{HDp(xF-k+EyJDE;on8S9mZ=^V!R1(gaiUu>W zpYlj0oyennUA-!Z5f+4o)C{7?cB6J3uejxO16B&R>{hU~Szj;*#=015VNj=;3Hd$E z79JkM2&TLGLRJXcNJnzwv#t^8QGskhQaChy2qF<1z6I%I(nfH6pBCP=cSC>UrSTY| zzYKymAZQF3(8wSKB+~JiV+%;`aPFmFO2(LQ&a@PM(o7^0vDbyCgO|MEQxI29;fN@i zh={`I^)?eg*r6DQV7t$X_Wu?Y^hWB3(=OlGj4JstZg`n3GzW~ujVMc}?bv+=Y{XRS zGDFy9wwUcEQZc_oleiv5Mw_S#)sV;SR1b0kBbq;-kYu|^$r$Cu@`J%+*1s&y7iOZP z@u$C;@sO&+9*jz8X0k1X25aBW`wW9@m7NCx#nQoAv>iDp$9>Kpsqh7 z9&BJgh$z>S^aG5g`xkWvr5~YBrA4{x^OVg{;uDZ+Bav{LQ=zoULXdX(nhn=FFOf$( z#o8_AB5|PdQ3+eA++yi&<1_wHCcy7cpTQmJOrvdIT=4)6%@>hh#3r{uC1eQ4G1Co* z=3S~@cVxjM#Z2+96Lze7p@{F>fn+q6P6!d>pWhn@@cNlG@cxea0*!9Txh$tlj%1!j zy#=?+eo2!ShQq{lN8VN6Oh^4OR{4ruO9vwvHqhWDV6m%*3(^HgFFDM{yMVP2#L0#-Xh#dbj_3v+-Q=^x&A$Y+|K^3A}xId)x6x31%L}oBz zB#)!?u*|s-$OMavGN97>t@_Yh)xch%q(p+c$_8lm@9*8qRDDIUroVBDVk%W4B`X=2 zDylI|+TfX7aqaT+kZzF0{H`UlJJ`X-<)Kv!t9?JMPZd1%1&L0a_GWkXC=(@m+|?ut zm;`vwS`nq{xPpnSbVXIck7tk)q!CY!Y{9qF(%HE|Og2^Zy?exo{wE-?;OWJL zP$z#KqEiR~Dw#r?7xLh5%9<{7yCF1bsp3DWl?kIYe!u@zoh&<#03@@;K1s0(digvIn-|OgYjAzGo|eOJ3O$HrR%MPR3m9H7WumX3-dTd_yi3z zP-@8`re$}EO+F|lYd}Yve%pCl6MH97*kqkueGC$4#*#k5MDf36g zDJ8?C#DAo5o2p2xW+IjF-G#I7&r2kQafx#LiZ|WsK&F?`%LhfiYQAY#R{QSFIgjm9>)j>!1jlqfxX^RuNCKx zXeCif!Z`Si$I{Ea31#+Z(R8bp3f&PW$r(UxNOo%c!5)c6;UC+(v2p;BM2p_ zm*IgNISXREvukHYI@?FMAv7~SG?EN1^Jt?=Zd7P;cynvyeYh>2ISsdp_mw|l;w9*r z(y{HNq=ybfFjGFC}~vIVD^&XGBCVDO5ouSSwr60(S{Ns;~=AuG=|@W zpGosvFO{XupUMSl((%95p1DY!DJE0Lo{)r@a2ZhMNU1b3H7j}93wLyQxgdt$!eU^b z#dhX_a86BhhMRx_m$m50FB5Y+CS{}mL_1M~ROxBHPwJ7!C?RwTTtbm<{pV#+cD2Xc zu4`T-12v3Skr+H*_4y?`d*Cb3ep9)*tsqu^siDPyrwL+s`reJB@NwgCnXrt6HFcl< zW+-EFZCTb%21)esi*59j+ph9^v~%FzXs9Yo!DiOVMK3gZfQs@xNrB)GB9p#MH*7tQ zzJ|iI(lG;aVMoHh!?(rbK@8Ht1XiOvdBP9P73G9)a}oK>)@)PVR- zY~X{tV!h9lz<`fgWg8n%J)rxgikoO#CbiP67Z6w^*`7A+o)v;R^3LAP5CNywBEEGaLMPusrr+A3on`RRBY`XM^fQ~XIaM1qx;SkK;s z9Tyi)<2TTZ1H2gzLpLVofnk6<09xeu%n8q*qGZvB8LnM`@hk2fmnuy!l8qX#W>^U? zDE%UC-+dRmAz7hN8ou<9khz{I<6B*24?5Rm-PbiynS60pK%nI8KKcyd2P46rFqb-m z69AS?(7T}k10@t2j67CK{hMq}iQTyTTagufkBo2U2>9*VGPL+D@mPz#{jIlaIa9ty zigF5H>uWSgQ7*`9NMdNCP0PFXPt3b%@t4A|DWJ1g_=^!arNm#6ZIashzujDNads&q zLeI$-;px{8?+TaWKwKoXP=C~lIhm^{Q8)ph-dDvJ`Gi<_jkcrSk($cc^APZp@G?@T zqc3b`APZG%BQBr>>&qFlP{~P35v>WP2J$-ngoCkbhzz$EBcu|*sDiDk8mF2VDU+&@ zilXk$`BBCW<)4py)l$0;4F5T^VVK#R-f*?kIwJlP%eD$$u`E}!oy%@XYc#%7NU=L zJBA2%L>kClemEGTkMvbl$L)o zR=2|1?sgViTlHOOhYhocE4LU271MN=1vJB3ME z82`?u7PIgJbw4QLHxBs=crcGHU9sjJp}<}pG+y#H!fWXIYG(0$Q5LQuR6ASKGY2xj zBUr1qsWZX8)g9(OFPN!%d)*3#E3b%8Q11p2(Giwlo=j;Cmen)p3%wyHjm*_Ft~~9= zb8JUB6zUobY^8(aseiU8l)#bAAv`}nVBlwJ``+c*%h}qC$n@Dcf)B4tg+n25RQk3SsrKcY52%gn|+l^Kt^4*+SfarVvYO2NA0C)=ny*wYdnD zHjfg!l9Lp~%39XP1)|}jtZC+BYbIb$B_@h2>?QaHU=MKv1HJ6+99#vxM5zA86@0t@ zOUyTA_Ik8%q;}fLGS+w@%AJ_W##7P zB*@0*>FLSp$;ImEV#&rKARxfT&dJ8f$?~Sb;_B_-2KHicaHakW;vX0wh^v{4wUe8* zqXY0SOt7h=yPF6V)muC8zx=azQd0UCyo2jMS$N}v%?s?r#=*+YW^d2-?-s6Z(jIRh z|8(g8XyK~)w%^O94smsKcQJ!Vdq5oAsQ(?p-0WZWPVO#te}`jk#s;y2*uSZ|zV*uS zKf08WQ&Rnx#a|RyTH8DQZS_X>|Il=^w)k(d{)caWwfr5I{ zrKBVXax`=Q%RM=e2-RQx3z|EcS(^*~eap|!Z^3H{;bDPT@bIv3^KkI8@bd}qvv8R6 zn6YzkKsW?=E&dHk&cW3U>|h4@3+fG=)%pzwEMURSV`lLN!OI0<;Wp*wX8{Xv@UgI) zu|qh__)YnF+1dXMLdC`UEi1ux|L)aaQ08w?0=zutU~YCE79K7Ea~5tsFbB(}K(1@HPjm9n2j)UH@BI)7l=Q;RgPTPYym#c20f{K5hFtc z9PF%IoPW3cH86s2;k;1`{wq`80REQ0MI$KX0s*@@x@bB&+KEv8ztCMBE!;f8 zE)WUJHy+=(dP~s1xdJl$bEp{qr#GHfkiW*^jj}h6SpJPNDz<+H%l22r_^)V%+5TUA z2>-3{Zzblzum3kc{~U+^n_U2b|LNp^#qWRU`VU?ID+c~o z%Kyo(|IqcnV&H$J{GaUl|BWu>|6WW%9Nyl5Jl~c|zub@r-j-SLrV273s4J*DsHbs0 zGvJ#9$w^k%6$%Ok=dTMIDl?n#O^DzorzDMVfB=sPgSRF9Df8{X36va2Lepz$v{knX zviLdwwi-Nc*|x9jy!{^Z9wgW!&^*m*`N?o~_ML>Tn>O_)%#gkESr)Iuj{)M6K%R4wV`$i^_AJ)Q zED8nsyWPTQeWEoQCKN_P7p@nD7l{|j{kAXtH2qV^_SmI4-~?(rPmsRrR^`46ZzIvz z?@9PYNa8|@`q>jdDF+sN0qVFPq4+iCq8$+^?iGB$`$X`vZ~Z;F{r z1NOR|S6TWV_3@SI)!66Nm_OF&tg@Z=Kr>8X{6#9muhH3gc88wFAl(pQDHkHppfJa1Lheg_`Uc)Jb@6QB@wH+^%NSk0D!tV zM5GU9`0n$J&@ksx7ot=EXc}I4HY8sasp-`bRfvYy0x*Ig%b$6So3v6q=dW5%OuSsePz1f zJI_%R2_kG?8UKVS6GdPg6Z`ZiS0$ZfVXg+sr9=GU1YpgC8~>BLwn}NSifO2%`)ZtS zfFq(AbXZb?md2{i&um7(F}3)63(1NRDF`KZ0~UY?03pgE$;)9^C(4_&1HCZSH<8Tc zVzFU9Gb96bGx4Qk4^hdbiU1#Wor9+Gi+bGAk5O}+8m6|)^R>vCVB57g**Rcd3`Etz zp;GwK@Vx_sH0;1)Rk*PQvGnt7?|^++d3is?3=>@iscMlckN9)p;XxK^g2@=F)a1@@ zf%EPSHDD2soqggk5aWdWq&xaKOE*HBrxop?pwu+?2xd>9$GQ0*3h2nS#w{MwSGm;w zKx&HqNX;OmqMVKQbK54RGW)Qv2RBHUjR0M%A)Z?~B`<@^KiwHJmb9Z1Jr`fefusg6 z6bbiB<_RRe)FGHw)tE-=xEwGN^B&v-8zH3xGJVcH71k5-_NBtX;M|GxejPT0w_Cbu=0DzbBKU2u4ZBhL%txo=>~zu&Os=oK9)FZ2K};F|1Urh1+*vf2OWjf3 zfK)~7kp@Ds?;B~O@LFHDD3wD~lbtM@pUno1ACC-yChev6LUg^cvX1N4@MZ6MTR6ks z$dVr3hn*veW~M&h{Z$#Emig@vbqs*+`R4?~H^ao5WTb@$k;a-T5iuD=2~$-;%!qs3 z($9Yv!Ui#EDZhWdB7JP$)e=u>zs%;ND|8Vkzs_hQ8#sntQkmAmK zWly;zdkWXHoEwf2F#{Z9e-jeG$soXK(_il2hf1dOA%jdhY%&}II9^MiD+j(U5ejbS z-wNBkI}(xRB-qjYX*VkwG@w@%n&aH_qDuLxfHy7X+twq&xYcx*<2gCUFC6^cxpg?5 zd9uo%wbKN+adzIjzB(yo+n~RfQdWwR-onqlZP@hmNbuU8qx>E}Fw+PT zj@5M}h0MAf+x!%|v&C1EnVmJL(bG~I3=oqJI~d=^@Zp%#|2e=}&1-NY_!PgB|5MJr z&xS%7Ujh9${D}&uQG1=ts@=ox5+|E29d)-S`RF}+^`Y-@D}}L30~ct+N=PCX$>JD) zS+HUb=QyJ!96wk+*%rafqW;s(+N<`~*yYa2Plv!)$CtD8<^cXJ-*b`8YK**#RiCJA zkk_$Oak0SZgvjX5R|->0wBb*rdKoX90;AU9#8w_fd&d6P=xYwJqAavZtJp;aT;y$o z;r6N-beUkbenJIycmx2JmEOqgFccZn74yDR_P1{r2q!Qz795S6ok+!V+BwhnWNV4ohJV3{Go}&829ajjltR%6XglU>v!mJDF56L4FpI4 zmd4a~IL>c)Nk>fs&MS@c`3O0UKg_s~`eLwoIXVxUQUpw+9{MDIEZOnMx$ZACoKkf4 z(A}2Gwc}csG?h0T?bD#RK?NS(2(UWwn>(%KB0ELBOx!1 zP{Vh&{OsiJ85uug`Lqui*)FAUX->f|j+SfM%@e)Nwx7$6XBnK1wMwn0u)NvIIRA{I zML}dFwor-|Z)0}Rb2T+9nzf`RATv)m@SO3Dm%FjV9?r%y_16rlSLJlW3fz60(>14wbR2WOMjZlM zm7aGGOX=tjQ@4h8w!_IP57HIh9!-0@W#dk&Ce@{OWHr}pPbwt}YlgorB%BHfO%Va5 zLtOoy<0=B=xKAUVjxNVPGqh{a1di@5)~+SKZ?P-g?{~PweGNQJWLxLYuNI1E&rqZL z;SCu&tfE#ioBJ^Gt!k1oKXdMSt~H&3_I}z^nO}Fbu9Mf~4h81~0$bO8$KB!D{DV5I z>q$Qyk#Yhi;P?+EAI3nR>`S^#0>g`X2qzZah0J-*g|@M8RJ*f0zAfv|%u)g-R(x8> zGKaDI(?E{xJyh1%#czri08vw=eO+2M8xD%Hn{ zo$Q89s1VjOsw5yxkTum4)ZrRXk2AP{grDPZhjbB>UP57%TJn-t%QH z%PuqR^(pX)mty5;x>e0&kLA)if>1_NOmB-I-heg?W(o}A<2q@|l*qigkdxCF8fY|q z=*0_V!;p3Oow2Haaj!eN+W?v56>c@S5}&`<7vRJ{pdgO_?b6}5kDM?**G4RtYfx1# zG%}W-&y%+Jkoo;Q=W=6{mh%n>b2dd8o-aO0VXe1a-Wue9vZu@$#{hu}&@8Nbb~eY`bc%zMFBAVY>*BSVq% zXwFPeVOBRJH8v)US-omMLV=`9XsnWlLb24K58pYvP(9ekv-eV>`}jM?{k`sRWzx>e zwg9~)o^;a0G5xQx`L^3LoQ~TYj!p4vjE-BVdBiH@A_-1n$Ivs~ADez#8SB0SBcYTd zN}(4a;7K#la|RNbS;Ewa0XyxUM$8ZrUxDL+%bf3dS8KZ=o1IP|&q?(*QL5%3UA@c% z8<*0<;}D2dQaG?9N#k`fLZ+0~)3GE`zQe_-t9?XatdplVj+(BHE*gep*@;*GqFXtp zV-CSmtuS%`K~z*9Yb16xCoB|b_y&pZOJaQogtaIGGcl*r2Y%_4}l)BeeD1x$*!glsyKe~-+`=RfZ@x{ z$O-r@%|gWyCInw|XL${Q>?X~gf=@m05@sY-8i zSjBrj&g58Xd2g|ycM(33h>!<>+-3BJ z8ADk@)q$JK!pF zr}frz&6&=Y_4h`5sltGC1P(bDszE};0e1l_*|GH7%C7Owjb!|=9&fj$Z*@$zrtiR6 z(Z8<9HDux4+^5arXK4C#Jo%o1W*joale3%q`HoBE?M?reWyki>t3WSBQa}>HjcQw6 z>o}9KX#RED-8h?oi0-s-S!4pXIqt#g*pItVf!?o*m`QyC9}VH2h((z#4cL4P+|VG# zm_LFTsOH3UCv(29wD^QG3BlFPnMVx}jV$>TMMgGmy$r)(bw7?Mkki2rggAc9z3gYF zOpEr)D2OXOMU}$_+YfF}!{vN`%A*JfdoE|DTUBBVhUYrJD%a#G)FEO5>B%r$De$Rmm|thsF5emM+jZHNAJT=sb7`tr5I zFXhb}y$XVtV&|0;;q{ySozErf30~`?vRdRMs4>#gvp$OZhqq>e`(7?THYD1+45GU9 zggLT4+7?KU+}ng*2DhNMU7HM7a8>c4b+x{|B^EuN8h7IC>VmWwOlft}$YLsJqp7Mc z%YcmfQnuCZTxmIlc+L_?&Ba2?E)PxpzVw! zyU&;SWDQmZJZVESu3iXl8Mu&RjCv_RW611wb<08WM=+6fh9fhMKGIH}pL{{5t|gyuX#R<XMnv($24`0^=rj%5p3W23VO6vY^b_dz}E_#$j1$L;;#MG6McZ06+1+lrY z!=}>vA}S?Jxlfa^zi-JW!Jvk$jTZ4*=nt|j;q=QakqDVLXF;5{=D=eZB`DuKyd^g{K!FzIx0xunn8T|Gqa%4)Fvtw3^yF;r;XB9Cyak!}Mg0XaL zVXUmel;mb~m&^3kwpd5L|Ec!1|{II!XBJ@?*oVh{vIQzg8Nmpk% zUFg#tCh7B^%E6Tm&YfKn9M+MvlEaLz`eB!m+_YNJ-uBM!G08Cd%pQo^$)a*aa>-$r z?3UVtRp%^>6lr#QEMHC#$$u?{1e>$b{zx(#BiSlUg;-jVf7KmGLugL}$p;iJg7dMn zgF@93+SUsrxv!T@D)AZNLWNCBWq+7*tu&aeHD+s*@UF4nufm=TBnCPMDdKuKl&v#H zg-V{&v)vEJW&f#ys3QITC?W{^VK*|h#Fizi#%yII@*0&0#<5kPRBd#OtDE4CKK2iz zcT)Z*DmiQ)>7LWg#6w?=pC6g#I{UG!#Ho=QFtHtGMT%vk^1B~;TWH z(8AyrDd(`P`Vmzu(0^!aP{D{C-#m#fc^Wk=${e7P)Z=8ts5DyR^DjWm0LSp{DL}z-=a&{5ALwThL18#ZAqu6| zpc!<`ly1`?3Wm3)_<(7k;G)Dyn3xs0dl{BuBo{F>RKZ4^o!G zk|2X&6o*r#=2ouFKURIS;Jk$Wk?~7?vgZ5Ru)pxFc}(GjT0?iZ=CZ|k zxJT>meqFiNB`vZaKeu?(fZ`ZiD)bAsu%a((L{dq~1dQFj*`bT3aJAT;@$|48TTI42 zj4wi+kAkoFgQb1yPJ-3Csc3?TX=MDHs-nOmP;}Q?{Ff?GF&q>{?Eld<`1`Y?$xtJYW2PT2MZ%h9}G_6|_u_z@TVaPW7GY4Fv>W zQq;#~?zs>+*7rR0$7sXCPD*!j+hMXuHD|FLYi%3a1CxXbhK@0yFk~H!If0^!`~2FH zLXU{)3iHF(@jrYMz7SAAp^PfJMpJW~1PEqz-V5VsjrfxJ;%be&ka?Rz%)1Yw9|{vJ z{w~Th*o%*@bC$k6m$K3PIv~o+c2sRn##ZUV$va>(=v5zTMIg5d<1V6qHT`Si`(^st zDzq`iqd9dxmK*g|JR>hwcs%z#e!=tUc`Q9id(?B|?8z0zAqNOIJ#AA%*_Q&L z(=rO4lVV1M_7E_33Vn2it8l=uy1%AcdVFoE8sm^Al}4QS)_kr5IPp4OB(GMC5SvLU z7cmpP0o#i4BB&9bl6%cJ+a0lbLVnA@q@%{levr9hQvJflQLzeVX-u+KmR3!2yLjKt z)SH(niVari3vg-~nXDYwR3BFIx5|)l6_bIJc^%bc2rFSga|V}}Yl53t?;OjiHyjn_ zspUaCVNsD!tz>}Za4>NaEfNMBo6b4PpU$RGR>19ZvPu4r1NKUE+%g>;JghaqN`1UG zU8@!4VU?voj==dd#i7t34z%CviOa1!rTYxU&N6UF=%_}TUsZm))&$Ua4RX#u6SQ%( z^0@K%YS70(X4O`xnQNLnVK~DNTNwBfbmi;Xr!iubeLZCY%C!Mq*uCq0=u=%1$5zms zo${9O$e@O4UZOUYP2fsy&-Peyda3PW*`p}}B`uZ6)jl)h>A_8bl0n#1(#NoMn5kaL zvJlQU_&UIm&-eMm{TRW`jJQ=(lK>s%Q>_xWdIm;kER|9p@8;vlRZWBj>u zAca0twwM90c8qI2wRXXd1P#-;o|JLSGSsT)cF{e=cbE=y-eE#avT6OaL1;O4mn<Jt|EcBAdo`mPJ^sDk!Hx`^+wEFf&1@T5TcmS>V- zz*d6ml&}JE6ChVq3$Vi^v|XHmH=~ghpCt~t^Q%x=y- zWKArkOF~Y;U1c}21_6l`$u`xATQVE@ge5cJst0ksXm24fvJaSqmYgxK=^c%6VX$oK z$@^47p;2Me%%dQN9Ia)}e&1g};PIuS)L_IPEdEO9zm2)BGbQ9drSHE~AMv|AnJP|p zI`u$2<)j}#LWsrj3)vh>1+=O=SNQ?zh2*(S>&Y_=lT``Ff7eNpEl!6o?Hh-kf;%t@ zPp-;pxvS;GsawOCK=FutjR)5|RuiU}Gk2JFQ&;JHmU3FGIYK#*0Ji# z$mZw5N@f|3sOs{F@eYO>XsEkMG{W}$4I)#rmu`Ajm-TQ1zCAkMR_+!m%+9&Ng!Ie) z0sBZ%bV>mG&~dVR#}J+rEE! zF;Th*&e5vNLrc^v4BPNiqq@Tepf%RvkHaW^w;3^^v4CL%FTo}2Tc(+kKxISbB_A^`LM7hn;^*Ep zKCA7c`C+ii?g!`Erdw0dpK02&cK`}g97YudPxk^BWpQx3HZ2l{5Gm6nlYi+ z>x>OKRsKzeuRaw?eWDdng5B0LK%Zn*yk`C&Y+O9}v*ZKO%=b zC`=ez&p=%pgaLipMW}@DTjkk|c>&V^MGqqyY*$vEy8ee?`JlrKW2-*CC9A%zb6_s5 zj9@w?T7;x?!LSbyVJ(TRKt&R1Chfb#{v681f6gC?{6{Wt0~J#L9yzX=>XJ#uRS0}p z7;W21O@p-`bCpt(Pk|iNI`1)`k|V)EdXtnSDT)D8jR}%xA2QR*iU_wWyQ5hJ^ym(5 z9*Q2@MBJg90VEu3uif5V27N~lG@MqVDY#r109Ow#H;WEKLBU4+brwK30U4(8@+6fJ z3#OchT&0KyTLv>^%B?DkIFIp{nxaeg7Y}X^iwj4-u)Z$Y`s$taj&cCZgT|@sn$Hj| zr^d3+37y{({j^}RG|&(!RTYXx4MYPYZ*5-m{YARRXIgy@ZH-aU)@k_(0JVRL639ZM zOZp|1PFBXfU*i-JbSk>fwioYZuU1!(1}&8@(5RK42hLi>Z#ED^p<+>!MX z9cDEkYQn1$bBY>{yQVM(?r7d8(yp~()!$cXk^x>$Lc^i9sZpFc7a=&1x%jDiwH>M2 zJq(!ilUgzshwRk8dq7`tAJJBZ`(rT4lsk_kVsuzu zSjvtB_=4S zZ78_vN=9j5OIqTZk{X5X({lt^ZGx2mWh3iOxuo+>j`)5)C@=&6^Uya^NQVATU!a>MdrT%}GV zToM!Zb>{w+`2m44HJ$P|Od@t0NXS-tLk#}qxqEDkzW>H)--{|Z5aS-BiE5dEbUAH% zKVgc#v!Lha#w+DA?+#I|$+Cxi2#|+kJ{3tFev%-Va#`yd$%#oEnhMKq*|i;0&(6OM znC&m<#TGEIs`AVu4krv*)_WFsxwch)XlVCOS6Qxp4cvdNKcFxPF_GNhfquPhPdV&- d9&Uc^Or7yZBa{Pkz8%~Cgn5x@7Hi}%-E^l{KX+#bq*ygiQpaC^w#9&@2q7k9@UU=mT`)_3lq4eUO>V%&|a zmyz`{y#Rk@_}{io`0=`1e3_!U2&$^xFqYe;`l6cOTD0kV$G%7|)*Oej&ADcGPs=X7 zzJF)=%dSnHl0Go=b2AGm1&=XYSoL!tg0BvJX==3uG-fWPn%8P(?pBL?saDOMTD=cJ z_G7N}Lv=TLtLj0bhg7o!WBISAi8@eW$Y!4a1dE2%8 zvNQBSgRbGbUpz#A{ETnBzh)Ti&UT-h!!b8wvG@AEeziU1Z-FdTdH2=ZzJ2+&zcD0% zpu(b!EZRT}0W;&1FRti^LfZuH-|pzzNZST3FIu`qVA;mgXDR|f2u@JI0XTgos^H-6 z9QwkWP0!(2czZo^y~|u(Ro-rn6v}M8fe-??@!8`mjzghIfrob|{Y|4>oVBO-)?J`m z#Q%@_2lj`;+s(jspHJh+k*VKm5fQfe=U^ zbZzrTfBMJw-up*C_ydViQ4vIhTAjmC_=_Js=a+{au0sEGOL}*~)4uXw{CgjAw`(}| zIsD^)wYl|qBe!ba`+xR>v%^P^)~lGNxo`jnz#W1@OnNea)v9IDBs5GqK~Pab5CF{l zB<|pD(>0EnQEQ=;$}Hq!lnS*vX5fHevtHwHFkZbWw5@Y?7I^30isdrWra0?Y1VJ^R zI_aww4u{HSXWY7oq@>eY%&Ar=#r}=@fv?@anX@}&LWJ{m;@+JlU7OIL%=eD~At<1H z{r(+uKaI5*$K!~*QK~WYm0>i-(OI{F>#cEl83<9S=8VPo?8`m>{r~*gdq4X5lmF=N z{r(64B!XzW)Wt8Q{DZH)dUN&{n>X~?zyhlp`TngX|IW8A_{&dUkYhy_0hW=?kFN=b zLjV3H|MgFw@zjm;Kf6b}tGxWnYk9setM8q)2o3^*q3Q?~b47dtxM_qY3MoyS?(QcG z?z$TTm}zj{05CJ$9COGbxC`b&aKMG2Mh(*@2_OQv0ibU5OXvJ7aCs4FQy~S2p&|mR z4x&I{%u3%^YBj3C?aRort3bwQ5OPsO3}n7f5n^)Ds38w z(NT?)0nYkWZ|)zL8F;YjxWRs$JiTj$7@->E?34=ba=Pw&r)i-AV}U%XedEF1Pd@qb zx|rD_nz`S(47Y#X*?RmqA-xe(OLk!&lz;N#ivRVmHdsuMoZ+gHKRuvbpp5X}{`e`2 zADpv@P!30G1uf1W{nkB@fKgG+G-;r13aY~FL0PvGI3aEkrXITJ8gA2B&M4wo%6HRIg}K`oVeidK}(f)nk-NQ>+!=Z|mkiynE}v z`(O6`f9hvZ%4US@pg^wVexPohnkumiwBNgh6lZ*V#FKFRVo&?sGxD~w{g-d~^WVCU z61dtLF%}kWCM5$gLNMH?#o|ECxGCmPE0hAcRK9#Bz{CzQ3SB3tKrKQw#efthpjBp= z-2qSx5fDIB2?0c>u+p}|`I)lW+9@vxq0ZoexdBGs8;9P&o%K@C;D~Ud)^PxH@CsrI zo+%^X5CR~Ah$8_+WEufc2blnx@#Wb2DK|I{m0U8_A|V7s1hdItYW3+_g|3A*=^Pqh zcc`bF0*yG4TAiGoI#z0hHo^8-xqf4`%fL{a&93&PdRCF@j>K^Y@vE;&Ts7mfKmX3z z|M@?@-27YhJce*5A}Zu(Z}42nhf2JcNN0iNM@w+U-WKw8K@#*oe8c#*@ct0_`1jXb z?JBslXezZ<%nCVIQmh~j$Q)}yMKCwaz#Q&eLN3nG!+!4^4sh7YiRy4DML>iapaeq& ze4Y~oRY8Ny9_APzG6N}s0R-peo67Du83Z_`I^$T`?~NFp_0q|MU^W46vrq&a#Et!4 zI2@fO!P#1Aq9MW20Fpq&aRmvWVOmeF#<3T+2k3jKD76NTgRwstr8-s%w{9uR4pMR! zjUx!92Hcck47|B=USGknz~)d{XeC+2>!fqh3B3#TAZ!nXx7UT;&JbbH;74$xOWuo? zC!76v`TBAAj4nO$e)te9-!E(j3VM9erOY{Dk{);{B!zHWVK4K_UP7&@2tCf|IJUoibSZzKomO~$4~ckAFr^XknVP* zM=i~pN{oq`3;%R;#XrkC&bkG^AI|w$135z<6!X9^3djU(n;drlCl|+D8Am~I#L8*( zEJSlUb#`0B3Y@P60#p+~a8>%O42603Aw&gDI1rQ*s3{6D1W-X0F3uyvXzX@VtlaIK zAd$3C`VqVu;vhg!hm#RcOtJ5c{SiWf%T=Il;AjRJM4S)+7rbz~jy8p|>cak5QB_u} zNKAoj0w#nAT?Z*bt${HcPQ(#hpw`N9TiEU#GiXy}5tY#)_~b+dz@1{wu{v+}&T(`$ z8|Uh6H8Zym?WMWx+@08G^H*<%z2)%5dLiF99PMr?whKuvyKksixd45>Un}m$cq<1ZcW&5S4_DOcBVltl@oQoQ`-)$Zbp_u^uCe@%JS(=>|TN{q)s z-5R#f?0;QgbZo4=-z<5!NL=2(;Io%+i1%AO8*e^rc=n5D+*w=@gAf!%1$TJXSMDzp zix{XTl&VZ2TM-qa2~?#9A&3(jXSG(Y_QtDgqdf{0p&E0X7sl+Qna({pB|2gO5vXbm zC^CZ)WYU+9#%^1~@7A!}(env(cB4T%GI=70O^7 z4|X#A3>>mCWarpdjz=S?$WZJpE-zA41v`&8E3djJS#Nts*fhTU>`}U}4(07Y^InHs zCWc?`2rmogVZ|=?Xe-p{{LcBB-@Sd#Zf^kGDjnPBndU)4mXWOEi7pjE6+RnAe#`(5 zS|knp?sdl>Efb4I5ge~I$ND)%flPpv)CTSAP`2Zl)3TB48AnvF- zL8f&CF=9|cn3A_;r=$cSC>rLP8vrKI9I82k6$W!qC=Q2l(!m_}XM;f;G9UuxATEf2 z%=4je%uw-p9iT3A$kLP3Etm756EKcO-&dArLTsI5o@hQBGyA|WR5rWHp(@wvEF9D! zBv`MNV_&lgo1oZO?XJ82UK~rkSS*_mf^=O+e|Qit)7{AUa$xm)xA5vGs`r=9-Rp+S zJC}T_ukc_rA2fXO*^zJ6GlB>>{PFpcr<;M#wJ=_ShRFj|;ks1*y6Xu|#P&VmR^s!% z=i>@(RH7P8wK#KC})1+%##5CECSN&i?Xs3B4i z1b`WAHrv8bj3Fzk$}mCgt~c|UJLWQ-^i_B~W}dB_^zj01;hWD}md|_6&c)4b zCqW*gq1q6BP^*0-1{Gf};_W8tz4bDtLl@t3hsC#7lucpy;z0h@k>;^sS>W8zE+Owk z$Qk>%F&pQV}2|ndrIrWEi94KIyM@7IT_3v5I_6|2!%LoxUdkKq*Ep z#-WGQC^0%QKoci@Z6m~>fMe4=PbH)pU%l(3b)+16V%zZ42YyQhX~d6-;Dql=@PqWY zncs`6E;OpXN=fznJY9VG#qquUPY2c#IIGHotmv-g%9K%i?pzu#w$AQVLDq^UC*E)P zr@L$F!wv~b4Tg`En1$n^aGnES97lFqKpj~n4xjI_(KwSpkelQXS1JKe1TYi&!8r_0 zHs^dD7>m$X!x1WA4#lUE$7k;c!EgWs0I0JLK`=m>Hm}dd`B_3!zySc6#RU){8z3;0 zsbWcupFGvvsf7~&n`o%nQ&d!6|ognho%xWyvH5VIlEmtv0Z5t_f z?!>%0)2LBWN~)`FI*c%hyg6KPcj^3rT=4Ym$o3bNyXTH?7JTv3p74Ve;XFYxYCkZ( zEaa;m>xFtS8s<_zx>(je{uJG zb>}$x?Td@}Af|8!SSCfI3XXAqb;gU`hUKF2?RU>uiDCwOjI(X#>CZ=AKN7-aAl+@L zqvOS?xl(##@vuXKknXkotKNC=1R8+>Cl7WKug)S(r(|IUEd}NyV<$9$Se>CjKN{N| zXmq;eoJ~hT;6}biyK_cvPzI+Auv{vVAs46O3_xN2VRe8R*NOhkA*r%lg}IA43CwL; zbAU-^{ct1I<%X6FqzKiGCszYMd3}uwT(ptR!FhMpvQXuNu;kZIdi8mHe(YE5E|e&aJCwfS1u!8!>=+*JX&-g` z7J{-HyM0ap3!dsC z<5YsKPc`}!?{D}8ggKVGPQSgP~qoYY7!|~T! z{Jj;64?1jLxju7#_VU1o)>2I=bw&>Xror8jNy!9|Os};tpX`CEgG`xo5eH`$P@PJ- z(G3Aa=SR|_kY=FG03aZf!Q7xqty6gFM?W!4HlvR7TI8mRhnxNevjIkjbke1W8#*)T zt3&3m_giG4#APCMimnAyu>A-JLs~t7e?Al*YNQ@v`?~TVwS2zWQqL9iU+Z9}gS?+U z-}B){IUbFsrDn684}Qeu7;&=00JvGa?PGe+h#v>ycQxp}5yGZ8MVxM~Wur3noo9@O znH|6?yIGl!pFV=A#xrChb2b`pU_#CrmF>w3_U?v8j!lF~aDJD0xJpF)dPW1`UaWHam znnp=+x_@&=1%T5iI6;{i0OTeFPzn@x%%|~a&OhJpsLMcmxuCgd@KDLyfx6E~5}JE0 zX0UwHvnX&YHe5+10B0fb=<=M`=NYT@-{@e+3;50Bk%gV|q}uQ5n^Np`2rAK>XFv;> zQ-^FhFJoxe>vVU0mKN<&p;1DkG;^k21#TxO4hlF9=6IdXyMMGD_|5x)a7*YvzXkza z1$?Nmb5MZ>V z$*bW7a)shBEy)pX{**a%%mB4XP7?Iy6j5fcO(F=+Pz0-vHhStp&WS1R%%K5bYIWBF zR=^wpFeeB^CaPB9Bn9Vjsnn&gxZlyM1Ilg$vFz#fG;=F0q#h0v>zXD{d->iaDkGtD>FXb^^{J^I@Cu(s^a zDtl`=ct)ZT-|u+xn}Kf=sl~ac3yx#vI98V5JSPrDes*Mdxu?0iWbs}{|Ln-$YzF=` zDXPG05MbylhoeypnpR0^J_IV$93pe+ zr`)u+alAUgZbD6jS^qQ|jw5U}a$qE!MdUmn8Jb5O@pglcFn&2QJU(JCM(*{(Dt7eM z8O@O>ynQH)ZuqXS{NAmTgB|{M!=3FwSp=l*cvUwL!CF}5fMtgO&)M1c&Nqi8e&Oumnzweu%}5UyJp0>``w|g^T*}q{ zn4g6pUaMOKw!nLB4DXzG>7&c_;=?<)mfz_QMiy8!O4lf&H(up{Iqb7D>QbEjEMmkFomSCIHfwpAz^%ovVCjxk9+zzm3pYu zzL1W_M>(;y#CjDtUq>!FC7F}DK*f1|G~}a}8uS$B^~-^ezEW~_#+S~)4(P*(JW^~^ zdHFt^{laM~v~6=Qsy4aQ-oYX;0`F^(KU*)mZ{E2$`(DjqX%kIOS#o5iN14HQ9LEB9 z02>`SfJUPW@F#u8n?s>LLX(sx3AfjQ%lTRVV<+^7#7{mwP#y-F_Y%7$9G_2~q)}M6 ziI0cC@oDAxtAYKKf%KrI+>Y46SnUGz1G}R!3LG3%fLRm>Ok*uji*dFJG%bibd2nJB zmJ!saPTnw1p07!$FjoLj9g2g%{Ms=fn`86m?%+7)hE=G=Phmub`PoJYQRsqzC><~y z;L9hO<9;9>oOf#EA~YuhjZrx3l(Ps;bsB|crS#^sUmb~0wj5lzyHzgxNHZUCTQ$nt zp5|CNMv!jOe|;%*zcJ3b?vLBH{pVvjYygiy1+s`fym#m9`!S|2B%w=6h!bt)3;^J` z-&_Nr&@5#30w~4t3g;nmel9d=qT85+!C(P&0p2-_aMkhnNoKpvgfr#XgNOh?fV2>T z1!NSSe=)Lu+)tTv3fwIXqdHQYrVA%90pjGiBoU$rFg0xY0fy|9ogreB3af>n3uS&p zn?*ZS1qCp>xkmwl-?WuwHiBx7f34heN^y=yo7=lW+fGK0Isk@%I}YgRTn@rnZV7SP zqa;EbgeFY;6q)tTjMfO;c^g=baL56Nd4b?{GU~2X*4N7RCnNenKtD>19dK}#>u`6q zY<{rYA0InjBH%$}*QEGP*L9r>Sb&USRVd~+pv)pOW7o(#!$Usgoz!hi{^?);~xmfI)7=DscSmF}RttrL4 z)Jmwy_&L>wc!VNM_&0UT9D<_AY&P|`5z7ga=sCe06k&Yi-q@u<&X zVopfajar;zfsr{3Wr!;D#ktPzua2dT)$0B@1O-_&IwjDmp0jvyia@zjqYl5WDci1j zv+KFOKK8kmUzstg;t}9K`0aPD{0shAi`0FU!ShQL{JftAd(T!f+#2arBNhAm9^tb6|p9UU5r|avAEigx3)uGph}F| ziHN)VVa)Zp2)&5dqKQ9yb9MNiYPGjFn@6{3!krZKBC4b+vTjp|G3rNA^*wX%hFrZ= z7kBSOPC)dk5^}ETIOJO?gsWjJ_sxCLHc3*{PB`g5j@e#{Fo=k?DgNT^X8%7_tFLY- zie(IXDI(_rp=shplR^x${%Y3cVs7R->u1r#AqEX))<5QYrb23hgk_3)`>f?`*^qQT zj-FUxw2_y)q4?|lXvgfqjHY60)s~3IRzv8TV1V}7y{}oSo0{25RCX!oXBy<^g1j!Z e{z`-$sQ%y3gpf0|_(pXA0000T-@-G&g;4VRe>*9+CcL)|B*s|>6?wa5(A-HRBw-6w>1cJM}TW|sd-X`CB z@9%r-y{cEY>b?K&R-HX(X1YJq{psncGhHWKT~!VXoeUig4h~B}URncomw;W=sK~JY zyiC6!I5>hnFD+dc4UjvvgOfef(gs59;^_dPhIm*);ov+L3e)u5=!BhvR%_5XbGZG#rL|9Ovl_oaPz_vQ8@iD=OI zD|exCr^|dDhm0hv9`U2#jjn#;Ec}p*+Zv?Mhha5iW5UR5FR8Q9NI&WA!}%%;-zb6h ze8MH~@Tcvq%d7jUDsu97ZR_pV?&9Y~t)ok$v*`_w`jgZWZa!h3$ z!P*^->@|P0Ozky;;=6cUTjhtRvfGd5{o`ba$h)y(l*_!SYh==?q>c^xbD;f^|LGdh zyNsYbk#p#Z&<)6F4i2F$lH;JGb!%6R?(fV#T{VsS~-eC!;a+4=eAfym&>gmXxa6uqMod zaOKE66JE=u+ufo0edoPks~c%NqD|D%bu3JLqvzV7Qfh1OHs@HB=|1n;R8`yt`qh8a z9+u{tzoS~<0(y)ftJ-q1w}GnMVgKuZcU4}Kry7BR1BgR1&L^Ly4oal{@MHw$!< z#Z;P$?Qo+pdydqdu5{p6`v%nM7FXcrU3A9ly+_E_BWY8+jBP|nU-(>wB=G7?>&0nR z(md}m)x^eV{my`;aypdTxrlrB+IqxjrrcK5%H%%lA_cNV)ot;)*>jOqmu`~GZx8%^ z_`Ix-JAM_~`{hc~z&2RED?0JU#jpxk)=&B79k+Gjd|5?c4ndPsHc+KW(ddKgC)~$< zr^mILW0Is(x2t885*c+SJ%KLTllCc6w2`VG&0%d_)`%i*dH(58%6=+NZH zAf|&~iO)^>kOIY9W?g(Vf6Sa2*#d(u&c@|d4ut|`d<XQj-64b6g_?f*34v?wn`&FI@u~}*n zyN||(Y;jiwoyuYO^6zrJKtMpo?yepC`ElgajJ)H0 zKf%Lp6WjC-j0Y*7&H=ry?*zXdurV6&oWtzQWD?lJ6W%85lC_vq0K9KL?ls`-GEK9` z2t=3CHMSjPmB^i27uCmUQc%$tN(j(X$-TwTo+5Gw>Wo|rWUJJ`&5R)>eL{AbcA|Ak-TO;aixuTj(|{6e*hAt*nO&w7FyRnAqXhqWR5#S z5VB>1Pvn(UHFFv=b2-hhDxEx%dFWoER6$J*)iM@b`8aIML|!0y>`;VJ0l7*lbKWCI zdjw8P{UAFlc$4u3-LXo+lz)SOea=B+UC%kTV9Em2D6aFMVcwYVGyo%Yp!t*}*-2_BPr;1_EoBQgN3K}HSv9hxIT;+;)j_vg6&sBdfKW`^A|PYX3Kz6mT{nZ!J$ z1QLYqN3EcjQYeX4QoZ`nz~k8;$b}Rj9dLPVwuDMqK~E8>X%f;ekEEB(E%#RQSr|S| zXJGVb^z=7u{wUuubsL?7+Ye6RLg_0=s*sL(na~Oe z!`iu57=SaOlh=)X8%vLZuN}W=chik)nfj&j&TxPD<7Lh($)~- zwnoDh!0J&Is-TG`hp!Swye~s!BH{E~lwYWmb;mocID&DDHC>^S@JC>q zds$*ij<`ag*DVnd^Df)Xu*nmSamiyLK&xv!^3j>PlQpTaI^}MYJ#np@2Q9(Iz_$Kt!Zc&dGnWZUUW2m$g34V?0#_Nf*ft9=0sMt$&Af3QI z8gYgf8p?eHXt!@G@7ZVL9g~Ch)2jTwS5fj)e?*||$hG>$rqFnpTPmS2ve$7j$T<*w z-Vy;Z>UDZ(MkW;I_Mpxac;i5;s|pF^^vCN#y9RhgAmq3(D% zVTQT&y1{99wU5hPOz!a>4% z_iHsnV1kBY(W#STd6XZ^VR|JJJC2V@3@#SBul?Y;5TrE^BpoOz7@MoC2|bgLGVmQG%9bwX9s$-pMNaE%J@&#Y%*Yvr+me}_V2 zP#1ZE0;y4(5w{nH4?NeYJo_v0)M4`O-$G0YQ6}YQ&Hf zu@C%WqaaP(00KFGaMRJsu3Vq{1)E z#C}yhd&!-!)NRQ!RcQo8P7n+!!ez#zDjSiS*A7I5ql9lT0NQv*avNZOLdpqOr*Sls z_Hh6zCXms!zah(KuojB{Y&_Z>-^K*G{W!8MSIvxT2Aooy4j&FfqvU0%n69||I39PP zy&qav%cuvn`+n+5k7Fle++x-SDzg-yj20F1g{6fa9(%P#D~dB{ z7l^VTP$191KPBl%WlA;cTMULbDhk@h-f) zGW4d#3;_%w1%Tul-Wj2Hx8olPvG($#cE+?2nM!4yKI)T|vIh~3XbRcl^5;P-7G3d0 z>c_|l$`#DWvM2`9!@3a1I*!~W;tm|Fw8!70^nAp4834ujiCT?heCne0iawAsle&O3 z<|T`B>OEVq*UQaUJk@b*CjrlctXL`eUFv(|qB}Ag*|5GO-zw7J2v0;PYT>z9iaghI zYIMw^B1g>-TlZSsC+eCIPYEse437^ArK9t)6jtanR@|WNq!esDZRK0OEukRGz;#jnXyHxwZ(q!@4NI$GW|lc3?WYoj}|s4 z0xL7qr6}246;U5#UE`yul_VYs*Oqs0!V!-xyS&?5XUB6D+tR+;FUR%Qr~|ALTWVaugEfK3-T&0!k`u>JsR1t_cBF#_hSX^TL&Nbg7Rrz%&F7#C3axO z1rvP~ib=?J!5Sd9a31R=bA1JmU=$y*Rj+Y1Qk-AVob%Qdt-cVmK_z?j6R&?a(^|Iw z*aOo-taAjBsv@6~_=|h*K|JGmWcFZ~{c}_SExufJ;stL41%19~S zupqq19p~(TKCo1X^0}hpfNR;w3)Eas zC3_rpIMmL2<#C`(xYtA1*S^$xygyPezxHBCsVJv; zXS7b3F=U{Envod-rYbB`xl!-(ydLCgU)Fco@s;P$lpS{rBpd}hjiJAsI^Ns>5WHTd z_F(PEOU^m#`EdA*Q8H_9_Gg$CJt;{d{&P=qyh$uhEQ0{-I>Cj}kka=b{ijIR4N#nY zrP0l5#4Mz57qudag<_0ChyqVhIaPv3s^NYFw={gq#B73lE4!+MMt0~QVj=W7yUZ|i zeQNUf-O(K{E2+wI;blbHHY_)e>k2&F+7N@WL7^7B&sJmM1Tg3BC;2oZDUIfZ%;3A^ zSqF?I8N3ME%6k?7CzxqRyk8u1nQxr+bD4jP`&JvStPpc{H>&G;Pki9N36vqtrX+oz z5h~S0^LFpr613vMXDOht9q0cb;lNDg;M$&uWiA)p^j=9N?jj-%r;~!gG_N~fMpFcE zVCB+j&KK07kXEI?VA?Rrk(nMP{n#icM5;cK>4sI6aZ;pcD=_fPZgVBk7E4iul6Bs?rBl>mN;c-9=&JSPC&`PG-}IBf27xf70?c#^?+4e0ZS|4C|rpc z;zRm<@uW~l8UR!(b!6OapFOQkk~V%Rj1mOIqMR-FA0*WlnOY@X6<)?Rop%+cj&~}1 zBjTPDKPk5`D;M9~Z70H|`L*gerxd>?Blr_V&7&84!Yj-9skgC)#EQ@m%KRx-tJ=}ftvO+y52xT2UDroLX6>f2P zBu4lt{30mxX{jb(iDHzL&}iYJXn}iK^g~spc!E7oL383>`tF_OvwXdTCwhh#WNPU+ zotgq`iSk3Mrjg}%(r5Wr#xI_}^R4Vo;R0ms(mQ`3KNJAa{@WS1! z;Ni_a;xwdk722Er5aTV?x_9@$F+L6riG<2Cv59~v!>-x6b?mSo$BK0@Y+qGigWhpG zclOzk4^~lGTbS&zmHvpCWI-TtJgC!+EB%z=-Me#k_Y|}-E+?=gwH;`OBN26Y%i8t& zi*dbRXg)##H=np}X*{dIjJ@cIk<1&g5#u^s5o1Kp0E6d(XZHPh8 z=o08CQjS&92L*;6ACL@YEA4wRSe;AW^i$R#$JQF~>&g1&p<$G{XZF2wP(t1}xNLcm zA(w7iBgU+idY6&=9$cLd1RKs9j)5HV4+F0A+X5qy&}Uhs0H;*o25OD&iD`4BUaxw1 zQCNON>Fcj??t1I3y?PbXdiPlm!JT=H8QVg`xG!tM2qti7@?%)6s&VqQ>3XF@uJNfJ zLH*eb$;y>1B*2{-c*6Kil&8Se<+Q@vf^-69xHitlUjTF@H-DY(#`aj-7FUGZY=72@ z%~cBop6mhvA^l5KRC`3?SxS`^L=N}&xr~O~FXhfB2^8tqenovPfx}!uKrFMfKlaTK zg99E|?IQ~cBJ~X>wC$XoJf5sPicX%KqImH;mD=S~55X$WZkDhLv#yG=5ZK<917v1z z3gPgub%0f%;owBXJsdz_YlsWADa72;PL%evrJa`A(oB^04W9~^ih~ry!cyML38Lwx zss;A41_RA##l_G?JcM8Xwh$K(wTG>ZowJaKDD59yA=vZpZcbY2KO!#HqO`gy>eN#9 zP7rEd4qgr}b{P*#H*Q)nbZQYNGpLY;wCq11U@cKv3l|p$Ax=(rcXtkV9u9jab4~yd z2;}7A=H%vPhe@zId)m2xJlO4=>3&1}g&_@b20K|gxLDfTQUAsSncBO$h|?4od3ZBj1Nu^kOL=xgNxJFmhRP=&V}yp5N6rs0c~hgI#}{rywm#`+I&NGkdV5 znb4m{0KWj3n-3(&4&ed|u=4`AA?&7R03LP$UQ=E!0X`tVfEn~}PzrX=E+9KFvTH^iPkv4afxwQ-I}wrJb3*yYv4DYgyVtG+jWy`2+}X zb8!m-cmce;K%f90&;JPNK%AUmYw{qn^%ZSK!}T9i%U?5k6(z7m;HD1 zZ}RqLmQc_CoAmGWp%(co=<=4%u=zdzbp4f6nh?joT7NZdEdL}EHT9pg5CVb!a={to z2Kg&oFs#3Zz!o4oa|mqz_{W0%XTRnDVKIPtKwzkVDIYr!2y=p05Gu$HghF`P`FX%V zZU{dQ4?h6%hlPKkJKIBD+(Ax|SLQGtVO+r$=pU}Anf?(f=6{!Ww}AYP1B@~lN9=#2 zjF$5s&T{_VG5+bT2%VmUM-2Q&!v9@e|E23cV&Fd#{_pDge?}Mj{~V?ucCa@fci2%0X@pT9 zcFaOHRg#m2JBPc0dl(e}Q^R`D9OU(!;ovave_!x$X&EH2P81gf6&aL06l82cey6jQ zB{(=7as}yES{5q}sY=D{^Pa2kR=u>Q{W5&1?#1p`bc`FOnjk>Duz@)m_>XfWNB*H_ z)HFd+qK%y<?5}1;-Qa54sLg2aH?ZAIxiF4zaOR=vvfpvmM58 z?+_l~e~7R6I{kW-TfV(rKgawGH`0Eri;#T_y4V(GI6w6_hFeIUC6JJoKr+t^!!57N znNnCJ0gT03iuPDM3)0uNzA7FZ+HFl+lEeOht9=n~Y4o_-Dq?ijs~75wyvr6bCfFZ( z8-ZKVFq5W!{C?kk{fTicyZwIai{Aho%(hjeudONWP_gXI@=otiQ;DE7j7H~rtGR;r zg*3g=^y?L4H;D+kC^Nc>Yzgs3@r34>=mZrO+Un{AuX{A7=l$M5J04 z2Ze=C+DRr3UL0nbrz1M=0!0rUwDqt*cv|DwH+wneWRg@?A(}^qusCIK#c4T?&`xuu z^Px&&egM!%=1l0Aiys?G#!M zB&I_>aueoXTz-Kd{_Eu9;T0>Q&+DKkXKPPdd(kib=3RP7?_HQ>bhIB1o0Nqu0Uk<-xeJ2ownTuy?;yTciLL#~IbGTy|y7hCL5U{=a z?6KjQF2|>*Au?y9GCWNXal&w%Am$(rKJw^(7r4;DZQ?cVHI0VSw#!M18z8a0OSuY^IUF2U zoOY*7%OT%`edS+#<3zuwsXfLgX6!1j+se~TD3vT%T#d~}eEcrz_xZtHc5D1?c5C-y ztlcCpm3cyM9(df7g9x9ci~L5FR1#A6qS=+B^&-*VS8>XafjF0?fPfTHnXwD>{RkV4 zuz!uEq$i?=;|Q3*1~Jq6bw&Niq}y|_$p(2X(TU;rxfis%MOgPzpjng^pRu!% zH+}7i@9MC()c2$c9kHa|zc;B^ziQcCTC!28xN6!u>)yV&Z&E#Z=ohgQR)yHEiI-b>c7U==>N>R4V5ZT+!+tVe=e2F87#;!qDJN>WlBLogL-~_ zICObkbkf54Fd*7j-0FA}q>&RF-bBR)Om7S#BmKBOevCFk%29>Vmw>9!tjmj;TTO{4 zaG#|nrt7e4Be@yGOYpe2yo=d9aYOekg+Hsjiv({(n3s4)sw)yCcJ;8A?tXh0$sP&_ z>*#3*;bliM&glL|O z%;DRkw>KUx?>enq*D$ibbd%5;`+lJ*l6*1gzWubGoPBn5AR&CU71u17{^QcAADX>S z*8TCu-s9RdTEy=&oAK=u-Nn$;L8OQM0I5^uB^b6J`3vq(UN61P!{Iuvaw2WWjAEZ7}h^oPP@3mb|bO( zcNDeAjx3-J@*!q^%B<9)Y_F}FQf1V{XEp|;nOWR4E-xsOks83Ryp*(Q; zy2GliHyqV|DQf~{`(Pd!SE_XIYpg+)ccl*9squ+Ib2T}}WZy=GNfehQ`G}f%&{va1 zWr>vZm;!bA%bFa774i@gU}mGBG5q$oNdMk?8JU#Eq(fIz&lRT|mzat!FVQi3xjU&X zJ>_CDsuf|W{B@U!@$qq0Hky6+?Kj*3W6GGjD<7?P@T-RPj=ipZ*YBW8n-xOvZ3b5l zyHAf#Kl@PV2z$fVf0h=tDr#4N#B71-o*X+opUjiEnV8MH1i7qa8?U8QIKv?ovoiq3z_Jj#mj8iNj*>iFpw>ST(4VeSmB?<+m~P zQiz`NN3(P*gQ2(cEZC>t2XcR`L{jcv#Kh5Q4SiJ;`BJy`O*@v)L4G@2GvO_<^W*mD zBVuKf|4=#=Vd2i;{U~<18yYxK;qX<0MnVG1D-3YZersp1a#(od)fR>4osZI@AT+vD z5tbj!0OIGN9aenj4?FK`0*bk>u$nj+P&FAU@(aF;y&;?BJ|+A5U?wHts!Qh*-3wy+ znKG7OWl=;$%maWh7)r7ESNU#+d~(cii%~#a(Vy{!k|c=#S_rXKKEkH!5I(j%)$@`fIRfo2VD8gd6hZ7FuR;Q4xb9)}6f zjBkPzEQt#qI#OFua#D>~hc!aHGZVaHUyysbEMF-Nxm|!BA91QBSi%!nuONkbk)|1l z+C7~TG{N#@a*|vD7%bM%gQ%!Ta!gF0f@ddt~=~e{)j<*93q+6EplEJ zF~;`Ubdm~76n{LRrzfjz`c7eBD=Qi0u_*|&OdVwdsk=$_=?3y~)r1(D1CQ_x%SZ@U zJ~wTh)N)1n|B6$fGt-W$`(6|iev^^K%ln*Sa7@ohH9;#3<+lB_!lHQ{N>0*_@_60y zqYgOpauJaiwT0&E0p2g376au~WIxsE1psl@*EwfYw34I?O}R-DyGH*j8q@M31m-|O zxx)^O@1L^LFp?KLtc1COdT1yjKllz#A(Su?;+XG|g<2FAbXgI5cr}|hVcUdua7im_ z>o0O;>K8k-VI19E{<`2Hcs46&#hid3aLC>P``oBT=a&XkV)oAsy2qPr(R@G`53)`R zZczXLi+GplEg=AzZt&N|vl4~?Sr;TQWh5zPcZ~v#&NsqJ0nx+btkR@-e8K@4J!O$h z9^Pm$zc885%T6z;k<{h5IE$Jq-H|L~51SHkoc0~%S0#i-{OUtxF=LM_$CLAm*3y$#SKK#OOn$a!hc#vA?fUAxpB@RN5<6T;0H4VG7~e8EM5G zPe+2q^^{{(i-|&X;}B-_`x0mZ0c+$m1wC9kQTRv>?{A0zMCOT=SFn#e_OP_~rRR1f z70~P{XILz9w^H^5bLkZYf;oG_zqN`th&=OB)& zkAl+Z1umjCJ`c*I9*SPGKDN&fQ?=4Wh1rdAx+ug3FCSLrHpWE7Nue(~sJV|F4<*xJ zH{^F_RZWOPy_fB6ZZ}I$li41TGoF$o)FEj>H4HPM@&k#UJV4dFm$lFWDxP+YPThfT zCjJKK%{u6c*6e*~Gx|x9&&?^{gm%oa>PG7JTQ?E=oHy|3o6G;y?cdh;fbOe`*&J8P zZT}@Uw4HolQ`g@Z_kELbdxNnN8?-1AKdLDuS(PhtOn2R8rREf|1yn$!gdXmczz4^~ z_c1<)VY7$JQe;FZ3K1NX-$_W=O@d+h-6Xaor-{f)CZkZ}Yy?z7VhvbXuc%IGIKqDM zqJ8yb0BDxu2s?$zXg{qETivKdS)(@RSaCJdF2pJ4VbgWz^vjw@2wInvqN2+(%?Gf{ z1N!w1SPk(l3*p(fypDKj!Zm{3OiM^I&?i{%7yT*Pyt45~5gR&8NK~NWm@inxcdL;f zcU#mducjG)XlXymyed4ynxSwN;2YDWk?WkxPmm#0WDjF$HdAIMP>JJ~d{&{G&pU&s zL}MQFwqD0{++H!IkJ%K7MGG9pjLS=RWfAs*sJ%!28`@fbRg;ugA`0pcdfcBfha!F6 zNSd1L8j79dA2iUlw1K6*rNuccr9t^orB@KI5>EQ2{HT|_a4h{e(_W!9&shVk*}wx~ zxUKk398+F4vB?EJX(bI4B)JJ*HX}Zowo{vIk6Au3Z=VGGjo%s=3^YaNBj0MT&BkI7 z7?svt6~;U$PLmOSlRbR5%_Ox7XTA30{0qF$SNf{ejkiuW>F7LhI_mJnw5l`ej zGh6K?2TAt#DiYWt&vaH%o}4@EVMpM*WTT4vDtII{nhlOdDG;o30H+|MDqSgQ67atO DDwEPk delta 3226 zcmV;L3}y53Xq_35BYzBJNkl%()- z?-X^L$3=SXp}VWAPMz~RpY@D2^}6mG`|T@-^Y3i?c=PmpYkxw_rd*b0`o@{PMQ7&I zR^FYneF*8FtIhBZ-S0Ne-e1hSzd2|6mR=6_x&=LZT6ehFhJE5UjVWKAPTK!lZ-N~{ z>duz^Ctd5#=Cd|Wy5_v|&B|DFI-U5FN$ZBDu_ou-SnC!|<8B?@UtK5p_K4p+#B`}~ z?nX+OqvlsKI<4_fc;wr%qk?fH|FKl~M$XX2=Kjgn+`V^h?j4=e`(XM$3Rt9+S+0X2B}D)$ ze63+6K6$V)M?`f$5v+hbqQ|bxi54cM41zWcIDzlYbbkU_NFmd;#$0=NYOd27GK{FS z9gdU(K_fYUf*eCq^&tB)*5sLr?s zdt!gbz<-VQ%vt#o<+6VaW*DN`GHs*T^vQ&fNe;s#b4ffR=<(slOY_?6@2z99uRZ_O zTd#WJKkvNz!H>W9?BdDCFVWV_*vi75knGi+M6MlU@et2-MELBSGuG9KiZHZ>_L#>Z z<*k{JH79Lj+Sc(}88-z4c`*fu3V?u|WzQirGJighf-xt0HzczG_!%ICi1&f+i`m4y zbo+C&pTF_$E6dgP7xv2G^yM#q{_vMS`tGxqnFq195#sOU!)Jc(@Zj0}mAY$B2& zFUa>y7M3Bk7RI}l!+|V|{2>O)geKBnR(y|@hzE`Qg8 z7~(F=F0g(cG&3V!8w;h>EhQPs7pL(q2~Kl_f%~`Ki8n>@ye#=92+_NY0Z7a7oY=Eq z(E?l$1HofxPuVN;-awya6N9cu@#QAUTs4WA&s*XjAMvzcwpk;=>`M11L zEuU)nN(Nbk!I$+WvkrJpi9HT7(-#hLzE3?d^3=SruyFYRp)>{sm;i*uVnZk{iGvlxfFD-f3XBg5w`)&M9SeU~tRV%{5oE&|uYXEWAMCqx~R^?z!U;0Y*| z(j&MQW2jRsuPGiUI;Kf0-sWk*wQVCCuQ$j8ylKpEp`r9qiudHI}Q41f6TbOsSShB1w42Cz#`E zg_6)JCDzYp9yOIIBYD6*oqy>FwT;cBfYSw8gv+X2-y2z@o7ch*K~zDS$4Sr#Unt+O zm69|04vd6%7E?z1Hqr1$+pyM-H-*(H80=~>v_)-9yVE6A;S`mYkzi%Y;`C-?zOa) zENRY1oJ~kw%0>O5lX{1bp$VVCIr@T<`H98zZ3wTS}HLsxjYsC-@{05=s?F zgmjV>7Q~^4l5V*V*?)vRXQx^>38kKECt`ilp>7wU`k{1-3EbryDnTqg!Ntwt$|_Lx z28;upl!OOFg#&2_R30&6ECv{W$(C?~g~7+@eh4+>u&97(Lg!0+k>E+uW9o?ZZr$8N zqRAO`lZa8}%QwOl;Al#AP8ebhP={g=c?`nNLybjbX|?tkIDcJ|M;@hf3pglyp;jpY zwSvc;AwpJEsr#IsZ)7<;)`lj?5i`V85(sBc=?9RwT(!bQ$Es2qUx8rSRUQW*Bu1w( zNb5U~rie>d3CB%OGH596UWn_I5)mvPQm%2`py@Jtl5L21eyAa--Ku!;v8REP7);5c z>P{R}QBGJcVSjS#tBWd%+6HIDsa6Rme6ZQBHSrQNFP3)*9+2c9AY`yR@Im_0gXL85 zi3yhfy zjpypR03_E;496{FGN|h-Qg#GjJym8g68INmBps{b34g$KEEmJp=YEj0&K=)+_h7ji z%(_op_a*j+kV^I!Exoru(&`v@a3z~JV@p|h$>>BVAw`s6g@Pek=b|D0c7Q-nq2bf; zkmI3hUB_kGm2S1>kz8{~j9`*5hsBp)wn9wz{H6Ww?mK_~)O_Qa8)h-J^Z}3y@7zDxNCF&!D`x;AEg6xS!i{0=%!vyY%{ANNo=bvL)g7OD5o`UZCM&swa4|W=?70-~Zs)KK|IjnkLU;L>a=t1=EY5F>0;1M5Cjv zh<`87O#?x)wxv;c0ElYL+PE;(79J_>EFi%CIFT}qy#V_|rnYh5VV$f=HO`3?47Tg8 z9Yp?5j@P{pA?*`_r#a^t;u}ee$*2(707VGEWJmSfvOwt5S@D|a>So&7qD)y;K!?l0 z1s-U)50E4b=JmF-e`$KOClg^yxC(9={C_M7np5O`QE+6?#Pzzjo*t*v3U6RtMifXE z>1$H6a4p#k0uMZj4qx6wU;*&Gw$GaBAv_utYim#LN=VeO(d~-E{?GkG#GdMzqo2;f z0~bPu0mX=REqt=HLrBsIw%a}q$7g}!TwEAUMQ!!5Q1F@?|)eGE_Xlaeu-> z$+EVVtX+cA^?7%HBvn;fPNb>GJQmynjHKU^gdHdGG=va?=c(t*{>sUDFkS0d0qF&{ zeIAvhT)9>><)z+n%Ok<7lISXJOf^gEeK$l4-)hl|plF3qsxs8CyIp9$piZPY$ER!3 z*Khd!C8F0~e&MOr!Tw~<2aAoI_6`P~TVJfxJ3aZ1)#@3cbZE6XDgVDv zPtc$3()~a41y9@s1WCDi!Mp!Bl9`8>=f5lL-yr(tY}zibJ#w%hWX_t#{eN-N`30%b zrkuKAh%AjoERmz{moFX6F12mb@eV_b)!ot3qGUN|8m6W}_>8gKxk4!a!^3f% zlp}!Uf3#mFU;@b$=~&y)JX`~S?im7bpI>qb%$j7bqMMI8Q1>;+7k=D?EyA~NB{r; M07*qoM6N<$f}{RKegFUf diff --git a/data/images/objects/platforms/vertical-wood.png b/data/images/objects/platforms/vertical-wood.png index 06c7de58f9111d9df2a792399d1a3091e336d411..54f9ba800adbb162388f2a6618da7ce19d09db9f 100644 GIT binary patch literal 12045 zcmeHtcTkht);AF8NN*xFbdZqHL3-~Z9RVQ;p+kVsJ4o-n2?A0Cq>2dAdoL0Svx7Oazv-TufM_c7K0UZGb2F7hQRYhI& zFEjcI#=}8>+gm%(VPKFj`05+G>q5PlUEGk?c8&;UcOMr7Gs4@>8Uw@ob4j*?CwO^Yvs4DFv$J=Cy7$aE-yn;NB2}au$qmYQUiX|$%OFp2nGk98702(b z9g-6zwnt+vl>GxL*ZpFCoL&2WJIOyi$(-&P@M{A0bx$0guiNf#%RGLNPuLoGFEEvf z=JUSH#d#U zkEL_N?Fanlq3T!swgH#a?L`Jh7b%BTgS$uT4=hO30uzSy&Y8S~<~vqvYHH3Z{Gt{r z_AO36H%(-V_f^E}Hl7qpCmde(dkphkPO;WDP~W%cCciq%^(QuNlN(!37+%*FL@YL! zb7=5>b$^zB-|3C<5&qjFjq&@L>wOP>pZPp_#PdmJa*Tm(?4o=J_vfR-^~WDjb9cPF z_e7fN*+FB`edNfqm5GBF$fjvimXcFYV8FrHZ0wi_z4*;I;*$NV*TYrrgMsxEl7WWW z6z}vlC64e<)8ssxGU_^v1%xyNG8S=~U*`#H?>O^0a!`?CH0ZN6Q2LEau@i`6*w%T_ zaq;4@B|AC_Ov}^!kbJd}(|CMrmcxGJw&>AI#8xci>+D^FX;_67t@0Zx%*E53btm}jEIe^0#Huuf5w#ig`2&AO##x%wLk=$lhwIEx#wR`LWV&vck z6+7nn(zix_vKRCgORNv5pPVewUvvmoO|I8e)#K|`({TPU=_0?@uwqp*9)6(G?1~H6 zRQAYM+7dri78)DUm>>A+z9pO39|6i);cH_mauNDQWoufPhB2i(gsthhwLZ#MweM4E zTRk}F2wzqPw=gDs7U~45ahaP4T7JtpxCzMFi|0+>)*8R6GwFU`4ig_tOTP5|di*>UNLY!uWv)4rhrRbMOZP-Y>gsUlQ^(;^lM)(u zh`d4!D@hTO6#0tEDZwD}O?EFZfjKilGI z9GL_fes0UHV%l6oUKhN#D6m0>2%Q$@4)9K1j1yxbp3kT|3pH%n;@XqD&Iug#!78bo z+M2gXZJ~BljTUZ1DQi4Ry)-oW#NWZyn5(2)Z?L+i5Z&54&=*9RmeI(Xtyc~a&69ok zXiq?b2=vUL5fv6+J%mxfD8tU;AY>*dmZYnY_|7Cj1#TLkKIudd9hT?F++1Fmd+b z-qiXlE8#{HlC(P@V?9W)t2Sj*YKfTT6*W;M@&IE}U`koqDK(K9$I9F6QjslL#No9_ zF!TDW;*?IpQ`y&Y9?{25275+ipuy@?N@-r}1K~GLR^{L^S%q9O zh6$-=iv3){PF>|LwMuf!x0Y`2LcG0c?qsB?bu}O|=VR8A$z34b>88XIDO2SXuQWQf z-b~0WVx28c?_^B(shd=Nb8>#aSMI)toekN^2FEkJ1sBLs@o_R{s!8#3c43jVEq}#P zC*l~KxYI;A6Krdx@j1$LCYO_x)q=FJ;yyEs!IIk=e@MmiQ@WC4vR?ugW){*RJ|IPb zi(D&~69b<1awK+Q<8>6V;8&zW{7w)v6i+8HY1+Rz7d&czVDgVXbM?U$$9r_87>>%5d}Xis)(Z znZS4t2Fl1@TzLCE39=oMWj*Y+-OnH-_UY!Abj*fmx?$OB-@BeG@0UvMLjgO8i2d{S8{?%G=OCeS!mT#5u^v-R1)#PN;9cv5g+?scjx5)5IRK; z1t@%{^{milY4tx(!y@Sp&~A-dXoMMlQ!|xUNwCpw;=;vu?3#X}=<#ESaO}|_ConI{ z__czO9g%P*!`_)BLRFL2)9f?XzO3u_gS~4&!j~mtt2T<~E>n{DBz?2~ywbZkKGl(o zK&HI%gF#Zl{*ND6Z{w8Q+2JUEYSka6;EJDf41y*c^5o&Oh9j~6Gt=oeF`iG(JxNr)E0LsNCUmKS-qlu26dDIf(Mgm7^+hh%Sk*m?b=^gcaSzjZ|fxp2!9a3fjq z-~pc4!hFUk-P6hZY_XN(;NE zPmB`DPMM9lidz$6QHz)2I*WdwnBe#%&!O9Eo;Z=CZI|!=_49^V1kQf%wdQpkxgy9| z<(-F`+$G|p@139JJcXyuBEeIlwjuE4ww?42?#pdsLEzF6r8EG$_D-5`a)=#S3Vrch zQ?3!#8~M!_31PZF&pw9KyAjNbyraY`WZQ4JMTa*Rk=VA@`AkZyRwJK&lP&R4A1P1> zz1Z*u`HEM%#d_~)m|CjiO1!^phgpNS9|FYO-6#&bRQ(4?BN}}RMX;6tSMHctx{ZNb z!=#UQzY8dC`jY4ad2mVkUDOL+$Gl|kCb`eLcm{!R(9rG+kGJFb*N4=v;~GZd+%DuX z!Q*_#@}&rjUCvWREbb2Ob6$Av#a^Th6XIE%IBg#^DE9XcKB$z>pg7N4!rRnhoC$Cl zxxSbFT7{Rt#GHfmNuv1!4r`)LnlF8%KegFv+UbGyqS?=CAJme>F$$!yb~SNYTE2(~ ztWJ035rP&FD2|Y4XPO)p6^veI2JS941&re5@tpUDsGbAzR5{56;6Li(+#6|F51{Tp zUobj8WD!aQ1&r(vepcjj67#_q3~jb6yh}@zrdux+n(4>Q+9)#^Vw0A^f(y-DW>nl; zC)Ny!WMvDo6b1kl=j3hUX7d43x0|y;S#BGee$QSM)YIbZLoXE`M99!>DpFO(k)_W} zYIm+>FEV3|;0d6lj&FQ>D3S#9_7;z@ z`!Js0;QMyAY$1BeSX&AzC^F6sbg!<{@hrvXN$yRyZ_xeY2#ezR1>&|Pn(~uI1>~vH z*46I2yMf8R7KPITUoFDs7fHzCA=CxnXwN&C}ViSBVzo?7COq?poNdBy~V<| zRMyO|H;`xW_G~T51xb+0U?~OQ!CnyH>Nyi0o3!e);3-X_q5M6MeuW<|WFK@|Xg+bS zVq;gu#mpbb>AjB1yN?qF`Yexk3->)X#O} zwqz?^t}^pq{l2sT!mQ)VttW03*k>fGarF8_m55q_!O~%5Dyp#3XTzXxi{kBjODo&v zaW+2r7pSnb=R+9zs*)q_J;2AD&*opdk6-kX875OMqn2HtfK)FBJ!V%$#}Sd(&+b6n zvc;G2>WuebZ(~jRbfRBG6~$CMY)|qsS!(SwsrqDc@$53Z>-n49Rf#b&wz??F52P$b z2|V_-q(ug-eTor3DHyMz1Nj`8n$fXybo#1tGZQ z8DiM;rX$g*#RKa!KZLhxWx*CpFuzz-;?Xf49uhz^&7d_80C@!$a+(XUsT@vHsam2)K^$(}Dt$p9S-kZOcn%vvR^%Zfea4upVK_6&% z+My3FjI}f+;7BJB)CvhhfV`bt(2>Hxkd*Oufx;aS?#wWRjh(X;aKEJk$ZTgN1vC=Y z0&BS_AZ+baeccdxzS{b5UkA9j6;MW+K+; z%)dq49i)K9S~|=MNH+wt5J(6F=2P;v^ArF|6EI74Hg zyu3hOf*_=u4L?L&T$~>)z%L-chnC<&`8c~nz4@F`tiK@sz)(b>;BIyry!(4r``RmgvsR8iB?`Ag#$ z1vYk0F2A+VWdDbxyPfsF$@&l9evSN|&fgtDtN(@jAJYGt`)^^il$Mr+A`r5>`mKot4BNw{W;1R9G0yCt?i|<`c34L-?RDbWlX#!omp!jHD{DN z)ESQW1%(C&*`aZ)g+zn|1;GM*XaxkH5FBB}2elRyqaI-^a zCDifnUj2fyLPLoOA;cgeLRNgj2#63G3I^j7v$8_tAw;)hgtHEpsU)U(Dr?Pcm1)Z^boFpwEk#1+WlTk%*?-+g#;A-#}rUd zPlVNPKhao!48d)o&Nc}2{_$tR{;S{ae@F%qK@kKL3WKAQK?I!)*4E)$=?Eh+hWjqfApcZF7!^w|JPRdCtqk^|2IE>#^Ha{1T*u0 zjr=2i|4Y|@>H0?u{3GH2X4ik|`bP}>BjNvM*Z()V2>xA6A)L`~KwjulX?1I22VG|2 zz%*18F%B_KFfJ!V;mqhBd>2&{6b1$%#jgt!BPW*@-HGe2rlo|tfr~?m!4-A41s?;0 z)Iv>BPT%|U?iY_IFxBSy*-$=4tu)MyNxvQ;aek z>y$F?@$aN(GS7t0FtdnI%d^(WQr|TuqJ@)Ce|@vs^~v1a;AE;T`_7%jqjNv9Mql5! zP5^t0Y;&DPiNJ)+gWj`z3;$x(rJtu8UkOQQ3o!6cBRe0&4pM(Chhb8Y-O_)k&+Wf{ z%D1?HF%cZ}{rlw0E0z7ngWIAqfxab;D}$NRJzj0UbOD#(1OE8I3ljdR!-MM#ZtBvv zE}owc=dTiIrU578(>p&yo(6t9{1kHK3d?~HzE$O}kiB&+c%adlhkY+$P`R=+ceJ;8V0};N{}SaD8u&fP%E=oiaGr?Qa<_ z^D*-!eZ0>DPCz2M(+N!8H_|~%Z5RFr^8uv=-ZlsGE@u_%LH^RN4f*0yRkV?^bH?+2 zO@)f9%dIQ>S5+OOB>o3kDkS4=C_}@SQ&)o|LE)*p5q>B9wuV(vgA;%bD{0@8Wh917 zy}9Tbf8aqF$wE-?*=A0~;g=mw#%I;u`%5?m?Chiv$~2l9oIR&U^6HL{26}KE)<`!J z1#gzT^51(y>vu7{FE>KB%{#qEas`~`pn15b2;56%otkNf`Jh&o%uz~#ajtf15D7rM z$8%S;oHTa1x8V8Cg)Cn7fQ`fT!I2b-%Nto9m*m!Esxtkt^6tc#Ywx$v3OOR$eHI+y zPHyILx_(k0mwC6F)|H*tMf*0bu0$*;v0%;YKs?C~My~P$H1}1Ue@eYBllcxn*eAfJ=Y7HX@c8^um&Npyf2 z4CB%rG})l*IeSy`QmQ3z`Sr^oo;ba=LtlCQx6+CcEbn|(2C-|@4>QVx^`N;FDNABD zgWz;o1h!`PUG{Y%9ijtaGEA~(7Poi$qf0Be@y1QGjTlh)tvBC7WqjWsZN@UfZ};4F^dFzvzQV_(Hxt6J4b>tlg8H8FdZRG1K$$BgKFm4X#^JIu}49^u< zFv0i!hehb2ZG2TKI=?bJ_FD7dI`T-+~%w9M*SA;pkVD8m6CvnSQV-07nU@NM< z@Fl%DLVR1o&CpP5Oek?DA>37TIbK1hmzK@}f>S9tS`XyVd&S;58xmhh--XF!!3U%1;^Z>6#?3Rc-?Bya8~ zuWEJza7_?%7-9#M0f%bug}}<2?f{O`W|(Z+fB1=3PE)lgz+#eJL1q@Xab$;O^y_iY zY1gw}D6WS67HZ)LYHtm1{KYhvb75JZqtDDfSY2@%7hqq@bYa(GzMEsIDo<)Yc)`q)j) zZ8!y_WJofi7f)k86Y7D!v>3a#SIyiOe4JjNN>%ouO3FtUWbuQRm6D7Yj{dt%Wyl-q zI12f}nZuG9%Ug}3H$<%h7(JB8Rw|GMqn&+WH9a>W3;TF0f+#$T@P&==QBt-WOIR<9 zvSCBX_lR7Aemeh^_xPo?Ve!px%IIR~+|<6^iawNx{z5A|K)M5_+?ui^RR>XG^LEDu zTFTslg}8!j^K^(%QE^AFieoV2`sio}I!Oh`K^;OF@^fOJ`^k$6I1~(Z_&VQXD9H-A zcnIrFXBb^X(*iKs1zNXo?cvcVSX44SVfv96E;m&t?B44s7au%L$Wq*58#ct4SBKu7 z+)63#UgotEQx>;U)sso5a4vcUSPo`U6Py3)P(~?rM3T$u$O2Kh3gAAt=3H~=LY1d+yz{E>9a@1QFTSF zy5zpyWPQt3Q;oyJ>3@`JlUrq9!2@{^-R$;yKA5-CERxc8s{}LJK#^W+*UrC3NJ)NJ zY}=N{miMMPSPyV1qO(p9k(C(_OWH_G&LXT15wrd|pt{Ycd^vGjEf=qzXGOgwg>^mZ0c$!=GipGI1jVV=vhW774UFJzT`^#7!6@C2 z%aw&>g%u2MJ3shP8T9Gt)M3zApr2><21^V?dS==#+>{0a?>;4{3C>lo`R|G`+I&1K zd07(Y@h&mCGCUV3&Kod1$^yjEo~Gi#DJIn?gJZUzD`A=tx;@oJg;rM#@_gfdZ}6;# zUVNX<9_hXQoaF^p%B&FMet43AYs|*(?Ug;T6gXRX5tpW1wmb(yj?{i%$2hUG5Ht3O$h=5iDWm1pc+ndo%X4QXEDbm}Rqw=GX}~j7 zIdz+gc;{8XoISUEM(UxjKf6OA6A;3qykzxN=gyO(5$2br)^nfe*Q3f{iaOl3A(QEd zIdR4G{yQQKfH5vCHIpiyccGIdvu}qFC8+qF9~$IRIX2uH-fdRWv!*Y!yF~>h ziXJ!eX4OyU1Z&>X5`Pdw2;FHH=?&mjP#G;_R^z%dY5~jKo>(YeGTJDQDP){XZl?0SP^e{H zzpnVq>x@zX`hj3%MxJ0s_iU+rE_O&Ra2|hyoP8XlJkOk*Ps6GvPesYjexUiN;9z%x zL^7}z$X-&#pf?%^(Gx;#uuiwgDrXmwPHOH-8BGJ6^iUg|1lSL`tY_J=1FoAf;5#1x zYouxrJ<$X^?JsklmnAjQi+#@B-aS33!Y$G%@NPq5z8H0A4iK*UI#_r_+rUI2DyBYR zJMgXD9ayi`k_bmk3!ki>$<%3u)5C2D&NDN|A*IuwBT~xg4=jGp0A&jwgijf2Jm;#l zzf8f*Whn_0ekRTXp;@zIGZfB{@4nYkwy`Zaifx%uqF+B>y)mG;&1;4bKc*Pq4(X&N z7ZqhSNgw_c2Z2?VR5-YCk3uF-b8@kb@F%^&|QD7ZW2NM`}Z%!+| zAw$b3S!l9>!KMljK70qHJw*iXy@>J9OMazm;PR&WAU+A8PZibh&5|4MD(!p2q9S-+ z?mJt!4ta3%w6u*J1N$s)Ij-SCK9d7FI+w)@d5pN#(FP2W+I4~V_OJ?2-;f^i?dYmv9zGJRr+)edck3bg& za}y`6O?267o$dJ$!#V~lgXK$QX^ewxlQ*!X5os6NZm%<0j_()wyE6-lYh(#6gVl-1 zEda(eae-UHO&-ZN$D}MZ!*WxNAi?BVA3df;zn>v~oWcrGLiSljAkCxoO@N6{i}b;= zb?Z^ceWs?Pked_#MR&apb0$1UyE)Sg)BJOi+{!O=KSC}zk+ZmNBFJgnh@?IL#c|w! z`ZY0yJO1DjjTC7bv<~o+KDdb_p(jbc7Aty=9Kh{2tCd~Z$?qTu%c5PEA0?ymQDD*; zy(uU8SlzA8QW{G4B!Gg6l&|me{#V>y0+tC{8!n~UsSK?jIMO=m(c_Pv6GXb6>jf+h zT~Vz-mK_KQ6k^O6=0|aJNCgZtj{NDd_`L*`(&0>Hxd-{uKK-*5&#TGp#`V*SI*MP`~$e*a{*H8mx={L&6S_h(k33qOU_J5`cXA~8ABIF)14;^ z7DuzIgJA2Q7g7d#6y0tukKL?AZ^;iEKTMI3*A&|pBMLENj+7;aV_m=B#=54`8AHuz zP9AG>4G%RVas)jP8#ysa5&L-A@9*wP#6V1Wew zgs0exCz!aGYzLx9cp%QbTI|5Q)f&ue!h_=<3mBIT9fyTyYe84Vmk{=5=Dd3`7L(}H P2MjeOZN+MN%h3M=a)SDG delta 4627 zcmZvdX&}=N;Ksi*Y#6poh-@ZT#1taT%vQ)Ta^zmCltoJA`en0n%u(qkx14iC5)w9Y zg-W?1;mXqW>Uz2auHaLO3BP?*I69dk2{95Mwu`w#&&0S(;PIyWjK5B0u+EQ_?@k}$^ zf9sPg1wexggPJww+OoL4iQ0X?K1-iD#F7pA4I(||{&`N(7I2PC!4idaxm{$U5|tth zjp0PWZ+aNP9nVeiJ%#fAD^LqD+gbH@ji>KJnHuiYE9s8@?e~Ji^3<&zrZBQ<+{-># z8E_ZGK$f8Nh>Bh5kc-5`jCf=1L><7Di%DBzn~d2mbPE93D`sSv{72vMPV)_${rg8z z0A09;$kg3($yoHYsa%i6g3-GHl@mca>JuI&7c8_z5tI+2U^sZ~Pj|aovUm<>#CX^h zWoEqfHI%M9{(HEMlEX*0=!vYK;_CgPiXM5#>06Jwx_5s4mM3h>3NM%p`cjfy$&`gM z=A{5oK1a`E#0V|8Q;;@YSHT+ZxUCFF%#^gd)!BlYrw=4oy3~P5z?#=Px}!}cCc(T| za$b#uu!x`kVCO2ZUs#}AZbBro4FN1->r6XS-vT4f4JmUrNYf z;nN@$FpFyw2`Ftyu=rWRs~t`c8LGfXW#F5sTv9?4jI3|tru!jYV~b|3Zy^eEK=r~{ zAPTkcU>8*P4XUW=dDJ(*?x6{Bv;e}~76K^5Me+>ry?8;ETu|_ZWysdt(KwDxlE3AB z{M2c@V6G*w{Z}@kFO{hzfUJ6RJ)~>>y&H`4~0)f&D($q%R4kYGS=m$|}o~8k5%ze3b z4I8lAA&3RNgW#Y5+(9^LGcLfpiK$K95axJ^==bC20BTq`5EK#)`3*A1L*6 zzse9sgxE*kxQQ@093tmLre{q-s(E+)(JPTD$`rPwKRuV4G=~a+3|YsKxor_qDP_^w zAhNzN_VAJJOq0e)cA)N@)@;d|SQK1V1JR`rkjtz8`f}1U0&-WXy9kV0pl{9jvi^WP zgEaU)laG{0*dMd``<45NUBbj1w?^hW{v%}Vl8PBt6TjK0T0axFM z{vltgVJeoHp3`LS!L}ijp9Sofm%j%lGNfxat{an`2kY;ax$wpta%PI^Vlxi;h|Jee z%j4`9VQPY_0aZH+W1pYUM<{|vzHPG;E{+Y%sTCT(qyTH54v;CnMEleP+a4T8|D7yE zB8<|eiT>ikSYltX(bPMCPhmoK!yI~2pd!NwW`h?!{ZigppvjQ4;k$zA|4r3p$X|gI zg{N}RzSu9ENvDOKjp@Os96?wdcOHCgX>}i%*;Ag5A5cLdU=piJ<%9%gfL=-6{qxYhPJ^_B@Qg)dEto9qCFHQ z;koIR%3{)J=LH@;Me<(fzGtMRJsL94Si+F*nCC=fOUo=Q1wW)W{Kq)2kNqP=Q}hrK zja9k(x8S_7``r2)e-KFeo@m(p+o2 zpC(WxO725m7c!>8E~F($Fhz8AsjKEi$0+fMN?|dR{1k%@j-f2Tm?>UBG}yHr^8X31 za}-rsC|IV|#SLD@7=V>qSx#bN4#&?m>uJKKh5(Nc6BnK1Sz>x;qyL-}-|Xk&O$h=k zR$Xq(!BSU(US8EkVS*5n#sWkU640~n$<&Mkui{$>;EET0oS~mq8*l%`Q?Vi?PgZtV z=}e{7chTddSN#!;_*z3LT0Z=S#SsMcyS25eM#^47WzhB|9ev|}54dWCU^iDt-JQ5S zOO?G;QKZSr(=OG@tvu01W$m1a=oU1vI6&WC|J}H_o)_b8`}{TD?+eKNcpbk)|K~gD zc9m-D7e@U$SEZ*}_Y68(i=1Tgye}i3{iQ_{^eP z#Y#Lip_Zx?8E4#jRQMY*3G@2gd(EYVt~soVJE{FR`AW1DfJZP>yk4@?ar7%rrw*+> znmdMg(^O&N&zl+eqK(&o$L0mLy9?q;x);J)+57GqT&=K`&a;1DRy|=0umO9JQsP)QX>3^v> zkVCVl$vh07_(7;C{#Ko0xs%DOgB1e_%#nm& z1b_yGPR`?=R|G=$v7etF2RQGY)xyC0;$;j!C5{qNKYB1Z9rZrh&LLLJ3c2lAR^9q= z4a2)>cSV=10t+V3KRM+_%@C#edC8dj$AwAr{#QK zokT$w#?0iIV)}EdxUc#vqnMH%yQy;wFjG!2O1(-uPztCSHjpVL5yd+)EEU*sAaS5+ zU;vUV(hOfbq5q{Do|JG(Mw$0>VD6yp6HK2w*S*bsmD$pdJJV|uUWtP%pS4tai9A9r zd;2k3_^EH`Z(7yudu^iJR^}!3#t>(Sl{0_Wj8R-gk5qoe&Y3l1)>X)f)7ALP8au2q<-u zIS)tX^;*Ze?CX<`JJ$o*%b5RR@|UdE8qC60Dl4j0Je@r?Hb{0}4pzk;2(ir1mvOvc z(JS58s{B?oycCBQi)xb{Y3#x_3{8`69`B?{bXZVbxnUi_St=P8>C7td2l+J+qo1EP z*oDnCe969}^YK?0caB2{Kos`wjR49sW^3&u-xw_2SOxitDkv{9G8z@GUQPKW5_>75 z45cIO;Ck|3E3!3xPjBQKs~45(m~mF*MT}+P*U*t;KxKkX-36 zaOl|xirMrQg4mos8C7u4o{fWJ?Zi6KZ2b8$$y{#v*Nyzy9O!*?^g*Rk=b)AQFFrvW zVHc|ToKoDCVoAogIq?7S|Bu^^zrdbzymw!W!3L?3vVUU&w1>vOLe3v(Z1X725GK3g z$0H#(YjH`HY0F6)(trs)^w#8aamRRdUQB&|=S4It`{_iseb#6Vu%Dd%FLn1P@npAu z+jb7P@=A{J21jNqlH--CKYQ+*rttx0jkid?%IMEuKf%nS7Bv@foG$DukLCEdiya_LGPrSCcL24{Op2OIl5=Y;a~#l`*_ zsEjbk^vNuGXgV&dcsNBGa$I#ns>Gy^=9P@OVK+!|>H`kvhSp!RFhpjFssYYp!w;7Qz@mYw^A3T}roLTwr5jW9bveOa$_f8fB&Jf>3EXs};viV47^|2dpa*;^BL~Ck+wLQW;XzfM7D+XP%0PjmKzUx#OJD7YS}_-Yp_P=XX83c-Q3^kxBFWL2Xvp{*2F_v;tD}z!OU%>^LqP?&lZjd@nL*X8I-t`;(6|a$;h_yKG)e1WS20 zm}Dv%K%|6P-L77BE0-5yMWAe04BZiTn zv3vrx^JlZ!6X~XKJ>S1(P;ADZRn?f}=XZTvv+YRt*H;ELGdU+68wlO*$G0c?6uVX< z>@>D{yST=8ZJE6CIxWL7>G}1Rhax}RLDXWcpY=q1S*!=CKCsqdlXN6!njaQny1Ol4 z)ER5ux1&PZSzFv?EX}W`O4>WxAhz6eKR&+Rn>tT_5Po`kiGAGju7<*sqWZQUDsMo8 z_vFkrmgI1ZS}=q!#lPbdAqm7Z?zW+JzE0D3Ml!?0-``VIXsc86P(Z0!BK(gQ1$*)L z#(s~Oo|QQp7@B^KYbbqldtRD|)Qu5#!H_f(W-3=qt$V~n0Og!UgUZD!5rFe|WO{X{ zATxb;M(<;zp563_<5V_i*ioT9R_PJP#Pw?)fORmHs<0=`H)Hr6=?}YS?K8jCU1F=5 z;f6nM{k5qre2gLWw!$|~NG_muyF(gR?%V@@?1IcvDH}pgXZ3)8vLe|L%LtTP{{y;7 BnDGDr diff --git a/data/images/objects/platforms/wood-fivetiles.png b/data/images/objects/platforms/wood-fivetiles.png index ac87565fc1b15e5d3d772742f196ebd7f99339c5..5f15d86e945ff3825de39491ab6de835c591ec12 100644 GIT binary patch literal 11734 zcmeHscTiNz*6)yW1|>%U$;^<3A?F+g$-*$qkcTux36e!gA|N1=L{wzRL9zq^$w5$p zL`j0=DCrHJbI&=q-dFYNR=w}PJ5_u3?$vAkdaYltUe&#KoT0u388IU<001D<(o{9Z z-19IOJ0U*iKP}AX5F@V-GBHOPL;cx3y*&`lZg6%~peLLi9^i}s00O37WV(8DNs~ui z?bF`JmB-ov2di(A9i5!z-wK>c%z3z8F;#2L|AalcNB2#~>0Fq{35D$|bMl(ES~uf@ z$M4-|m904Wl{GX(yRpB2%DDaPm@f3$m)wi}_65k$)26akDXrWy1(J}Q z!nUfTzQNUykkD57ITFNK{jf|#$~~Fxi_nhy`6+W$<6q`nn?rS^F8r$ZrT2ntD_dJ! zM+Eg!?uJeguVcISqLAqP6s4YauTs#4D%)t>kZy*yFA zd`BqNWiRWYmLssvr&w4R)!x3%HCM(Je=_ZG_3ev-+&w1)y*ZhSlqOrrlbB~^jtX8T zz1v<6t06k4_f~G(wuYr%T`0RK%o?^F4Yh8~Y@AtKhRPirBBO@Bh%C4IPlpWl^QqH$ zb8M@GB%a7FwJ^xO7@CfX-TM|$I`nd1G|Lq$nkA&;(|!(!{{7pc7wQe`vaM#CkLg|I zElywT_i_uBGJO0IC{6l-C<#@SeovC}6I{-`nESqSiH8OVAGX9(`!AqH5$$>gQeL@(N3`sXI?XEjCvZLKcf8(E#W*>awu8&&_D0t zBfOI!r;%bkHB-Gta)G<(%#19Hx)C3d;lPap*Sgs=`b}x`z@3#gGFVimW2SE{-<{V3 z^4-|-?@DVO)+@)qd<}d?#^*lS;C?Kp4^dqIJeJ5T=NANCim0(dHvjA$cdeV-HLW>7 zPUj{mys->26H-Xy58f~ve_#B|f>ZiM^}NJO`+6S!(tFr|7tM$fWAvoJs)S1J+M{%$ z%0PF&y+=lELB>d_XtUin-)z&)%zR1gThUgRW4(AH-&#v%>KdZQ-cEZI*V=sla;L)V zW{@!~{|pHN+&g~ZOZINKXNoCCcGG^BlURqi=~hp>uH)>;4>_VKeqS2LX|ur5lClym z>JKgM*>V$T#|b-es{3f8_&S%FOZ&;)`20gaO$JfNxpR$gk3-3G9ejqZK=Myb2jfH& z<2;8T5GSJVXtwuLb&b6Dc1pJOK05%J416{qFs`=J9>VVU|ws{C|BhpO?ESLH`pzdgoI3+YdNFRIud zzvf=R+TxC*KAz3ghW9<+f9u1yFI3isf!MQB$R8}<7&f!JC}rw5wCkMa2<(2obT-SX zEgMiOk{DG|4VfW+p-XA`R#CgE@a3>*fUs}k>=6R$qVYEUyArs$P{!xg^jD~ljSta! zxi{K66VBrOh3W7m%HQMxWYS36TIg9QAjIWj)UJ3v2Pb%u^&n%0xi++%~0@VKyDDDA#El-XWmtPx|Ug?MkMD9&myy_DySN)z5>QPk3Bkt{e%< zi41DF;cO$-P+k6`@8n`1i+(p;Wi%CCu6qyRl^(qGapv9_s8VqJgmdo!1eqJKN?qT)&LQ}{(9lnMOX{00>Cjr1cV9Nu@R24>J^PqzwsKjvC!<<_ zh<MC#6=qk-@j1y{lK2LqC7szw2?42M8c}ZfZavVOj zkO(YwD{EgK9)6-nKnu&n>8Xo` z(cq2)9yWt^8_{R{0qgbW($3W~Y1#6b1s&$LxPrJ}KMH+OY|x3BEyv;AO!+ zf}zEz?@nE~o8guP+Sud7+yx(G3;-r&2w$jF1I1_bf={HYi7q_J$US?^GBcDR4Y!OW zH_(M5^#>``)rZ?U@ViXkPt&A=#)Bv?$xdQ}rM_~$>d>BLWtEX;Wo=$-nx3#;o(jMM zS&Aecw!ap!yYN7TS}U`s>;vDS8Us0`D!nK&xdwhB_@d{}_p)yCLe)QxUtS2xmD86-zW5UNW ztlPLkZz79E7XpBp@t;q(xHiGi^qI+MOI>k2@0U-*2MYSvo(IJ)EFTOHX0=N)9k4R5 z>o%;X<5g1{Pg(6G9H6~suxXx&LELb>r?7BIeft#J*pU%-QS;t@6H_Ho1et8*+y$S! zb7VC>AE!rSt4T#MO|&Dzt=BvoCT?S&D!y*G{{x%o(AVdAUfwNI92r43I|BR+Dk;Sd z2?%u6iR}CO@IfEzr$iX`da!7{_|5MuG+l>XcMxsfHNf*q`yh5j6Cxi?%ZircPpltU zBk!r`**#CVFORe{_PhBIkNW|>@j`n}^^&6}KK(klK32(&`yAQ89y_aQr(UkYBWhR9 zR?4jnEWdX#g#v+1h^;nPyKCl+B=KJF2KW(pr*+p zD_rdAKDab!exC8QRsLn<{zO?*v?lCx)r@gPHK-aa5fO9q`x^PZ^_~6!`CvB9dWnKO zJO;s~v8GZ#tXN)o;}Uo~7<(9N)dfb^e_I&;0|ckqtbtxR;#JY&HuC)B+@*XZhN)S9LbS4f6-^bLPa z(1;hf8X%ivpGaXk%z0t}(s4}Bx zo}+g7_^+`t1fS@JUi-79tKR1dunp zAN_hD&>_8>(gxo0fh?fp-9%2(YiZfIu%Pls*<^g%tx5Dxywrgj(6VFJ@OA<^d~qZOWq5Kum#ricH8?Qn=<)Z}W% zldIEBCslVKn_92&QL0#UEi zE_e3J!)L|sd(-_U&0Fy%p*DDe(Ef0)GA@w-Hj9J$)7+Zjb}9{>Fv%;A=twO8d+;rX zz3`_Rb|>h8t9_2v*`+Jry+uwsx~cBEBbXT1&QU z$Xq7s#94))Mfb8}UW%?S73Wbge4%cY@*9nDPSZ%AmzBScGYo(FWC(UPe#qdhz!81f zsvDhoRwSYpdP(8=Xzc#LUKk$$fEDGeqGG6}qVlgp9Omej9r8p@vqO>jqwSpxanxaVvVP?gVQl!hRq>E^ zl#=6RBEL&Hg<; z0Euz^!tZv}wkEkZ`eL8th6|vV=A5v_atoy(mIs7{9ym9@u;|U=2>UUocJ-z(>jf&p-cqoC{o?rumQNPryYZ(IoG z`C2T($^Kgf#;WRnLSR~QoK7f| zCqzWV-``)@UrgA;+ff84EiEk~3K9Wl>- zf3)y1!MvLgF^2ni_c4zR!MJ$=31euv`#6M?(I-7%^@m{EcMHl&7@ zp5b2>*AzH9yLxpZ`VD)!}+Hp81uhy|4sW}vHw=aXzA%eR6St6 z*Y0Vl%5h$g4{`8-IXggpKf*z92?;5Xq>uy{CMG0~0K$a84pImqaVZ2$ObR9{CMgB_ z2b31l2L(mK;MY(XaA9W*4jc-XM1a5&LJm-SsF1j*6kG_3K!AlLq@XZ_xTu7fH29wo z2Hwt?tc1G#)2nMJhifQ%F$WM(Qc?&GbN~v8i#v!5*^5g{3fW5|fRfS(5Kvme;kP#q zFo?Q`w>uOwozCu1N4SV5((!l4HQ^8?LoGQ@kg(|A5<@pA3V|`etN~}FgNMJ*-(4oo z?(jP(=rx}}DUc`#3>1?T7ncTO?td%Yg?sy8a`74!C@L)WM?BXP1HpuYp%!|bsThFY z7MN%tD&BA?%EQ~l!^2IE^V%u)Ys|1a(9<-;!f$E0gI`(VZo{4M%pP2GWe{n7fP>E`@_Kl#G=`oH=6a~}RT zhhS&_?;!sXzyGD{zjXaa4E#sR|IM!d()AxP@E8TN{5#UpRaT|D& ztT7@Ml$tq8#l!u2PY(FKQG`3N`#YnY*iD?^?AM#cZ3k{706+=TQdKeunEE-R^@iIb z=-pfx(7qpxmdG+t=$eOJbuatB=cqA3Ivz*C(RVBHnNvch2Vf% z2)=&!(<_)QR&K+t!eq<&i->cx`DYJ~J~|S!bFxQN>30%NSQ!2&bdRTB>qg0SI^jiG znz|mo>3w_^Xz`w{B`*F=*3F{8-H?6zu=U4P(Q1FGvR;l{BZ)b@ezm`&Kt! z!ri5eW>+Z9P04nq6&UB8kZW|KKrs zE8DylSUD@^pYw8w+$?Q_1LQ%rD6~3sTusyQQEfh8(ol^Y4?l%}(4vqLQH8JckONet zI?~&;E3VgvVD_3|MM|eGS@e02q&&{6-$~fE1s!g6g^`^XM$i$$pll=)L~L?wN_LIk zDreoUa8K4T+*`Lc0a|ahv&~uxeg8&qeDcJA#b*`Ojv6(5RL-g%(=wm%zvxRw0qUyF;fKk0cQr;V?CtY>;etbrCnbuLo$;J+(qAv)~fK}7HCd`rV z3b9Lf1y{*5KT0PVm6M@L)oMl|2Gi2<;c*^4mhb%`u)3sdW{J(CXm_@N)zEIK7Kz!D zvhuKclJACVDzCiAR31FALoc8kd9CjubsGlC9?&dNq%`wHAmcN z^MQV-`Vj1Bv8^r%vuo71-o{_qk2&kU1ETcl>U|v0b=x54IJLOYcoKQPnBKnFP(Y2M z&G!o=afO8sF3wGyR}jzP6IRnHk-qNGJBj8C1ueOZJ++??VnLpN`A}9I4_gRs=B0x( zixJAU(0g`ydIjnca_Ot4`+JCJ0fC*JueXGx=Zz`$8cQjUdaII- z+|Jt9Kc&)a2h{%DO=yF27}q!b@M7t|LDofIB4J|Mn_(1Pz@W$FpX6ubPMfb2G~N}Ew&R3R;K*kTz7Z9 zd8lb&_G(71>rGRLzY^bYcW2|V8MA?vazgy4o%ti&Rnj40{H|0&EomD`()@A;>Sv8P z26MLFs{zVOQR1|h2a&Hy>qn2d@G>NGO4{kE2W7->mc~Zi>4$3nV-StF$&;o^>{?mK9jcJ`C>I z-Hjh=y`MzjAz0rqwSVcjB^uLHr(pf`PJYsQR~X)f!s!Z4PWHC*>l|j#>uwtP;97Wd zA1YyCWJxDSwpE=q2i<#S8*F#EED}bvO(v}}m=-EX3LK%x+zzc?UWXg#W;!ov)_D8U zX<67%1EPgHI&Zr35PPE}avozbaPLoesLq=hzMwby3rZqkzjU3dWVgQ`#G({)s##2(e!o4EBgRmcYT_nxh>|tRE}Tt!V!4bY5jE@huf^+Mm(Kr+FOtJzEd28PbZ9w5zhn?Tr>U2=7Ot> zoEjx{HK5K`FLYs%(i37@EmQZk}l zjRNscr_x6(GVAijAV)=a@v(jZtG2nk*bG;dhzIFKA5pb2EgX$ReGKl+Ag=Y&ErDsq zS*JqdlNTx}PKrRzmd5XQZRx^V^+;cVq8_C^^1`39WK2Dz#p_8+98H5oOO9|CL%LQSu!xoGUZ?7rNU(S`Ii`7{MW zx&!)xWT--Nrcf8X(0VJdcc`Mc$VRjS$Zz15+UekP6Jqn~uE(;vXKl&^wX{PvsGyfYN^#e^h;noRrYZ;1|%pZSqnHK9ZAnI-do~) zyP(s2Z7SxX#s7oU_l3zHbAcXVKXb3f*j!zVmE)t#Ppdo>UaG1brDsO&A8J0N@?d_f z))$N*imYS-bupHN$4Pu0teoR+xC`WO3h_`Y5RDK2maGNi6rkr7e4Q9~%q+ynNMN?n zlbn`K!$GGV)kbfb+NWpNv}>!Q@Vq1A01>ukHcS3w`|2kR-sNK(q1W433h!KgW{|MS z&s9(my-k10r7=b?EET>H(rIphXN)h9I1zp`Lr+fPW{x|y+4FFYTSp6`^vyb%mh5z| zuop>fmMGDwChw>4F~u0xNa7arK~z=S)N)$%h2~GRF$MFC8bZ;=^Ls%! z!9hlCqlq&t!}O;yY8&MK42c(%TBpM;7pQCUJsAgf>JDUPEKGdLuG*mGF^NT5jNtF2!1t^(F2vdU;)p*0x$vf<(Rl$)fN$BY$lTecAh zLn}&)v&W_a2$kZ1T%4L*UxU_mvQgx&c&manCS5=(?KXNJr=7c$IHu4QJIQT!fqWBh z{zA)4l+Ylg{r&5^NgjA2=_dS79w`y#W44g>3N^h;ysKCzc=sz9%!OXJUaWkhxq50F z_-rCjd5}FOE2@I0^!Q1#z&=9x3vvFfN<<-R(5wy~jDt6Fd3dM4#@Nu(6{uf6QEBN1 z-T==Lblq#S?1aoVHGd!TU>$>~^u`9#)|(V6=hCPM7nbxt-|D)$but|;n@D$JhP^Xu zRp<9^Y;_F5c9soge_(EGJQ+#?9_bZ7n zYt??@gn1n5bVP9Mvew5fbW0P$-Ielij6I=XiJVJYk zsYLqwg&|G?oi}Z~T%mU!@v9rEY1W`3+DAN^4EYgvONAJt)KF{@3O5$7)Uh6LOBA4VErQ31MkPJO`Khj($(Q;RZC&PD{Ha z(^4RTO8af>rwTSlnGqE}%r3ci)$s5Vf5#*J^=pxvKB3ucE4DaSN1ovuCrS-v{$S~hdyYvNxA1kqt$*|9`S xBDOTcIBeKvQkSl)VN@pu*A(3pDQmnU%Ufbl#y&b-z`U0LXsPL|mMYst{2wf>a|r+d delta 4552 zcmV;(5jXDETk9i`BM<-vVoOIv0RI600RN!9r<0Qk9UdLs2n_=b6b)P=Bme*aA!$@t zbVF}#ZDnqB00000lR+I8e{Har0000HOG!jQRCwC$TwSYW*;O5LuC@31xF1zr-Bp#Y zZo0J-5j6-#g+w3vB@h&UfNwqsz6%l%e}EwPF9P~1Li9mIgb2QfARVQ(HMZ$8=}Onf zt$Xg-d#^R;^kJ^G_CB|6856}c+{kRe)H~~?Qe~f zym@v$B8#;*iGUaw$45Q3>kdQ!Gfg?`zh4aLy`1&K!1VZN+y4_YrYZ#SK-`f%RIZ~?;EdKI6oI!+-F%q$S`Q3(9bqsJEy#z~HcF>kZzt-$<-s#>^cZcvR;KJUE~kDE_~zpZu)~^ly3t7Egb9{e`fflw;!C~^FMJ1_g>xN z{+$hOpY}L8>aku21ZE6l#^YxrK74qNhmX!Nj0w{u$YR(J8M}RksKLw+PDBWS@VzGk z9z7Wj96B&zy^2_`0%Bkg0lR(1FlMa!fO~f~*sLN}tAJN-t+46?wyTI$AHd{G55W)^ zKsn)6A3)52e*tEOiy`Cj*@)dm#*?!V&vyw=&c?Qu<861X?O*kH{q7d8-#vn=`A_jC zX2N#u*DElii;TVl?!UUmgS%U7*Bt=Dm=qU-;Q1~Udjp=Fjria{&hVd)F0fgJe|Yyx zKluxP{#W0es5ry#-G6oSJAe4qFW!FpjS~O_CIS&bf7Ot(Lev+rT$HLpvLK5Ef5T<1U18y6jMp3L|B~7{4fyI7;64D zGlO_hx@)?tIoZtrj(`{mtDezEM%OWz8BFExL13;?PR()aiJKbKfRsa9hrt)gY>+T# z;j8Q)Z@U}&k+50?th(^OvTp_?F^DNr2Br*me|~c(%;LW%0gg5+{Mx%ezWJlCzyBM% zi}8=+-8<_q|IFv^Y(Mw*E0~fZXN4#*B}Gb}`BV*J22)=f5kbvYq{Rq~Kor0P5P4ZJ zL;D;Pq3;MGFoNSpa3I7OK_Maw!LmXPCHvMBDE7+<`v!P)!+ev~2&w@9!$?8F(1khh zf6WXGAVfmlUnT+vMvURcezh+P>}J(z6j?muE#Z?pW6h3)abjc%Aa+;~1KdZlB1`ot z!+tWHoNVycgH!&_$7jD9UpZa<`a5r)(l{wp4LK`@q!>p*7JqFl&dBU3nurjXU?n{p z0KT+3E1LrXn1Q}yaPXh31Qh}a(1{^sfAJ_h-oi8P4|!Ia?{;Hrq^!l>9j}VY6bad(YN@uQw%M3lor4 zF(qJ{6sm4Ji()9Hc}#|jQ86aP-8Z1OR$U}dXp`dnBIA577?b~bdLR6X5u!Fw$t83ZrCU1W$l z?(mcL@={a22nyNpENhCgS=uhZst;v7)-nh)5Sb7|m5*xqui1iHl!NG6f7{RE*F9&$ zlpTWQY{=y`HGmW_CBQtR#exa57^Y-}@EC{zD{#TFC?RFR#a^%*1XD7Ul!WcJL(cMA zG_}ocpPa3zVYkm1C-?q~QLrCo3_xt?BfA0fSPj9QuZ#Yi$xkX}DhnY52B@U}z{}EL zh-?rgq->2rh2W*9>X2NHe{Tg?+%Rr7-ud{u? zox93nh>RHA(Yt63Rdtcj1p><7xlhcQ&s8CV!IMwQ4iYa$ErI0$0XTFUM}YzBn8o7J zwuh*D@|1mX6$7aGMyMLP$Vhok$ssVhQc9Wqbydd}zH$C~Ew^>Ue~GAI9Ktwhaagwx z7;+|OPFApG^ek&eAX0RlN0FCwYrr`$V1klG04B#K0D+)jFhm3?do+XmqF!hFTpWse zLMZsp42aQ7J{5q?*7C?))_rZr;Ti0!-PUs}4CUA`x-d z1&A2-gX2JgV+v+!e++EZxih6Co_-V1b%exzGS)O2YPwOS@ZHh@OD1IY;~S_@^-^X) zAO?D_nv_R;jn`b|Sjt~UM8Q2fha4fUyTx!?bJ~Kniprzb< z;{ad+ zq~JpTw+{bdt@s9w{;#+Ob)dZKuX;$_f&y;LP4w4BdWrZ8&Ih>O4=UJ?2j5#T?NDGh}RXGL68yd^@*CcxYm}zUze_F|KT7syG-5iP}C&giHX7)u3&T*LJ z>BEnA$M3v(T)?ckZnGEc$10TiL36I%4F|8a*=WVUho=4a;0nQn<)KR@D6KY`=DpiRdtE(V>&t!7->gr@s9ccT>+3O8^%csaOF7)4)94^CE~&n)$B#*Lp|{- z#{hwD*e&xY@fNd>9}cw z!(_;M_3(*jFM_ILJvAT~5<&!o;KDb`ecA z%>3PpF=IbS5k=aUU&GG#05_N;Fj_)X<47c9yJ_47yyt z7t<6 z^IHgsi#O|RA{InO)ZmAkA=z?bUc|9vE7yzTe)QevI6hi^61SV~y~odnG7iM82Rx-h znaeb*C`z_7^pQNGY-T%Lf0Xx1FqZOw*3s-m$AlP*4ZM{0&DtR4i#X>0(mu^1?T!5( z$o_a~RE*0IGGCH4R|Mu;t^w#UAdoyfA%FRM$fgVx5&^nve6!gVt6~IpKgD=GDoEgtI zwH)*{3m_$!lP~hI@(Nq)?4aM+VwXhi8~dLI`$U8;upfhbs8|;`PpdO>BiIKICc^ig z?x&cuo`~w1nQc%ae-(FWJ*UoRDWs;!eTwrJmZ*RTnp0f;n927zlyf0)Zg1FQ$S*p2;9lYPI@ z=x}PgX4-ZP)RL_YPZre}l9f_civYTDlJxX>#;PwV+^Drq<^#Q~Rb)ksoKGH?8sJsb zXEvyD>1)~x0_i2q^V0Jh`=2KJb%I{i+iYUmeCEJ$$~agZ9Z(p^2uU>MEI9(O^WAj! z*?C6aG0Y6Rf4yLw?0}LRmJwkuOj_Vl1AN(bsqe4?Bzn;Brk8bmF3%U<*#CdGZuR&+Z$$uq z1Hk_F?>~C_bDw{6JNNc*Aaq{N&vxaBQ@f|NGBhi9Qnj0@U*6-svj2Hw|3`2CfBLXX z2d_?8Nl|s&_y6?~0N9<|+rO@d|2lwQ*{r+W{nt*9PL9{lL*Tz#_3?;6otpM3iKQ$M zQC2lle>Gn9@%F9L&8@BrJq$=~gu^E^sC>NxF(WV|gm55kUe$Q_drkfOX6p24(LqP#y8l*&Xz1WX1S2^2seX6j)GW;ij} zF#!@|c-nO#2j-)3%6HXlv+5&tkvBwSW_B?p`7RL#BGPpqzxnv-#h-}ilSRaBV&qqd zf9RBe(D(6n--Q?>|5#*xQ&cx8tEn2B*@lSFcX42*kdk!!G2QNBczT`frzEFl)~Q*5 zf!FH}oAUL0XcO2rJU<^lP*ngFiK$~kuZB)VkJYR*wLnB_Fu(c2C$L1-j+yCs7sEql m`p1;y0}%c)XZ7K?l*Jiow?t?H!~;a?7g4$?6sb~_Rd)|i8nIPW}xMv1pojHIw%bj z;vIN;QBxAX@j*d5006yekeMaH1RVhM!FfBmdSHQsYd%;YHqg}x00sxVxrQ+8rUd)GV zqrg%tA?5o=ON&yUmmBk9Lk+fml+BLr)65#pDK^`?|Fk*rQwU+&Z1z+7&O|oy9SIFn z8W?mwK76Z^pIr!#t4*FFzr4^vB}t;GC1S-#%exq}mU;lcJ7A4X0AIG*Z>{uQx7Kn| z^eVTVjqNWX^PhW3Mwixb7S1dI|IS|EwNzw*_*=0wEr(9|_RY;y z)^;+&oZ8}#2dzdQoB<~7!v>Oqk%02(CBfK+tXs?|M~VW2CH9*P%+%}8s0U3-5)#aZ zhCiFUelh%6HpG_~N=B2Kol^xICJ{d$t9;&Ec33e8x4+s^C9{EC$W&akd8|=;$8ylT zan3{+{9uR2z0wX3e)_>8xb6&#zW0k;7FXPx;Lgr-{S)`-f&`>zP;C#>w7LDB42bMx zyB_w|^~#N}zO}Gf>g=hiemVA4-lP1<(B8d(Pk!|i0_A({D>|vl-$e~W$A(@RAGI8g zZ$pge1cq0E_vzlsxbcGL-Q$2rUo_=a|NDR$O=cArHm3jv(d?VV8@%#$GSD{b0kB;~ za_#ERD9EZrFbfCngwyM?j`A0$6LH*~f}=}wVV!G+<>2KBg}5g3@{-B4ud~NB6Jngz z6P};-rnGxQ7sftBlP{ke9DFeUr8;U@D6u*6VaagR3!!WFyj*R;D0ho@y7!a);1(OL z5COx-QX70aotCXZ^N#yex=(_y)P(L=$6p>?dsAI(+_`QVD7&8=HQfK6!(~lz!?U9J zVSj$KMKO~aNIM_CuxQg4w9Pa0*m#_)KE?jKufX{$(*=xkwK(e%sXj{B5>B9^B6JVx zlwYwCdkHBEb9aZYAm6O&fETAb-h<==e3%m zciFAT7wROLzz>7@pQrb*KYYK1hi!SnfG1h)^tOA5A znQ99KMUID0O9xF)v@>#Cv)&q$(h zx4ca7wcxKLhd{f#ayPw_W5}8wRiE=wO;6$uACG3Fl(-m?5=nCP3GQJVZ}A;gIi2DX zC#9W~qJ31{Ns&omx@!et*VDQ*?tCIxcTE^4`2C{xNa;v$j?QpUF!kbb5f@FV`1$#J z9}F+g%gWT>O@b~>&~cNmw90WAV<~epq^}xDFiN4mW`L|JAE+)fY6PBnbSdsJsrKYj z;Ky(ZIlimQ=jaVgd3zE#o&fK=qx6_X`ho75?aUINZeGVpin}ktE6EB#6m&i2gV!x{ z(R#(yE_dRt52<-ux`QZQ6h^jC8?dv`vpqGwTdctv8qz;QpEXhG5IB|{$lb8I822eR zykS`1(&oZg=o>OzhRq=DvJmqPs7glilYy%~LBZY}G~^9tT-g$r|s6mT2UMNrcGTjU}UOLU)fhju& zM_*K5zpSSD>xj2o{)u!26nheGK`$TZrY01$OM(0Hv81X)%;hY?nG4bp?4<)K6^n_w zT;}>Y+n*D5&}rQAmac>y9@2E5Ei=)rVyO$C{`AgO_hLKCebB z=bhNMeVY2-1ulGo^+1Va$`adJhCw5Hq}Tm@Q!}eEp?f8d=FSHzex}uxh)|`tW~`Ah z+_R|kb$m>-F(ykNY4w~{whP%=!&q!GI)Rux>uPnik9HIJIN1VW%xsr@zTp_a3$GM^ zx&o$^dw5B=RHSh(Q^4jxbvUQQfs@7Rm}%cA)LhT{xfQJL=?r|N!+I%W>}%{#3MQ-d zgm^|@Q>~)dAV{}Ku)$tU^ZWNp$#FCes`lzLK&J0EjCJo2KJrRjb-SG_Y)#@_3 z95$J>zfV}xOI@DkN30l=z8{+=Qg~`VbI&iD-zphPL%QR}zO(T8^;W_u zhK|;94BV}h^#~}7nTqmWlY1KwgATB$Hy*#-w^yA{4oh5z*r#=A1YOAKo&f4`V2=mP z9%|4PRa_bJ@^LB~=jY3pH&*}^RT%W8R54Qo1JnJ*MtAPA&}SsEbKE=TfklF`W?Wxn zgoDypnlVNfq(RfBpC9{-D3wrC+mI~!wPpr0Je5^odO^a}s|?7_DSC1%6156((OG6b z7mlP=eUwTFH>8{O9|$gJ%H=(0RBX zTRA>j@#-v#iPB>o)ft}KM6((kW`~eI%b;u}boHt$cK@u^ztpAFg|;_FrDo37F3t9j z{hS!Xz(+oHZdck*8ll4H8#B4OBL@#{qZ$e}lg$+GwAl0vEuVi{t~?8x6RdPA#0~W= zAat#mJ&r$SFgshWg9grL!l-Hr8?*nl3!JVPG#g_%eDmU{*Hu@{xzJ>6M3 zxK3g^U@a7EqHh5JkVLtvs~hR4tN&3<5KD;M&@@FHWt#DtX`yjJmaf+DRBj#dr zp$?6hJvRQI=+1oMJ9;%@T*!r55{~p)s*@X26FK(}O761j0h%Dsen4r-{Ua>ep1n%- zZ15vJ$d3?zFgxW!3ePW*k+a^RruHV|9OcuWB$EgTFBGwbozwm{#IAdO`bSc81%Q5% zl&s3jdo46q34r|SwoEB2Oa7)OvuR;#{pb4RPsO424XPk%T%}hr@GY_E^LHf{cb58k zau{z<3ACfP16Cr?(}!660RRfhfj(%AJC*=+z&g8nDS|c{UV(tFj*6hmQu>nmKI&K( zS5y!VYZ_!=h6!@VARR%=h)gJ~@q6I489G&D$G_-!FAhr}iE(C&)90U>&5Fil%m+;0p zL!d|`5+VtMz+hk^0*t@rML-9Fz3@V(6u)t3VDT87s}I4|+Y5NgiFWYzBPfDE#Btys z{(1W7>;Fmbh5uazq8^Yyv=0O-AqnyHg#6tCPtf!ylKk$_|7d|XBi6_e6D;1_4~M~O z`eVHaLVu@l#QbUR1Zf|PUn|%^v1Y4%Kdtj zmUKYKBBiikC|pJojF6H+gJrQY2rvdJ4Mkv}a9Jrw*x#shyzm6H7Y2JuMI@JSCGtpO z;0_q4QwkUc0Y;!@;a~@8q$5}oEh8oAAc-MTVE#s7h;t=oCEDZfUY$}o5~(m~DX5Gi z0t$x7V6k9?qZ9&+bbzA44pKzVWMwguSlQpaam2`JdE-3M#N~ALL_1?4K3>kh<~S8x zPSr?95d@Qv{Hw>v15I!u8W8t@tCyp90RFEbGgnWnDFJ<|CsYO|36q7wq-3SxvT(T6 zUmy!C4o}R*Q&y;?1pGHAP8UXw7!FZd^l7FN34U1+qmfg`VbKI{oSC<`ha%|IDd4H) zpTqjZ4dsX?pf%70ERj?ahLDq#k&~1*la!T{LdZd7!Kcl?;k_MQov!`A(5Kr6sPNmO zqg?UC`LF%z`fX2{Vts#W{nqqw{k55Zz+c-!4vqOO1U%Xw>-fu0BG+$27#FmcGnROM z{GPCX^t=8K$pC|+;aG$N5)5;2ASMIM0Ru*(9bsTeq%>UG3FZWoaYFu+9q;W#2tebo zs?J0miCPg8^p{q^3%@Uw=s)oRF4)s`AWBBm2>dt6K#<>qg`A!ke?+SQ`M>l~_yzde z5ks{5t&ezg5l=$MpGV>EdYv9R|BIjB*WrJ01|s!;ll&`v|C8%Kx&D;`{|fwHcKs*U zzf#~|f&a^{|8H{9{#8t2y@+o>0mM?N@T8%WSY}Z=T+-G6d;{zQj^D{(fW#geACwgy z0H9+#y+{B#xm?6fDuRx_Ce;!ZC6hGkdtc5QL|CwnhN_umoB5qfao9^1F|RmSj{N$& zt2451?LIfR_FD_CI$O)Zqw3-;XB-PkSSn~ud!KB|!b2tZwXn#vBOYkLlSWAeG9dUo z9oZB6;8{4*SZ{X?w%xcV#P5!jwX)``>q}{xO^tin{50%~zd~@x2NII57V2aE%|sB6 z{!H&?cswm1cJf{O9UIm5K!mc@Q36TEOit04T4LSI!7`7mytep^F6*^O#3i*D|{)FbR z`(VNToHcf57Cv-L{PreG0e+5oHf_KfVF zF_)TV3ZL?+PdtHcb{8ML6?h)(e@>t6;CKk%yg8T4l$Q(FDyB`T#M#)b9c&0yxDbwm zmqbZc-?l*bAlCbB0tz#2WlXZR66Gricl)}2%;$>ir%J+clq|6hjm=+Q1P`;|7s}~A zzpB5QkTwxEv+?r>h39!*zITAYgXyFdzjpIHQO=iMF-#mS-c-|cDs`3@0}nUjilU)s zBH@)<&p+>Fl6EGl^y``k#kIA6Tm?bT@aJ7Tn0(7%YF61}Dlf=+|67FB_#+o_uRXGw z3r>u_)0MO)2&#)DG?UQw_NJkf?ICWFx7-aA8uO%~dh8sBwU1VW9@YdS#J#1-wy#B3 zDV)dV+1o((dJ;!k{81X<#{KD}iLC7OT0Yi(aq~^;etH(F&lJ^_qyb|oR+sTX2#j5D zZWZ%%o3^v8C_S|H<+3POe)E{=h}4l_?PQ9Lx6si8*hu*cL6 zQlEgXEGoR4B;j9-jCEO@9?b4M$9yoW4iI{4r4B`N(cKvpa(J^VJ+PlvL)%_t<}}v> z7b9nj5f!4?GmRiE)^dYP!*0QKMS)plN+KZO>nihiL0qmYl$zA7b-C}d5Z`tNxKFl& zI?Emg$Zq&dUNH7;p23a4zb9M^AFYb;i$dpaPG&qdrk4(Ndf~!iTslzxIRd~K7)PB$ zcjqXg5W)-QHRS*NB?vB=*_Fk+ZPiic?O$SJ*~{~?bmnC~^Bv|zUpJc?re&)VX0{|z zeBD_t6ScmNyKHS&>qTq>gDIFInP$dSZj|BF;?vM3{!rMeNM2q5LN!jbj*qUh4&X4H zT=>F4URa_gxRk3xt);5a;ilky`j%ynet#}ew{{y9hJxoe=nJ8p_po#`*#Uej6J7rI z4j!(gG4pQRvEm#_?&1S26U(o{2hSS*O%pL6dA>oHL_S?-`CGPlx(^NvK)W z+RbjA?2Cg^k#uTF6c0C^Fc?sWbF=x(0}i1RW_Hg*>dHK$N*U)s?YYPb1$8qMiHn9j zrOlFO&cEq3VrP2NYWjGlvDi)ABMQo&lU%x$g&gM9gr8T}n(_z9Fg_C0n%dVLLh?qQ z(PU_(ei)#5SBaG)MyFO7Q{Snirz=LoMzXlY7$Z1XrnVV-PuTpW^!ulIndEqigotd? zV5)Mi8bH;E#!z65w2-JKpmNOj>56Nvh<>)xd0mqnqghQIE9l}Tzud<2&suLXX$;E6 zm}WNZRLB-!?COl{2q5w*tLZNP?M^9&N2%Gqq`54QH-8pm#ag_ zokdoXHSf-uaK%KC&M1`XQs>q9llzwY0$WtW@h!UMrki<=ul>0yA~7FmAd@>bDP;S% z`JS3(;m_UBUc|?Q7P%>K?I3H%7*_*mNXWJO8vxWqibq5C)pyekEcFkJYeb_ zIRZe&e*G-OzBh0>@W5Ba90)HK0ORNf$c~zt?aez88aAG(#~d`i5dDO*!vlxwU!?w zL2hUJz?Z8(infckQg@9{8~)CWwws-^pu&xDL{-6Olth3ei|5Gl`J}T!D*0B=e9*h^ zTS*%s`{(i)PBznUpuM+r$Fe^(O2 zsjAn?J*hG>aRv=A_`IDsQU++1ukmJGv7N*5ahLYWIvtv1namMBMTqLaUA~m&mrs1r z7SlaTI_}BjP<|~k;0b70zu*FImwOgBM?yT6?2)o4RG1ypboZl&P{VTgV_D$^+cxKi z^&XwCmy3!YP{@bhLueWmzl-lvieN)H>q7lsNOnZYT1vR-@y4I+U@(sN($$6o0i`DXGWXVp~t=?lj9 zjvg=Y*tZWHCkgm|DgCxaI$nr%j3884akaPAOS$O&YPd2<7=z2CZ}V5iEn~A0l6mP3 zzD@A-ors@A+h)TSdB*RY;mQPqeih~j6UOsTYZ^PuB*If89+I3~b6>g6e^4+Xc}nLs9lZxKd5^z{r~^~ delta 1956 zcmV;V2V3~fO0f@+BYy{YNkl&u6<$@l_PO@ybUL@mBqVcDAuz%?j5s== z4>K~1h|j($2>t;<5q%UNM8V%6^Q=g~Cov$-h%#VAyx^D!A&HZ;N&0fm*|)m5zO|~{ znxYrAckNZ{_O1Hrv^ldkHAGBS#``o2dFheFg z_zmlS=IXO6dg-J4bpFhOF6_@~Z+Ai~b~>9?Y{*jEd3t=*(VhEix__|d_kjiuz^ECT zPAXdMlpqcDLw}^Bla`(wcXa#i2`9Rx`Lz1et1mzQ$=|+zt2aOS{_Eze-+lKx=lAE| z_|Z3C+q-&cB{5lJ#6XORGl~>=#=yHs!p!SFkPm@Eh!D~BKJglf1l9|fgW9?Ga6|80 z|DXxcyz|*lz4)!_#_u02+2GHA{OwQge(d?voFz#%DSsu2zU_lR0rx3V8Tu|k5Xy}? z2WI5m$2@zYA*jwEkXpKUc3J=7uMai#i5sMNuCFmpczXh zDGF3tnKWXocmslpSWCXw4!GhwA}lr&HGQJhYED<4-L)S+IDXrm-kpB=h0D99>mwXV z04+Q2I)7xYYh4b;TEL=G@pHn6at z*jg=T9N5uS*Y)9<^QUKUj&e)1$D5u|5iD*Rjei&omr&-CeH!xdG?)+sDpZ;c`p}hx zw(NM*27w^u^Rigfip8MvRnF;z(&D*6e)n$dsst;dE`>oMr6A?QOaDy9KVYk|k{f@O9R=S_<~Py^_Clr%=I%(OOeETn_s2R6uS zJ*+2n&Rg_U1ZiBr2xoX#hy+12y4uEYi@Bpz$R$aqvncIO98qf$XJhk*#95Q*WAr`c zV+!Ym8%EOc0nU}8fl$o*hM+bklghi=Re!)qvX4%rEd0-jzg09>WEgWJcO~;qnd)p-g&iS(;9rxC-`iaN-cg#h}t{B!R#RL@bCxOO0;| znVQN>N=$aG!~w=`p}_Yws8^dtnkY#ZTVX#OAH{bZLdghNS&(vvvlw8F_lPW$^noWG zrJ6BH6%QRR90i}7MtL3CfSLtU8-G<9@Tk+0MK-3~hOEV-%YjB&CuL1p%r~c@yjNKB zLuajhukM3)UuTO~8a0I_aIE+@Yss@VOC-l6EoOdvHQK z%jqL#!ul_dk6Q8p%C_7AEIIO^1_Fy-Cb*Cc`a?=;^T|F1W0Jkf6J8_HhK_XQ z(*DXFJZ`oi7zpJnHEHFs27l_s4G2EK1yk@ZO`Cr=1{lKb zG`#^4&6tW?&CUvMN714@3a@8&vs4<52BNGV^xa34J>RV5h6H3$_F!bzpx~onePP17 z>%(w(;u&W!p)yw*sXmV=?w%e=73FRyFeOMV4WBtc)s&zTnm7*L2k&5Gz3I;#tvyX@ zi_O9Xod7r7UNR|FP&4+Rg8yxxmVY#|`^)E#AM#a{WthUfb@jrVBJt zD>q&$4vQ7Y=#aFt$4ZO}qu%Ir`~r>{=*D{=&}wJ)6+rMF)PHyL-r*-+y1dYG7M>sf z5gEr=k*CN1sg>+aA)+zJzu!I(js3mFugjKSu)IB=)td`vcYl{0*-2H|o70IqMTvIU z-D()Z+=n=cF;;AdC8fHmXtA6qTjB;q18Ho*Rkp8K2-FbbqVN6c=%k^8M{8PdJ0$hX zw?236Eus;c&$E1QKCORR*VP}1=wZg-kY&RHV}Zq&*%%rOJ1A>L*8&^wdEQ!MPGExr qJf76m-#EdaaUEbkbk2UEAoCw565!kP*!W)n0000Z From 19e2884f5da5b6951d2a16abb910440ba764fcd3 Mon Sep 17 00:00:00 2001 From: Vankata453 <78196474+Vankata453@users.noreply.github.com> Date: Sat, 6 Jul 2024 21:29:29 +0300 Subject: [PATCH 05/33] Use `simplesquirrel` library for creating Squirrel API binds (#2792) Incorporates a SuperTux fork of the `simplesquirrel` library. Most important feature of this library in the context of SuperTux is the ability to easily expose functions, classes (which can include properties) and other entries to Squirrel in one or a few lines. Every exposed class, variable and function has been migrated to incorporate this change. As a result, the `scripting/` directory, which included all scripting functions, classes and variables, as well as the API wrapper, has been removed, since it is no longer needed for the new binds. Some scripting functions have been deprecated (currently only via a tag in comment, later to be migrated to docmentation) for several reasons: * Some `get_` and `set_` functions have been deprecated, since a class property has been added and should replace their usage. * Functions with the names `get_pos_x` or `get_pos_y` have been replaced with `get_x` and `get_y` for consistency, thus are now deprecated. This way of creating Squirrel binds would allow for way more flexibility in exposing functions, classes and properties. **Additionally:** * Removed the `camera()` function, as it only printed the camera position, which is already accessible through methods from the `Camera` itself. * `Granito` and `GranitoBig` are now scriptable. ## Documentation Doxygen scripting documentation is now generated for the entire codebase as well, since scripting classes might be found anywhere. The `@scripting` tag for classes, functions, constants and variables indicates the item should be added to the scripting documentation. Otherwise, it should be ignored. Added support for the following: * Enumerators * Member variables * Listing of base and derived classes # TODO - [x] Expand usage of simplesquirrel functions, instead of ones in `SquirrelVM`, to reduce code duplication. - [x] Update the scripting API documentation/reference generator to incorporate all changes. Closes #2736. Co-authored-by: Tobias Markus Co-authored-by: MatusGuy <85036874+MatusGuy@users.noreply.github.com> --- .github/workflows/android.yml | 2 +- .github/workflows/bsd.yml | 2 +- .github/workflows/gnulinux.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/scripting.yml | 21 +- .github/workflows/ubuntu-touch.yml | 2 +- .github/workflows/wasm.yml | 2 +- .github/workflows/windows.yml | 16 +- .gitmodules | 9 +- CMakeLists.txt | 10 +- data/scripts/default.nut | 17 - external/simplesquirrel | 1 + external/squirrel | 1 - mk/cmake/SuperTux/BuildCPack.cmake | 2 +- mk/cmake/SuperTux/BuildDocumentation.cmake | 25 +- mk/cmake/SuperTux/BuildMiniswigWrapper.cmake | 27 - mk/cmake/SuperTux/ProvideSimpleSquirrel.cmake | 14 + mk/cmake/SuperTux/ProvideSquirrel.cmake | 88 - mk/cmake/SuperTux/WarningFlags.cmake | 1 + Doxyfile.in => mk/doxygen/Doxyfile.in | 3 +- mk/doxygen/Doxyfile_scripting.in | 12 +- src/badguy/badguy.cpp | 15 +- src/badguy/badguy.hpp | 28 +- src/badguy/dispenser.cpp | 14 +- src/badguy/dispenser.hpp | 33 +- src/badguy/granito.cpp | 253 +- src/badguy/granito.hpp | 131 +- src/badguy/granito_big.cpp | 60 +- src/badguy/granito_big.hpp | 35 + src/badguy/willowisp.cpp | 58 +- src/badguy/willowisp.hpp | 42 +- src/interface/control_enum.hpp | 2 + src/math/anchor_point.hpp | 33 +- src/math/rectf.hpp | 4 +- src/object/ambient_sound.cpp | 41 +- src/object/ambient_sound.hpp | 40 +- src/object/background.cpp | 60 +- src/object/background.hpp | 81 +- src/object/camera.cpp | 130 +- src/object/camera.hpp | 113 +- src/object/candle.cpp | 15 +- src/object/candle.hpp | 36 +- src/object/cloud_particle_system.cpp | 26 +- src/object/cloud_particle_system.hpp | 48 +- src/object/conveyor_belt.cpp | 17 +- src/object/conveyor_belt.hpp | 49 +- src/object/custom_particle_system.cpp | 972 +- src/object/custom_particle_system.hpp | 794 +- src/object/custom_particle_system_file.hpp | 5 +- src/object/decal.cpp | 18 +- src/object/decal.hpp | 49 +- src/object/display_effect.cpp | 18 +- src/object/display_effect.hpp | 58 +- src/object/floating_image.cpp | 171 +- src/object/floating_image.hpp | 166 +- src/object/gradient.cpp | 66 +- src/object/gradient.hpp | 104 +- src/object/level_time.cpp | 16 +- src/object/level_time.hpp | 41 +- src/object/lit_object.cpp | 22 +- src/object/lit_object.hpp | 28 +- src/object/moving_sprite.cpp | 35 + src/object/moving_sprite.hpp | 49 +- src/object/particle_zone.cpp | 1 - src/object/particle_zone.hpp | 11 +- src/object/particlesystem.cpp | 17 +- src/object/particlesystem.hpp | 60 +- src/object/path_object.cpp | 43 +- src/object/path_object.hpp | 36 +- src/object/platform.cpp | 37 +- src/object/platform.hpp | 37 +- src/object/player.cpp | 146 +- src/object/player.hpp | 220 +- src/object/rain_particle_system.cpp | 48 +- src/object/rain_particle_system.hpp | 52 +- src/object/rock.cpp | 2 - src/object/rock.hpp | 5 +- src/object/scripted_object.cpp | 43 +- src/object/scripted_object.hpp | 84 +- src/object/snow_particle_system.cpp | 14 +- src/object/sound_object.cpp | 23 +- src/object/sound_object.hpp | 33 +- src/object/spotlight.cpp | 182 +- src/object/spotlight.hpp | 174 +- src/object/text_array_object.cpp | 263 +- src/object/text_array_object.hpp | 168 +- src/object/text_object.cpp | 109 +- src/object/text_object.hpp | 185 +- src/object/thunderstorm.cpp | 52 +- src/object/thunderstorm.hpp | 57 +- src/object/tilemap.cpp | 85 +- src/object/tilemap.hpp | 123 +- src/object/torch.cpp | 20 +- src/object/torch.hpp | 40 +- src/object/wind.cpp | 14 +- src/object/wind.hpp | 24 +- src/scripting/ambient_sound.cpp | 46 - src/scripting/ambient_sound.hpp | 68 - src/scripting/anchor_points.hpp | 50 - src/scripting/background.cpp | 125 - src/scripting/background.hpp | 107 - src/scripting/badguy.cpp | 60 - src/scripting/badguy.hpp | 77 - src/scripting/camera.cpp | 176 - src/scripting/camera.hpp | 162 - src/scripting/candle.cpp | 37 - src/scripting/candle.hpp | 63 - src/scripting/clouds.cpp | 54 - src/scripting/clouds.hpp | 85 - src/scripting/conveyor_belt.cpp | 60 - src/scripting/conveyor_belt.hpp | 80 - src/scripting/custom_particles.cpp | 925 - src/scripting/custom_particles.hpp | 493 - src/scripting/decal.cpp | 59 - src/scripting/decal.hpp | 79 - src/scripting/dispenser.cpp | 36 - src/scripting/dispenser.hpp | 67 - src/scripting/display_effect.cpp | 67 - src/scripting/display_effect.hpp | 87 - src/scripting/floating_image.cpp | 124 - src/scripting/floating_image.hpp | 119 - src/scripting/functions.cpp | 475 - src/scripting/functions.hpp | 306 - src/scripting/game_object.cpp | 34 - src/scripting/game_object.hpp | 116 - src/scripting/game_object_manager.cpp | 84 - src/scripting/game_object_manager.hpp | 100 - src/scripting/gradient.cpp | 88 - src/scripting/gradient.hpp | 123 - src/scripting/level.cpp | 126 - src/scripting/level.hpp | 141 - src/scripting/level_time.cpp | 48 - src/scripting/level_time.hpp | 75 - src/scripting/lit_object.cpp | 53 - src/scripting/lit_object.hpp | 74 - src/scripting/particlesystem.cpp | 37 - src/scripting/particlesystem.hpp | 64 - src/scripting/platform.cpp | 66 - src/scripting/platform.hpp | 86 - src/scripting/player.cpp | 272 - src/scripting/player.hpp | 248 - src/scripting/rain.cpp | 55 - src/scripting/rain.hpp | 86 - src/scripting/rock.hpp | 52 - src/scripting/scripted_object.cpp | 137 - src/scripting/scripted_object.hpp | 135 - src/scripting/sector.cpp | 66 - src/scripting/sector.hpp | 103 - src/scripting/sound_object.cpp | 53 - src/scripting/sound_object.hpp | 74 - src/scripting/spotlight.cpp | 111 - src/scripting/spotlight.hpp | 137 - src/scripting/text_array_object.cpp | 320 - src/scripting/text_array_object.hpp | 146 - src/scripting/text_object.cpp | 172 - src/scripting/text_object.hpp | 165 - src/scripting/thunderstorm.cpp | 59 - src/scripting/thunderstorm.hpp | 82 - src/scripting/tilemap.cpp | 115 - src/scripting/tilemap.hpp | 146 - src/scripting/torch.cpp | 39 - src/scripting/torch.hpp | 64 - src/scripting/willowisp.cpp | 53 - src/scripting/willowisp.hpp | 84 - src/scripting/wind.hpp | 62 - src/scripting/worldmap_sector.cpp | 78 - src/scripting/worldmap_sector.hpp | 104 - src/scripting/wrapper.cpp | 17624 ---------------- src/scripting/wrapper.hpp | 86 - src/scripting/wrapper.interface.hpp | 39 - ...ript_interface.hpp => exposable_class.hpp} | 28 +- src/squirrel/exposed_object.hpp | 107 - src/squirrel/serialize.cpp | 108 +- src/squirrel/serialize.hpp | 10 +- src/squirrel/squirrel_environment.cpp | 139 +- src/squirrel/squirrel_environment.hpp | 41 +- src/squirrel/squirrel_error.cpp | 50 - src/squirrel/squirrel_error.hpp | 44 - src/squirrel/squirrel_scheduler.cpp | 46 +- src/squirrel/squirrel_scheduler.hpp | 14 +- src/squirrel/squirrel_thread_queue.cpp | 36 +- src/squirrel/squirrel_thread_queue.hpp | 11 +- src/squirrel/squirrel_util.cpp | 222 +- src/squirrel/squirrel_util.hpp | 59 +- src/squirrel/squirrel_virtual_machine.cpp | 96 +- src/squirrel/squirrel_virtual_machine.hpp | 15 +- src/squirrel/squirrel_vm.cpp | 324 - src/squirrel/squirrel_vm.hpp | 81 - src/squirrel/supertux_api.cpp | 877 + .../wind.cpp => squirrel/supertux_api.hpp} | 24 +- src/supertux/console.cpp | 108 +- src/supertux/console.hpp | 6 +- src/supertux/game_object.cpp | 39 +- src/supertux/game_object.hpp | 64 +- src/supertux/game_object_factory.cpp | 47 + src/supertux/game_object_factory.hpp | 7 + src/supertux/game_object_manager.cpp | 65 + src/supertux/game_object_manager.hpp | 82 +- src/supertux/game_session.cpp | 9 +- src/supertux/game_session.hpp | 5 +- src/supertux/menu/cheat_apply_menu.cpp | 1 - src/supertux/menu/cheat_menu.cpp | 1 - .../menu/worldmap_cheat_apply_menu.cpp | 1 - src/supertux/moving_object.cpp | 53 + src/supertux/moving_object.hpp | 53 +- src/supertux/savegame.cpp | 146 +- src/supertux/savegame.hpp | 3 + src/supertux/sector.cpp | 79 +- src/supertux/sector.hpp | 83 +- src/supertux/sector_base.cpp | 5 +- src/supertux/statistics.cpp | 43 +- src/supertux/statistics.hpp | 9 +- src/supertux/title_screen.cpp | 1 + src/worldmap/world_select.cpp | 139 +- src/worldmap/worldmap_sector.cpp | 63 +- src/worldmap/worldmap_sector.hpp | 57 +- src/worldmap/worldmap_state.cpp | 370 +- src/worldmap/worldmap_state.hpp | 26 +- tools/miniswig | 1 - tools/scripting_docs_gen/class.hpp | 47 +- tools/scripting_docs_gen/main.cpp | 35 +- tools/scripting_docs_gen/parser.cpp | 350 +- tools/scripting_docs_gen/parser.hpp | 10 +- tools/scripting_docs_gen/util.cpp | 35 +- tools/scripting_docs_gen/util.hpp | 6 +- tools/scripting_docs_gen/writer.cpp | 92 +- tools/scripting_docs_gen/writer.hpp | 4 + 227 files changed, 8132 insertions(+), 29357 deletions(-) create mode 160000 external/simplesquirrel delete mode 160000 external/squirrel delete mode 100644 mk/cmake/SuperTux/BuildMiniswigWrapper.cmake create mode 100644 mk/cmake/SuperTux/ProvideSimpleSquirrel.cmake delete mode 100644 mk/cmake/SuperTux/ProvideSquirrel.cmake rename Doxyfile.in => mk/doxygen/Doxyfile.in (99%) delete mode 100644 src/scripting/ambient_sound.cpp delete mode 100644 src/scripting/ambient_sound.hpp delete mode 100644 src/scripting/anchor_points.hpp delete mode 100644 src/scripting/background.cpp delete mode 100644 src/scripting/background.hpp delete mode 100644 src/scripting/badguy.cpp delete mode 100644 src/scripting/badguy.hpp delete mode 100644 src/scripting/camera.cpp delete mode 100644 src/scripting/camera.hpp delete mode 100644 src/scripting/candle.cpp delete mode 100644 src/scripting/candle.hpp delete mode 100644 src/scripting/clouds.cpp delete mode 100644 src/scripting/clouds.hpp delete mode 100644 src/scripting/conveyor_belt.cpp delete mode 100644 src/scripting/conveyor_belt.hpp delete mode 100644 src/scripting/custom_particles.cpp delete mode 100644 src/scripting/custom_particles.hpp delete mode 100644 src/scripting/decal.cpp delete mode 100644 src/scripting/decal.hpp delete mode 100644 src/scripting/dispenser.cpp delete mode 100644 src/scripting/dispenser.hpp delete mode 100644 src/scripting/display_effect.cpp delete mode 100644 src/scripting/display_effect.hpp delete mode 100644 src/scripting/floating_image.cpp delete mode 100644 src/scripting/floating_image.hpp delete mode 100644 src/scripting/functions.cpp delete mode 100644 src/scripting/functions.hpp delete mode 100644 src/scripting/game_object.cpp delete mode 100644 src/scripting/game_object.hpp delete mode 100644 src/scripting/game_object_manager.cpp delete mode 100644 src/scripting/game_object_manager.hpp delete mode 100644 src/scripting/gradient.cpp delete mode 100644 src/scripting/gradient.hpp delete mode 100644 src/scripting/level.cpp delete mode 100644 src/scripting/level.hpp delete mode 100644 src/scripting/level_time.cpp delete mode 100644 src/scripting/level_time.hpp delete mode 100644 src/scripting/lit_object.cpp delete mode 100644 src/scripting/lit_object.hpp delete mode 100644 src/scripting/particlesystem.cpp delete mode 100644 src/scripting/particlesystem.hpp delete mode 100644 src/scripting/platform.cpp delete mode 100644 src/scripting/platform.hpp delete mode 100644 src/scripting/player.cpp delete mode 100644 src/scripting/player.hpp delete mode 100644 src/scripting/rain.cpp delete mode 100644 src/scripting/rain.hpp delete mode 100644 src/scripting/rock.hpp delete mode 100644 src/scripting/scripted_object.cpp delete mode 100644 src/scripting/scripted_object.hpp delete mode 100644 src/scripting/sector.cpp delete mode 100644 src/scripting/sector.hpp delete mode 100644 src/scripting/sound_object.cpp delete mode 100644 src/scripting/sound_object.hpp delete mode 100644 src/scripting/spotlight.cpp delete mode 100644 src/scripting/spotlight.hpp delete mode 100644 src/scripting/text_array_object.cpp delete mode 100644 src/scripting/text_array_object.hpp delete mode 100644 src/scripting/text_object.cpp delete mode 100644 src/scripting/text_object.hpp delete mode 100644 src/scripting/thunderstorm.cpp delete mode 100644 src/scripting/thunderstorm.hpp delete mode 100644 src/scripting/tilemap.cpp delete mode 100644 src/scripting/tilemap.hpp delete mode 100644 src/scripting/torch.cpp delete mode 100644 src/scripting/torch.hpp delete mode 100644 src/scripting/willowisp.cpp delete mode 100644 src/scripting/willowisp.hpp delete mode 100644 src/scripting/wind.hpp delete mode 100644 src/scripting/worldmap_sector.cpp delete mode 100644 src/scripting/worldmap_sector.hpp delete mode 100644 src/scripting/wrapper.cpp delete mode 100644 src/scripting/wrapper.hpp delete mode 100644 src/scripting/wrapper.interface.hpp rename src/squirrel/{script_interface.hpp => exposable_class.hpp} (55%) delete mode 100644 src/squirrel/exposed_object.hpp delete mode 100644 src/squirrel/squirrel_error.cpp delete mode 100644 src/squirrel/squirrel_error.hpp delete mode 100644 src/squirrel/squirrel_vm.cpp delete mode 100644 src/squirrel/squirrel_vm.hpp create mode 100644 src/squirrel/supertux_api.cpp rename src/{scripting/wind.cpp => squirrel/supertux_api.hpp} (70%) delete mode 160000 tools/miniswig diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 98e9af0527d..e9206d81b08 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -40,7 +40,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - submodules: true + submodules: recursive - name: Clone SDL Android repo run: | diff --git a/.github/workflows/bsd.yml b/.github/workflows/bsd.yml index 52feff5cde7..9aad082567d 100644 --- a/.github/workflows/bsd.yml +++ b/.github/workflows/bsd.yml @@ -42,7 +42,7 @@ jobs: with: # Fetch the whole tree so git describe works fetch-depth: 0 - submodules: true + submodules: recursive - name: Build in FreeBSD if: ${{ matrix.vm_os == 'freebsd' }} diff --git a/.github/workflows/gnulinux.yml b/.github/workflows/gnulinux.yml index ad9d1619177..cd0eb204462 100644 --- a/.github/workflows/gnulinux.yml +++ b/.github/workflows/gnulinux.yml @@ -62,7 +62,7 @@ jobs: with: # Fetch the whole tree so git describe works fetch-depth: 0 - submodules: true + submodules: recursive - name: Install 64-bit dependencies if: ${{ matrix.arch == 64 }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 8f9513b0ce7..ffcf46e2b6e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -46,7 +46,7 @@ jobs: with: # Fetch the whole tree so git describe works fetch-depth: 0 - submodules: true + submodules: recursive - name: Install macos dependencies if: ${{ matrix.os == 'macos-12' }} diff --git a/.github/workflows/scripting.yml b/.github/workflows/scripting.yml index c4ce2f82b2a..dbec6463912 100644 --- a/.github/workflows/scripting.yml +++ b/.github/workflows/scripting.yml @@ -20,7 +20,7 @@ on: push: branches: [ "master" ] paths: - - src/scripting/*.hpp + - src/ workflow_dispatch: jobs: @@ -56,31 +56,42 @@ jobs: cmake --version mkdir build cd build - cmake .. -DBUILD_SCRIPTING_DOCUMENTATION=ON + cmake .. -DBUILD_DOCUMENTATION_WITH_SCRIPTING=ON make - name: Generate scripting reference working-directory: tools/scripting_docs_gen/build run: | - doxygen docs/scripting/Doxyfile + doxygen docs/Doxyfile rm ../../../wiki/Scripting*.md - ./ScriptingDocsGen --dir docs/scripting/doxygen/xml \ + ./ScriptingDocsGen --dir docs/doxygen/xml \ --home ../../../wiki/templates/ScriptingHome.md \ --page ../../../wiki/templates/ScriptingPage.md \ --output ../../../wiki + - name: Check for changes + working-directory: wiki + run: | + REF_UPDATED=true + if git diff --exit-code; then + REF_UPDATED=false + fi + echo "REFERENCE_UPDATED=$(echo $REF_UPDATED)" >> $GITHUB_ENV + - name: Install SSH key + if: ${{ env.REFERENCE_UPDATED == 'true' }} uses: shimataro/ssh-key-action@v2 with: key: ${{ secrets.wiki_repo_key }} known_hosts: ${{ secrets.wiki_repo_hosts }} - name: Push changes to wiki + if: ${{ env.REFERENCE_UPDATED == 'true' }} working-directory: wiki run: | git --version git status - git config --global user.email "supertux-bot" + git config --global user.email "SuperTux-bot@users.noreply.github.com" git config --global user.name "SuperTux Bot" git add . git commit -m "Update scripting reference (SuperTux/supertux@${{ github.sha }})" diff --git a/.github/workflows/ubuntu-touch.yml b/.github/workflows/ubuntu-touch.yml index 001d5629f8f..abb445f3990 100644 --- a/.github/workflows/ubuntu-touch.yml +++ b/.github/workflows/ubuntu-touch.yml @@ -45,7 +45,7 @@ jobs: with: # Fetch the whole tree so git describe works fetch-depth: 0 - submodules: true + submodules: recursive - name: Install clickable run: | diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index f34e245ce70..bbb29c0dc79 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -38,7 +38,7 @@ jobs: with: # Fetch the whole tree so git describe works fetch-depth: 0 - submodules: true + submodules: recursive - name: Install emscripten tools run: | diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f19582e26e7..73ed5ab1653 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -50,7 +50,7 @@ jobs: with: # Fetch the whole tree so git describe works fetch-depth: 0 - submodules: true + submodules: recursive - name: Use cached dependencies id: cache-dependencies @@ -105,13 +105,23 @@ jobs: "./$Env:BUILD_TYPE/run_tests.exe" - name: Package MSI Installer + shell: pwsh working-directory: build env: BUILD_TYPE: ${{ matrix.build_type }} run: | cpack -C $Env:BUILD_TYPE - mkdir upload - mv *.msi upload/ + if ($LASTEXITCODE -ne 0) + { + $code = $LASTEXITCODE + type ./_CPack_Packages/win64/WIX/wix.log + exit $code + } + else + { + mkdir upload + mv *.msi upload/ + } - name: Upload MSI Installer uses: actions/upload-artifact@v4 diff --git a/.gitmodules b/.gitmodules index a758a02e929..eef1724a1e4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,6 @@ [submodule "external/tinygettext"] path = external/tinygettext url = https://github.com/SuperTux/tinygettext.git -[submodule "external/squirrel"] - path = external/squirrel - url = https://github.com/albertodemichelis/squirrel.git [submodule "external/sexp-cpp"] path = external/sexp-cpp url = https://github.com/SuperTux/sexp-cpp.git @@ -19,9 +16,9 @@ [submodule "external/fmt"] path = external/fmt url = https://github.com/fmtlib/fmt.git -[submodule "tools/miniswig"] - path = tools/miniswig - url = https://github.com/WindstilleTeam/miniswig [submodule "external/glm"] path = external/glm url = https://github.com/g-truc/glm.git +[submodule "external/simplesquirrel"] + path = external/simplesquirrel + url = https://github.com/SuperTux/simplesquirrel diff --git a/CMakeLists.txt b/CMakeLists.txt index 25d5edcf7e5..8133c22ac5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,7 +174,7 @@ include(SuperTux/ProvideOpenAL) include(SuperTux/ProvideOggVorbis) include(SuperTux/ProvidePhysfs) include(SuperTux/ProvideCurl) -include(SuperTux/ProvideSquirrel) +include(SuperTux/ProvideSimpleSquirrel) include(SuperTux/ProvideTinygettext) include(SuperTux/ProvideSDL2_ttf) include(SuperTux/ProvideDiscord) @@ -187,7 +187,6 @@ include(SuperTux/ProvideOpenGL) include(SuperTux/BuildVersion) include(SuperTux/BuildDocumentation) include(SuperTux/BuildMessagePot) -include(SuperTux/BuildMiniswigWrapper) ## Build list of sources for supertux binary file(GLOB SUPERTUX_SOURCES_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} external/obstack/*.c external/findlocale/findlocale.c) @@ -205,10 +204,6 @@ list(SORT SUPERTUX_SOURCES_C) list(SORT SUPERTUX_SOURCES_CXX) list(SORT SUPERTUX_RESOURCES) -if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp) - set(SUPERTUX_SOURCES_CXX ${SUPERTUX_SOURCES_CXX} ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp) -endif() - ## On Windows, add an icon if(WIN32) if(MINGW) @@ -269,8 +264,7 @@ endif() ## Link supertux binary with squirrel and other libraries -target_link_libraries(supertux2_lib PUBLIC LibSquirrel) -target_link_libraries(supertux2_lib PUBLIC LibSqstdlib) +target_link_libraries(supertux2_lib PUBLIC LibSimpleSquirrel) target_link_libraries(supertux2_lib PUBLIC LibTinygettext) target_link_libraries(supertux2_lib PUBLIC LibSexp) target_link_libraries(supertux2_lib PUBLIC LibSavePNG) diff --git a/data/scripts/default.nut b/data/scripts/default.nut index 6625a954384..9cce66f726f 100644 --- a/data/scripts/default.nut +++ b/data/scripts/default.nut @@ -3,23 +3,6 @@ * and variables you define here can be used in all threads */ -//Create Level table -Level <- { - finish=Level_finish, - has_active_sequence=Level_has_active_sequence, - spawn=Level_spawn, - spawn_transition=Level_spawn_transition, - set_start_point=Level_set_start_point, - set_start_pos=Level_set_start_pos, - set_respawn_point=Level_set_respawn_point, - set_respawn_pos=Level_set_respawn_pos, - flip_vertically=Level_flip_vertically, - toggle_pause=Level_toggle_pause, - pause_target_timer=Level_pause_target_timer, - resume_target_timer=Level_resume_target_timer -}; - - function end_level() { play_music("music/misc/leveldone.ogg"); diff --git a/external/simplesquirrel b/external/simplesquirrel new file mode 160000 index 00000000000..e7eab2d6203 --- /dev/null +++ b/external/simplesquirrel @@ -0,0 +1 @@ +Subproject commit e7eab2d62035d933022ac1a15272c00951a7385b diff --git a/external/squirrel b/external/squirrel deleted file mode 160000 index b31e5bdc213..00000000000 --- a/external/squirrel +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b31e5bdc213359f6612e77d36bae26fa85424c56 diff --git a/mk/cmake/SuperTux/BuildCPack.cmake b/mk/cmake/SuperTux/BuildCPack.cmake index d7fc4c4cdf4..5ecc5c9fa77 100644 --- a/mk/cmake/SuperTux/BuildCPack.cmake +++ b/mk/cmake/SuperTux/BuildCPack.cmake @@ -1,7 +1,7 @@ option(DISABLE_CPACK_BUNDLING "Build an .app bundle without CPack" OFF) include(InstallRequiredSystemLibraries) -set(DIRS ${Boost_LIBRARY_DIRS} ${CMAKE_CURRENT_BINARY_DIR}/external/squirrel ${CMAKE_CURRENT_BINARY_DIR}/external/tinygettext) +set(DIRS ${CMAKE_CURRENT_BINARY_DIR}/external/tinygettext ${CMAKE_CURRENT_BINARY_DIR}/external/simplesquirrel) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT DISABLE_CPACK_BUNDLING) set(INFOPLIST_CFBUNDLEEXECUTABLE "SuperTux") diff --git a/mk/cmake/SuperTux/BuildDocumentation.cmake b/mk/cmake/SuperTux/BuildDocumentation.cmake index ab265f1e0b3..6c8607819d8 100644 --- a/mk/cmake/SuperTux/BuildDocumentation.cmake +++ b/mk/cmake/SuperTux/BuildDocumentation.cmake @@ -2,7 +2,7 @@ # Adapted from https://tty1.net/blog/2014/cmake-doxygen_en.html # add a target to generate API documentation with Doxygen option(BUILD_DOCUMENTATION "Build API documentation using Doxygen" ${DOXYGEN_FOUND}) -option(BUILD_SCRIPTING_DOCUMENTATION "Build scripting API documentation using Doxygen" ${DOXYGEN_FOUND}) +option(BUILD_DOCUMENTATION_WITH_SCRIPTING "Build API documentation, including scripting API, using Doxygen" OFF) # CMakeLists, including this file from a different directory, can define PROJECT_SOURCE_DIR as the path to the SuperTux source. if(NOT DEFINED PROJECT_SOURCE_DIR) @@ -10,10 +10,14 @@ if(NOT DEFINED PROJECT_SOURCE_DIR) set(PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) endif() -if(BUILD_DOCUMENTATION) +if(BUILD_DOCUMENTATION OR BUILD_DOCUMENTATION_WITH_SCRIPTING) find_package(Doxygen REQUIRED) - set(doxyfile_in ${PROJECT_SOURCE_DIR}/Doxyfile.in) + if(BUILD_DOCUMENTATION_WITH_SCRIPTING) + set(doxyfile_in ${PROJECT_SOURCE_DIR}/mk/doxygen/Doxyfile_scripting.in) + else() + set(doxyfile_in ${PROJECT_SOURCE_DIR}/mk/doxygen/Doxyfile.in) + endif() set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile) configure_file(${doxyfile_in} ${doxyfile} @ONLY) @@ -25,19 +29,4 @@ if(BUILD_DOCUMENTATION) VERBATIM) endif() -if(BUILD_SCRIPTING_DOCUMENTATION) - find_package(Doxygen REQUIRED) - - set(doxyfile_in ${PROJECT_SOURCE_DIR}/mk/doxygen/Doxyfile_scripting.in) - set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/docs/scripting/Doxyfile) - - configure_file(${doxyfile_in} ${doxyfile} @ONLY) - - add_custom_target(scripting_doc - COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Generating scripting API documentation with Doxygen" - VERBATIM) -endif() - # EOF # diff --git a/mk/cmake/SuperTux/BuildMiniswigWrapper.cmake b/mk/cmake/SuperTux/BuildMiniswigWrapper.cmake deleted file mode 100644 index 38550f1bf76..00000000000 --- a/mk/cmake/SuperTux/BuildMiniswigWrapper.cmake +++ /dev/null @@ -1,27 +0,0 @@ -option(GENERATE_WRAPPER "Build miniswig and generate the wrapper" OFF) -if(GENERATE_WRAPPER) - add_subdirectory(tools/miniswig) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.hpp - COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && ${CMAKE_CXX_COMPILER} - ARGS -x "c++" -E -CC - -DSCRIPTING_API src/scripting/wrapper.interface.hpp - -o ${CMAKE_CURRENT_BINARY_DIR}/miniswig.tmp - -I${CMAKE_CURRENT_SOURCE_DIR}/src - COMMAND tools/miniswig/miniswig - ARGS --input miniswig.tmp - --input-hpp scripting/wrapper.interface.hpp - --output-cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp - --output-hpp ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.hpp - --output-hpp-include scripting/wrapper.hpp - --module supertux - --select-namespace scripting - DEPENDS tools/miniswig/miniswig - IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.interface.hpp - ) - if(USE_CLANG_TIDY) - set_target_properties(miniswig PROPERTIES CXX_CLANG_TIDY "") - endif() -endif() - -# EOF # diff --git a/mk/cmake/SuperTux/ProvideSimpleSquirrel.cmake b/mk/cmake/SuperTux/ProvideSimpleSquirrel.cmake new file mode 100644 index 00000000000..8e9c413735e --- /dev/null +++ b/mk/cmake/SuperTux/ProvideSimpleSquirrel.cmake @@ -0,0 +1,14 @@ +if(EMSCRIPTEN) + set(SQ_DISABLE_INSTALLER ON) +endif() + +add_subdirectory("${CMAKE_SOURCE_DIR}/external/simplesquirrel/") + +if(MSVC) + add_library(LibSimpleSquirrel ALIAS simplesquirrel_static) +else() + add_library(LibSimpleSquirrel ALIAS simplesquirrel) +endif() + +# Set variables +set(SQUIRREL_PREFIX ${CMAKE_BINARY_DIR}/external/simplesquirrel/libs/squirrel) diff --git a/mk/cmake/SuperTux/ProvideSquirrel.cmake b/mk/cmake/SuperTux/ProvideSquirrel.cmake deleted file mode 100644 index 128dca1d0c2..00000000000 --- a/mk/cmake/SuperTux/ProvideSquirrel.cmake +++ /dev/null @@ -1,88 +0,0 @@ -option(USE_SYSTEM_SQUIRREL "Use preinstalled squirrel if available" ON) - -if(USE_SYSTEM_SQUIRREL) - find_package(squirrel 3.2 QUIET) -endif() - -if(TARGET squirrel::squirrel) - message(STATUS "Found preinstalled squirrel") - - add_library(LibSquirrel ALIAS squirrel::squirrel) - add_library(LibSqstdlib ALIAS squirrel::sqstdlib) -else() - if(USE_SYSTEM_SQUIRREL) - message(STATUS "Could NOT find squirrel, using external/squirrel fallback") - endif() - - if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/squirrel/CMakeLists.txt) - message(FATAL_ERROR "squirrel submodule is not checked out or ${CMAKE_CURRENT_SOURCE_DIR}/external/squirrel/CMakeLists.txt is missing") - endif() - - if(CMAKE_CROSSCOMPILING AND NOT EMSCRIPTEN) - set(SQUIRREL_MULTIARCH_DIR "${CMAKE_LIBRARY_ARCHITECTURE}/") - else() - set(SQUIRREL_MULTIARCH_DIR "") - endif() - - # Cannot build Debug version when using gcc on arm64 because an incompatible flag is being passed in - if(CMAKE_COMPILER_IS_GNUCXX AND "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "aarch64" AND "${CMAKE_BUILD_TYPE}" MATCHES "Debug") - set (BUILD_TYPE "RelWithDebInfo") - else() - set (BUILD_TYPE ${CMAKE_BUILD_TYPE}) - endif() - - set(SQUIRREL_PREFIX ${CMAKE_BINARY_DIR}/squirrel/ex) - ExternalProject_Add(squirrel_project - SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/squirrel/" - BUILD_BYPRODUCTS - "${SQUIRREL_PREFIX}/lib/${SQUIRREL_MULTIARCH_DIR}${CMAKE_STATIC_LIBRARY_PREFIX}sqstdlib_static${CMAKE_STATIC_LIBRARY_SUFFIX}" - "${SQUIRREL_PREFIX}/lib/${SQUIRREL_MULTIARCH_DIR}${CMAKE_STATIC_LIBRARY_PREFIX}squirrel_static${CMAKE_STATIC_LIBRARY_SUFFIX}" - CMAKE_ARGS - -DCMAKE_BUILD_TYPE=${BUILD_TYPE} - -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} - -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} - -DCMAKE_INSTALL_PREFIX=${SQUIRREL_PREFIX} - -DCMAKE_INSTALL_LIBDIR=lib - -DINSTALL_INC_DIR=include - -DCMAKE_POSITION_INDEPENDENT_CODE=ON) - - if(WIN32) - add_library(LibSquirrel SHARED IMPORTED) - set_target_properties(LibSquirrel PROPERTIES - IMPORTED_LOCATION "${SQUIRREL_PREFIX}/bin/${CMAKE_SHARED_LIBRARY_PREFIX}squirrel${CMAKE_SHARED_LIBRARY_SUFFIX}" - IMPORTED_IMPLIB "${SQUIRREL_PREFIX}/lib/squirrel${CMAKE_LINK_LIBRARY_SUFFIX}" - INTERFACE_INCLUDE_DIRECTORIES "${SQUIRREL_PREFIX}/include") - - add_library(LibSqstdlib SHARED IMPORTED) - set_target_properties(LibSqstdlib PROPERTIES - IMPORTED_LOCATION "${SQUIRREL_PREFIX}/bin/${CMAKE_SHARED_LIBRARY_PREFIX}sqstdlib${CMAKE_SHARED_LIBRARY_SUFFIX}" - IMPORTED_IMPLIB "${SQUIRREL_PREFIX}/lib/sqstdlib${CMAKE_LINK_LIBRARY_SUFFIX}" - INTERFACE_INCLUDE_DIRECTORIES "${SQUIRREL_PREFIX}/include") - else() - add_library(LibSquirrel STATIC IMPORTED) - set_target_properties(LibSquirrel PROPERTIES - IMPORTED_LOCATION "${SQUIRREL_PREFIX}/lib/${SQUIRREL_MULTIARCH_DIR}${CMAKE_STATIC_LIBRARY_PREFIX}squirrel_static${CMAKE_STATIC_LIBRARY_SUFFIX}" - INTERFACE_INCLUDE_DIRECTORIES "${SQUIRREL_PREFIX}/include") - - add_library(LibSqstdlib STATIC IMPORTED) - set_target_properties(LibSqstdlib PROPERTIES - IMPORTED_LOCATION "${SQUIRREL_PREFIX}/lib/${SQUIRREL_MULTIARCH_DIR}${CMAKE_STATIC_LIBRARY_PREFIX}sqstdlib_static${CMAKE_STATIC_LIBRARY_SUFFIX}" - INTERFACE_INCLUDE_DIRECTORIES "${SQUIRREL_PREFIX}/include") - endif() - - # Pre-create directory so that cmake doesn't complain about its non-existance - file(MAKE_DIRECTORY ${SQUIRREL_PREFIX}/include) - - add_dependencies(LibSquirrel squirrel_project) - add_dependencies(LibSqstdlib squirrel_project) - - if(WIN32) - get_property(SQUIRREL_LIB_PATH TARGET LibSquirrel PROPERTY IMPORTED_LOCATION) - get_property(SQSTDLIB_LIB_PATH TARGET LibSqstdlib PROPERTY IMPORTED_LOCATION) - install(FILES ${SQUIRREL_LIB_PATH} ${SQSTDLIB_LIB_PATH} DESTINATION "${INSTALL_SUBDIR_BIN}") - endif() -endif() - -# EOF # diff --git a/mk/cmake/SuperTux/WarningFlags.cmake b/mk/cmake/SuperTux/WarningFlags.cmake index a36165116b1..2ee2773d49c 100644 --- a/mk/cmake/SuperTux/WarningFlags.cmake +++ b/mk/cmake/SuperTux/WarningFlags.cmake @@ -59,6 +59,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") # flags that we deliberately ignore "-Wno-unused-parameter " + "-Wno-unused-template " "-Wno-c++98-compat " "-Wno-c++98-compat-pedantic " "-Wno-float-equal " diff --git a/Doxyfile.in b/mk/doxygen/Doxyfile.in similarity index 99% rename from Doxyfile.in rename to mk/doxygen/Doxyfile.in index 8ce41f6596f..5e71fef254a 100644 --- a/Doxyfile.in +++ b/mk/doxygen/Doxyfile.in @@ -238,7 +238,8 @@ TAB_SIZE = 8 # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. -ALIASES = +ALIASES += "scripting=\xrefitem scripting \"Scripting\" \"Scripting\"" +ALIASES += "description=\xrefitem description \"Description\" \"Description\"" # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" diff --git a/mk/doxygen/Doxyfile_scripting.in b/mk/doxygen/Doxyfile_scripting.in index 0c5b588a2b1..e29aff5b64e 100644 --- a/mk/doxygen/Doxyfile_scripting.in +++ b/mk/doxygen/Doxyfile_scripting.in @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = docs/scripting/doxygen +OUTPUT_DIRECTORY = docs/doxygen # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -162,7 +162,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@/src/scripting +STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@/src # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -238,9 +238,12 @@ TAB_SIZE = 8 # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. +ALIASES += "scripting=\xrefitem scripting \"Scripting\" \"Scripting\"" ALIASES += "summary=\xrefitem summary \"Summary\" \"Summary\"" ALIASES += "instances=\xrefitem instances \"Instances\" \"Instances\"" ALIASES += "constants=\xrefitem constants \"Constants\" \"Constants\"" +ALIASES += "description=\xrefitem description \"Description\" \"Description\"" +ALIASES += "prefix=\xrefitem prefix \"Prefix\" \"Prefix\"" # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" @@ -793,7 +796,7 @@ WARN_LOGFILE = # Note: If this tag is empty the current directory is searched. INPUT = @doxy_main_page@ \ - @PROJECT_SOURCE_DIR@/src/scripting + @PROJECT_SOURCE_DIR@/src # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -852,8 +855,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = @PROJECT_SOURCE_DIR@/src/scripting/wrapper.* \ - @PROJECT_SOURCE_DIR@/src/scripting/game_object.* +EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the diff --git a/src/badguy/badguy.cpp b/src/badguy/badguy.cpp index 131050fff93..34d555c0c1f 100644 --- a/src/badguy/badguy.cpp +++ b/src/badguy/badguy.cpp @@ -16,6 +16,9 @@ #include "badguy/badguy.hpp" +#include +#include + #include "audio/sound_manager.hpp" #include "badguy/dispenser.hpp" #include "editor/editor.hpp" @@ -50,7 +53,6 @@ BadGuy::BadGuy(const Vector& pos, const std::string& sprite_name, int layer, BadGuy::BadGuy(const Vector& pos, Direction direction, const std::string& sprite_name, int layer, const std::string& light_sprite_name, const std::string& ice_sprite_name) : MovingSprite(pos, sprite_name, layer, COLGROUP_DISABLED), - ExposedObject(this), m_physic(), m_countMe(true), m_is_initialized(false), @@ -94,7 +96,6 @@ BadGuy::BadGuy(const ReaderMapping& reader, const std::string& sprite_name, Direction default_direction, int layer, const std::string& light_sprite_name, const std::string& ice_sprite_name) : MovingSprite(reader, sprite_name, layer, COLGROUP_DISABLED), - ExposedObject(this), m_physic(), m_countMe(true), m_is_initialized(false), @@ -1200,4 +1201,14 @@ BadGuy::add_wind_velocity(const Vector& velocity, const Vector& end_speed) m_physic.set_velocity_y(std::max(m_physic.get_velocity_y() + velocity.y, end_speed.y)); } + +void +BadGuy::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("BadGuy", vm.findClass("MovingSprite")); + + cls.addFunc("kill", &BadGuy::kill_fall); + cls.addFunc("ignite", &BadGuy::ignite); +} + /* EOF */ diff --git a/src/badguy/badguy.hpp b/src/badguy/badguy.hpp index a3a3d9fc078..861998b81ae 100644 --- a/src/badguy/badguy.hpp +++ b/src/badguy/badguy.hpp @@ -20,8 +20,6 @@ #include "editor/object_option.hpp" #include "object/moving_sprite.hpp" #include "object/portable.hpp" -#include "scripting/badguy.hpp" -#include "squirrel/exposed_object.hpp" #include "supertux/physic.hpp" #include "supertux/timer.hpp" @@ -29,11 +27,20 @@ enum class Direction; class Player; class Bullet; -/** Base class for moving sprites that can hurt the Player. */ +/** + * Base class for moving sprites that can hurt the Player. + + * @scripting + * @summary A ""BadGuy"" that was given a name can be controlled by scripts. + * @instances A ""BadGuy"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ class BadGuy : public MovingSprite, - public ExposedObject, public Portable { +public: + static void register_class(ssq::VM& vm); + public: BadGuy(const Vector& pos, const std::string& sprite_name, int layer = LAYER_OBJECTS, const std::string& light_sprite_name = "images/objects/lightmap_light/lightmap_light-medium.sprite", @@ -58,6 +65,7 @@ class BadGuy : public MovingSprite, static std::string class_name() { return "badguy"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "BadGuy"; } static std::string display_name() { return _("Badguy"); } virtual std::string get_display_name() const override { return display_name(); } @@ -78,6 +86,13 @@ class BadGuy : public MovingSprite, /** Set the badguy to kill/falling state, which makes him falling of the screen (his sprite is turned upside-down) */ virtual void kill_fall(); +#ifdef DOXYGEN_SCRIPTING + /** + * @scripting + * @description Sets the badguy to kill/falling state, which makes it fall of the screen (its sprite is turned upside-down). + */ + void kill(); +#endif /** Call this, if you use custom kill_fall() or kill_squashed(GameObject& object) */ virtual void run_dead_script(); @@ -93,7 +108,10 @@ class BadGuy : public MovingSprite, virtual void ungrab(MovingObject& object, Direction dir) override; virtual bool is_portable() const override; - /** Called when hit by a fire bullet, and is_flammable() returns true */ + /** + * @scripting + * @description Kills the badguy by igniting it. + */ virtual void ignite(); /** Called to revert a badguy when is_ignited() returns true */ diff --git a/src/badguy/dispenser.cpp b/src/badguy/dispenser.cpp index d160789f8b2..71efb37dc0a 100644 --- a/src/badguy/dispenser.cpp +++ b/src/badguy/dispenser.cpp @@ -16,6 +16,9 @@ #include "badguy/dispenser.hpp" +#include +#include + #include "audio/sound_manager.hpp" #include "editor/editor.hpp" #include "math/random.hpp" @@ -30,7 +33,6 @@ Dispenser::Dispenser(const ReaderMapping& reader) : BadGuy(reader, "images/creatures/dispenser/dropper.sprite", LAYER_OBJECTS + 5), - ExposedObject(this), m_cycle(), m_objects(), m_next_object(0), @@ -461,4 +463,14 @@ Dispenser::on_flip(float height) FlipLevelTransformer::transform_flip(m_flip); } + +void +Dispenser::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("Dispenser", vm.findClass("BadGuy")); + + cls.addFunc("activate", &Dispenser::activate); + cls.addFunc("deactivate", &Dispenser::deactivate); +} + /* EOF */ diff --git a/src/badguy/dispenser.hpp b/src/badguy/dispenser.hpp index 53adda7f61c..48ea925313e 100644 --- a/src/badguy/dispenser.hpp +++ b/src/badguy/dispenser.hpp @@ -18,14 +18,20 @@ #define HEADER_SUPERTUX_BADGUY_DISPENSER_HPP #include "badguy/badguy.hpp" -#include "scripting/dispenser.hpp" -#include "squirrel/exposed_object.hpp" class GameObject; -class Dispenser final : public BadGuy, - public ExposedObject +/** + * @scripting + * @summary A ""Dispenser"" that was given a name can be controlled by scripts. + * @instances A ""Dispenser"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class Dispenser final : public BadGuy { +public: + static void register_class(ssq::VM& vm); + private: enum DispenserType { DROPPER, CANNON, POINT, GRANITO @@ -36,7 +42,15 @@ class Dispenser final : public BadGuy, virtual void draw(DrawingContext& context) override; virtual void initialize() override; + /** + * @scripting + * @description Makes the dispenser start dispensing badguys. + */ virtual void activate() override; + /** + * @scripting + * @description Stops the dispenser from dispensing badguys. + */ virtual void deactivate() override; virtual void active_update(float dt_sec) override; @@ -49,6 +63,7 @@ class Dispenser final : public BadGuy, static std::string class_name() { return "dispenser"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "Dispenser"; } static std::string display_name() { return _("Dispenser"); } virtual std::string get_display_name() const override { return display_name(); } @@ -60,16 +75,6 @@ class Dispenser final : public BadGuy, virtual void after_editor_set() override; - virtual void expose(HSQUIRRELVM vm, SQInteger table_idx) override - { - ExposedObject::expose(vm, table_idx); - } - - virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx) override - { - ExposedObject::unexpose(vm, table_idx); - } - void notify_dead() { if (m_limit_dispensed_badguys) { m_current_badguys--; diff --git a/src/badguy/granito.cpp b/src/badguy/granito.cpp index 72faf257910..5c84edaca81 100644 --- a/src/badguy/granito.cpp +++ b/src/badguy/granito.cpp @@ -20,6 +20,7 @@ #include "math/random.hpp" #include "object/player.hpp" #include "supertux/sector.hpp" +#include "util/reader_mapping.hpp" Granito::Granito(const ReaderMapping& reader, const std::string& sprite_name, int layer) : WalkingBadguy(reader, sprite_name, "left", "right", layer), @@ -28,7 +29,9 @@ Granito::Granito(const ReaderMapping& reader, const std::string& sprite_name, in m_original_state(STATE_STAND), m_has_waved(false), m_stepped_on(false), - m_airborne(false) + m_airborne(false), + m_detect_script(), + m_carried_script() { parse_type(reader); @@ -39,6 +42,9 @@ Granito::Granito(const ReaderMapping& reader, const std::string& sprite_name, in set_colgroup_active(COLGROUP_MOVING_STATIC); m_col.set_unisolid(true); + + reader.get("detect-script", m_detect_script); + reader.get("carried-script", m_carried_script); } void @@ -122,8 +128,13 @@ Granito::active_update(float dt_sec) return; } - // Only called, when timer has finished - if (!m_walk_interval.started() && !m_walk_interval.check()) + if (m_type == SCRIPTABLE && m_walk_interval.check()) + { + stand(); + } + + // Only called when timer has finished + else if (m_type != SCRIPTABLE && !m_walk_interval.started() && !m_walk_interval.check()) { m_walk_interval.start(gameRandom.randf(1.f, 4.f)); @@ -133,8 +144,7 @@ Granito::active_update(float dt_sec) if (gameRandom.rand(100) > 50) { // Turn around - m_dir = m_dir == Direction::LEFT ? Direction::RIGHT : Direction::LEFT; - set_action("stand", m_dir); + turn(m_dir == Direction::LEFT ? Direction::RIGHT : Direction::LEFT); } break; @@ -144,28 +154,19 @@ Granito::active_update(float dt_sec) if (gameRandom.rand(100) > 50 && walk_speed == 0) { // Turn around - m_dir = m_dir == Direction::LEFT ? Direction::RIGHT : Direction::LEFT; - set_action("stand", m_dir); + turn(m_dir == Direction::LEFT ? Direction::RIGHT : Direction::LEFT); } else { // Walk/stop if (walk_speed > 0) { - walk_speed = 0; - m_state = STATE_STAND; - m_original_state = STATE_STAND; - m_physic.set_velocity_x(0); - set_action("stand", m_dir); + stand(); } else { - m_dir = (gameRandom.rand(2) == 0 ? Direction::LEFT : Direction::RIGHT); - walk_speed = 80; - m_state = STATE_WALK; - m_original_state = STATE_WALK; - m_physic.set_velocity_x(80 * (m_dir == Direction::LEFT ? -1 : 1)); - set_action(m_dir); + turn(m_dir == Direction::LEFT ? Direction::RIGHT : Direction::LEFT); + walk(); } } @@ -185,7 +186,7 @@ Granito::active_update(float dt_sec) HitResponse Granito::collision_player(Player& player, const CollisionHit& hit) { - if (m_state == STATE_SIT || m_type == WALK) return FORCE_MOVE; + if (m_state == STATE_SIT || m_type == WALK || m_type == SCRIPTABLE) return FORCE_MOVE; if (hit.top) { @@ -225,17 +226,18 @@ Granito::collision(GameObject& other, const CollisionHit& hit) return WalkingBadguy::collision(other, hit); } - if (granito->m_carrying != nullptr) + if (granito->get_carrying() != nullptr) { // Sorry, im already carrying this guy. return WalkingBadguy::collision(other, hit); } // Sure dude. - granito->m_carrying = this; + granito->carry(this); // Yay! m_state = STATE_SIT; + Sector::get().run_script(m_carried_script, "carried-script"); } return WalkingBadguy::collision(other, hit); @@ -247,14 +249,26 @@ Granito::kill_fall() return; } +ObjectSettings +Granito::get_settings() +{ + auto settings = WalkingBadguy::get_settings(); + + settings.remove("dead-script"); + + settings.add_script(_("Detect script"), &m_detect_script, "detect-script"); + settings.add_script(_("Carried script"), &m_carried_script, "carried-script"); + + return settings; +} + void Granito::activate() { WalkingBadguy::activate(); - m_has_waved = false; + reset_detection(); } - GameObjectTypes Granito::get_types() const { @@ -263,6 +277,7 @@ Granito::get_types() const { "default", _("Default") }, { "standing", _("Standing") }, { "walking", _("Walking") }, + { "scriptable", _("Scriptable") }, // Small granito only { "sitting", _("Sitting") } @@ -282,12 +297,32 @@ Granito::after_editor_set() case SIT: set_action("sit", m_dir); break; + case SCRIPTABLE: case STAND: set_action("stand", m_dir); break; } } +GranitoBig* +Granito::get_carrier() const +{ + for (auto& granito : Sector::get().get_objects_by_type()) + { + if (granito.get_carrying() == this) + return &granito; + } + + return nullptr; +} + +std::string +Granito::get_carrier_name() const +{ + GranitoBig* carrier = get_carrier(); + return carrier != nullptr ? carrier->get_name() : ""; +} + void Granito::initialize() { @@ -314,6 +349,7 @@ Granito::initialize() set_action("sit", m_dir); break; + case SCRIPTABLE: case STAND: set_action("stand", m_dir); break; @@ -335,26 +371,32 @@ Granito::try_wave() if (!on_ground()) return false; Player* player = get_nearest_player(); - if (!player) return false; + if (!player) + return false; - RaycastResult result = Sector::get().get_first_line_intersection(get_bbox().get_middle(), - player->get_bbox().get_middle(), - false, - get_collision_object()); + Vector mid = get_bbox().get_middle(); + Vector plrmid = player->get_bbox().get_middle(); + + float xdist = mid.x - plrmid.x; + if (std::abs(xdist) > 32.f*4.f) + return false; + + RaycastResult result = Sector::get().get_first_line_intersection(mid, plrmid, false, get_collision_object()); CollisionObject** resultobj = std::get_if(&result.hit); if (resultobj && *resultobj == player->get_collision_object()) { - float xdist = get_bbox().get_middle().x - result.box.get_middle().x; - if (std::abs(xdist) < 32.f*4.f) - { - // Only wave if facing player. - if (xdist == std::abs(xdist) * (m_dir == Direction::LEFT ? -1 : 1)) - return false; + // Only wave if facing player. + if (xdist == std::abs(xdist) * (m_dir == Direction::LEFT ? -1 : 1)) + return false; + Sector::get().run_script(m_detect_script, "detect-script"); + if (m_type == SCRIPTABLE) + m_has_waved = true; + else wave(); - return true; - } + + return true; } return false; @@ -363,6 +405,9 @@ Granito::try_wave() void Granito::wave() { + if (m_type == SCRIPTABLE) + reset_detection(); + walk_speed = 0; m_physic.set_velocity_x(0); @@ -371,6 +416,93 @@ Granito::wave() set_action("wave", m_dir, 1); } +void +Granito::sit() +{ + walk_speed = 0; + m_state = STATE_SIT; + m_original_state = STATE_SIT; + m_physic.set_velocity_x(0); + + if (!m_airborne) + { + float oldheight = get_bbox().get_size().height; + set_action("sit", m_dir); + + float height = get_bbox().get_size().height; + set_pos(Vector(get_bbox().get_left(), get_bbox().get_top() + oldheight - height)); + } + else + { + set_action("sit", m_dir); + } +} + +void +Granito::turn(const Direction& direction) +{ + m_dir = direction; + switch (m_state) + { + case STATE_WALK: + walk(); + break; + + case STATE_STAND: + set_action("stand", m_dir); + break; + + case STATE_SIT: + set_action("sit", m_dir); + break; + + case STATE_LOOKUP: + set_action("lookup", m_dir); + break; + + case STATE_JUMPING: + set_action("jump", m_dir); + break; + + default: + break; + } +} + +void +Granito::turn(const std::string& direction) +{ + turn(string_to_dir(direction)); +} + +void +Granito::walk() +{ + walk_speed = 80; + m_state = STATE_WALK; + m_original_state = STATE_WALK; + m_physic.set_velocity_x(80 * (m_dir == Direction::LEFT ? -1 : 1)); + set_action(m_dir); +} + +void +Granito::walk_for(float seconds) +{ + m_walk_interval.start(seconds); + if (m_original_state != STATE_WALK) + walk(); +} + +void +Granito::stand() +{ + walk_speed = 0; + m_state = STATE_STAND; + m_original_state = STATE_STAND; + m_physic.set_velocity_x(0); + set_action("stand", m_dir); +} + bool Granito::try_jump() { @@ -418,25 +550,60 @@ Granito::jump() m_physic.set_velocity_y(-420.f); } +void Granito::eject() +{ + GranitoBig* granito = get_carrier(); + + if (!granito) + return; + + granito->eject(); +} + void Granito::restore_original_state() { - if (m_state == m_original_state) return; + if (m_state == m_original_state) + return; m_state = m_original_state; if (m_state == STATE_WALK) { - set_action(m_dir); - walk_speed = 80; - m_physic.set_velocity_x(80 * (m_dir == Direction::LEFT ? -1 : 1)); + walk(); } else { - set_action("stand", m_dir); - walk_speed = 0; - m_physic.set_velocity_x(0); + stand(); } } + +void +Granito::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("Granito", vm.findClass("BadGuy")); + + cls.addFunc("wave", &Granito::wave); + cls.addFunc("sit", &Granito::sit); + cls.addFunc("turn", static_cast(&Granito::turn)); + cls.addFunc("set_walking", &Granito::set_walking); + cls.addFunc("walk", &Granito::walk); + cls.addFunc("walk_for", &Granito::walk_for); + cls.addFunc("stand", &Granito::stand); + cls.addFunc("jump", &Granito::jump); + cls.addFunc("get_state", &Granito::get_state); + cls.addFunc("get_carrier_name", &Granito::get_carrier_name); + cls.addFunc("reset_detection", &Granito::reset_detection); + cls.addFunc("eject", &Granito::eject); + + // Enumerators + vm.setConst("GRANITO_STATE_SIT", Granito::STATE_SIT); + vm.setConst("GRANITO_STATE_STAND", Granito::STATE_STAND); + vm.setConst("GRANITO_STATE_WALK", Granito::STATE_WALK); + vm.setConst("GRANITO_STATE_WAVE", Granito::STATE_WAVE); + vm.setConst("GRANITO_STATE_LOOKUP", Granito::STATE_LOOKUP); + vm.setConst("GRANITO_STATE_JUMPING", Granito::STATE_JUMPING); +} + /* EOF */ diff --git a/src/badguy/granito.hpp b/src/badguy/granito.hpp index c005a0cece0..ae4b360249b 100644 --- a/src/badguy/granito.hpp +++ b/src/badguy/granito.hpp @@ -21,9 +21,21 @@ class GranitoBig; -/** Interactable friendly NPC */ +/** + * Interactable friendly NPC + * + * @scripting + * @summary A ""Granito"" that was given a name can be controlled by scripts. + * Note: Using these functions in a non-"Scriptable" granito can lead to undefined behavior! + * You can do it, but make sure you know what you're doing. + * @instances A ""Granito"" is instantiated by placing a definition inside a level. + * It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ class Granito : public WalkingBadguy { +public: + static void register_class(ssq::VM& vm); + public: Granito(const ReaderMapping& reader, const std::string& sprite_name = "images/creatures/granito/granito.sprite", @@ -36,6 +48,7 @@ class Granito : public WalkingBadguy static std::string class_name() { return "granito"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "Granito"; } static std::string display_name() { return _("Granito"); } virtual std::string get_display_name() const override { return display_name(); } @@ -45,9 +58,96 @@ class Granito : public WalkingBadguy virtual void kill_fall() override; + virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; virtual void after_editor_set() override; + virtual GranitoBig* get_carrier() const; + void turn(const Direction& direction); + + /** + * @scripting + * @description Makes the Granito wave. + */ + virtual void wave(); + + /** + * @scripting + * @description Makes the Granito sit. + */ + virtual void sit(); + + /** + * @scripting + * @description Makes the Granito sit. + * @param string $direction Direction to turn to. Can be "left or "right". + */ + void turn(const std::string& direction); + + /** + * @scripting + * @description Sets the walking state for the Granito. + * @param bool $walking + */ + void set_walking(bool walking) + { + if (walking) + walk(); + else + stand(); + } + + /** + * @scripting + * @description Makes the Granito walk. + */ + void walk(); + + /** + * @scripting + * @description Makes the Granito walk for a specified amount of seconds. + * @param float $seconds + */ + void walk_for(float seconds); + + /** + * @scripting + * @description Makes the Granito stand, or stop if walking. + */ + void stand(); + + /** + * @scripting + * @description Makes the Granito jump. + */ + virtual void jump(); + + /** + * @scripting + * @description Eject itself from the Big Granito. + */ + virtual void eject(); + + /** + * @scripting + * @description Gets the current Granito state. Value is any of the ""GRANITO_STATE"" enumerators. + */ + int get_state() const { return static_cast(m_state); } + + /** + * @scripting + * @description Gets the name of the Big Granito that is carrying the Granito. + */ + std::string get_carrier_name() const; + + /** + * @scripting + * @description Resets the player detection used for waving, + * allowing the Detect Script to be ran again. + * Only works on Standing and Default granito. + */ + void reset_detection() { m_has_waved = false; } + protected: virtual void initialize() override; virtual void update_hitbox() override; @@ -55,27 +155,31 @@ class Granito : public WalkingBadguy void activate() override; protected: - enum Type { DEFAULT, STAND, WALK, SIT }; + enum Type { DEFAULT, STAND, WALK, SCRIPTABLE, SIT }; + + /** + * NOTE: Make sure to expose any new enumerators to Squirrel. + * + * @scripting + * @prefix GRANITO_ + */ enum State { - STATE_SIT, - STATE_STAND, - STATE_WALK, - STATE_WAVE, - STATE_LOOKUP, - STATE_JUMPING + STATE_SIT = 0, /*!< @description The Granito is sitting. */ + STATE_STAND = 1, /*!< @description The Granito is standing. */ + STATE_WALK = 2, /*!< @description The Granito is walking. */ + STATE_WAVE = 3, /*!< @description The Granito is waving. */ + STATE_LOOKUP = 4, /*!< @description The Granito is looking up. */ + STATE_JUMPING = 5 /*!< @description The Granito is jumping. */ }; protected: virtual bool try_wave(); - void wave(); - virtual bool try_jump(); - void jump(); void restore_original_state(); -private: +protected: Timer m_walk_interval; State m_state; State m_original_state; @@ -84,6 +188,9 @@ class Granito : public WalkingBadguy bool m_stepped_on; /** True if tux was on top of granito last frame. */ bool m_airborne; /** Unfortunately, on_ground() sucks. */ + std::string m_detect_script; + std::string m_carried_script; /** This is ran when the Granito is carried by a Big Granito */ + private: Granito(const Granito&) = delete; Granito& operator=(const Granito&) = delete; diff --git a/src/badguy/granito_big.cpp b/src/badguy/granito_big.cpp index 4824cc816dc..37104ebb479 100644 --- a/src/badguy/granito_big.cpp +++ b/src/badguy/granito_big.cpp @@ -16,12 +16,17 @@ #include "badguy/granito_big.hpp" +#include "util/reader_mapping.hpp" +#include "supertux/sector.hpp" + GranitoBig::GranitoBig(const ReaderMapping& reader) : Granito(reader, "images/creatures/granito/big/granito_big.sprite", LAYER_OBJECTS - 2), m_carrying(nullptr) { parse_type(reader); + reader.get("carrying-script", m_carried_script); + max_drop_height = 16; } @@ -37,12 +42,28 @@ GranitoBig::active_update(float dt_sec) { Granito::active_update(dt_sec); - if (!m_carrying) return; + if (!m_carrying) + return; Vector pos(get_bbox().get_middle().x - m_carrying->get_bbox().get_width() / 2, get_bbox().get_top() - m_carrying->get_bbox().get_height()); m_carrying->set_pos(pos); - m_carrying->set_action("sit", m_dir); + m_carrying->turn(m_dir); +} + +ObjectSettings +GranitoBig::get_settings() +{ + auto settings = Granito::get_settings(); + + settings.remove("detect-script"); + settings.remove("carried-script"); + + // No need to make another member for the carrying script. + // Just repurpose the carried script. + settings.add_script(_("Carrying Script"), &m_carried_script, "carrying-script"); + + return settings; } GameObjectTypes @@ -51,10 +72,35 @@ GranitoBig::get_types() const return { { "default", _("Default") }, { "standing", _("Standing") }, - { "walking", _("Walking") } + { "walking", _("Walking") }, + { "scriptable", _("Scriptable") }, }; } +void +GranitoBig::carry(Granito* granito) +{ + m_carrying = granito; + Sector::get().run_script(m_carried_script, "carrying-script"); +} + +void +GranitoBig::eject() +{ + if (!m_carrying) + return; + + m_carrying->walk_for(1.5f); + m_carrying->jump(); + m_carrying = nullptr; +} + +std::string +GranitoBig::get_carrying_name() const +{ + return m_carrying ? m_carrying->get_name() : ""; +} + bool GranitoBig::try_wave() { @@ -67,4 +113,12 @@ GranitoBig::try_jump() return false; } +void +GranitoBig::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("GranitoBig", vm.findClass("Granito")); + + cls.addFunc("get_carrying_name", &GranitoBig::get_carrying_name); +} + /* EOF */ diff --git a/src/badguy/granito_big.hpp b/src/badguy/granito_big.hpp index cff94547514..44e8749b86a 100644 --- a/src/badguy/granito_big.hpp +++ b/src/badguy/granito_big.hpp @@ -19,8 +19,18 @@ #include "badguy/granito.hpp" +/** + * @scripting + * @summary A ""GranitoBig"" that was given a name can be controlled by scripts. + * It has some features from its base class, ""Granito"", disabled. + * @instances A ""GranitoBig"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ class GranitoBig final : public Granito { +public: + static void register_class(ssq::VM& vm); + public: GranitoBig(const ReaderMapping& reader); @@ -30,11 +40,36 @@ class GranitoBig final : public Granito static std::string class_name() { return "granito_big"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "GranitoBig"; } static std::string display_name() { return _("Big Granito"); } virtual std::string get_display_name() const override { return display_name(); } + virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; + void carry(Granito* granito); + Granito* get_carrying() const { return m_carrying; } + + /** + * @scripting + * @description This function tells the Granito being carried to + * unglue itself from the Big Granito, by jumping and walking off. + */ + virtual void eject() override; + + /** + * @scripting + * @description Gets the name of the Granito being carried by the Big Granito. + */ + std::string get_carrying_name() const; + + // The following functions are unimplemented for Big Granito. + virtual void wave() override {} + virtual void jump() override {} + virtual void sit() override {} + virtual GranitoBig* get_carrier() const override { return nullptr; } + +public: Granito* m_carrying; protected: diff --git a/src/badguy/willowisp.cpp b/src/badguy/willowisp.cpp index 2f64bcde0b3..ff0933ac1e5 100644 --- a/src/badguy/willowisp.cpp +++ b/src/badguy/willowisp.cpp @@ -37,7 +37,6 @@ static const std::string SOUNDFILE = "sounds/willowisp.wav"; WillOWisp::WillOWisp(const ReaderMapping& reader) : BadGuy(reader, "images/creatures/willowisp/willowisp.sprite", LAYER_FLOATINGOBJECTS, "images/objects/lightmap_light/lightmap_light-small.sprite"), - ExposedObject(this), PathObject(), m_mystate(STATE_IDLE), m_target_sector(), @@ -263,44 +262,37 @@ WillOWisp::collision_player(Player& player, const CollisionHit& ) { void WillOWisp::goto_node(int node_idx) { - get_walker()->goto_node(node_idx); - if (m_mystate != STATE_PATHMOVING && m_mystate != STATE_PATHMOVING_TRACK) { - m_mystate = STATE_PATHMOVING; - } -} - -void -WillOWisp::start_moving() -{ - get_walker()->start_moving(); -} + PathObject::goto_node(node_idx); -void -WillOWisp::stop_moving() -{ - get_walker()->stop_moving(); + if (m_mystate != STATE_PATHMOVING && m_mystate != STATE_PATHMOVING_TRACK) + m_mystate = STATE_PATHMOVING; } void WillOWisp::set_state(const std::string& new_state) { - if (new_state == "stopped") { + if (new_state == "stopped") m_mystate = STATE_STOPPED; - } else if (new_state == "idle") { + else if (new_state == "idle") m_mystate = STATE_IDLE; - } else if (new_state == "move_path") { + else if (new_state == "move_path") + { m_mystate = STATE_PATHMOVING; - get_walker()->start_moving(); - } else if (new_state == "move_path_track") { + if (get_walker()) + get_walker()->start_moving(); + } + else if (new_state == "move_path_track") + { m_mystate = STATE_PATHMOVING_TRACK; - get_walker()->start_moving(); - } else if (new_state == "normal") { + if (get_walker()) + get_walker()->start_moving(); + } + else if (new_state == "normal") m_mystate = STATE_IDLE; - } else if (new_state == "vanish") { + else if (new_state == "vanish") vanish(); - } else { - log_warning << "Can't set unknown willowisp state '" << new_state << std::endl; - } + else + log_warning << "Cannot set unknown Will-O-Wisp state: '" << new_state << "'." << std::endl; } ObjectSettings @@ -365,4 +357,16 @@ WillOWisp::on_flip(float height) PathObject::on_flip(); } + +void +WillOWisp::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("WillOWisp", vm.findClass("BadGuy")); + + PathObject::register_members(cls); + + cls.addFunc("goto_node", &WillOWisp::goto_node); + cls.addFunc("set_state", &WillOWisp::set_state); +} + /* EOF */ diff --git a/src/badguy/willowisp.hpp b/src/badguy/willowisp.hpp index 25d625b8ebd..cac9ae4e368 100644 --- a/src/badguy/willowisp.hpp +++ b/src/badguy/willowisp.hpp @@ -19,16 +19,21 @@ #include "badguy/badguy.hpp" #include "object/path_object.hpp" -#include "squirrel/exposed_object.hpp" -#include "scripting/willowisp.hpp" class SoundSource; -class WillOWisp final : - public BadGuy, - public ExposedObject, - public PathObject +/** + * @scripting + * @summary A ""WillOWisp"" that was given a name can be controlled by scripts. + * @instances A ""WillOWisp"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class WillOWisp final : public BadGuy, + public PathObject { +public: + static void register_class(ssq::VM& vm); + public: WillOWisp(const ReaderMapping& reader); @@ -44,16 +49,23 @@ class WillOWisp final : virtual bool is_hurtable() const override { return false; } virtual void kill_fall() override { vanish(); } - virtual void goto_node(int node_idx); - virtual void set_state(const std::string& state); - virtual void start_moving(); - virtual void stop_moving(); + void goto_node(int node_idx); + + /** + * @scripting + * @description Sets the state of the WillOWisp. + * @param string $state One of the following: "stopped", "move_path" (moves along a path), + "move_path_track" (moves along a path but catches Tux when he is near), "normal" (starts tracking Tux when he is near enough), + "vanish". + */ + void set_state(const std::string& state); virtual void stop_looping_sounds() override; virtual void play_looping_sounds() override; static std::string class_name() { return "willowisp"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "WillOWisp"; } static std::string display_name() { return _("Will o' Wisp"); } virtual std::string get_display_name() const override { return display_name(); } @@ -62,16 +74,6 @@ class WillOWisp final : virtual void on_flip(float height) override; - virtual void expose(HSQUIRRELVM vm, SQInteger table_idx) override - { - ExposedObject::expose(vm, table_idx); - } - - virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx) override - { - ExposedObject::unexpose(vm, table_idx); - } - /** make WillOWisp vanish */ void vanish(); diff --git a/src/interface/control_enum.hpp b/src/interface/control_enum.hpp index 9faab88e018..778a9389094 100644 --- a/src/interface/control_enum.hpp +++ b/src/interface/control_enum.hpp @@ -21,6 +21,8 @@ #include "interface/control.hpp" +#include "util/log.hpp" + template class ControlEnum : public InterfaceControl { diff --git a/src/math/anchor_point.hpp b/src/math/anchor_point.hpp index c2f87301bc2..8709dfbda42 100644 --- a/src/math/anchor_point.hpp +++ b/src/math/anchor_point.hpp @@ -24,19 +24,34 @@ class Rectf; +#ifdef DOXYGEN_SCRIPTING +/** + * @scripting + * @summary This module contains global anchor constants. + */ +namespace AnchorPoints { +#endif + +/** + * @scripting + */ enum AnchorPoint { - ANCHOR_TOP_LEFT, - ANCHOR_TOP, - ANCHOR_TOP_RIGHT, - ANCHOR_LEFT, - ANCHOR_MIDDLE, - ANCHOR_RIGHT, - ANCHOR_BOTTOM_LEFT, - ANCHOR_BOTTOM, - ANCHOR_BOTTOM_RIGHT, + ANCHOR_TOP_LEFT = 0, /*!< @description Top-left anchor point. */ + ANCHOR_TOP = 1, /*!< @description Top anchor point. */ + ANCHOR_TOP_RIGHT = 2, /*!< @description Top-right anchor point. */ + ANCHOR_LEFT = 3, /*!< @description Left anchor point. */ + ANCHOR_MIDDLE = 4, /*!< @description Middle anchor point. */ + ANCHOR_RIGHT = 5, /*!< @description Right anchor point. */ + ANCHOR_BOTTOM_LEFT = 6, /*!< @description Bottom-left anchor point. */ + ANCHOR_BOTTOM = 7, /*!< @description Bottom anchor point. */ + ANCHOR_BOTTOM_RIGHT = 8, /*!< @description Bottom-right anchor point. */ ANCHOR_LAST = ANCHOR_BOTTOM_RIGHT }; +#ifdef DOXYGEN_SCRIPTING +} // namespace AnchorPoints +#endif + const std::vector g_anchor_keys = { "topleft", "top", "topright", "left", "middle", "right", "bottomleft", "bottom", "bottomright" diff --git a/src/math/rectf.hpp b/src/math/rectf.hpp index 7952ea51808..1e374e28480 100644 --- a/src/math/rectf.hpp +++ b/src/math/rectf.hpp @@ -81,7 +81,6 @@ class Rectf final m_size == other.m_size); } - // This is a temporary hack to pass x/y to ReaderMapping float& get_left() { return m_p1.x; } float& get_top() { return m_p1.y; } @@ -90,6 +89,9 @@ class Rectf final float get_top() const { return m_p1.y; } float get_bottom() const { return m_p1.y + m_size.height; } + float& get_width() { return m_size.width; } + float& get_height() { return m_size.height; } + float get_width() const { return m_size.width; } float get_height() const { return m_size.height; } diff --git a/src/object/ambient_sound.cpp b/src/object/ambient_sound.cpp index cf1736aa5c4..aa8c3910735 100644 --- a/src/object/ambient_sound.cpp +++ b/src/object/ambient_sound.cpp @@ -19,6 +19,9 @@ #include +#include +#include + #include "audio/sound_manager.hpp" #include "audio/sound_source.hpp" #include "editor/editor.hpp" @@ -29,7 +32,6 @@ AmbientSound::AmbientSound(const ReaderMapping& mapping) : MovingObject(mapping), - ExposedObject(this), m_sample(), m_sound_source(), m_radius(), @@ -56,7 +58,6 @@ AmbientSound::AmbientSound(const ReaderMapping& mapping) : } AmbientSound::AmbientSound(const Vector& pos, float radius, float vol, const std::string& file) : - ExposedObject(this), m_sample(file), m_sound_source(), m_radius(radius), @@ -91,32 +92,6 @@ AmbientSound::get_settings() return result; } -#ifndef SCRIPTING_API -void -AmbientSound::set_pos(const Vector& pos) -{ - MovingObject::set_pos(pos); -} -#endif - -void -AmbientSound::set_pos(float x, float y) -{ - m_col.m_bbox.set_pos(Vector(x, y)); -} - -float -AmbientSound::get_pos_x() const -{ - return m_col.m_bbox.get_left(); -} - -float -AmbientSound::get_pos_y() const -{ - return m_col.m_bbox.get_top(); -} - HitResponse AmbientSound::collision(GameObject& other, const CollisionHit& hit_) { @@ -213,4 +188,14 @@ AmbientSound::prepare_sound_source() } } + +void +AmbientSound::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("AmbientSound"); + + cls.addFunc("get_pos_x", &MovingObject::get_x); + cls.addFunc("get_pos_y", &MovingObject::get_y); +} + /* EOF */ diff --git a/src/object/ambient_sound.hpp b/src/object/ambient_sound.hpp index 2bf0994f10d..43a868cf6ba 100644 --- a/src/object/ambient_sound.hpp +++ b/src/object/ambient_sound.hpp @@ -20,17 +20,23 @@ #include "math/vector.hpp" #include "supertux/moving_object.hpp" -#include "scripting/ambient_sound.hpp" -#include "squirrel/exposed_object.hpp" #include "video/layer.hpp" class GameObject; class ReaderMapping; class SoundSource; -class AmbientSound final : public MovingObject, - public ExposedObject +/** + * @scripting + * @summary An ""AmbientSound"" that was given a name can be controlled by scripts. + * @instances An ""AmbientSound"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class AmbientSound final : public MovingObject { +public: + static void register_class(ssq::VM& vm); + public: AmbientSound(const ReaderMapping& mapping); AmbientSound(const Vector& pos, float radius, float vol, const std::string& file); @@ -40,20 +46,11 @@ class AmbientSound final : public MovingObject, static std::string class_name() { return "ambient-sound"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "AmbientSound"; } static std::string display_name() { return _("Ambient Sound"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } - /** @name Scriptable Methods - @{ */ -#ifndef SCRIPTING_API - virtual void set_pos(const Vector& pos) override; -#endif - void set_pos(float x, float y); - float get_pos_x() const; - float get_pos_y() const; - /** @} */ - virtual void draw(DrawingContext& context) override; virtual ObjectSettings get_settings() override; @@ -63,6 +60,21 @@ class AmbientSound final : public MovingObject, virtual void stop_looping_sounds() override; virtual void play_looping_sounds() override; +#ifdef DOXYGEN_SCRIPTING + /** + * @scripting + * @deprecated Use ""get_x()"" instead! + * @description Returns the ambient sound's X coordinate. + */ + float get_pos_x() const; + /** + * @scripting + * @deprecated Use ""get_y()"" instead! + * @description Returns the ambient sound's Y coordinate. + */ + float get_pos_y() const; +#endif + protected: virtual void update(float dt_sec) override; diff --git a/src/object/background.cpp b/src/object/background.cpp index 66ba9657ac1..1808274671d 100644 --- a/src/object/background.cpp +++ b/src/object/background.cpp @@ -16,9 +16,12 @@ #include "object/background.hpp" -#include #include +#include +#include +#include + #include "editor/editor.hpp" #include "supertux/d_scope.hpp" #include "supertux/flip_level_transformer.hpp" @@ -31,7 +34,6 @@ #include "video/surface.hpp" Background::Background() : - ExposedObject(this), m_alignment(NO_ALIGNMENT), m_fill(false), m_layer(LAYER_BACKGROUND0), @@ -57,7 +59,6 @@ Background::Background() : Background::Background(const ReaderMapping& reader) : GameObject(reader), - ExposedObject(this), m_alignment(NO_ALIGNMENT), m_fill(false), m_layer(LAYER_BACKGROUND0), @@ -235,6 +236,12 @@ Background::update(float dt_sec) } } +void +Background::set_color(float red, float green, float blue, float alpha) +{ + m_color = Color(red, green, blue, alpha); +} + void Background::fade_color(Color color, float time) { @@ -246,6 +253,12 @@ Background::fade_color(Color color, float time) m_color = m_src_color; } +void +Background::fade_color(float red, float green, float blue, float alpha, float time) +{ + fade_color(Color(red, green, blue, alpha), time); +} + void Background::set_image(const std::string& name) { @@ -275,6 +288,30 @@ Background::set_speed(float speed) m_parallax_speed.y = speed; } +float +Background::get_color_red() const +{ + return m_color.red; +} + +float +Background::get_color_green() const +{ + return m_color.green; +} + +float +Background::get_color_blue() const +{ + return m_color.blue; +} + +float +Background::get_color_alpha() const +{ + return m_color.alpha; +} + void Background::draw_image(DrawingContext& context, const Vector& pos_) { @@ -500,4 +537,21 @@ Background::on_flip(float height) FlipLevelTransformer::transform_flip(m_flip); } + +void +Background::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("Background", vm.findClass("GameObject")); + + cls.addFunc("set_image", &Background::set_image); + cls.addFunc("set_images", &Background::set_images); + cls.addFunc("set_speed", &Background::set_speed); + cls.addFunc("get_color_red", &Background::get_color_red); + cls.addFunc("get_color_green", &Background::get_color_green); + cls.addFunc("get_color_blue", &Background::get_color_blue); + cls.addFunc("get_color_alpha", &Background::get_color_alpha); + cls.addFunc("set_color", &Background::set_color); + cls.addFunc("fade_color", &Background::fade_color); +} + /* EOF */ diff --git a/src/object/background.hpp b/src/object/background.hpp index 9c438bf3a43..d5f15247901 100644 --- a/src/object/background.hpp +++ b/src/object/background.hpp @@ -18,8 +18,6 @@ #define HEADER_SUPERTUX_OBJECT_BACKGROUND_HPP #include "math/vector.hpp" -#include "scripting/background.hpp" -#include "squirrel/exposed_object.hpp" #include "supertux/game_object.hpp" #include "supertux/timer.hpp" #include "video/blend.hpp" @@ -29,9 +27,16 @@ class ReaderMapping; -class Background final : public GameObject, - public ExposedObject +/** + * @scripting + * @summary A ""Background"" that was given a name can be manipulated by scripts. + * @instances A ""Background"" can be accessed by its name from a script or via ""sector.name"" from the console. + */ +class Background final : public GameObject { +public: + static void register_class(ssq::VM& vm); + public: Background(); Background(const ReaderMapping& reader); @@ -42,6 +47,7 @@ class Background final : public GameObject, static std::string class_name() { return "background"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "Background"; } static std::string display_name() { return _("Background"); } virtual std::string get_display_name() const override { return display_name(); } @@ -54,10 +60,6 @@ class Background final : public GameObject, virtual void on_flip(float height) override; - void set_image(const std::string& name); - void set_images(const std::string& name_top, const std::string& name_middle, const std::string& name_bottom); - void set_speed(float bgd_speed); - void draw_image(DrawingContext& context, const Vector& pos); const std::string& get_image() const { return m_imagefile; } @@ -65,9 +67,70 @@ class Background final : public GameObject, int get_layer() const { return m_layer; } Color get_color() const { return m_color; } - void set_color(Color color) { m_color = color; } void fade_color(Color color, float time); + /** + * @scripting + * @description Sets the background's image. + * @param string $image + */ + void set_image(const std::string& image); + /** + * @scripting + * @description Sets the top, middle and bottom background images. + * @param string $top_image + * @param string $middle_image + * @param string $bottom_image + */ + void set_images(const std::string& top_image, const std::string& middle_image, + const std::string& bottom_image); + /** + * @scripting + * @description Sets the background speed. + * @param float $speed + */ + void set_speed(float speed); + + /** + * @scripting + * @description Returns the red color value. + */ + float get_color_red() const; + /** + * @scripting + * @description Returns the green color value. + */ + float get_color_green() const; + /** + * @scripting + * @description Returns the blue color value. + */ + float get_color_blue() const; + /** + * @scripting + * @description Returns the alpha color value. + */ + float get_color_alpha() const; + /** + * @scripting + * @description Sets the background color. + * @param float $red + * @param float $green + * @param float $blue + * @param float $alpha + */ + void set_color(float red, float green, float blue, float alpha); + /** + * @scripting + * @description Fades to specified background color in ""time"" seconds. + * @param float $red + * @param float $green + * @param float $blue + * @param float $alpha + * @param float $time + */ + void fade_color(float red, float green, float blue, float alpha, float time); + private: enum Alignment { NO_ALIGNMENT, diff --git a/src/object/camera.cpp b/src/object/camera.cpp index 3f3a92eddfa..65ed00eb89d 100644 --- a/src/object/camera.cpp +++ b/src/object/camera.cpp @@ -19,6 +19,9 @@ #include +#include +#include + #include "math/random.hpp" #include "math/util.hpp" #include "object/player.hpp" @@ -49,7 +52,6 @@ static const float MULTIPLAYER_CAM_WEIGHT = 0.1f; Camera::Camera(const std::string& name) : GameObject(name), - ExposedObject(this), m_mode(Mode::NORMAL), m_defaultmode(Mode::NORMAL), m_screen_size(static_cast(SCREEN_WIDTH), static_cast(SCREEN_HEIGHT)), @@ -86,7 +88,6 @@ Camera::Camera(const std::string& name) : Camera::Camera(const ReaderMapping& reader) : GameObject(reader), - ExposedObject(this), m_mode(Mode::NORMAL), m_defaultmode(Mode::NORMAL), m_screen_size(static_cast(SCREEN_WIDTH), static_cast(SCREEN_HEIGHT)), @@ -365,8 +366,8 @@ Camera::keep_in_bounds(const Rectf& bounds) void Camera::keep_in_bounds(Vector& translation_) { - float width = d_sector->get_width(); - float height = d_sector->get_height(); + float width = get_parent()->get_width(); + float height = get_parent()->get_height(); // Remove any earthquake offset from the translation. translation_.y -= m_earthquake_last_offset; @@ -635,7 +636,7 @@ Camera::update_scroll_normal_multiplayer(float dt_sec) void Camera::update_scroll_autoscroll(float dt_sec) { - if (!d_sector->get_object_count([](const Player& p) { return !p.is_dead() && !p.is_dying(); })) + if (!get_parent()->get_object_count([](const Player& p) { return !p.is_dead() && !p.is_dying(); })) return; get_walker()->update(dt_sec); @@ -764,6 +765,95 @@ Camera::ease_scale(float scale, float time, easing ease, AnchorPoint anchor) } } +void +Camera::set_pos(float x, float y) +{ + scroll_to(Vector(x, y), 0.0f); +} + +void +Camera::move(float x, float y) +{ + scroll_to(m_translation + Vector(x, y), 0.0f); +} + +void +Camera::set_mode(const std::string& mode) +{ + if (mode == "normal") + m_mode = Mode::NORMAL; + else if (mode == "manual") + m_mode = Mode::MANUAL; + else + log_warning << "Camera mode '" << mode << "' unknown." << std::endl; +} + +void +Camera::scroll_to(float x, float y, float scrolltime) +{ + scroll_to(Vector(x, y), scrolltime); +} + +void +Camera::set_scale(float scale) +{ + m_scale = scale; +} + +void +Camera::set_scale_anchor(float scale, int anchor) +{ + ease_scale_anchor(scale, 0, anchor, ""); +} + +void +Camera::scale(float scale, float time) +{ + ease_scale(scale, time, ""); +} + +void +Camera::scale_anchor(float scale, float time, int anchor) +{ + ease_scale_anchor(scale, time, anchor, ""); +} + +void +Camera::ease_scale(float scale, float time, const std::string& ease) +{ + ease_scale_anchor(scale, time, AnchorPoint::ANCHOR_MIDDLE, ease); +} + +void +Camera::ease_scale_anchor(float scale, float time, int anchor, const std::string& ease) +{ + ease_scale(scale, time, getEasingByName(EasingMode_from_string(ease)), static_cast(anchor)); +} + +float +Camera::get_screen_width() const +{ + return m_screen_size.width; +} + +float +Camera::get_screen_height() const +{ + return m_screen_size.height; +} + +float +Camera::get_x() const +{ + return m_translation.x; +} + +float +Camera::get_y() const +{ + return m_translation.y; +} + Vector Camera::get_center() const { @@ -796,4 +886,34 @@ Camera::is_saveable() const return !(Level::current() && Level::current()->is_worldmap()); } + + +void +Camera::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("Camera", vm.findClass("GameObject")); + + PathObject::register_members(cls); + + cls.addFunc("shake", &Camera::shake); + cls.addFunc("start_earthquake", &Camera::start_earthquake); + cls.addFunc("stop_earthquake", &Camera::stop_earthquake); + cls.addFunc("set_pos", &Camera::set_pos); + cls.addFunc("move", &Camera::move); + cls.addFunc("set_mode", &Camera::set_mode); + cls.addFunc("scroll_to", &Camera::scroll_to); + cls.addFunc("get_current_scale", &Camera::get_current_scale); + cls.addFunc("get_target_scale", &Camera::get_target_scale); + cls.addFunc("set_scale", &Camera::set_scale); + cls.addFunc("set_scale_anchor", &Camera::set_scale_anchor); + cls.addFunc("scale", &Camera::scale); + cls.addFunc("scale_anchor", &Camera::scale_anchor); + cls.addFunc("ease_scale", &Camera::ease_scale); + cls.addFunc("ease_scale_anchor", &Camera::ease_scale_anchor); + cls.addFunc("get_screen_width", &Camera::get_screen_width); + cls.addFunc("get_screen_height", &Camera::get_screen_height); + cls.addFunc("get_x", &Camera::get_x); + cls.addFunc("get_y", &Camera::get_y); +} + /* EOF */ diff --git a/src/object/camera.hpp b/src/object/camera.hpp index 62d5628fd1c..912f40e4126 100644 --- a/src/object/camera.hpp +++ b/src/object/camera.hpp @@ -24,8 +24,6 @@ #include "math/size.hpp" #include "math/vector.hpp" #include "object/path_object.hpp" -#include "scripting/camera.hpp" -#include "squirrel/exposed_object.hpp" #include "supertux/game_object.hpp" #include "supertux/timer.hpp" @@ -33,10 +31,18 @@ class Path; class PathWalker; class ReaderMapping; +/** + * @scripting + * @summary A ""Camera"" that was given a name can be manipulated by scripts. + * @instances An instance named ""Camera"" (""sector.Camera"" in the console) is available.${SRG_NEWPARAGRAPH} + The mode of the camera is either ""normal"" (the camera is following the player) or ""autoscroll"". In the latter mode, the camera is forced along a specified path. + */ class Camera final : public GameObject, - public ExposedObject, public PathObject { +public: + static void register_class(ssq::VM& vm); + public: enum class Mode { @@ -58,6 +64,7 @@ class Camera final : public GameObject, static std::string class_name() { return "camera"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "Camera"; } static std::string display_name() { return _("Camera"); } virtual std::string get_display_name() const override { return display_name(); } @@ -118,13 +125,107 @@ class Camera final : public GameObject, /** get the scale towards which the camera is moving */ float get_target_scale() const { return m_scale_target; } - /** Instantly set the scale of the camera */ - void set_scale(float scale) { m_scale = scale; } - /** smoothly slide the scale and anchor position of the camera towards a new value */ void ease_scale(float scale, float time, easing ease, AnchorPoint anchor = AnchorPoint::ANCHOR_MIDDLE); /** @} */ + /** + * @scripting + * @description Moves the camera to the specified absolute position. The origin is at the top left. + * @param float $x + * @param float $y + */ + void set_pos(float x, float y); + /** + * @scripting + * @description Moves the camera ""x"" to the left and ""y"" down. + * @param float $x + * @param float $y + */ + void move(float x, float y); + /** + * @scripting + * @description Sets the camera mode. + * @param string $mode The mode can be "normal" or "manual". + */ + void set_mode(const std::string& mode); + /** + * @scripting + * @description Scrolls the camera to specific coordinates in ""scrolltime"" seconds. + * @param float $x + * @param float $y + * @param float $scrolltime + */ + void scroll_to(float x, float y, float scrolltime); + /** + * @scripting + * @description Sets the scale factor. + * @param float $scale + */ + void set_scale(float scale); + /** + * @scripting + * @description Sets the scale factor and the target position anchor. + NOTE: Target position anchor is only applied, if the camera is in "manual" mode. + * @param float $scale + * @param int $anchor Anchor point as represented by the ""ANCHOR_*"" constants (see ${SRG_REF_AnchorPoints}). + */ + void set_scale_anchor(float scale, int anchor); + /** + * @scripting + * @description Fades to a specified scale factor in ""time"" seconds. + * @param float $scale + * @param float $time + */ + void scale(float scale, float time); + /** + * @scripting + * @description Fades to a specified scale factor and target position anchor in ""time"" seconds. + NOTE: Target position anchor is only applied, if the camera is in "manual" mode. + * @param float $scale + * @param float $time + * @param int $anchor Anchor point as represented by the ""ANCHOR_*"" constants (see ${SRG_REF_AnchorPoints}). + */ + void scale_anchor(float scale, float time, int anchor); + /** + * @scripting + * @description Fades to a specified scale factor in ""time"" seconds with easing (smooth movement). + * @param float $scale + * @param float $time + * @param string $ease + */ + void ease_scale(float scale, float time, const std::string& ease); + /** + * @scripting + * @description Fades to a specified scale factor and target position anchor in ""time"" seconds with easing (smooth movement). + NOTE: Target position anchor is only applied, if the camera is in "manual" mode. + * @param float $scale + * @param float $time + * @param int $anchor Anchor point as represented by the ""ANCHOR_*"" constants (see ${SRG_REF_AnchorPoints}). + * @param string $ease + */ + void ease_scale_anchor(float scale, float time, int anchor, const std::string& ease); + /** + * @scripting + * @description Gets the current width of the screen. + */ + float get_screen_width() const; + /** + * @scripting + * @description Gets the current height of the screen. + */ + float get_screen_height() const; + /** + * @scripting + * @description Gets the X coordinate of the top-left corner of the screen. + */ + float get_x() const; + /** + * @scripting + * @description Gets the Y coordinate of the top-left corner of the screen. + */ + float get_y() const; + private: void keep_in_bounds(Vector& vector); diff --git a/src/object/candle.cpp b/src/object/candle.cpp index bb049413318..883c011ecbe 100644 --- a/src/object/candle.cpp +++ b/src/object/candle.cpp @@ -16,6 +16,9 @@ #include "object/candle.hpp" +#include +#include + #include "math/random.hpp" #include "object/sprite_particle.hpp" #include "sprite/sprite.hpp" @@ -26,7 +29,6 @@ Candle::Candle(const ReaderMapping& mapping) : MovingSprite(mapping, "images/objects/candle/candle.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_DISABLED), - ExposedObject(this), burning(true), flicker(true), lightcolor(1.0f, 1.0f, 1.0f), @@ -146,4 +148,15 @@ Candle::on_flip(float height) FlipLevelTransformer::transform_flip(m_flip); } + +void +Candle::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("Candle", vm.findClass("MovingSprite")); + + cls.addFunc("puff_smoke", &Candle::puff_smoke); + cls.addFunc("get_burning", &Candle::get_burning); + cls.addFunc("set_burning", &Candle::set_burning); +} + /* EOF */ diff --git a/src/object/candle.hpp b/src/object/candle.hpp index 8f5ad6d9284..34be1323caa 100644 --- a/src/object/candle.hpp +++ b/src/object/candle.hpp @@ -18,15 +18,20 @@ #define HEADER_SUPERTUX_OBJECT_CANDLE_HPP #include "object/moving_sprite.hpp" -#include "scripting/candle.hpp" -#include "squirrel/exposed_object.hpp" /** * A burning candle: Simple, scriptable level decoration. + + * @scripting + * @summary A ""Candle"" that was given a name can be controlled by scripts. + * @instances A ""Candle"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. */ -class Candle final : public MovingSprite, - public ExposedObject +class Candle final : public MovingSprite { +public: + static void register_class(ssq::VM& vm); + public: Candle(const ReaderMapping& mapping); virtual void draw(DrawingContext& context) override; @@ -34,6 +39,7 @@ class Candle final : public MovingSprite, virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; static std::string class_name() { return "candle"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "Candle"; } static std::string display_name() { return _("Candle"); } virtual std::string get_display_name() const override { return display_name(); } @@ -42,12 +48,22 @@ class Candle final : public MovingSprite, virtual void on_flip(float height) override; - /** @name Scriptable Methods - @{ */ - void puff_smoke(); /**< spawn a puff of smoke */ - bool get_burning() const; /**< returns true if candle is lighted */ - void set_burning(bool burning); /**< true: light candle, false: extinguish candle */ - /** @} */ + /** + * @scripting + * @description Spawns a puff of smoke. + */ + void puff_smoke(); + /** + * @scripting + * @description Returns ""true"" if the candle is lit up. + */ + bool get_burning() const; + /** + * @scripting + * @description Sets the burning state of the candle. + * @param bool $burning If ""true"", the candle is lit up. If ""false"", it's extinguished. + */ + void set_burning(bool burning); private: bool burning; /**< true if candle is currently lighted */ diff --git a/src/object/cloud_particle_system.cpp b/src/object/cloud_particle_system.cpp index 0b9ed19263a..aafee814586 100644 --- a/src/object/cloud_particle_system.cpp +++ b/src/object/cloud_particle_system.cpp @@ -16,6 +16,9 @@ #include "object/cloud_particle_system.hpp" +#include +#include + #include "math/random.hpp" #include "object/camera.hpp" #include "supertux/sector.hpp" @@ -29,13 +32,10 @@ CloudParticleSystem::CloudParticleSystem() : ParticleSystem(128), - ExposedObject(this), cloudimage(Surface::from_file("images/particles/cloud.png")), - m_current_speed(1.f), m_target_speed(1.f), m_speed_fade_time_remaining(0.f), - m_current_amount(15), m_current_real_amount(0) { @@ -44,13 +44,10 @@ CloudParticleSystem::CloudParticleSystem() : CloudParticleSystem::CloudParticleSystem(const ReaderMapping& reader) : ParticleSystem(reader, 128), - ExposedObject(this), cloudimage(Surface::from_file("images/particles/cloud.png")), - m_current_speed(1.f), m_target_speed(1.f), m_speed_fade_time_remaining(0.f), - m_current_amount(15), m_current_real_amount(0) { @@ -229,6 +226,12 @@ void CloudParticleSystem::fade_amount(int new_amount, float fade_time, float tim } // If delta is zero, there is nothing to do. } +void +CloudParticleSystem::set_amount(int amount, float time) +{ + fade_amount(amount, time, 0.f); +} + void CloudParticleSystem::draw(DrawingContext& context) { @@ -277,4 +280,15 @@ void CloudParticleSystem::draw(DrawingContext& context) context.pop_transform(); } + +void +CloudParticleSystem::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("CloudParticleSystem", vm.findClass("ParticleSystem")); + + cls.addFunc("fade_speed", &CloudParticleSystem::fade_speed); + cls.addFunc("fade_amount", &CloudParticleSystem::fade_amount); + cls.addFunc("set_amount", &CloudParticleSystem::set_amount); +} + /* EOF */ diff --git a/src/object/cloud_particle_system.hpp b/src/object/cloud_particle_system.hpp index b81c6e68155..20c1cee322d 100644 --- a/src/object/cloud_particle_system.hpp +++ b/src/object/cloud_particle_system.hpp @@ -18,15 +18,22 @@ #define HEADER_SUPERTUX_OBJECT_CLOUD_PARTICLE_SYSTEM_HPP #include "object/particlesystem.hpp" -#include "scripting/clouds.hpp" + #include "video/surface_ptr.hpp" class ReaderMapping; -class CloudParticleSystem final : - public ParticleSystem, - public ExposedObject +/** + * @scripting + * @summary A ""CloudParticleSystem"" that was given a name can be controlled by scripts. + * @instances A ""CloudParticleSystem"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class CloudParticleSystem final : public ParticleSystem { +public: + static void register_class(ssq::VM& vm); + public: CloudParticleSystem(); CloudParticleSystem(const ReaderMapping& reader); @@ -39,6 +46,7 @@ class CloudParticleSystem final : static std::string class_name() { return "particles-clouds"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "CloudParticleSystem"; } static std::string display_name() { return _("Cloud Particles"); } virtual std::string get_display_name() const override { return display_name(); } virtual ObjectSettings get_settings() override; @@ -47,21 +55,33 @@ class CloudParticleSystem final : return "images/engine/editor/clouds.png"; } - void fade_speed(float new_speed, float fade_time); - void fade_amount(int new_amount, float fade_time, float time_between = 0.f); + /** + * @scripting + * @description Smoothly changes the rain speed to the given value in ""time"" seconds. + * @param float $speed + * @param float $time + */ + void fade_speed(float speed, float time); + /** + * @scripting + * @description Smoothly changes the amount of particles to the given value in ""time"" seconds. + * @param int $amount + * @param float $time + * @param float $time_between + */ + void fade_amount(int amount, float time, float time_between); + /** + * @scripting + * @description Smoothly changes the amount of particles to the given value in ""time"" seconds. + * @param int $amount + * @param float $time + */ + void set_amount(int amount, float time); // Minimum and maximum multiplier for the amount of clouds static int constexpr const max_amount = 500; static int constexpr const min_amount = 0; - virtual void expose(HSQUIRRELVM vm, SQInteger table_idx) override { - ExposedObject::expose(vm, table_idx); - } - - virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx) override { - ExposedObject::unexpose(vm, table_idx); - } - private: /** Returns the amount that got inserted (In case max_amount got hit) */ int add_clouds(int amount, float fade_time); diff --git a/src/object/conveyor_belt.cpp b/src/object/conveyor_belt.cpp index 66ae15f0199..0820031d44d 100644 --- a/src/object/conveyor_belt.cpp +++ b/src/object/conveyor_belt.cpp @@ -16,6 +16,9 @@ #include "object/conveyor_belt.hpp" +#include +#include + #include "badguy/walking_badguy.hpp" #include "sprite/sprite.hpp" #include "sprite/sprite_manager.hpp" @@ -25,7 +28,6 @@ ConveyorBelt::ConveyorBelt(const ReaderMapping &reader) : MovingSprite(reader, "images/objects/conveyor_belt/conveyor.sprite"), - ExposedObject(this), m_running(true), m_dir(Direction::LEFT), m_length(1), @@ -170,4 +172,17 @@ ConveyorBelt::set_speed(float target_speed) m_speed = target_speed; } + +void +ConveyorBelt::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("ConveyorBelt", vm.findClass("MovingSprite")); + + cls.addFunc("start", &ConveyorBelt::start); + cls.addFunc("stop", &ConveyorBelt::stop); + cls.addFunc("move_left", &ConveyorBelt::move_left); + cls.addFunc("move_right", &ConveyorBelt::move_right); + cls.addFunc("set_speed", &ConveyorBelt::set_speed); +} + /* EOF */ diff --git a/src/object/conveyor_belt.hpp b/src/object/conveyor_belt.hpp index c3228811b1e..80eff3dec91 100644 --- a/src/object/conveyor_belt.hpp +++ b/src/object/conveyor_belt.hpp @@ -18,15 +18,22 @@ #define HEADER_SUPERTUX_OBJECT_CONVEYOR_BELT_HPP #include "object/moving_sprite.hpp" -#include "squirrel/exposed_object.hpp" -#include "scripting/conveyor_belt.hpp" #include "supertux/timer.hpp" -/** This class represents a platform that moves entities riding it. */ -class ConveyorBelt final : public MovingSprite, - public ExposedObject +/** + * This class represents a platform that moves entities riding it. + + * @scripting + * @summary A ""ConveyorBelt"" that was given a name can be controlled by scripts. + * @instances A ""ConveyorBelt"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class ConveyorBelt final : public MovingSprite { +public: + static void register_class(ssq::VM& vm); + public: ConveyorBelt(const ReaderMapping& reader); @@ -36,6 +43,7 @@ class ConveyorBelt final : public MovingSprite, static std::string class_name() { return "conveyor-belt"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "ConveyorBelt"; } static std::string display_name() { return _("Conveyor Belt"); } virtual std::string get_display_name() const override { return display_name(); } @@ -47,20 +55,31 @@ class ConveyorBelt final : public MovingSprite, virtual void after_editor_set() override; /** @name Scriptable Methods */ - - /** Starts the conveyor belt. */ + /** + * @scripting + * Starts the conveyor belt. + */ void start(); - - /** Stops the conveyor belt. */ + /** + * @scripting + * Stops the conveyor belt. + */ void stop(); - - /** Makes the conveyor shift objects to the left. */ + /** + * @scripting + * Makes the conveyor shift objects to the left. + */ void move_left(); - - /** Makes the conveyor shift objects to the right. */ + /** + * @scripting + * Makes the conveyor shift objects to the right. + */ void move_right(); - - /** Changes the shifting speed of the conveyor. */ + /** + * @scripting + * Change the shifting speed of the conveyor. + * @param float $target_speed + */ void set_speed(float target_speed); private: diff --git a/src/object/custom_particle_system.cpp b/src/object/custom_particle_system.cpp index 3069e1c30b9..11ecc6be51c 100644 --- a/src/object/custom_particle_system.cpp +++ b/src/object/custom_particle_system.cpp @@ -43,7 +43,6 @@ #include "video/viewport.hpp" CustomParticleSystem::CustomParticleSystem() : - ExposedObject(this), texture_sum_odds(0.f), time_last_remaining(0.f), script_easings(), @@ -87,7 +86,6 @@ CustomParticleSystem::CustomParticleSystem() : CustomParticleSystem::CustomParticleSystem(const ReaderMapping& reader) : ParticleSystem_Interactive(reader), - ExposedObject(this), texture_sum_odds(0.f), time_last_remaining(0.f), script_easings(), @@ -1072,7 +1070,7 @@ CustomParticleSystem::get_collision(Particle* object, const Vector& movement) // LOCAL CustomParticleSystem::SpriteProperties -CustomParticleSystem::get_random_texture() +CustomParticleSystem::get_random_texture() const { float val = graphicsRandom.randf(texture_sum_odds); for (const auto& texture : m_textures) @@ -1087,7 +1085,7 @@ CustomParticleSystem::get_random_texture() } std::vector -CustomParticleSystem::get_zones() +CustomParticleSystem::get_zones() const { std::vector list; @@ -1116,13 +1114,13 @@ CustomParticleSystem::get_zones() } float -CustomParticleSystem::get_abs_x() +CustomParticleSystem::get_abs_x() const { return (Sector::current()) ? Sector::get().get_camera().get_translation().x : 0.f; } float -CustomParticleSystem::get_abs_y() +CustomParticleSystem::get_abs_y() const { return (Sector::current()) ? Sector::get().get_camera().get_translation().y : 0.f; } @@ -1227,7 +1225,14 @@ CustomParticleSystem::spawn_particles(float lifetime) // SCRIPTING void -CustomParticleSystem::ease_value(float* value, float target, float time, easing func) { +CustomParticleSystem::clear() +{ + custom_particles.clear(); +} + +void +CustomParticleSystem::ease_value(float* value, float target, float time, easing func) +{ assert(value); ease_request req; @@ -1241,4 +1246,957 @@ CustomParticleSystem::ease_value(float* value, float target, float time, easing script_easings.push_back(req); } +void +CustomParticleSystem::spawn_particles(int amount, bool instantly) +{ + if (!instantly) + { + // TODO: Implement delayed spawn mode for scripting. + log_warning << "Delayed spawn mode is not yet implemented for scripting." << std::endl; + return; + } + + for (int i = 0; i < amount; i++) + spawn_particles(0.f); +} + +// ============================================================================= +// ============================ ATTRIBUTES ================================= +// ============================================================================= + +int +CustomParticleSystem::get_max_amount() const +{ + return m_max_amount; +} + +void +CustomParticleSystem::set_max_amount(int amount) +{ + m_max_amount = amount; +} + +bool +CustomParticleSystem::get_cover_screen() const +{ + return m_cover_screen; +} + +void +CustomParticleSystem::set_cover_screen(bool cover) +{ + m_cover_screen = cover; +} + +std::string +CustomParticleSystem::get_birth_mode() const +{ + switch (m_particle_birth_mode) + { + case FadeMode::None: + return "None"; + case FadeMode::Fade: + return "Fade"; + case FadeMode::Shrink: + return "Shrink"; + default: + return ""; + } +} + +void +CustomParticleSystem::set_birth_mode(const std::string& mode) +{ + if (mode == "None") + m_particle_birth_mode = FadeMode::None; + else if (mode == "Fade") + m_particle_birth_mode = FadeMode::Fade; + else if (mode == "Shrink") + m_particle_birth_mode = FadeMode::Shrink; + else + log_warning << "Invalid option " + mode + "; valid options are: None, Fade, Shrink." << std::endl; +} + +std::string +CustomParticleSystem::get_death_mode() const +{ + switch (m_particle_death_mode) + { + case FadeMode::None: + return "None"; + case FadeMode::Fade: + return "Fade"; + case FadeMode::Shrink: + return "Shrink"; + default: + return ""; + } +} + +void +CustomParticleSystem::set_death_mode(const std::string& mode) +{ + if (mode == "None") + m_particle_death_mode = FadeMode::None; + else if (mode == "Fade") + m_particle_death_mode = FadeMode::Fade; + else if (mode == "Shrink") + m_particle_death_mode = FadeMode::Shrink; + else + log_warning << "Invalid option " + mode + "; valid options are: None, Fade, Shrink." << std::endl; +} + +std::string +CustomParticleSystem::get_rotation_mode() const +{ + switch (m_particle_rotation_mode) + { + case RotationMode::Fixed: + return "Fixed"; + case RotationMode::Facing: + return "Facing"; + case RotationMode::Wiggling: + return "Wiggling"; + default: + return ""; + } +} + +void +CustomParticleSystem::set_rotation_mode(const std::string& mode) +{ + if (mode == "Fixed") + m_particle_rotation_mode = RotationMode::Fixed; + else if (mode == "Facing") + m_particle_rotation_mode = RotationMode::Facing; + else if (mode == "Wiggling") + m_particle_rotation_mode = RotationMode::Wiggling; + else + log_warning << "Invalid option " + mode + "; valid options are: Fixed, Facing, Wiggling." << std::endl; +} + +std::string +CustomParticleSystem::get_collision_mode() const +{ + switch (m_particle_collision_mode) + { + case CollisionMode::Ignore: + return "Ignore"; + case CollisionMode::Stick: + return "Stick"; + case CollisionMode::StickForever: + return "StickForever"; + case CollisionMode::BounceHeavy: + return "BounceHeavy"; + case CollisionMode::BounceLight: + return "BounceLight"; + case CollisionMode::Destroy: + return "Destroy"; + default: + return ""; + } +} + +void +CustomParticleSystem::set_collision_mode(const std::string& mode) +{ + if (mode == "Ignore") + m_particle_collision_mode = CollisionMode::Ignore; + else if (mode == "Stick") + m_particle_collision_mode = CollisionMode::Stick; + else if (mode == "StickForever") + m_particle_collision_mode = CollisionMode::StickForever; + else if (mode == "BounceHeavy") + m_particle_collision_mode = CollisionMode::BounceHeavy; + else if (mode == "BounceLight") + m_particle_collision_mode = CollisionMode::BounceLight; + else if (mode == "Destroy") + m_particle_collision_mode = CollisionMode::Destroy; + else + log_warning << "Invalid option " + mode + "; valid options are: Ignore, Stick, StickForever, BounceHeavy, BounceLight, Destroy." << std::endl; +} + +std::string +CustomParticleSystem::get_offscreen_mode() const +{ + switch (m_particle_offscreen_mode) + { + case OffscreenMode::Never: + return "Never"; + case OffscreenMode::OnlyOnExit: + return "OnlyOnExit"; + case OffscreenMode::Always: + return "Always"; + default: + return ""; + } +} + +void +CustomParticleSystem::set_offscreen_mode(const std::string& mode) +{ + if (mode == "Never") + m_particle_offscreen_mode = OffscreenMode::Never; + else if (mode == "OnlyOnExit") + m_particle_offscreen_mode = OffscreenMode::OnlyOnExit; + else if (mode == "Always") + m_particle_offscreen_mode = OffscreenMode::Always; + else + log_warning << "Invalid option " + mode + "; valid options are: Never, OnlyOnExit, Always." << std::endl; +} + +// ============================================================================= +// Delay +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_delay() const +{ + return m_delay; +} + +void +CustomParticleSystem::set_delay(float delay) +{ + m_delay = delay; +} + +void +CustomParticleSystem::fade_delay(float delay, float time) +{ + ease_value(&m_delay, delay, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_delay(float delay, float time, const std::string& easing_) +{ + ease_value(&m_delay, delay, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// Lifetime +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_lifetime() const +{ + return m_particle_lifetime; +} + +void +CustomParticleSystem::set_lifetime(float lifetime) +{ + m_particle_lifetime = lifetime; +} + +void +CustomParticleSystem::fade_lifetime(float lifetime, float time) +{ + ease_value(&m_particle_lifetime, lifetime, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_lifetime(float lifetime, float time, const std::string& easing_) +{ + ease_value(&m_particle_lifetime, lifetime, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// Lifetime variation +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_lifetime_variation() const +{ + return m_particle_lifetime_variation; +} + +void +CustomParticleSystem::set_lifetime_variation(float lifetime_variation) +{ + m_particle_lifetime_variation = lifetime_variation; +} + +void +CustomParticleSystem::fade_lifetime_variation(float lifetime_variation, float time) +{ + ease_value(&m_particle_lifetime_variation, lifetime_variation, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_lifetime_variation(float lifetime_variation, float time, const std::string& easing_) +{ + ease_value(&m_particle_lifetime_variation, lifetime_variation, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// Birth time +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_birth_time() const +{ + return m_particle_birth_time; +} + +void +CustomParticleSystem::set_birth_time(float birth_time) +{ + m_particle_birth_time = birth_time; +} + +void +CustomParticleSystem::fade_birth_time(float birth_time, float time) +{ + ease_value(&m_particle_birth_time, birth_time, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_birth_time(float birth_time, float time, const std::string& easing_) +{ + ease_value(&m_particle_birth_time, birth_time, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// Birth time variation +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_birth_time_variation() const +{ + return m_particle_birth_time_variation; +} + +void +CustomParticleSystem::set_birth_time_variation(float birth_time_variation) +{ + m_particle_birth_time_variation = birth_time_variation; +} + +void +CustomParticleSystem::fade_birth_time_variation(float birth_time_variation, float time) +{ + ease_value(&m_particle_birth_time_variation, birth_time_variation, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_birth_time_variation(float birth_time_variation, float time, const std::string& easing_) +{ + ease_value(&m_particle_birth_time_variation, birth_time_variation, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// Death time +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_death_time() const +{ + return m_particle_death_time; +} + +void +CustomParticleSystem::set_death_time(float death_time) +{ + m_particle_death_time = death_time; +} + +void +CustomParticleSystem::fade_death_time(float death_time, float time) +{ + ease_value(&m_particle_death_time, death_time, time, LinearInterpolation); +} + +void +CustomParticleSystem::ease_death_time(float death_time, float time, const std::string& easing_) +{ + ease_value(&m_particle_death_time, death_time, time, getEasingByName(EasingMode_from_string(easing_))); +} + + + +// ============================================================================= +// Death time variation +// ----------------------------------------------------------------------------- +float +CustomParticleSystem::get_death_time_variation() const +{ + return m_particle_death_time_variation; +} + +void +CustomParticleSystem::set_death_time_variation(float death_time_variation) +{ + m_particle_death_time_variation = death_time_variation; +} + +void +CustomParticleSystem::fade_death_time_variation(float death_time_variation, float time) +{ + ease_value(&m_particle_death_time_variation, death_time_variation, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_death_time_variation(float death_time_variation, float time, const std::string& easing_) +{ + ease_value(&m_particle_death_time_variation, death_time_variation, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// X speed +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_speed_x() const +{ + return m_particle_speed_x; +} + +void +CustomParticleSystem::set_speed_x(float speed_x) +{ + m_particle_speed_x = speed_x; +} + +void +CustomParticleSystem::fade_speed_x(float speed_x, float time) +{ + ease_value(&m_particle_speed_x, speed_x, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_speed_x(float speed_x, float time, const std::string& easing_) +{ + ease_value(&m_particle_speed_x, speed_x, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// Y speed +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_speed_y() const +{ + return m_particle_speed_y; +} + +void +CustomParticleSystem::set_speed_y(float speed_y) +{ + m_particle_speed_y = speed_y; +} + +void +CustomParticleSystem::fade_speed_y(float speed_y, float time) +{ + ease_value(&m_particle_speed_y, speed_y, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_speed_y(float speed_y, float time, const std::string& easing_) +{ + ease_value(&m_particle_speed_y, speed_y, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// X speed variation +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_speed_variation_x() const +{ + return m_particle_speed_variation_x; +} + +void +CustomParticleSystem::set_speed_variation_x(float speed_variation_x) +{ + m_particle_speed_variation_x = speed_variation_x; +} + +void +CustomParticleSystem::fade_speed_variation_x(float speed_variation_x, float time) +{ + ease_value(&m_particle_speed_variation_x, speed_variation_x, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_speed_variation_x(float speed_variation_x, float time, const std::string& easing_) +{ + ease_value(&m_particle_speed_variation_x, speed_variation_x, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// Y speed variation +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_speed_variation_y() const +{ + return m_particle_speed_variation_y; +} + +void +CustomParticleSystem::set_speed_variation_y(float speed_variation_y) +{ + m_particle_speed_variation_y = speed_variation_y; +} + +void +CustomParticleSystem::fade_speed_variation_y(float speed_variation_y, float time) +{ + ease_value(&m_particle_speed_variation_y, speed_variation_y, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_speed_variation_y(float speed_variation_y, float time, const std::string& easing_) +{ + ease_value(&m_particle_speed_variation_y, speed_variation_y, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// X acceleration +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_acceleration_x() const +{ + return m_particle_acceleration_x; +} + +void +CustomParticleSystem::set_acceleration_x(float acceleration_x) +{ + m_particle_acceleration_x = acceleration_x; +} + +void +CustomParticleSystem::fade_acceleration_x(float acceleration_x, float time) +{ + ease_value(&m_particle_acceleration_x, acceleration_x, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_acceleration_x(float acceleration_x, float time, const std::string& easing_) +{ + ease_value(&m_particle_acceleration_x, acceleration_x, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// Y acceleration +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_acceleration_y() const +{ + return m_particle_acceleration_y; +} + +void +CustomParticleSystem::set_acceleration_y(float acceleration_y) +{ + m_particle_acceleration_y = acceleration_y; +} + +void +CustomParticleSystem::fade_acceleration_y(float acceleration_y, float time) +{ + ease_value(&m_particle_acceleration_y, acceleration_y, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_acceleration_y(float acceleration_y, float time, const std::string& easing_) +{ + ease_value(&m_particle_acceleration_y, acceleration_y, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// X friction +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_friction_x() const +{ + return m_particle_friction_x; +} + +void +CustomParticleSystem::set_friction_x(float friction_x) +{ + m_particle_friction_x = friction_x; +} + +void +CustomParticleSystem::fade_friction_x(float friction_x, float time) +{ + ease_value(&m_particle_friction_x, friction_x, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_friction_x(float friction_x, float time, const std::string& easing_) +{ + ease_value(&m_particle_friction_x, friction_x, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// Y friction +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_friction_y() const +{ + return m_particle_friction_y; +} + +void +CustomParticleSystem::set_friction_y(float friction_y) +{ + m_particle_friction_y = friction_y; +} + +void +CustomParticleSystem::fade_friction_y(float friction_y, float time) +{ + ease_value(&m_particle_friction_y, friction_y, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_friction_y(float friction_y, float time, const std::string& easing_) +{ + ease_value(&m_particle_friction_y, friction_y, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// Feather factor +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_feather_factor() const +{ + return m_particle_feather_factor; +} + +void +CustomParticleSystem::set_feather_factor(float feather_factor) +{ + m_particle_feather_factor = feather_factor; +} + +void +CustomParticleSystem::fade_feather_factor(float feather_factor, float time) +{ + ease_value(&m_particle_feather_factor, feather_factor, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_feather_factor(float feather_factor, float time, const std::string& easing_) +{ + ease_value(&m_particle_feather_factor, feather_factor, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// Rotation +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_rotation() const +{ + return m_particle_rotation; +} + +void +CustomParticleSystem::set_rotation(float rotation) +{ + m_particle_rotation = rotation; +} + +void +CustomParticleSystem::fade_rotation(float rotation, float time) +{ + ease_value(&m_particle_rotation, rotation, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_rotation(float rotation, float time, const std::string& easing_) +{ + ease_value(&m_particle_rotation, rotation, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// Rotation variation +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_rotation_variation() const +{ + return m_particle_rotation_variation; +} + +void +CustomParticleSystem::set_rotation_variation(float rotation_variation) +{ + m_particle_rotation_variation = rotation_variation; +} + +void +CustomParticleSystem::fade_rotation_variation(float rotation_variation, float time) +{ + ease_value(&m_particle_rotation_variation, rotation_variation, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_rotation_variation(float rotation_variation, float time, const std::string& easing_) +{ + ease_value(&m_particle_rotation_variation, rotation_variation, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// Rotation speed +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_rotation_speed() const +{ + return m_particle_rotation_speed; +} + +void +CustomParticleSystem::set_rotation_speed(float rotation_speed) +{ + m_particle_rotation_speed = rotation_speed; +} + +void +CustomParticleSystem::fade_rotation_speed(float rotation_speed, float time) +{ + ease_value(&m_particle_rotation_speed, rotation_speed, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_rotation_speed(float rotation_speed, float time, const std::string& easing_) +{ + ease_value(&m_particle_rotation_speed, rotation_speed, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// Rotation speed variation +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_rotation_speed_variation() const +{ + return m_particle_rotation_speed_variation; +} + +void +CustomParticleSystem::set_rotation_speed_variation(float rotation_speed_variation) +{ + m_particle_rotation_speed_variation = rotation_speed_variation; +} + +void +CustomParticleSystem::fade_rotation_speed_variation(float rotation_speed_variation, float time) +{ + ease_value(&m_particle_rotation_speed_variation, rotation_speed_variation, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_rotation_speed_variation(float rotation_speed_variation, float time, const std::string& easing_) +{ + ease_value(&m_particle_rotation_speed_variation, rotation_speed_variation, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// Rotation acceleration +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_rotation_acceleration() const +{ + return m_particle_rotation_acceleration; +} + +void +CustomParticleSystem::set_rotation_acceleration(float rotation_acceleration) +{ + m_particle_rotation_acceleration = rotation_acceleration; +} + +void +CustomParticleSystem::fade_rotation_acceleration(float rotation_acceleration, float time) +{ + ease_value(&m_particle_rotation_acceleration, rotation_acceleration, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_rotation_acceleration(float rotation_acceleration, float time, const std::string& easing_) +{ + ease_value(&m_particle_rotation_acceleration, rotation_acceleration, time, getEasingByName(EasingMode_from_string(easing_))); +} + +// ============================================================================= +// Rotation decceleration +// ----------------------------------------------------------------------------- + +float +CustomParticleSystem::get_rotation_decceleration() const +{ + return m_particle_rotation_decceleration; +} + +void +CustomParticleSystem::set_rotation_decceleration(float rotation_decceleration) +{ + m_particle_rotation_decceleration = rotation_decceleration; +} + +void +CustomParticleSystem::fade_rotation_decceleration(float rotation_decceleration, float time) +{ + ease_value(&m_particle_rotation_decceleration, rotation_decceleration, time, getEasingByName(EasingMode::EaseNone)); +} + +void +CustomParticleSystem::ease_rotation_decceleration(float rotation_decceleration, float time, const std::string& easing_) +{ + ease_value(&m_particle_rotation_decceleration, rotation_decceleration, time, getEasingByName(EasingMode_from_string(easing_))); +} + + +void +CustomParticleSystem::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("CustomParticleSystem", vm.findClass("ParticleSystem")); + + cls.addFunc("clear", &CustomParticleSystem::clear); + cls.addFunc("spawn_particles", &CustomParticleSystem::spawn_particles); + cls.addFunc("get_max_amount", &CustomParticleSystem::get_max_amount); + cls.addFunc("set_max_amount", &CustomParticleSystem::set_max_amount); + cls.addFunc("get_cover_screen", &CustomParticleSystem::get_cover_screen); + cls.addFunc("set_cover_screen", &CustomParticleSystem::set_cover_screen); + cls.addFunc("get_birth_mode", &CustomParticleSystem::get_birth_mode); + cls.addFunc("set_birth_mode", &CustomParticleSystem::set_birth_mode); + cls.addFunc("get_death_mode", &CustomParticleSystem::get_death_mode); + cls.addFunc("set_death_mode", &CustomParticleSystem::set_death_mode); + cls.addFunc("get_rotation_mode", &CustomParticleSystem::get_rotation_mode); + cls.addFunc("set_rotation_mode", &CustomParticleSystem::set_rotation_mode); + cls.addFunc("get_collision_mode", &CustomParticleSystem::get_collision_mode); + cls.addFunc("set_collision_mode", &CustomParticleSystem::set_collision_mode); + cls.addFunc("get_offscreen_mode", &CustomParticleSystem::get_offscreen_mode); + cls.addFunc("set_offscreen_mode", &CustomParticleSystem::set_offscreen_mode); + cls.addFunc("get_delay", &CustomParticleSystem::get_delay); + cls.addFunc("set_delay", &CustomParticleSystem::set_delay); + cls.addFunc("fade_delay", &CustomParticleSystem::fade_delay); + cls.addFunc("ease_delay", &CustomParticleSystem::ease_delay); + cls.addFunc("get_lifetime", &CustomParticleSystem::get_lifetime); + cls.addFunc("set_lifetime", &CustomParticleSystem::set_lifetime); + cls.addFunc("fade_lifetime", &CustomParticleSystem::fade_lifetime); + cls.addFunc("ease_lifetime", &CustomParticleSystem::ease_lifetime); + cls.addFunc("get_lifetime_variation", &CustomParticleSystem::get_lifetime_variation); + cls.addFunc("set_lifetime_variation", &CustomParticleSystem::set_lifetime_variation); + cls.addFunc("fade_lifetime_variation", &CustomParticleSystem::fade_lifetime_variation); + cls.addFunc("ease_lifetime_variation", &CustomParticleSystem::ease_lifetime_variation); + cls.addFunc("get_birth_time", &CustomParticleSystem::get_birth_time); + cls.addFunc("set_birth_time", &CustomParticleSystem::set_birth_time); + cls.addFunc("fade_birth_time", &CustomParticleSystem::fade_birth_time); + cls.addFunc("ease_birth_time", &CustomParticleSystem::ease_birth_time); + cls.addFunc("get_birth_time_variation", &CustomParticleSystem::get_birth_time_variation); + cls.addFunc("set_birth_time_variation", &CustomParticleSystem::set_birth_time_variation); + cls.addFunc("fade_birth_time_variation", &CustomParticleSystem::fade_birth_time_variation); + cls.addFunc("ease_birth_time_variation", &CustomParticleSystem::ease_birth_time_variation); + cls.addFunc("get_death_time", &CustomParticleSystem::get_death_time); + cls.addFunc("set_death_time", &CustomParticleSystem::set_death_time); + cls.addFunc("fade_death_time", &CustomParticleSystem::fade_death_time); + cls.addFunc("ease_death_time", &CustomParticleSystem::ease_death_time); + cls.addFunc("get_death_time_variation", &CustomParticleSystem::get_death_time_variation); + cls.addFunc("set_death_time_variation", &CustomParticleSystem::set_death_time_variation); + cls.addFunc("fade_death_time_variation", &CustomParticleSystem::fade_death_time_variation); + cls.addFunc("ease_death_time_variation", &CustomParticleSystem::ease_death_time_variation); + cls.addFunc("get_speed_x", &CustomParticleSystem::get_speed_x); + cls.addFunc("set_speed_x", &CustomParticleSystem::set_speed_x); + cls.addFunc("fade_speed_x", &CustomParticleSystem::fade_speed_x); + cls.addFunc("ease_speed_x", &CustomParticleSystem::ease_speed_x); + cls.addFunc("get_speed_y", &CustomParticleSystem::get_speed_y); + cls.addFunc("set_speed_y", &CustomParticleSystem::set_speed_y); + cls.addFunc("fade_speed_y", &CustomParticleSystem::fade_speed_y); + cls.addFunc("ease_speed_y", &CustomParticleSystem::ease_speed_y); + cls.addFunc("get_speed_variation_x", &CustomParticleSystem::get_speed_variation_x); + cls.addFunc("set_speed_variation_x", &CustomParticleSystem::set_speed_variation_x); + cls.addFunc("fade_speed_variation_x", &CustomParticleSystem::fade_speed_variation_x); + cls.addFunc("ease_speed_variation_x", &CustomParticleSystem::ease_speed_variation_x); + cls.addFunc("get_speed_variation_y", &CustomParticleSystem::get_speed_variation_y); + cls.addFunc("set_speed_variation_y", &CustomParticleSystem::set_speed_variation_y); + cls.addFunc("fade_speed_variation_y", &CustomParticleSystem::fade_speed_variation_y); + cls.addFunc("ease_speed_variation_y", &CustomParticleSystem::ease_speed_variation_y); + cls.addFunc("get_acceleration_x", &CustomParticleSystem::get_acceleration_x); + cls.addFunc("set_acceleration_x", &CustomParticleSystem::set_acceleration_x); + cls.addFunc("fade_acceleration_x", &CustomParticleSystem::fade_acceleration_x); + cls.addFunc("ease_acceleration_x", &CustomParticleSystem::ease_acceleration_x); + cls.addFunc("get_acceleration_y", &CustomParticleSystem::get_acceleration_y); + cls.addFunc("set_acceleration_y", &CustomParticleSystem::set_acceleration_y); + cls.addFunc("fade_acceleration_y", &CustomParticleSystem::fade_acceleration_y); + cls.addFunc("ease_acceleration_y", &CustomParticleSystem::ease_acceleration_y); + cls.addFunc("get_friction_x", &CustomParticleSystem::get_friction_x); + cls.addFunc("set_friction_x", &CustomParticleSystem::set_friction_x); + cls.addFunc("fade_friction_x", &CustomParticleSystem::fade_friction_x); + cls.addFunc("ease_friction_x", &CustomParticleSystem::ease_friction_x); + cls.addFunc("get_friction_y", &CustomParticleSystem::get_friction_y); + cls.addFunc("set_friction_y", &CustomParticleSystem::set_friction_y); + cls.addFunc("fade_friction_y", &CustomParticleSystem::fade_friction_y); + cls.addFunc("ease_friction_y", &CustomParticleSystem::ease_friction_y); + cls.addFunc("get_feather_factor", &CustomParticleSystem::get_feather_factor); + cls.addFunc("set_feather_factor", &CustomParticleSystem::set_feather_factor); + cls.addFunc("fade_feather_factor", &CustomParticleSystem::fade_feather_factor); + cls.addFunc("ease_feather_factor", &CustomParticleSystem::ease_feather_factor); + cls.addFunc("get_rotation", &CustomParticleSystem::get_rotation); + cls.addFunc("set_rotation", &CustomParticleSystem::set_rotation); + cls.addFunc("fade_rotation", &CustomParticleSystem::fade_rotation); + cls.addFunc("ease_rotation", &CustomParticleSystem::ease_rotation); + cls.addFunc("get_rotation_variation", &CustomParticleSystem::get_rotation_variation); + cls.addFunc("set_rotation_variation", &CustomParticleSystem::set_rotation_variation); + cls.addFunc("fade_rotation_variation", &CustomParticleSystem::fade_rotation_variation); + cls.addFunc("ease_rotation_variation", &CustomParticleSystem::ease_rotation_variation); + cls.addFunc("get_rotation_speed", &CustomParticleSystem::get_rotation_speed); + cls.addFunc("set_rotation_speed", &CustomParticleSystem::set_rotation_speed); + cls.addFunc("fade_rotation_speed", &CustomParticleSystem::fade_rotation_speed); + cls.addFunc("ease_rotation_speed", &CustomParticleSystem::ease_rotation_speed); + cls.addFunc("get_rotation_speed_variation", &CustomParticleSystem::get_rotation_speed_variation); + cls.addFunc("set_rotation_speed_variation", &CustomParticleSystem::set_rotation_speed_variation); + cls.addFunc("fade_rotation_speed_variation", &CustomParticleSystem::fade_rotation_speed_variation); + cls.addFunc("ease_rotation_speed_variation", &CustomParticleSystem::ease_rotation_speed_variation); + cls.addFunc("get_rotation_acceleration", &CustomParticleSystem::get_rotation_acceleration); + cls.addFunc("set_rotation_acceleration", &CustomParticleSystem::set_rotation_acceleration); + cls.addFunc("fade_rotation_acceleration", &CustomParticleSystem::fade_rotation_acceleration); + cls.addFunc("ease_rotation_acceleration", &CustomParticleSystem::ease_rotation_acceleration); + cls.addFunc("get_rotation_decceleration", &CustomParticleSystem::get_rotation_decceleration); + cls.addFunc("set_rotation_decceleration", &CustomParticleSystem::set_rotation_decceleration); + cls.addFunc("fade_rotation_decceleration", &CustomParticleSystem::fade_rotation_decceleration); + cls.addFunc("ease_rotation_decceleration", &CustomParticleSystem::ease_rotation_decceleration); + + cls.addVar("max_amount", &CustomParticleSystem::m_max_amount); + cls.addVar("cover_screen", &CustomParticleSystem::m_cover_screen); + cls.addVar("delay", &CustomParticleSystem::m_delay); + cls.addVar("particle_lifetime", &CustomParticleSystem::m_particle_lifetime); + cls.addVar("particle_lifetime_variation", &CustomParticleSystem::m_particle_lifetime_variation); + cls.addVar("particle_birth_time", &CustomParticleSystem::m_particle_birth_time); + cls.addVar("particle_birth_time_variation", &CustomParticleSystem::m_particle_birth_time_variation); + cls.addVar("particle_death_time", &CustomParticleSystem::m_particle_death_time); + cls.addVar("particle_death_time_variation", &CustomParticleSystem::m_particle_death_time_variation); + cls.addVar("particle_speed_x", &CustomParticleSystem::m_particle_speed_x); + cls.addVar("particle_speed_y", &CustomParticleSystem::m_particle_speed_y); + cls.addVar("particle_speed_variation_x", &CustomParticleSystem::m_particle_speed_variation_x); + cls.addVar("particle_speed_variation_y", &CustomParticleSystem::m_particle_speed_variation_y); + cls.addVar("particle_acceleration_x", &CustomParticleSystem::m_particle_acceleration_x); + cls.addVar("particle_acceleration_y", &CustomParticleSystem::m_particle_acceleration_y); + cls.addVar("particle_friction_x", &CustomParticleSystem::m_particle_friction_x); + cls.addVar("particle_friction_y", &CustomParticleSystem::m_particle_friction_y); + cls.addVar("particle_feather_factor", &CustomParticleSystem::m_particle_feather_factor); + cls.addVar("particle_rotation", &CustomParticleSystem::m_particle_rotation); + cls.addVar("particle_rotation_variation", &CustomParticleSystem::m_particle_rotation_variation); + cls.addVar("particle_rotation_speed", &CustomParticleSystem::m_particle_rotation_speed); + cls.addVar("particle_rotation_speed_variation", &CustomParticleSystem::m_particle_rotation_speed_variation); + cls.addVar("particle_rotation_acceleration", &CustomParticleSystem::m_particle_rotation_acceleration); + cls.addVar("particle_rotation_decceleration", &CustomParticleSystem::m_particle_rotation_decceleration); +} + /* EOF */ diff --git a/src/object/custom_particle_system.hpp b/src/object/custom_particle_system.hpp index ca2b00dc66d..427970374a6 100644 --- a/src/object/custom_particle_system.hpp +++ b/src/object/custom_particle_system.hpp @@ -17,20 +17,27 @@ #ifndef HEADER_SUPERTUX_OBJECT_CUSTOM_PARTICLE_SYSTEM_HPP #define HEADER_SUPERTUX_OBJECT_CUSTOM_PARTICLE_SYSTEM_HPP +#include "object/particlesystem_interactive.hpp" + #include "math/easing.hpp" #include "math/vector.hpp" -#include "object/particlesystem_interactive.hpp" #include "object/particle_zone.hpp" -#include "scripting/custom_particles.hpp" #include "video/surface.hpp" #include "video/surface_ptr.hpp" -class CustomParticleSystem : - public ParticleSystem_Interactive, - public ExposedObject +/** + * @scripting + * @summary A ""CustomParticleSystem"" that was given a name can be controlled by scripts. + * @instances A ""CustomParticleSystem"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class CustomParticleSystem : public ParticleSystem_Interactive { friend class ParticleEditor; - friend class scripting::CustomParticles; + +public: + static void register_class(ssq::VM& vm); + public: CustomParticleSystem(); CustomParticleSystem(const ReaderMapping& reader); @@ -43,6 +50,7 @@ class CustomParticleSystem : static std::string class_name() { return "particles-custom"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "CustomParticleSystem"; } static std::string display_name() { return _("Custom Particles"); } virtual std::string get_display_name() const override { return display_name(); } virtual void save(Writer& writer) override; @@ -52,15 +60,8 @@ class CustomParticleSystem : return "images/engine/editor/particle.png"; } - virtual void expose(HSQUIRRELVM vm, SQInteger table_idx) override { - ExposedObject::expose(vm, table_idx); - } - - virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx) override { - ExposedObject::unexpose(vm, table_idx); - } - //void fade_amount(int new_amount, float fade_time); + protected: virtual int collision(Particle* particle, const Vector& movement) override; CollisionHit get_collision(Particle* particle, const Vector& movement); @@ -80,19 +81,661 @@ class CustomParticleSystem : void add_particle(float lifetime, float x, float y); void spawn_particles(float lifetime); - std::vector get_zones(); + std::vector get_zones() const; - float get_abs_x(); - float get_abs_y(); + float get_abs_x() const; + float get_abs_y() const; float texture_sum_odds; float time_last_remaining; public: // Scripting - void clear() { custom_particles.clear(); } void ease_value(float* value, float target, float time, easing func); + /** + * @scripting + * @description Instantly removes all particles of that type on the screen. + */ + void clear(); + + /** + * @scripting + * @description Spawns particles, regardless of whether or not particles are enabled. + * @param int $amount + * @param bool $instantly If ""true"", disregard the delay settings. + */ + void spawn_particles(int amount, bool instantly); + + /** + * @scripting + * @deprecated Use the ""max_amount"" property instead! + */ + int get_max_amount() const; + /** + * @scripting + * @deprecated Use the ""max_amount"" property instead! + * @param int $amount + */ + void set_max_amount(int amount); + + /** + * @scripting + * @description Returns "None", "Fade", "Shrink". + */ + std::string get_birth_mode() const; + /** + * @scripting + * @param string $mode Possible values: "None", "Fade", "Shrink". + */ + void set_birth_mode(const std::string& mode); + + /** + * @scripting + * @description Returns "None", "Fade", "Shrink". + */ + std::string get_death_mode() const; + /** + * @scripting + * @param string $mode Possible values: "None", "Fade", "Shrink". + */ + void set_death_mode(const std::string& mode); + + /** + * @scripting + * @description Returns "Fixed", "Facing", "Wiggling". + */ + std::string get_rotation_mode() const; + /** + * @scripting + * @param string $mode Possible values: "Fixed", "Facing", "Wiggling". + */ + void set_rotation_mode(const std::string& mode); + + /** + * @scripting + * @description Returns "Ignore", "Stick", "StickForever", "BounceHeavy", "BounceLight", "Destroy". + */ + std::string get_collision_mode() const; + /** + * @scripting + * @param string $mode Possible values: "Ignore", "Stick", "StickForever", "BounceHeavy", "BounceLight", "Destroy". + */ + void set_collision_mode(const std::string& mode); + + /** + * @scripting + * @description Returns "Never", "OnlyOnExit", "Always". + */ + std::string get_offscreen_mode() const; + /** + * @scripting + * @param string $mode Possible values: "Never", "OnlyOnExit", "Always". + */ + void set_offscreen_mode(const std::string& mode); + + /** + * @scripting + * @deprecated Use the ""cover_screen"" property instead! + */ + bool get_cover_screen() const; + /** + * @scripting + * @deprecated Use the ""cover_screen"" property instead! + * @param bool $cover + */ + void set_cover_screen(bool cover); + + /** + * @scripting + * @deprecated Use the ""delay"" property instead! + */ + float get_delay() const; + /** + * @scripting + * @deprecated Use the ""delay"" property instead! + * @param float $delay + */ + void set_delay(float delay); + /** + * @scripting + * @param float $delay + * @param float $time + */ + void fade_delay(float delay, float time); + /** + * @scripting + * @param float $delay + * @param float $time + * @param string $easing + */ + void ease_delay(float delay, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_lifetime"" property instead! + */ + float get_lifetime() const; + /** + * @scripting + * @deprecated Use the ""particle_lifetime"" property instead! + * @param float $lifetime + */ + void set_lifetime(float lifetime); + /** + * @scripting + * @param float $lifetime + * @param float $time + */ + void fade_lifetime(float lifetime, float time); + /** + * @scripting + * @param float $lifetime + * @param float $time + * @param string $easing + */ + void ease_lifetime(float lifetime, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_lifetime_variation"" property instead! + */ + float get_lifetime_variation() const; + /** + * @scripting + * @deprecated Use the ""particle_lifetime_variation"" property instead! + * @param float $lifetime_variation + */ + void set_lifetime_variation(float lifetime_variation); + /** + * @scripting + * @param float $lifetime_variation + * @param float $time + */ + void fade_lifetime_variation(float lifetime_variation, float time); + /** + * @scripting + * @param float $lifetime_variation + * @param float $time + * @param string $easing + */ + void ease_lifetime_variation(float lifetime_variation, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_birth_time"" property instead! + */ + float get_birth_time() const; + /** + * @scripting + * @deprecated Use the ""particle_birth_time"" property instead! + * @param float $birth_time + */ + void set_birth_time(float birth_time); + /** + * @scripting + * @param float $birth_time + * @param float $time + */ + void fade_birth_time(float birth_time, float time); + /** + * @scripting + * @param float $birth_time + * @param float $time + * @param string $easing + */ + void ease_birth_time(float birth_time, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_birth_time_variation"" property instead! + */ + float get_birth_time_variation() const; + /** + * @scripting + * @deprecated Use the ""particle_birth_time_variation"" property instead! + * @param float $birth_time_variation + */ + void set_birth_time_variation(float birth_time_variation); + /** + * @scripting + * @param float $birth_time_variation + * @param float $time + */ + void fade_birth_time_variation(float birth_time_variation, float time); + /** + * @scripting + * @param float $birth_time_variation + * @param float $time + * @param string $easing + */ + void ease_birth_time_variation(float birth_time_variation, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_death_time"" property instead! + */ + float get_death_time() const; + /** + * @scripting + * @deprecated Use the ""particle_death_time"" property instead! + * @param float $death_time + */ + void set_death_time(float death_time); + /** + * @scripting + * @param float $death_time + * @param float $time + */ + void fade_death_time(float death_time, float time); + /** + * @scripting + * @param float $death_time + * @param float $time + * @param string $easing + */ + void ease_death_time(float death_time, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_death_time_variation"" property instead! + */ + float get_death_time_variation() const; + /** + * @scripting + * @deprecated Use the ""particle_death_time_variation"" property instead! + * @param float $death_time_variation + */ + void set_death_time_variation(float death_time_variation); + /** + * @scripting + * @param float $death_time_variation + * @param float $time + */ + void fade_death_time_variation(float death_time_variation, float time); + /** + * @scripting + * @param float $death_time_variation + * @param float $time + * @param string $easing + */ + void ease_death_time_variation(float death_time_variation, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_speed_x"" property instead! + */ + float get_speed_x() const; + /** + * @scripting + * @deprecated Use the ""particle_speed_x"" property instead! + * @param float $speed_x + */ + void set_speed_x(float speed_x); + /** + * @scripting + * @param float $speed_x + * @param float $time + */ + void fade_speed_x(float speed_x, float time); + /** + * @scripting + * @param float $speed_x + * @param float $time + * @param string $easing + */ + void ease_speed_x(float speed_x, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_speed_y"" property instead! + */ + float get_speed_y() const; + /** + * @scripting + * @deprecated Use the ""particle_speed_y"" property instead! + * @param float $speed_y + */ + void set_speed_y(float speed_y); + /** + * @scripting + * @param float $speed_y + * @param float $time + */ + void fade_speed_y(float speed_y, float time); + /** + * @scripting + * @param float $speed_y + * @param float $time + * @param string $easing + */ + void ease_speed_y(float speed_y, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_speed_variation_x"" property instead! + */ + float get_speed_variation_x() const; + /** + * @scripting + * @deprecated Use the ""particle_speed_variation_x"" property instead! + * @param float $speed_variation_x + */ + void set_speed_variation_x(float speed_variation_x); + /** + * @scripting + * @param float $speed_variation_x + * @param float $time + */ + void fade_speed_variation_x(float speed_variation_x, float time); + /** + * @scripting + * @param float $speed_variation_x + * @param float $time + * @param string $easing + */ + void ease_speed_variation_x(float speed_variation_x, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_speed_variation_y"" property instead! + */ + float get_speed_variation_y() const; + /** + * @scripting + * @deprecated Use the ""particle_speed_variation_y"" property instead! + * @param float $speed_variation_y + */ + void set_speed_variation_y(float speed_variation_y); + /** + * @scripting + * @param float $speed_variation_y + * @param float $time + */ + void fade_speed_variation_y(float speed_variation_y, float time); + /** + * @scripting + * @param float $speed_variation_y + * @param float $time + * @param string $easing + */ + void ease_speed_variation_y(float speed_variation_y, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_acceleration_x"" property instead! + */ + float get_acceleration_x() const; + /** + * @scripting + * @deprecated Use the ""particle_acceleration_x"" property instead! + * @param float $acceleration_x + */ + void set_acceleration_x(float acceleration_x); + /** + * @scripting + * @param float $acceleration_x + * @param float $time + */ + void fade_acceleration_x(float acceleration_x, float time); + /** + * @scripting + * @param float $acceleration_x + * @param float $time + * @param string $easing + */ + void ease_acceleration_x(float acceleration_x, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_acceleration_y"" property instead! + */ + float get_acceleration_y() const; + /** + * @scripting + * @deprecated Use the ""particle_acceleration_y"" property instead! + * @param float $acceleration_y + */ + void set_acceleration_y(float acceleration_y); + /** + * @scripting + * @param float $acceleration_y + * @param float $time + */ + void fade_acceleration_y(float acceleration_y, float time); + /** + * @scripting + * @param float $acceleration_y + * @param float $time + * @param string $easing + */ + void ease_acceleration_y(float acceleration_y, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_friction_x"" property instead! + */ + float get_friction_x() const; + /** + * @scripting + * @deprecated Use the ""particle_friction_x"" property instead! + * @param float $friction_x + */ + void set_friction_x(float friction_x); + /** + * @scripting + * @param float $friction_x + * @param float $time + */ + void fade_friction_x(float friction_x, float time); + /** + * @scripting + * @param float $friction_x + * @param float $time + * @param string $easing + */ + void ease_friction_x(float friction_x, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_friction_y"" property instead! + */ + float get_friction_y() const; + /** + * @scripting + * @deprecated Use the ""particle_friction_y"" property instead! + * @param float $friction_y + */ + void set_friction_y(float friction_y); + /** + * @scripting + * @param float $friction_y + * @param float $time + */ + void fade_friction_y(float friction_y, float time); + /** + * @scripting + * @param float $friction_y + * @param float $time + * @param string $easing + */ + void ease_friction_y(float friction_y, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_feather_factor"" property instead! + */ + float get_feather_factor() const; + /** + * @scripting + * @deprecated Use the ""particle_feather_factor"" property instead! + * @param float $feather_factor + */ + void set_feather_factor(float feather_factor); + /** + * @scripting + * @param float $feather_factor + * @param float $time + */ + void fade_feather_factor(float feather_factor, float time); + /** + * @scripting + * @param float $feather_factor + * @param float $time + * @param string $easing + */ + void ease_feather_factor(float feather_factor, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_rotation"" property instead! + */ + float get_rotation() const; + /** + * @scripting + * @deprecated Use the ""particle_rotation"" property instead! + * @param float $rotation + */ + void set_rotation(float rotation); + /** + * @scripting + * @param float $rotation + * @param float $time + */ + void fade_rotation(float rotation, float time); + /** + * @scripting + * @param float $rotation + * @param float $time + * @param string $easing + */ + void ease_rotation(float rotation, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_rotation_variation"" property instead! + */ + float get_rotation_variation() const; + /** + * @scripting + * @deprecated Use the ""particle_rotation_variation"" property instead! + * @param float $rotation_variation + */ + void set_rotation_variation(float rotation_variation); + /** + * @scripting + * @param float $rotation_variation + * @param float $time + */ + void fade_rotation_variation(float rotation_variation, float time); + /** + * @scripting + * @param float $rotation_variation + * @param float $time + * @param string $easing + */ + void ease_rotation_variation(float rotation_variation, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_rotation_speed"" property instead! + */ + float get_rotation_speed() const; + /** + * @scripting + * @deprecated Use the ""particle_rotation_speed"" property instead! + * @param float $rotation_speed + */ + void set_rotation_speed(float rotation_speed); + /** + * @scripting + * @param float $rotation_speed + * @param float $time + */ + void fade_rotation_speed(float rotation_speed, float time); + /** + * @scripting + * @param float $rotation_speed + * @param float $time + * @param string $easing + */ + void ease_rotation_speed(float rotation_speed, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_rotation_speed_variation"" property instead! + */ + float get_rotation_speed_variation() const; + /** + * @scripting + * @deprecated Use the ""particle_rotation_speed_variation"" property instead! + * @param float $rotation_speed_variation + */ + void set_rotation_speed_variation(float rotation_speed_variation); + /** + * @scripting + * @param float $rotation_speed_variation + * @param float $time + */ + void fade_rotation_speed_variation(float rotation_speed_variation, float time); + /** + * @scripting + * @param float $rotation_speed_variation + * @param float $time + * @param string $easing + */ + void ease_rotation_speed_variation(float rotation_speed_variation, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_rotation_acceleration"" property instead! + */ + float get_rotation_acceleration() const; + /** + * @scripting + * @deprecated Use the ""particle_rotation_acceleration"" property instead! + * @param float $rotation_acceleration + */ + void set_rotation_acceleration(float rotation_acceleration); + /** + * @scripting + * @param float $rotation_acceleration + * @param float $time + */ + void fade_rotation_acceleration(float rotation_acceleration, float time); + /** + * @scripting + * @param float $rotation_acceleration + * @param float $time + * @param string $easing + */ + void ease_rotation_acceleration(float rotation_acceleration, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""particle_rotation_decceleration"" property instead! + */ + float get_rotation_decceleration() const; + /** + * @scripting + * @deprecated Use the ""particle_rotation_decceleration"" property instead! + * @param float $rotation_decceleration + */ + void set_rotation_decceleration(float rotation_decceleration); + /** + * @scripting + * @param float $rotation_decceleration + * @param float $time + */ + void fade_rotation_decceleration(float rotation_decceleration, float time); + /** + * @scripting + * @param float $rotation_decceleration + * @param float $time + * @param string $easing + */ + void ease_rotation_decceleration(float rotation_decceleration, float time, const std::string& easing); + private: std::vector script_easings; @@ -179,7 +822,7 @@ class CustomParticleSystem : } }; - SpriteProperties get_random_texture(); + SpriteProperties get_random_texture() const; class CustomParticle : public Particle { @@ -241,36 +884,113 @@ class CustomParticleSystem : std::vector > custom_particles; std::string m_particle_main_texture; + + /** + * @scripting + */ int m_max_amount; + /** + * @scripting + */ float m_delay; + /** + * @scripting + */ float m_particle_lifetime; + /** + * @scripting + */ float m_particle_lifetime_variation; - float m_particle_birth_time, - m_particle_birth_time_variation, - m_particle_death_time, - m_particle_death_time_variation; + /** + * @scripting + */ + float m_particle_birth_time; + /** + * @scripting + */ + float m_particle_birth_time_variation; + /** + * @scripting + */ + float m_particle_death_time; + /** + * @scripting + */ + float m_particle_death_time_variation; + FadeMode m_particle_birth_mode, m_particle_death_mode; EasingMode m_particle_birth_easing, m_particle_death_easing; - float m_particle_speed_x, - m_particle_speed_y, - m_particle_speed_variation_x, - m_particle_speed_variation_y, - m_particle_acceleration_x, - m_particle_acceleration_y, - m_particle_friction_x, - m_particle_friction_y; + + /** + * @scripting + */ + float m_particle_speed_x; + /** + * @scripting + */ + float m_particle_speed_y; + /** + * @scripting + */ + float m_particle_speed_variation_x; + /** + * @scripting + */ + float m_particle_speed_variation_y; + /** + * @scripting + */ + float m_particle_acceleration_x; + /** + * @scripting + */ + float m_particle_acceleration_y; + /** + * @scripting + */ + float m_particle_friction_x; + /** + * @scripting + */ + float m_particle_friction_y; + /** + * @scripting + */ float m_particle_feather_factor; - float m_particle_rotation, - m_particle_rotation_variation, - m_particle_rotation_speed, - m_particle_rotation_speed_variation, - m_particle_rotation_acceleration, - m_particle_rotation_decceleration; + /** + * @scripting + */ + float m_particle_rotation; + /** + * @scripting + */ + float m_particle_rotation_variation; + /** + * @scripting + */ + float m_particle_rotation_speed; + /** + * @scripting + */ + float m_particle_rotation_speed_variation; + /** + * @scripting + */ + float m_particle_rotation_acceleration; + /** + * @scripting + */ + float m_particle_rotation_decceleration; + RotationMode m_particle_rotation_mode; CollisionMode m_particle_collision_mode; OffscreenMode m_particle_offscreen_mode; + + /** + * @scripting + */ bool m_cover_screen; public: diff --git a/src/object/custom_particle_system_file.hpp b/src/object/custom_particle_system_file.hpp index 5dc1b30c4c3..b37a4c4cded 100644 --- a/src/object/custom_particle_system_file.hpp +++ b/src/object/custom_particle_system_file.hpp @@ -22,14 +22,13 @@ #include "object/custom_particle_system.hpp" #include "object/particlesystem_interactive.hpp" #include "object/particle_zone.hpp" -#include "scripting/custom_particles.hpp" #include "video/surface.hpp" #include "video/surface_ptr.hpp" -class CustomParticleSystemFile final : - public CustomParticleSystem +class CustomParticleSystemFile final : public CustomParticleSystem { friend class ParticleEditor; + public: CustomParticleSystemFile(); CustomParticleSystemFile(const ReaderMapping& reader); diff --git a/src/object/decal.cpp b/src/object/decal.cpp index 13cb8a71cf0..ba8f4b73f0e 100644 --- a/src/object/decal.cpp +++ b/src/object/decal.cpp @@ -15,7 +15,10 @@ // along with this program. If not, see . #include "object/decal.hpp" -#include "scripting/decal.hpp" + +#include +#include + #include "supertux/flip_level_transformer.hpp" #include "sprite/sprite_manager.hpp" #include "util/reader.hpp" @@ -23,7 +26,6 @@ Decal::Decal(const ReaderMapping& reader) : MovingSprite(reader, "images/decal/explanations/billboard-bigtux.png", LAYER_OBJECTS, COLGROUP_DISABLED), - ExposedObject(this), m_default_action("default"), m_solid(), m_fade_sprite(m_sprite.get()->clone()), @@ -142,4 +144,16 @@ Decal::update(float) } } + +void +Decal::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("Decal", vm.findClass("MovingSprite")); + + cls.addFunc("fade_sprite", &Decal::fade_sprite); + cls.addFunc("change_sprite", &MovingSprite::change_sprite); // Deprecated; for compatibility + cls.addFunc("fade_in", &Decal::fade_in); + cls.addFunc("fade_out", &Decal::fade_out); +} + /* EOF */ diff --git a/src/object/decal.hpp b/src/object/decal.hpp index 0d2008664a4..c8913305bad 100644 --- a/src/object/decal.hpp +++ b/src/object/decal.hpp @@ -18,18 +18,25 @@ #define HEADER_SUPERTUX_OBJECT_DECAL_HPP #include "object/moving_sprite.hpp" -#include "scripting/decal.hpp" -#include "squirrel/exposed_object.hpp" #include "supertux/timer.hpp" class ReaderMapping; -/** A decorative image, perhaps part of the terrain */ -class Decal final : public MovingSprite, - public ExposedObject +/** + * A decorative image, perhaps part of the terrain. + + * @scripting + * @summary A ""Decal"" that was given a name can be controlled by scripts. + * @instances A ""Decal"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class Decal final : public MovingSprite { friend class FlipLevelTransformer; +public: + static void register_class(ssq::VM& vm); + public: Decal(const ReaderMapping& reader); ~Decal() override; @@ -38,6 +45,7 @@ class Decal final : public MovingSprite, static std::string class_name() { return "decal"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "Decal"; } static std::string display_name() { return _("Decal"); } virtual std::string get_display_name() const override { return display_name(); } @@ -48,9 +56,34 @@ class Decal final : public MovingSprite, virtual void on_flip(float height) override; - void fade_in(float fade_time); - void fade_out(float fade_time); - void fade_sprite(const std::string& new_sprite, float fade_time); + /** + * @scripting + * @description Fades the decal sprite to a new one in ""time"" seconds. + * @param string $sprite + * @param float $time + */ + void fade_sprite(const std::string& sprite, float time); +#ifdef DOXYGEN_SCRIPTING + /** + * @scripting + * @deprecated Use ""set_sprite()"" instead! + * @description Changes the decal sprite. + * @param string $sprite + */ + void change_sprite(const std::string& sprite); +#endif + /** + * @scripting + * @description Fades in the decal in ""time"" seconds. + * @param float $time + */ + void fade_in(float time); + /** + * @scripting + * @description Fades out the decal in ""time"" seconds. + * @param float $time + */ + void fade_out(float time); void set_visible(bool v) { m_visible = v; } bool is_visible() const { return m_visible; } diff --git a/src/object/display_effect.cpp b/src/object/display_effect.cpp index 6813628530a..5981d7f0e85 100644 --- a/src/object/display_effect.cpp +++ b/src/object/display_effect.cpp @@ -16,6 +16,9 @@ #include "object/display_effect.hpp" +#include +#include + #include "supertux/globals.hpp" #include "video/drawing_context.hpp" @@ -23,7 +26,6 @@ static const float BORDER_SIZE = 75; DisplayEffect::DisplayEffect(const std::string& name) : GameObject(name), - ExposedObject(this), screen_fade(FadeType::NO_FADE), screen_fadetime(0), screen_fading(0), @@ -190,4 +192,18 @@ DisplayEffect::four_to_three(float fadetime) } } + +void +DisplayEffect::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("DisplayEffect", vm.findClass("GameObject")); + + cls.addFunc("fade_out", &DisplayEffect::fade_out); + cls.addFunc("fade_in", &DisplayEffect::fade_in); + cls.addFunc("set_black", &DisplayEffect::set_black); + cls.addFunc("is_black", &DisplayEffect::is_black); + cls.addFunc("sixteen_to_nine", &DisplayEffect::sixteen_to_nine); + cls.addFunc("four_to_three", &DisplayEffect::four_to_three); +} + /* EOF */ diff --git a/src/object/display_effect.hpp b/src/object/display_effect.hpp index f400dad722c..33ef9533565 100644 --- a/src/object/display_effect.hpp +++ b/src/object/display_effect.hpp @@ -18,12 +18,19 @@ #define HEADER_SUPERTUX_OBJECT_DISPLAY_EFFECT_HPP #include "supertux/game_object.hpp" -#include "scripting/display_effect.hpp" -#include "squirrel/exposed_object.hpp" -class DisplayEffect final : public GameObject, - public ExposedObject +/** + * @scripting + * @summary ""DisplayEffect"" is an interface for toying with the display. + * @instances SuperTux creates an instance named ""Effect"" when starting the scripting engine. + Its usage is preferred – creating another instance might have unexpected side effects and is strongly discouraged. + (Use ""sector.Effect"" in the console.) + */ +class DisplayEffect final : public GameObject { +public: + static void register_class(ssq::VM& vm); + public: DisplayEffect(const std::string& name = ""); ~DisplayEffect() override; @@ -32,16 +39,49 @@ class DisplayEffect final : public GameObject, virtual void draw(DrawingContext& context) override; virtual bool is_singleton() const override { return true; } virtual bool is_saveable() const override { return false; } + virtual std::string get_exposed_class_name() const override { return "DisplayEffect"; } /** @name Scriptable Methods @{ */ - void fade_out(float fadetime); - void fade_in(float fadetime); - void set_black(bool enabled); + /** + * @scripting + * @description Gradually fades out the screen to black for the next ""time"" seconds. + * @param float $time + */ + void fade_out(float time); + /** + * @scripting + * @description Gradually fades in the screen from black for the next ""time"" seconds. + * @param float $time + */ + void fade_in(float time); + /** + * @scripting + * @description Blackens or un-blackens the screen (depending on the value of ""black""). + * @param bool $black + */ + void set_black(bool black); + /** + * @scripting + * @description Returns ""true"" if the screen has been blackened by ""set_black"". + Note: Calling ""fade_in"" or ""fade_out"" resets the return value to ""false"". + */ bool is_black() const; - void sixteen_to_nine(float fadetime); - void four_to_three(float fadetime); + /** + * @scripting + * @description Sets the display ratio to 16:9, effectively adding black bars at the top and bottom of the screen. + Should be used before cutscenes. Gradually fades to this state for the next ""time"" seconds. + * @param float $time + */ + void sixteen_to_nine(float time); + /** + * @scripting + * @description Sets the display ratio to 4:3, removing the black bars added by ""sixteen_to_nine()"". + Should be used after cutscenes. Gradually fades to this state for the next ""time"" seconds. + * @param float $time + */ + void four_to_three(float time); /** @} */ diff --git a/src/object/floating_image.cpp b/src/object/floating_image.cpp index 64963c6a9a8..cebabe5df58 100644 --- a/src/object/floating_image.cpp +++ b/src/object/floating_image.cpp @@ -16,18 +16,22 @@ #include "object/floating_image.hpp" +#include +#include + #include "sprite/sprite.hpp" #include "sprite/sprite_manager.hpp" #include "supertux/globals.hpp" +#include "supertux/sector.hpp" FloatingImage::FloatingImage(const std::string& spritefile) : - sprite(SpriteManager::current()->create(spritefile)), - layer(LAYER_FOREGROUND1 + 1), - visible(false), - anchor(ANCHOR_MIDDLE), - pos(0.0f, 0.0f), - fading(0), - fadetime(0) + m_sprite(SpriteManager::current()->create(spritefile)), + m_layer(LAYER_FOREGROUND1 + 1), + m_visible(false), + m_anchor(ANCHOR_MIDDLE), + m_pos(0.0f, 0.0f), + m_fading(0), + m_fadetime(0) { } @@ -38,45 +42,104 @@ FloatingImage::~FloatingImage() void FloatingImage::update(float dt_sec) { - if (fading > 0) { - fading -= dt_sec; - if (fading <= 0) { - fading = 0; - visible = true; + if (m_fading > 0) + { + m_fading -= dt_sec; + if (m_fading <= 0) + { + m_fading = 0; + m_visible = true; } - } else if (fading < 0) { - fading += dt_sec; - if (fading >= 0) { - fading = 0; - visible = false; + } + else if (m_fading < 0) + { + m_fading += dt_sec; + if (m_fading >= 0) + { + m_fading = 0; + m_visible = false; } } } +void +FloatingImage::set_layer(int layer) +{ + m_layer = layer; +} + +int +FloatingImage::get_layer() const +{ + return m_layer; +} + +void +FloatingImage::set_pos(float x, float y) +{ + m_pos = Vector(x, y); +} + +float +FloatingImage::get_x() const +{ + return m_pos.x; +} + +float +FloatingImage::get_y() const +{ + return m_pos.y; +} + +void +FloatingImage::set_anchor_point(int anchor) +{ + m_anchor = static_cast(anchor); +} + +int +FloatingImage::get_anchor_point() const +{ + return static_cast(m_anchor); +} + +bool +FloatingImage::get_visible() const +{ + return m_visible; +} + +void +FloatingImage::set_visible(bool visible) +{ + m_visible = visible; +} + void FloatingImage::set_action(const std::string& action) { - sprite->set_action(action); + m_sprite->set_action(action); } std::string -FloatingImage::get_action() +FloatingImage::get_action() const { - return sprite->get_action(); + return m_sprite->get_action(); } void -FloatingImage::fade_in(float fadetime_) +FloatingImage::fade_in(float time) { - fadetime = fadetime_; - fading = fadetime_; + m_fadetime = time; + m_fading = time; } void -FloatingImage::fade_out(float fadetime_) +FloatingImage::fade_out(float time) { - fadetime = fadetime_; - fading = -fadetime_; + m_fadetime = time; + m_fading = -time; } void @@ -85,23 +148,57 @@ FloatingImage::draw(DrawingContext& context) context.push_transform(); context.set_translation(Vector(0, 0)); - if (fading > 0) { - context.set_alpha((fadetime-fading) / fadetime); - } else if (fading < 0) { - context.set_alpha(-fading / fadetime); - } else if (!visible) { + if (m_fading > 0) + context.set_alpha((m_fadetime - m_fading) / m_fadetime); + else if (m_fading < 0) + context.set_alpha(-m_fading / m_fadetime); + else if (!m_visible) + { context.pop_transform(); return; } - Vector spos = pos + get_anchor_pos(context.get_rect(), - static_cast(sprite->get_width()), - static_cast(sprite->get_height()), - anchor); - - sprite->draw(context.color(), spos, layer); + const Vector spos = m_pos + get_anchor_pos(context.get_rect(), + static_cast(m_sprite->get_width()), + static_cast(m_sprite->get_height()), + m_anchor); + m_sprite->draw(context.color(), spos, m_layer); context.pop_transform(); } + +void +FloatingImage::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addClass("FloatingImage", [](const std::string& spritefile) + { + if (!Sector::current()) + throw std::runtime_error("Tried to create 'FloatingImage' without an active sector."); + + return &Sector::get().add(spritefile); + }, + false /* Do not free pointer from Squirrel */, + vm.findClass("GameObject")); + + cls.addFunc("set_layer", &FloatingImage::set_layer); + cls.addFunc("get_layer", &FloatingImage::get_layer); + cls.addFunc("set_pos", &FloatingImage::set_pos); + cls.addFunc("get_x", &FloatingImage::get_x); + cls.addFunc("get_y", &FloatingImage::get_y); + cls.addFunc("get_pos_x", &FloatingImage::get_x); // Deprecated + cls.addFunc("get_pos_y", &FloatingImage::get_y); // Deprecated + cls.addFunc("set_anchor_point", &FloatingImage::set_anchor_point); + cls.addFunc("get_anchor_point", &FloatingImage::get_anchor_point); + cls.addFunc("set_visible", &FloatingImage::set_visible); + cls.addFunc("get_visible", &FloatingImage::get_visible); + cls.addFunc("set_action", &FloatingImage::set_action); + cls.addFunc("get_action", &FloatingImage::get_action); + cls.addFunc("fade_in", &FloatingImage::fade_in); + cls.addFunc("fade_out", &FloatingImage::fade_out); + + cls.addVar("layer", &FloatingImage::m_layer); + cls.addVar("visible", &FloatingImage::m_visible); +} + /* EOF */ diff --git a/src/object/floating_image.hpp b/src/object/floating_image.hpp index d34ebdf94b6..59774cdc45d 100644 --- a/src/object/floating_image.hpp +++ b/src/object/floating_image.hpp @@ -21,61 +21,139 @@ #include "sprite/sprite_ptr.hpp" #include "supertux/game_object.hpp" +/** + * @scripting + * @summary This class provides the ability to create, edit, and remove images floating in midair on the screen. + It is implemented as a wrapper around a sprite, so any sprite actions are applicable. + * @instances Floating Images are created in a script or from the console. Constructor:${SRG_NEWPARAGRAPH} + """""" <- FloatingImage(string filename)""""""${SRG_NEWPARAGRAPH} + This creates a ""FloatingImage"" from ""filename"" (which is relative to the data directory root). + */ class FloatingImage final : public GameObject { +public: + static void register_class(ssq::VM& vm); + public: FloatingImage(const std::string& sprite); ~FloatingImage() override; - virtual bool is_saveable() const override { - return false; - } - - void set_layer(int layer_) { - layer = layer_; - } - - int get_layer() const { - return layer; - } - - void set_pos(const Vector& pos_) { - pos = pos_; - } - const Vector& get_pos() const { - return pos; - } - - void set_anchor_point(AnchorPoint anchor_) { - anchor = anchor_; - } - AnchorPoint get_anchor_point() const { - return anchor; - } - void set_visible(bool visible_) { - visible = visible_; - } - bool get_visible() const { - return visible; - } - - void set_action(const std::string& action); - std::string get_action(); - - void fade_in(float fadetime); - void fade_out(float fadetime); + virtual bool is_saveable() const override { return false; } + virtual std::string get_exposed_class_name() const override { return "FloatingImage"; } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; + /** + * @scripting + * @deprecated Use the ""layer"" property instead! + * @description Sets the layer of the floating image. + * @param int $layer + */ + void set_layer(int layer); + /** + * @scripting + * @deprecated Use the ""layer"" property instead! + * @description Returns the layer the floating image is on. + */ + int get_layer() const; + /** + * @scripting + * @description Sets the location of the image in relation to the current anchor point. + * @param float $x + * @param float $y + */ + void set_pos(float x, float y); + /** + * @scripting + * @description Returns the image's X coordinate relative to the current anchor point. + */ + float get_x() const; + /** + * @scripting + * @description Returns the image's Y coordinate relative to the current anchor point. + */ + float get_y() const; +#ifdef DOXYGEN_SCRIPTING + /** + * @scripting + * @deprecated Use ""get_x()"" instead! + * @description Returns the image's X coordinate relative to the current anchor point. + */ + float get_pos_x() const; + /** + * @scripting + * @deprecated Use ""get_y()"" instead! + * @description Returns the image's Y coordinate relative to the current anchor point. + */ + float get_pos_y() const; +#endif + /** + * @scripting + * @description Sets the image's anchor point. + * @param int $anchor Anchor point as represented by the ""ANCHOR_*"" constants (see ${SRG_REF_AnchorPoints}). + */ + void set_anchor_point(int anchor); + /** + * @scripting + * @description Returns the current anchor point. + */ + int get_anchor_point() const; + /** + * @scripting + * @deprecated Use the ""visible"" property instead! + * @description Sets the visibility of the floating image. + * @param bool $visible + */ + void set_visible(bool visible); + /** + * @scripting + * @deprecated Use the ""visible"" property instead! + * @description Returns the visibility state of the floating image. + */ + bool get_visible() const; + /** + * @scripting + * @description Sets the action of the image. + * This is only useful when the image is a sprite. + * @param string $action Name of the action, as defined in the sprite. + */ + void set_action(const std::string& action); + /** + * @scripting + * @description Returns the name of the action of the image, as defined in the sprite. + * This is only useful when the image is a sprite. + */ + std::string get_action() const; + /** + * @scripting + * @description Fades in the image for the next ""time"" seconds. + * @param float $time + */ + void fade_in(float time); + /** + * @scripting + * @description Fades out the image for the next ""time"" seconds. + * @param float $time + */ + void fade_out(float time); + private: - SpritePtr sprite; - int layer; - bool visible; - AnchorPoint anchor; - Vector pos; - float fading; - float fadetime; + SpritePtr m_sprite; + /** + * @scripting + * The layer the floating image is on. + */ + int m_layer; + /** + * @scripting + * Determines whether the floating image is visible. + */ + bool m_visible; + AnchorPoint m_anchor; + Vector m_pos; + float m_fading; + float m_fadetime; }; #endif diff --git a/src/object/gradient.cpp b/src/object/gradient.cpp index ab130838a2e..e65e3774d01 100644 --- a/src/object/gradient.cpp +++ b/src/object/gradient.cpp @@ -14,9 +14,12 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +#include "object/gradient.hpp" + #include -#include "object/gradient.hpp" +#include +#include #include "editor/editor.hpp" #include "object/camera.hpp" @@ -30,7 +33,6 @@ #include "video/viewport.hpp" Gradient::Gradient() : - ExposedObject(this), m_layer(LAYER_BACKGROUND0), m_gradient_top(), m_gradient_bottom(), @@ -48,7 +50,6 @@ Gradient::Gradient() : Gradient::Gradient(const ReaderMapping& reader) : GameObject(reader), - ExposedObject(this), m_layer(LAYER_BACKGROUND0), m_gradient_top(), m_gradient_bottom(), @@ -241,6 +242,48 @@ Gradient::set_direction(const std::string& direction) } } +void +Gradient::set_color1(float red, float green, float blue) +{ + set_gradient(Color(red, green, blue), m_gradient_bottom); +} + +void +Gradient::set_color2(float red, float green, float blue) +{ + set_gradient(m_gradient_top, Color(red, green, blue)); +} + +void +Gradient::set_colors(float red1, float green1, float blue1, float red2, float green2, float blue2) +{ + set_gradient(Color(red1, green1, blue1), Color(red2, green2, blue2)); +} + +void +Gradient::fade_color1(float red, float green, float blue, float time) +{ + fade_gradient(Color(red, green, blue), m_gradient_bottom, time); +} + +void +Gradient::fade_color2(float red, float green, float blue, float time) +{ + fade_gradient(m_gradient_top, Color(red, green, blue), time); +} + +void +Gradient::fade_colors(float red1, float green1, float blue1, float red2, float green2, float blue2, float time) +{ + fade_gradient(Color(red1, green1, blue1), Color(red2, green2, blue2), time); +} + +void +Gradient::swap_colors() +{ + set_gradient(m_gradient_bottom, m_gradient_top); +} + void Gradient::draw(DrawingContext& context) { @@ -283,4 +326,21 @@ Gradient::on_flip(float height) std::swap(m_gradient_top, m_gradient_bottom); } + +void +Gradient::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("Gradient", vm.findClass("GameObject")); + + cls.addFunc("set_direction", &Gradient::set_direction); + cls.addFunc("get_direction", &Gradient::get_direction_string); + cls.addFunc("set_color1", &Gradient::set_color1); + cls.addFunc("set_color2", &Gradient::set_color2); + cls.addFunc("set_colors", &Gradient::set_colors); + cls.addFunc("fade_color1", &Gradient::fade_color1); + cls.addFunc("fade_color2", &Gradient::fade_color2); + cls.addFunc("fade_colors", &Gradient::fade_colors); + cls.addFunc("swap_colors", &Gradient::swap_colors); +} + /* EOF */ diff --git a/src/object/gradient.hpp b/src/object/gradient.hpp index bb654963dc6..0c57c2a5e95 100644 --- a/src/object/gradient.hpp +++ b/src/object/gradient.hpp @@ -17,17 +17,22 @@ #ifndef HEADER_SUPERTUX_OBJECT_GRADIENT_HPP #define HEADER_SUPERTUX_OBJECT_GRADIENT_HPP -#include "scripting/gradient.hpp" -#include "squirrel/exposed_object.hpp" #include "supertux/game_object.hpp" #include "video/drawing_context.hpp" class ReaderMapping; -class Gradient final : - public GameObject, - public ExposedObject +/** + * @scripting + * @summary A ""Gradient"" that was given a name can be controlled by scripts. + * @instances A ""Gradient"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class Gradient final : public GameObject { +public: + static void register_class(ssq::VM& vm); + public: Gradient(); Gradient(const ReaderMapping& reader); @@ -40,6 +45,7 @@ class Gradient final : static std::string class_name() { return "gradient"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "Gradient"; } static std::string display_name() { return _("Gradient"); } virtual std::string get_display_name() const override { return display_name(); } @@ -59,11 +65,87 @@ class Gradient final : GradientDirection get_direction() const { return m_gradient_direction; } std::string get_direction_string() const; void set_direction(const GradientDirection& direction); - void set_direction(const std::string& direction); void set_layer(int layer) { m_layer = layer; } int get_layer() const { return m_layer; } + /** + * @scripting + * @description Sets the direction of the gradient. + * @param string $direction Can be "horizontal", "vertical", "horizontal_sector" or "vertical_sector". + */ + void set_direction(const std::string& direction); +#ifdef DOXYGEN_SCRIPTING + /** + * @scripting + * @description Returns the direction of the gradient. + Possible values are "horizontal", "vertical", "horizontal_sector" or "vertical_sector". + */ + std::string get_direction() const; +#endif + /** + * @scripting + * @description Set top gradient color. + * @param float $red + * @param float $green + * @param float $blue + */ + void set_color1(float red, float green, float blue); + /** + * @scripting + * @description Set bottom gradient color. + * @param float $red + * @param float $green + * @param float $blue + */ + void set_color2(float red, float green, float blue); + /** + * @scripting + * @description Set both gradient colors. + * @param float $red1 + * @param float $green1 + * @param float $blue1 + * @param float $red2 + * @param float $green2 + * @param float $blue2 + */ + void set_colors(float red1, float green1, float blue1, float red2, float green2, float blue2); + /** + * @scripting + * @description Fade the top gradient color to a specified new color in ""time"" seconds. + * @param float $red + * @param float $green + * @param float $blue + * @param float $time + */ + void fade_color1(float red, float green, float blue, float time); + /** + * @scripting + * @description Fade the bottom gradient color to a specified new color in ""time"" seconds. + * @param float $red + * @param float $green + * @param float $blue + * @param float $time + */ + void fade_color2(float red, float green, float blue, float time); + /** + * @scripting + * @description Fade both gradient colors to specified new colors in ""time"" seconds. + * @param float $red1 + * @param float $green1 + * @param float $blue1 + * @param float $red2 + * @param float $green2 + * @param float $blue2 + * @param float $time + */ + void fade_colors(float red1, float green1, float blue1, float red2, float green2, float blue2, float time); + /** + * @scripting + * @description Swap top and bottom gradient colors. + */ + void swap_colors(); + private: int m_layer; Color m_gradient_top; @@ -72,16 +154,16 @@ class Gradient final : Blend m_blend; DrawingTarget m_target; -private: - Gradient(const Gradient&) = delete; - Gradient& operator=(const Gradient&) = delete; - Color m_start_gradient_top; Color m_start_gradient_bottom; Color m_fade_gradient_top; Color m_fade_gradient_bottom; float m_fade_total_time; - float m_fade_time = 0; + float m_fade_time; + +private: + Gradient(const Gradient&) = delete; + Gradient& operator=(const Gradient&) = delete; }; #endif diff --git a/src/object/level_time.cpp b/src/object/level_time.cpp index a6cb0fb296d..e8857ce4ab6 100644 --- a/src/object/level_time.cpp +++ b/src/object/level_time.cpp @@ -18,6 +18,9 @@ #include +#include +#include + #include "editor/editor.hpp" #include "object/player.hpp" #include "supertux/game_session.hpp" @@ -32,7 +35,6 @@ static const float TIME_WARNING = 20; LevelTime::LevelTime(const ReaderMapping& reader) : GameObject(reader), - ExposedObject(this), time_surface(Surface::from_file("images/engine/hud/time-0.png")), running(!Editor::is_active()), time_left() @@ -154,4 +156,16 @@ LevelTime::set_time(float time_left_) time_left = std::min(std::max(time_left_, 0.0f), 999.0f); } + +void +LevelTime::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("LevelTime", vm.findClass("GameObject")); + + cls.addFunc("start", &LevelTime::start); + cls.addFunc("stop", &LevelTime::stop); + cls.addFunc("get_time", &LevelTime::get_time); + cls.addFunc("set_time", &LevelTime::set_time); +} + /* EOF */ diff --git a/src/object/level_time.hpp b/src/object/level_time.hpp index 8df1d5b434b..ee752a1a8a6 100644 --- a/src/object/level_time.hpp +++ b/src/object/level_time.hpp @@ -17,18 +17,25 @@ #ifndef HEADER_SUPERTUX_OBJECT_LEVEL_TIME_HPP #define HEADER_SUPERTUX_OBJECT_LEVEL_TIME_HPP -#include "squirrel/exposed_object.hpp" -#include "scripting/level_time.hpp" #include "supertux/game_object.hpp" #include "video/color.hpp" #include "video/surface_ptr.hpp" class ReaderMapping; -class LevelTime final : public GameObject, - public ExposedObject +/** + * @scripting + * @summary A ""LevelTime"" that was given a name can be controlled by scripts. + * @instances A ""LevelTime"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class LevelTime final : public GameObject { static Color text_color; + +public: + static void register_class(ssq::VM& vm); + public: LevelTime(const ReaderMapping& reader); @@ -38,21 +45,33 @@ class LevelTime final : public GameObject, /** @name Scriptable Methods @{ */ - /** Resumes the countdown */ + /** + * @scripting + * @description Resumes the countdown (assuming it isn't already started, in which case it does nothing). + */ void start(); - - /** Pauses the countdown */ + /** + * @scripting + * @description Pauses the countdown (assuming it isn't already stopped, in which case it does nothing). + */ void stop(); - - /** Returns the number of seconds left on the clock */ + /** + * @scripting + * @description Returns the number of seconds left on the clock. + */ float get_time() const; - - /** Changes the number of seconds left on the clock */ + /** + * @scripting + * @description Sets the number of seconds left on the clock. + * @param float $time_left + */ void set_time(float time_left); /** @} */ + static std::string class_name() { return "leveltime"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "LevelTime"; } static std::string display_name() { return _("Time Limit"); } virtual std::string get_display_name() const override { return display_name(); } diff --git a/src/object/lit_object.cpp b/src/object/lit_object.cpp index 03390a03fec..1e04e8ed189 100644 --- a/src/object/lit_object.cpp +++ b/src/object/lit_object.cpp @@ -16,6 +16,9 @@ #include "object/lit_object.hpp" +#include +#include + #include "sprite/sprite.hpp" #include "sprite/sprite_manager.hpp" #include "supertux/flip_level_transformer.hpp" @@ -23,7 +26,6 @@ LitObject::LitObject(const ReaderMapping& reader) : MovingSprite(reader, "images/objects/lightflower/lightflower1.sprite"), - ExposedObject(this), m_light_offset(-6.f, -17.f), m_light_sprite_name("images/objects/lightflower/light/glow_light.sprite"), m_sprite_action("default"), @@ -96,13 +98,7 @@ LitObject::on_flip(float height) FlipLevelTransformer::transform_flip(m_flip); } -const std::string& -LitObject::get_action() const -{ - return m_sprite->get_action(); -} - -const std::string& +std::string LitObject::get_light_action() const { return m_light_sprite->get_action(); @@ -114,4 +110,14 @@ LitObject::set_light_action(const std::string& action) m_light_sprite->set_action(action); } + +void +LitObject::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("LitObject", vm.findClass("MovingSprite")); + + cls.addFunc("get_light_action", &LitObject::get_light_action); + cls.addFunc("set_light_action", &LitObject::set_light_action); +} + /* EOF */ diff --git a/src/object/lit_object.hpp b/src/object/lit_object.hpp index b44baf1b18c..4c326d38d9c 100644 --- a/src/object/lit_object.hpp +++ b/src/object/lit_object.hpp @@ -18,15 +18,20 @@ #define HEADER_SUPERTUX_OBJECT_LIT_OBJECT_HPP #include "object/moving_sprite.hpp" -#include "squirrel/exposed_object.hpp" - -#include "scripting/lit_object.hpp" class ReaderMapping; -class LitObject final : public MovingSprite, - public ExposedObject +/** + * @scripting + * @summary A ""LitObject"" that was given a name can be controlled by scripts. + * @instances A ""LitObject"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class LitObject final : public MovingSprite { +public: + static void register_class(ssq::VM& vm); + public: LitObject(const ReaderMapping& reader); @@ -37,6 +42,7 @@ class LitObject final : public MovingSprite, static std::string class_name() { return "lit-object"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "LitObject"; } static std::string display_name() { return _("Lit object"); } virtual std::string get_display_name() const override { return display_name(); } @@ -47,8 +53,16 @@ class LitObject final : public MovingSprite, virtual void on_flip(float height) override; - const std::string& get_action() const; - const std::string& get_light_action() const; + /** + * @scripting + * @description Returns the current light sprite action. + */ + std::string get_light_action() const; + /** + * @scripting + * @description Sets the light sprite action. + * @param string $action + */ void set_light_action(const std::string& action); private: diff --git a/src/object/moving_sprite.cpp b/src/object/moving_sprite.cpp index 968bedffb3e..ac3e75c3400 100644 --- a/src/object/moving_sprite.cpp +++ b/src/object/moving_sprite.cpp @@ -18,6 +18,9 @@ #include +#include +#include + #include "editor/editor.hpp" #include "math/random.hpp" #include "math/util.hpp" @@ -120,6 +123,12 @@ MovingSprite::matches_sprite(const std::string& sprite_file) const return m_sprite_name == sprite_file || m_sprite_name == "/" + sprite_file; } +std::string +MovingSprite::get_action() const +{ + return m_sprite->get_action(); +} + void MovingSprite::update_hitbox() { @@ -127,6 +136,19 @@ MovingSprite::update_hitbox() m_col.set_unisolid(m_sprite->is_current_hitbox_unisolid()); } +void +MovingSprite::set_action(const std::string& name) +{ + m_sprite->set_action(name); + update_hitbox(); +} + +void +MovingSprite::set_action_loops(const std::string& name, int loops) +{ + set_action(name, loops); +} + void MovingSprite::set_action(const std::string& name, int loops) { @@ -231,4 +253,17 @@ MovingSprite::spawn_explosion_sprites(int count, const std::string& sprite_path) } } + +void +MovingSprite::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("MovingSprite", vm.findClass("MovingObject")); + + cls.addFunc("set_sprite", &MovingSprite::change_sprite); + cls.addFunc("get_sprite", &MovingSprite::get_sprite_name); + cls.addFunc("get_action", &MovingSprite::get_action); + cls.addFunc("set_action", &MovingSprite::set_action); + cls.addFunc("set_action_loops", &MovingSprite::set_action_loops); +} + /* EOF */ diff --git a/src/object/moving_sprite.hpp b/src/object/moving_sprite.hpp index bcec8a87ac2..1f1c26323e9 100644 --- a/src/object/moving_sprite.hpp +++ b/src/object/moving_sprite.hpp @@ -26,9 +26,15 @@ class ReaderMapping; -/** Abstract base class for MovingObjects that are represented by a Sprite */ +/** + * @scripting + * @summary Abstract base class for ""MovingObject""s, that are represented by a sprite. + */ class MovingSprite : public MovingObject { +public: + static void register_class(ssq::VM& vm); + public: MovingSprite(const Vector& pos, const std::string& sprite_name, @@ -50,6 +56,7 @@ class MovingSprite : public MovingObject virtual void update(float dt_sec) override; static std::string class_name() { return "moving-sprite"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "MovingSprite"; } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; @@ -67,11 +74,43 @@ class MovingSprite : public MovingObject /** Get various sprite properties. **/ Sprite* get_sprite() const { return m_sprite.get(); } - const std::string& get_action() const { return m_sprite->get_action(); } - /** Set new action for sprite and resize bounding box. use with - care as you can easily get stuck when resizing the bounding box. */ - void set_action(const std::string& name, int loops = -1); +#ifdef DOXYGEN_SCRIPTING + /** + * @scripting + * @description Sets the sprite of the object. + * @param string $file + */ + void set_sprite(const std::string& file); + /** + * @scripting + * @description Returns the file of the object's sprite. + */ + std::string get_sprite() const; +#endif + /** + * @scripting + * @description Returns the name of the current action of the sprite. + */ + std::string get_action() const; + /** + * @scripting + * @description Sets the current action of the sprite and resizes the bounding box. + NOTE: Use with care as you can easily get stuck when resizing the bounding box. + * @param string $name + */ + void set_action(const std::string& name); + /** + * @scripting + * @description Sets the current action of the sprite, as well as the number of times it should loop, and resizes the bounding box. + NOTE: Use with care as you can easily get stuck when resizing the bounding box. + * @param string $name + * @param int $loops + */ + void set_action_loops(const std::string& name, int loops); + + /** Sets the action from an action name, as well as the number of times it should loop. */ + void set_action(const std::string& name, int loops); /** Sets the action from an action name and a particular direction in the form of "name-direction", eg. "walk-left". diff --git a/src/object/particle_zone.cpp b/src/object/particle_zone.cpp index 1f74fc417a4..495bc7cc46c 100644 --- a/src/object/particle_zone.cpp +++ b/src/object/particle_zone.cpp @@ -23,7 +23,6 @@ ParticleZone::ParticleZone(const ReaderMapping& reader) : MovingObject(reader), - //ExposedObject(this), m_enabled(), m_particle_name() { diff --git a/src/object/particle_zone.hpp b/src/object/particle_zone.hpp index ecf2761e1b0..dd59e6858e0 100644 --- a/src/object/particle_zone.hpp +++ b/src/object/particle_zone.hpp @@ -17,18 +17,15 @@ #ifndef HEADER_SUPERTUX_OBJECT_PARTICLE_ZONE_HPP #define HEADER_SUPERTUX_OBJECT_PARTICLE_ZONE_HPP -#include "squirrel/exposed_object.hpp" -// TODO: #include "scripting/wind.hpp" #include "supertux/moving_object.hpp" -#include "video/layer.hpp" -class ReaderMapping; +#include "video/layer.hpp" /** Defines an area where a certain particle type can spawn */ -class ParticleZone final : - public MovingObject//, // TODO: Make this area actually moveable with Squirrel - //public ExposedObject // TODO: Scripting interface +class ParticleZone final : public MovingObject { + // TODO: Scripting interface + public: ParticleZone(const ReaderMapping& reader); diff --git a/src/object/particlesystem.cpp b/src/object/particlesystem.cpp index 3548380ebd1..9905180ddcf 100644 --- a/src/object/particlesystem.cpp +++ b/src/object/particlesystem.cpp @@ -18,6 +18,9 @@ #include +#include +#include + #include "supertux/globals.hpp" #include "supertux/sector.hpp" #include "util/reader.hpp" @@ -32,7 +35,6 @@ ParticleSystem::ParticleSystem(const ReaderMapping& reader, float max_particle_size_) : GameObject(reader), - ExposedObject(this), max_particle_size(max_particle_size_), z_pos(LAYER_BACKGROUND1), particles(), @@ -46,7 +48,6 @@ ParticleSystem::ParticleSystem(const ReaderMapping& reader, float max_particle_s ParticleSystem::ParticleSystem(float max_particle_size_) : GameObject(), - ExposedObject(this), max_particle_size(max_particle_size_), z_pos(LAYER_BACKGROUND1), particles(), @@ -143,4 +144,16 @@ ParticleSystem::get_enabled() const return enabled; } + +void +ParticleSystem::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("ParticleSystem", vm.findClass("GameObject")); + + cls.addFunc("set_enabled", &ParticleSystem::set_enabled); + cls.addFunc("get_enabled", &ParticleSystem::get_enabled); + + cls.addVar("enabled", &ParticleSystem::enabled); +} + /* EOF */ diff --git a/src/object/particlesystem.hpp b/src/object/particlesystem.hpp index d3eb1e4dbd4..239dd519d69 100644 --- a/src/object/particlesystem.hpp +++ b/src/object/particlesystem.hpp @@ -20,32 +20,37 @@ #include #include "math/vector.hpp" -#include "squirrel/exposed_object.hpp" -#include "scripting/particlesystem.hpp" #include "supertux/game_object.hpp" #include "video/surface_ptr.hpp" class ReaderMapping; /** - This is the base class for particle systems. It is responsible for - storing a set of particles with each having an x- and y-coordinate - the number of the layer where it should be drawn and a texture. - - The coordinate system used here is a virtual one. It would be a bad - idea to populate whole levels with particles. So we're using a - virtual rectangle here that is tiled onto the level when drawing. - This rect.has the size (virtual_width, virtual_height). We're using - modulo on the particle coordinates, so when a particle leaves left, - it'll reenter at the right side. - - Classes that implement a particle system should subclass from this - class, initialize particles in the constructor and move them in the - simulate function. + * This is the base class for particle systems. It is responsible for + storing a set of particles with each having an x- and y-coordinate + the number of the layer where it should be drawn and a texture. + + The coordinate system used here is a virtual one. It would be a bad + idea to populate whole levels with particles. So we're using a + virtual rectangle here that is tiled onto the level when drawing. + This rect.has the size (virtual_width, virtual_height). We're using + modulo on the particle coordinates, so when a particle leaves left, + it'll reenter at the right side. + + Classes that implement a particle system should subclass from this + class, initialize particles in the constructor and move them in the + simulate function. + + * @scripting + * @summary A ""ParticleSystem"" that was given a name can be controlled by scripts. + * @instances A ""ParticleSystem"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. */ -class ParticleSystem : public GameObject, - public ExposedObject +class ParticleSystem : public GameObject { +public: + static void register_class(ssq::VM& vm); + public: ParticleSystem(const ReaderMapping& reader, float max_particle_size = 60); ParticleSystem(float max_particle_size = 60); @@ -55,11 +60,23 @@ class ParticleSystem : public GameObject, static std::string class_name() { return "particle-system"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "ParticleSystem"; } static std::string display_name() { return _("Particle system"); } virtual std::string get_display_name() const override { return display_name(); } virtual ObjectSettings get_settings() override; - void set_enabled(bool enabled_); + /** + * @scripting + * @deprecated Use the ""enabled"" property instead! + * @description Enables/disables the system. + * @param bool $enable + */ + void set_enabled(bool enable); + /** + * @scripting + * @deprecated Use the ""enabled"" property instead! + * @description Returns ""true"" if the system is enabled. + */ bool get_enabled() const; int get_layer() const { return z_pos; } @@ -97,6 +114,11 @@ class ParticleSystem : public GameObject, std::vector > particles; float virtual_width; float virtual_height; + + /** + * @scripting + * @description Determines whether the system is enabled. + */ bool enabled; private: diff --git a/src/object/path_object.cpp b/src/object/path_object.cpp index 29307ee625b..15fb9b6d4f5 100644 --- a/src/object/path_object.cpp +++ b/src/object/path_object.cpp @@ -18,8 +18,9 @@ #include +#include + #include "editor/editor.hpp" -#include "object/path_gameobject.hpp" #include "supertux/d_scope.hpp" #include "supertux/game_object_factory.hpp" #include "supertux/sector.hpp" @@ -78,6 +79,36 @@ PathObject::init_path_pos(const Vector& pos, bool running) m_walker.reset(new PathWalker(path_gameobject.get_uid(), running)); } +void +PathObject::goto_node(int node_idx) +{ + if (!m_walker) return; + BIND_SECTOR(Sector::get()); + m_walker->goto_node(node_idx); +} + +void +PathObject::set_node(int node_idx) +{ + if (!m_walker) return; + BIND_SECTOR(Sector::get()); + m_walker->jump_to_node(node_idx, true); +} + +void +PathObject::start_moving() +{ + if (!m_walker) return; + m_walker->start_moving(); +} + +void +PathObject::stop_moving() +{ + if (!m_walker) return; + m_walker->stop_moving(); +} + void PathObject::save_state() const { @@ -151,4 +182,14 @@ PathObject::on_flip() m_path_handle.m_pixel_offset.y = -m_path_handle.m_pixel_offset.y; } + +void +PathObject::register_members(ssq::Class& cls) +{ + cls.addFunc("goto_node", &PathObject::goto_node); + cls.addFunc("set_node", &PathObject::set_node); + cls.addFunc("start_moving", &PathObject::start_moving); + cls.addFunc("stop_moving", &PathObject::stop_moving); +} + /* EOF */ diff --git a/src/object/path_object.hpp b/src/object/path_object.hpp index a0704e4398a..18cf66b6acf 100644 --- a/src/object/path_object.hpp +++ b/src/object/path_object.hpp @@ -25,9 +25,19 @@ #include "object/path_walker.hpp" #include "util/uid.hpp" -/** A class for all objects that contain / make use of a path. */ +namespace ssq { +class Class; +} // namespace ssq + +/** + * @scripting + * @summary A base class for all objects that contain, or make use of a path. + */ class PathObject { +protected: + static void register_members(ssq::Class& cls); + public: PathObject(); virtual ~PathObject(); @@ -46,12 +56,36 @@ class PathObject std::string get_path_ref() const; void editor_set_path_by_ref(const std::string& new_ref); + /** + * @scripting + * @description Moves the path object until at given node, then stops. + * @param int $node_idx + */ + void goto_node(int node_idx); + /** + * @scripting + * @description Jumps instantly to the given node. + * @param int $node_idx + */ + void set_node(int node_idx); + /** + * @scripting + * @description Starts moving the path object automatically. + */ + void start_moving(); + /** + * @scripting + * @description Stops moving the path object. + */ + void stop_moving(); + protected: void save_state() const; void check_state() const; void on_flip(); +protected: PathWalker::Handle m_path_handle; private: diff --git a/src/object/platform.cpp b/src/object/platform.cpp index 2f3db61adb6..0ce8dcbc198 100644 --- a/src/object/platform.cpp +++ b/src/object/platform.cpp @@ -16,6 +16,8 @@ #include "object/platform.hpp" +#include + #include "editor/editor.hpp" #include "object/player.hpp" #include "supertux/sector.hpp" @@ -30,7 +32,6 @@ Platform::Platform(const ReaderMapping& reader) : Platform::Platform(const ReaderMapping& reader, const std::string& default_sprite) : MovingSprite(reader, default_sprite, LAYER_OBJECTS, COLGROUP_STATIC), - ExposedObject(this), PathObject(), m_speed(Vector(0,0)), m_movement(Vector(0, 0)), @@ -152,30 +153,12 @@ Platform::editor_update() } void -Platform::goto_node(int node_idx) -{ - get_walker()->goto_node(node_idx); -} - -void -Platform::jump_to_node(int node_idx, bool instantaneous) +Platform::jump_to_node(int node_idx) { - get_walker()->jump_to_node(node_idx, instantaneous); + set_node(node_idx); set_pos(m_path_handle.get_pos(m_col.m_bbox.get_size(), get_path()->get_nodes()[node_idx].position)); } -void -Platform::start_moving() -{ - get_walker()->start_moving(); -} - -void -Platform::stop_moving() -{ - get_walker()->stop_moving(); -} - void Platform::move_to(const Vector& pos) { @@ -208,4 +191,16 @@ Platform::check_state() PathObject::check_state(); } + +void +Platform::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("Platform", vm.findClass("MovingSprite")); + + PathObject::register_members(cls); + + // Use Platform's implementation of "set_node". + cls.addFunc("set_node", &Platform::jump_to_node); +} + /* EOF */ diff --git a/src/object/platform.hpp b/src/object/platform.hpp index 7b208dd955d..8308de5c763 100644 --- a/src/object/platform.hpp +++ b/src/object/platform.hpp @@ -19,15 +19,22 @@ #include "object/moving_sprite.hpp" #include "object/path_object.hpp" -#include "squirrel/exposed_object.hpp" -#include "scripting/platform.hpp" -/** This class is the base class for platforms that tux can stand - on */ +/** + * This is the base class for platforms that Tux can stand on. + + * @scripting + * @summary A ""Platform"" that was given a name can be controlled by scripts. + It moves along a specified path. + * @instances A ""Platform"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. +*/ class Platform : public MovingSprite, - public ExposedObject, public PathObject { +public: + static void register_class(ssq::VM& vm); + public: Platform(const ReaderMapping& reader); Platform(const ReaderMapping& reader, const std::string& default_sprite); @@ -43,6 +50,7 @@ class Platform : public MovingSprite, static std::string class_name() { return "platform"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "Platform"; } static std::string display_name() { return _("Platform"); } virtual std::string get_display_name() const override { return display_name(); } @@ -54,24 +62,11 @@ class Platform : public MovingSprite, void check_state() override; const Vector& get_speed() const { return m_speed; } - const Vector& get_movement() const { return m_movement; } - /** @name Scriptable Methods - @{ */ - - /** Move platform until at given node, then stop */ - void goto_node(int node_idx); - - /** Move platform instantly to given node */ - void jump_to_node(int node_idx, bool instantaneous = false); - - /** Start moving platform */ - void start_moving(); - - /** Stop platform at next node */ - void stop_moving(); - /** @} */ + /** Moves platform instantly to given node. + Replaces PathObject::set_node's implementation in scripting. */ + void jump_to_node(int node_idx); private: Vector m_speed; diff --git a/src/object/player.cpp b/src/object/player.cpp index 8d43352d2b3..911863b88b2 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -17,6 +17,9 @@ #include "object/player.hpp" +#include +#include + #include "audio/sound_manager.hpp" #include "badguy/badguy.hpp" #include "control/codecontroller.hpp" @@ -150,7 +153,6 @@ const float BUTTJUMP_SPEED = 800.f; } // namespace Player::Player(PlayerStatus& player_status, const std::string& name_, int player_id) : - ExposedObject(this), m_id(player_id), m_target(nullptr), m_deactivated(false), @@ -301,13 +303,15 @@ Player::set_winning() } void -Player::use_scripting_controller(bool use_or_release) +Player::use_scripting_controller(bool enable) { - if ((use_or_release == true) && (m_controller != m_scripting_controller.get())) { + if (enable && (m_controller != m_scripting_controller.get())) + { m_scripting_controller_old = &get_controller(); set_controller(m_scripting_controller.get()); } - if ((use_or_release == false) && (m_controller == m_scripting_controller.get())) { + else if (!enable && (m_controller == m_scripting_controller.get())) + { set_controller(m_scripting_controller_old); m_scripting_controller_old = nullptr; } @@ -356,11 +360,17 @@ Player::adjust_height(float new_height, float bottom_offset) // adjust bbox accordingly // note that we use members of moving_object for this, so we can run this during CD, too - set_pos(bbox2.p1()); + m_col.set_pos(bbox2.p1()); m_col.set_size(bbox2.get_width(), bbox2.get_height()); return true; } +void +Player::trigger_sequence(const std::string& sequence_name) +{ + trigger_sequence(string_to_sequence(sequence_name), nullptr); +} + void Player::trigger_sequence(const std::string& sequence_name, const SequenceData* data) { @@ -1263,7 +1273,15 @@ Player::do_duck() { } void -Player::do_standup(bool force_standup) { +Player::do_standup() +{ + // Scripting: Force standup for backwards compatibility. + do_standup(true); +} + +void +Player::do_standup(bool force_standup) +{ if (!m_duck || !is_big() || m_backflipping || m_stone) { m_crawl = false; @@ -2361,7 +2379,7 @@ Player::on_flip(float height) { Vector pos = get_pos(); pos.y = height - pos.y - get_bbox().get_height(); - move(pos); + set_pos(pos); } void @@ -2470,9 +2488,9 @@ Player::kill(bool completely) } void -Player::move(const Vector& vector) +Player::set_pos(const Vector& vector) { - set_pos(vector); + MovingObject::set_pos(vector); // Reset size to get correct hitbox if Tux was eg. ducked before moving if (is_big()) @@ -2499,21 +2517,21 @@ Player::check_bounds() if (get_pos().x < 0) { // Lock Tux to the size of the level, so that he doesn't fall off // the left side - set_pos(Vector(0, get_pos().y)); + m_col.set_pos(Vector(0, get_pos().y)); } if (m_col.m_bbox.get_right() > Sector::get().get_width()) { // Lock Tux to the size of the level, so that he doesn't fall off // the right side - set_pos(Vector(Sector::get().get_width() - m_col.m_bbox.get_width(), - m_col.m_bbox.get_top())); + m_col.set_pos(Vector(Sector::get().get_width() - m_col.m_bbox.get_width(), + m_col.m_bbox.get_top())); } // If Tux is swimming, don't allow him to go below the sector if (m_swimming && !m_ghost_mode && !is_dying() && !is_dead() && m_col.m_bbox.get_bottom() > Sector::get().get_height()) { - set_pos(Vector(m_col.m_bbox.get_left(), - Sector::get().get_height() - m_col.m_bbox.get_height())); + m_col.set_pos(Vector(m_col.m_bbox.get_left(), + Sector::get().get_height() - m_col.m_bbox.get_height())); } /* fallen out of the level? */ @@ -2550,6 +2568,24 @@ Player::get_velocity() const return m_physic.get_velocity(); } +float +Player::get_velocity_x() const +{ + return m_physic.get_velocity_x(); +} + +float +Player::get_velocity_y() const +{ + return m_physic.get_velocity_y(); +} + +void +Player::set_velocity(float x, float y) +{ + m_physic.set_velocity(x, y); +} + void Player::bounce(BadGuy& ) { @@ -2562,6 +2598,14 @@ Player::bounce(BadGuy& ) //scripting Functions Below +void +Player::activate() +{ + if (!m_deactivated) + return; + m_deactivated = false; +} + void Player::deactivate() { @@ -2574,20 +2618,32 @@ Player::deactivate() if (m_climbing) stop_climbing(*m_climbing); } -void -Player::activate() +bool +Player::get_input_pressed(const std::string& input) { - if (!m_deactivated) - return; - m_deactivated = false; + return m_controller->pressed(Control_from_string(input).value()); +} + +bool +Player::get_input_held(const std::string& input) +{ + return m_controller->hold(Control_from_string(input).value()); } -void Player::walk(float speed) +bool +Player::get_input_released(const std::string& input) +{ + return m_controller->released(Control_from_string(input).value()); +} + +void +Player::walk(float speed) { m_physic.set_velocity_x(speed); } -void Player::set_dir(bool right) +void +Player::set_dir(bool right) { m_dir = right ? Direction::RIGHT : Direction::LEFT; } @@ -2615,6 +2671,12 @@ Player::set_ghost_mode(bool enable) } } +bool +Player::get_ghost_mode() const +{ + return m_ghost_mode; +} + void Player::start_climbing(Climbable& climbable) { @@ -2940,7 +3002,7 @@ Player::multiplayer_respawn() set_group(COLGROUP_MOVING); m_physic.reset(); - move(target->get_pos()); + set_pos(target->get_pos()); m_target.reset(); } @@ -2987,4 +3049,44 @@ Player::remove_collected_key(Key* key) m_collected_keys.end()); } + +void +Player::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("Player", vm.findClass("MovingObject")); + + cls.addFunc("add_bonus", &Player::add_bonus); + cls.addFunc("set_bonus", &Player::set_bonus); + cls.addFunc("get_bonus", &Player::bonus_to_string); + cls.addFunc("add_coins", &Player::add_coins); + cls.addFunc("get_coins", &Player::get_coins); + cls.addFunc("make_invincible", &Player::make_invincible); + cls.addFunc("deactivate", &Player::deactivate); + cls.addFunc("activate", &Player::activate); + cls.addFunc("walk", &Player::walk); + cls.addFunc("set_dir", &Player::set_dir); + cls.addFunc("set_visible", &Player::set_visible); + cls.addFunc("get_visible", &Player::get_visible); + cls.addFunc("kill", &Player::kill); + cls.addFunc("set_ghost_mode", &Player::set_ghost_mode); + cls.addFunc("get_ghost_mode", &Player::get_ghost_mode); + cls.addFunc("kick", &Player::kick); + cls.addFunc("do_cheer", &Player::do_cheer); + cls.addFunc("do_duck", &Player::do_duck); + cls.addFunc("do_standup", static_cast(&Player::do_standup)); + cls.addFunc("do_backflip", &Player::do_backflip); + cls.addFunc("do_jump", &Player::do_jump); + cls.addFunc("trigger_sequence", static_cast(&Player::trigger_sequence)); + cls.addFunc("use_scripting_controller", &Player::use_scripting_controller); + cls.addFunc("do_scripting_controller", &Player::do_scripting_controller); + cls.addFunc("has_grabbed", &Player::has_grabbed); + cls.addFunc("get_velocity_x", &Player::get_velocity_x); + cls.addFunc("get_velocity_y", &Player::get_velocity_y); + cls.addFunc("set_velocity", &Player::set_velocity); + cls.addFunc("get_action", &Player::get_action); + cls.addFunc("get_input_pressed", &Player::get_input_pressed); + cls.addFunc("get_input_held", &Player::get_input_held); + cls.addFunc("get_input_released", &Player::get_input_released); +} + /* EOF */ diff --git a/src/object/player.hpp b/src/object/player.hpp index 8a8f0c1025e..be7532333da 100644 --- a/src/object/player.hpp +++ b/src/object/player.hpp @@ -17,9 +17,7 @@ #ifndef HEADER_SUPERTUX_OBJECT_PLAYER_HPP #define HEADER_SUPERTUX_OBJECT_PLAYER_HPP -#include "scripting/player.hpp" #include "sprite/sprite_ptr.hpp" -#include "squirrel/exposed_object.hpp" #include "supertux/direction.hpp" #include "supertux/moving_object.hpp" #include "supertux/object_remove_listener.hpp" @@ -39,9 +37,18 @@ class Portable; extern const float TUX_INVINCIBLE_TIME_WARNING; -class Player final : public MovingObject, - public ExposedObject +/** + * @scripting + * @summary This module contains methods controlling the player. (No, SuperTux doesn't use mind control. ""Player"" refers to the type of the player object.) + * @instances The first player can be accessed using ""Tux"", or ""sector.Tux"" from the console. + All following players (2nd, 3rd, etc...) can be accessed by ""Tux{index}"". + For example, to access the 2nd player, use ""Tux1"" (or ""sector.Tux1"" from the console). + */ +class Player final : public MovingObject { +public: + static void register_class(ssq::VM& vm); + public: enum FallMode { ON_GROUND, JUMPING, TRAMPOLINE_JUMP, FALLING }; @@ -80,6 +87,7 @@ class Player final : public MovingObject, virtual bool is_saveable() const override { return false; } virtual bool is_singleton() const override { return false; } virtual bool has_object_manager_priority() const override { return true; } + virtual std::string get_exposed_class_name() const override { return "Player"; } virtual void remove_me() override; int get_id() const { return m_id; } @@ -98,12 +106,28 @@ class Player final : public MovingObject, const Controller& get_controller() const { return *m_controller; } - void use_scripting_controller(bool use_or_release); + /** + * @scripting + * @description Uses a scriptable controller for all user input (or restores controls). + * @param bool $enable + */ + void use_scripting_controller(bool enable); + /** + * @scripting + * @description Instructs the scriptable controller to press or release a button. + * @param string $control Can be “left”, “right”, “up”, “down”, “jump”, “action”, “start”, “escape”, + “menu-select”, “menu-select-space”, “menu-back”, “remove”, “cheat-menu”, “debug-menu”, “console”, + “peek-left”, “peek-right”, “peek-up” or “peek-down”. + * @param bool $pressed + */ void do_scripting_controller(const std::string& control, bool pressed); /** Move the player to a different sector, including any objects that it points to, or references. */ void move_to_sector(Sector& other); + /** + * Make Tux invincible for a short amount of time. + */ void make_invincible(); void make_temporarily_safe(float safe_time); @@ -113,12 +137,48 @@ class Player final : public MovingObject, Direction peeking_direction_x() const { return m_peekingX; } Direction peeking_direction_y() const { return m_peekingY; } + /** + * @scripting + * @description Hurts Tux. + * @param bool $completely If true, he will be killed even if he had "grow" or a superior bonus. + */ void kill(bool completely); - void move(const Vector& vector); + void set_pos(const Vector& vector) override; + + /** + * @scripting + * @description Gives Tux the specified bonus unless Tux’s current bonus is superior. + * @param string $bonus Can be "grow", "fireflower", "iceflower", "airflower" or "earthflower" at the moment. + */ bool add_bonus(const std::string& bonus); + /** + * @scripting + * @description Gives Tux the specified bonus. + * @param string $bonus Can be "grow", "fireflower", "iceflower", "airflower" or "earthflower" at the moment. + */ bool set_bonus(const std::string& bonus); +#ifdef DOXYGEN_SCRIPTING + /** + * @scripting + * @description Returns Tux's current bonus. + */ + std::string get_bonus() const; +#endif + + /** + * @scripting + * @description Gives the player a number of coins.${SRG_TABLENEWPARAGRAPH} + If count is a negative amount of coins, that number of coins will be taken + from the player (until the number of coins the player has is 0, when it + will stop changing). + * @param int $count + */ void add_coins(int count); + /** + * @scripting + * @description Returns the number of coins the player currently has. + */ int get_coins() const; /** picks up a bonus, taking care not to pick up lesser bonus items than we already have @@ -135,30 +195,53 @@ class Player final : public MovingObject, PlayerStatus& get_status() const { return m_player_status; } - /** set kick animation */ + /** + * @scripting + * @description Start kick animation. + */ void kick(); - /** gets the players action */ + /** + * @scripting + * @description Gets the player's current action/animation. + */ std::string get_action() const; - /** play cheer animation. - This might need some space and behave in an unpredictable way. - Best to use this at level end. */ + /** + * @scripting + * @description Play cheer animation.${SRG_TABLENEWPARAGRAPH} + * This might need some space and behave in an unpredictable way. It's best to use this at level end. + */ void do_cheer(); - /** duck down if possible. - this won't last long as long as input is enabled. */ + /** + * @scripting + * @description Makes Tux duck down, if possible. Won't last long, as long as input is enabled. + */ void do_duck(); - /** stand back up if possible. */ + /** + * @scripting + * @description Makes Tux stand back up, if possible. + */ + void do_standup(); + /** + * @scripting + * @description Makes Tux stand back up, if possible. + */ void do_standup(bool force_standup); - /** do a backflip if possible. */ + /** + * @scripting + * @description Makes Tux do a backflip, if possible. + */ void do_backflip(); - /** jump in the air if possible - sensible values for yspeed are negative - unless we want to jump - into the ground of course */ + /** + * @scripting + * @description Makes Tux jump in the air, if possible. + * @param float $yspeed Sensible values are negative - unless we want to jump into the ground of course. + */ void do_jump(float yspeed); /** Adds velocity to the player (be careful when using this) */ @@ -169,6 +252,23 @@ class Player final : public MovingObject, /** Returns the current velocity of the player */ Vector get_velocity() const; + /** + * @scripting + * @description Returns Tux’s velocity in X direction. + */ + float get_velocity_x() const; + /** + * @scripting + * @description Returns Tux’s velocity in Y direction. + */ + float get_velocity_y() const; + /** + * @scripting + * @description Sets the velocity of the player to a programmable/variable speed. + * @param float $x The speed Tux will move on the x axis. + * @param float $y The speed Tux will move on the y axis. + */ + void set_velocity(float x, float y); void bounce(BadGuy& badguy); void override_velocity() { m_velocity_override = true; } @@ -183,7 +283,18 @@ class Player final : public MovingObject, bool is_skidding() const { return m_skidding_timer.started(); } float get_swimming_angle() const { return m_swimming_angle; } + /** + * @scripting + * @deprecated + * @description Set Tux visible or invisible. + * @param bool $visible + */ void set_visible(bool visible); + /** + * @scripting + * @deprecated + * @description Returns ""true"" if Tux is currently visible (has not been set invisible by the ""set_visible()"" method). + */ bool get_visible() const; bool on_ground() const; @@ -192,25 +303,40 @@ class Player final : public MovingObject, Portable* get_grabbed_object() const { return m_grabbed_object; } void stop_grabbing() { ungrab_object(); } - /** Checks whether the player has grabbed a certain object - @param name Name of the object to check */ - bool has_grabbed(const std::string& object_name) const; + /** + * @scripting + * @description Returns whether the player is carrying a certain object. + * @param string $name Name of the portable object to check for. + */ + bool has_grabbed(const std::string& name) const; - /** Switches ghost mode on/off. - Lets Tux float around and through solid objects. */ + /** + * @scripting + * @description Switches ghost mode on/off. Lets Tux float around and through solid objects. + * @param bool $enable + */ void set_ghost_mode(bool enable); - - /** Returns whether ghost mode is currently enabled */ - bool get_ghost_mode() const { return m_ghost_mode; } + /** + * @scripting + * @description Returns whether ghost mode is currently enabled. + */ + bool get_ghost_mode() const; /** Changes height of bounding box. Returns true if successful, false otherwise */ bool adjust_height(float new_height, float bottom_offset = 0); + /** + * @scripting + * @description Orders the current ""GameSession"" to start a sequence. + * @param string $sequence_name One of “stoptux”, “endsequence” or “fireworks”. + */ + void trigger_sequence(const std::string& sequence_name); + /** Orders the current GameSession to start a sequence @param sequence_name Name of the sequence to start @param data Custom additional sequence data */ - void trigger_sequence(const std::string& sequence_name, const SequenceData* data = nullptr); + void trigger_sequence(const std::string& sequence_name, const SequenceData* data); /** Orders the current GameSession to start a sequence @param sequence Sequence to start @@ -225,10 +351,50 @@ class Player final : public MovingObject, Physic& get_physic() { return m_physic; } + /** + * @scripting + * @description Give control back to user/scripting. + */ void activate(); + /** + * @scripting + * @description Deactivate user/scripting input for Tux. + Carried items like trampolines won't be dropped. + */ void deactivate(); + /** + * @scripting + * @description Gets whether the current input on the keyboard/controller/touchpad has been pressed. + * @param string $input Can be “left”, “right”, “up”, “down”, “jump”, “action”, “start”, “escape”, + “menu-select”, “menu-select-space”, “menu-back”, “remove”, “cheat-menu”, “debug-menu”, “console”, + “peek-left”, “peek-right”, “peek-up” or “peek-down”. + */ + bool get_input_pressed(const std::string& input); + /** + * @scripting + * @description Gets whether the current input on the keyboard/controller/touchpad is being held. + * @param string $input Valid values are listed above. + */ + bool get_input_held(const std::string& input); + /** + * @scripting + * @description Gets whether the current input on the keyboard/controller/touchpad has been released. + * @param string $input Valid values are listed above. + */ + bool get_input_released(const std::string& input); + + /** + * @scripting + * @description Makes Tux walk. + * @param float $speed + */ void walk(float speed); + /** + * @scripting + * @description Face Tux in the proper direction. + * @param bool $right Set to ""true"" to make Tux face right, ""false"" to face left. + */ void set_dir(bool right); void stop_backflipping(); diff --git a/src/object/rain_particle_system.cpp b/src/object/rain_particle_system.cpp index 500d19cdedb..50263864edc 100644 --- a/src/object/rain_particle_system.cpp +++ b/src/object/rain_particle_system.cpp @@ -19,6 +19,9 @@ #include #include +#include +#include + #include "math/easing.hpp" #include "math/random.hpp" #include "object/camera.hpp" @@ -32,18 +35,15 @@ #include "video/viewport.hpp" RainParticleSystem::RainParticleSystem() : - ExposedObject(this), m_current_speed(1.f), m_target_speed(1.f), m_speed_fade_time_remaining(0.f), - m_begin_angle(45.f), m_current_angle(45.f), m_target_angle(45.f), m_angle_fade_time_remaining(0.f), m_angle_fade_time_total(0.f), m_angle_easing(getEasingByName(EaseNone)), - m_current_amount(1.f), m_target_amount(1.f), m_amount_fade_time_remaining(0.f), @@ -54,18 +54,15 @@ RainParticleSystem::RainParticleSystem() : RainParticleSystem::RainParticleSystem(const ReaderMapping& reader) : ParticleSystem_Interactive(reader), - ExposedObject(this), m_current_speed(1.f), m_target_speed(1.f), m_speed_fade_time_remaining(0.f), - m_begin_angle(45.f), m_current_angle(45.f), m_target_angle(45.f), m_angle_fade_time_remaining(0.f), m_angle_fade_time_total(0.f), m_angle_easing(getEasingByName(EaseNone)), - m_current_amount(1.f), m_target_amount(1.f), m_amount_fade_time_remaining(0.f), @@ -252,35 +249,41 @@ void RainParticleSystem::fade_speed(float new_speed, float fade_time) m_speed_fade_time_remaining = fade_time; } -void RainParticleSystem::fade_angle(float new_angle, float fade_time, easing ease_func) +void RainParticleSystem::fade_amount(float new_amount, float fade_time) { // No check to enabled; change the fading even if it's disabled // If time is 0 (or smaller?), then update() will never change m_current_amount if (fade_time <= 0.f) { - m_current_angle = new_angle - 45.f; + m_current_amount = new_amount; } - m_begin_angle = m_current_angle; - m_target_angle = new_angle - 45.f; - m_angle_fade_time_total = fade_time; - m_angle_fade_time_remaining = fade_time; - m_angle_easing = ease_func; + m_target_amount = new_amount; + m_amount_fade_time_remaining = fade_time; } -void RainParticleSystem::fade_amount(float new_amount, float fade_time) +void +RainParticleSystem::fade_angle(float angle, float time, const std::string& ease) +{ + fade_angle(angle, time, getEasingByName(EasingMode_from_string(ease))); +} + +void RainParticleSystem::fade_angle(float new_angle, float fade_time, easing ease_func) { // No check to enabled; change the fading even if it's disabled // If time is 0 (or smaller?), then update() will never change m_current_amount if (fade_time <= 0.f) { - m_current_amount = new_amount; + m_current_angle = new_angle - 45.f; } - m_target_amount = new_amount; - m_amount_fade_time_remaining = fade_time; + m_begin_angle = m_current_angle; + m_target_angle = new_angle - 45.f; + m_angle_fade_time_total = fade_time; + m_angle_fade_time_remaining = fade_time; + m_angle_easing = ease_func; } void RainParticleSystem::draw(DrawingContext& context) @@ -304,4 +307,15 @@ void RainParticleSystem::draw(DrawingContext& context) context.pop_transform(); } + +void +RainParticleSystem::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("RainParticleSystem", vm.findClass("ParticleSystem")); + + cls.addFunc("fade_speed", &RainParticleSystem::fade_speed); + cls.addFunc("fade_amount", &RainParticleSystem::fade_amount); + cls.addFunc("fade_angle", &RainParticleSystem::fade_angle); +} + /* EOF */ diff --git a/src/object/rain_particle_system.hpp b/src/object/rain_particle_system.hpp index 13613ea6bba..5b2acd9cae4 100644 --- a/src/object/rain_particle_system.hpp +++ b/src/object/rain_particle_system.hpp @@ -17,15 +17,22 @@ #ifndef HEADER_SUPERTUX_OBJECT_RAIN_PARTICLE_SYSTEM_HPP #define HEADER_SUPERTUX_OBJECT_RAIN_PARTICLE_SYSTEM_HPP -#include "math/easing.hpp" #include "object/particlesystem_interactive.hpp" -#include "scripting/rain.hpp" + +#include "math/easing.hpp" #include "video/surface_ptr.hpp" -class RainParticleSystem final : - public ParticleSystem_Interactive, - public ExposedObject +/** + * @scripting + * @summary A ""RainParticleSystem"" that was given a name can be controlled by scripts. + * @instances A ""RainParticleSystem"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class RainParticleSystem final : public ParticleSystem_Interactive { +public: + static void register_class(ssq::VM& vm); + public: RainParticleSystem(); RainParticleSystem(const ReaderMapping& reader); @@ -38,13 +45,36 @@ class RainParticleSystem final : static std::string class_name() { return "particles-rain"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "RainParticleSystem"; } static std::string display_name() { return _("Rain Particles"); } virtual std::string get_display_name() const override { return display_name(); } virtual ObjectSettings get_settings() override; - void fade_speed(float new_speed, float fade_time); + /** + * @scripting + * @description Smoothly changes the rain speed to the given value in ""time"" seconds. + * @param float $speed + * @param float $time + */ + void fade_speed(float speed, float time); + /** + * @scripting + * @description Smoothly changes the amount of particles to the given value in ""time"" seconds. + * @param float $amount + * @param float $time + */ + void fade_amount(float amount, float time); + /** + * @scripting + * @description Smoothly changes the angle of the rain the given value in ""time"" seconds, according to the provided easing function. + * @param float $angle + * @param float $time + * @param string $ease + */ + void fade_angle(float angle, float time, const std::string& ease); + + /** Smoothly changes the angle of the rain the given value in ""time"" seconds, according to the provided easing function. */ void fade_angle(float new_angle, float fade_time, easing ease_func); - void fade_amount(float new_amount, float fade_time); virtual const std::string get_icon_path() const override { return "images/engine/editor/rain.png"; @@ -60,14 +90,6 @@ class RainParticleSystem final : // When m_current_amount == max_amount, fog is this value static float constexpr const fog_max_value = 0.6f; - virtual void expose(HSQUIRRELVM vm, SQInteger table_idx) override { - ExposedObject::expose(vm, table_idx); - } - - virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx) override { - ExposedObject::unexpose(vm, table_idx); - } - private: void set_amount(float amount); void set_angle(float angle); diff --git a/src/object/rock.cpp b/src/object/rock.cpp index 78e5282d9b0..2e200d4c91c 100644 --- a/src/object/rock.cpp +++ b/src/object/rock.cpp @@ -37,7 +37,6 @@ namespace { Rock::Rock(const ReaderMapping& reader, const std::string& spritename) : MovingSprite(reader, spritename), - ExposedObject(this), physic(), on_ground(false), on_ice(false), @@ -57,7 +56,6 @@ Rock::Rock(const ReaderMapping& reader, const std::string& spritename) : Rock::Rock(const Vector& pos, const std::string& spritename) : MovingSprite(pos, spritename), - ExposedObject(this), physic(), on_ground(false), on_ice(false), diff --git a/src/object/rock.hpp b/src/object/rock.hpp index 5b1535a09ba..c50f8ff45fb 100644 --- a/src/object/rock.hpp +++ b/src/object/rock.hpp @@ -19,13 +19,10 @@ #include "object/moving_sprite.hpp" #include "object/portable.hpp" -#include "squirrel/exposed_object.hpp" -#include "scripting/rock.hpp" #include "supertux/physic.hpp" class Rock : public MovingSprite, - public Portable, - public ExposedObject + public Portable { public: Rock(const ReaderMapping& reader, const std::string& spritename = "images/objects/rock/rock.sprite"); diff --git a/src/object/scripted_object.cpp b/src/object/scripted_object.cpp index 034fc572592..e55bb5c3021 100644 --- a/src/object/scripted_object.cpp +++ b/src/object/scripted_object.cpp @@ -16,6 +16,9 @@ #include "object/scripted_object.hpp" +#include +#include + #include "editor/editor.hpp" #include "math/random.hpp" #include "object/player.hpp" @@ -27,7 +30,6 @@ ScriptedObject::ScriptedObject(const ReaderMapping& mapping) : MovingSprite(mapping, "images/objects/bonus_block/brick.sprite", LAYER_OBJECTS, COLGROUP_MOVING_STATIC), - ExposedObject(this), physic(), solid(), physic_enabled(), @@ -77,24 +79,6 @@ ScriptedObject::get_settings() return result; } -void -ScriptedObject::move(float x, float y) -{ - m_col.m_bbox.move(Vector(x, y)); -} - -float -ScriptedObject::get_pos_x() const -{ - return get_pos().x; -} - -float -ScriptedObject::get_pos_y() const -{ - return get_pos().y; -} - void ScriptedObject::set_velocity(float x, float y) { @@ -213,4 +197,25 @@ ScriptedObject::on_flip(float height) FlipLevelTransformer::transform_flip(m_flip); } + +void +ScriptedObject::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("ScriptedObject", vm.findClass("MovingSprite")); + + cls.addFunc("get_pos_x", &MovingObject::get_x); // Deprecated + cls.addFunc("get_pos_y", &MovingObject::get_y); // Deprecated + cls.addFunc("set_velocity", &ScriptedObject::set_velocity); + cls.addFunc("get_velocity_x", &ScriptedObject::get_velocity_x); + cls.addFunc("get_velocity_y", &ScriptedObject::get_velocity_y); + cls.addFunc("enable_gravity", &ScriptedObject::enable_gravity); + cls.addFunc("gravity_enabled", &ScriptedObject::gravity_enabled); + cls.addFunc("set_visible", &ScriptedObject::set_visible); + cls.addFunc("is_visible", &ScriptedObject::is_visible); + cls.addFunc("set_solid", &ScriptedObject::set_solid); + cls.addFunc("is_solid", &ScriptedObject::is_solid); + + cls.addVar("visible", &ScriptedObject::visible); +} + /* EOF */ diff --git a/src/object/scripted_object.hpp b/src/object/scripted_object.hpp index 57b3aada55d..5465f78d210 100644 --- a/src/object/scripted_object.hpp +++ b/src/object/scripted_object.hpp @@ -18,14 +18,19 @@ #define HEADER_SUPERTUX_OBJECT_SCRIPTED_OBJECT_HPP #include "object/moving_sprite.hpp" -#include "scripting/scripted_object.hpp" -#include "squirrel/exposed_object.hpp" #include "supertux/physic.hpp" -class ScriptedObject final : - public MovingSprite, - public ExposedObject +/** + * @scripting + * @summary A ""ScriptedObject"" that was given a name can be controlled by scripts. + * @instances A ""ScriptedObject"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class ScriptedObject final : public MovingSprite { +public: + static void register_class(ssq::VM& vm); + public: ScriptedObject(const ReaderMapping& mapping); @@ -37,6 +42,7 @@ class ScriptedObject final : static std::string class_name() { return "scriptedobject"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "ScriptedObject"; } static std::string display_name() { return _("Scripted Object"); } virtual std::string get_display_name() const override { return display_name(); } @@ -44,23 +50,85 @@ class ScriptedObject final : virtual void on_flip(float height) override; - void move(float x, float y); +#ifdef DOXYGEN_SCRIPTING + /** + * @scripting + * @deprecated Use ""get_x()"" instead! + * @description Returns the X coordinate of the object's position. + */ float get_pos_x() const; + /** + * @scripting + * @deprecated Use ""get_y()"" instead! + * @description Returns the Y coordinate of the object's position. + */ float get_pos_y() const; +#endif + + /** + * @scripting + * @description Makes the object move in a certain ""x"" and ""y"" direction (with a certain speed). + * @param float $x + * @param float $y + */ void set_velocity(float x, float y); + /** + * @scripting + * @description Returns the X coordinate of the object's velocity. + */ float get_velocity_x() const; + /** + * @scripting + * @description Returns the Y coordinate of the object's velocity. + */ float get_velocity_y() const; + + /** + * @scripting + * @description Enables or disables gravity, according to the value of ""enabled"". + * @param bool $enabled + */ + void enable_gravity(bool enabled); + /** + * @scripting + * @description Returns ""true"" if the object's gravity is enabled. + */ + bool gravity_enabled() const; + + /** + * @scripting + * @deprecated Use the ""visible"" property instead! + * @description Shows or hides the object, according to the value of ""visible"". + * @param bool $visible + */ void set_visible(bool visible); + /** + * @scripting + * @deprecated Use the ""visible"" property instead! + * @description Returns ""true"" if the object is visible. + */ bool is_visible() const; + + /** + * @scripting + * @description Changes the solidity, according to the value of ""solid"". + * @param bool $solid + */ void set_solid(bool solid); + /** + * @scripting + * @description Returns ""true"" if the object is solid. + */ bool is_solid() const; - void enable_gravity(bool f); - bool gravity_enabled() const; private: Physic physic; bool solid; bool physic_enabled; + /** + * @scripting + * @description Determines whether the object is visible. + */ bool visible; std::string hit_script; bool new_vel_set; diff --git a/src/object/snow_particle_system.cpp b/src/object/snow_particle_system.cpp index dbfe4cb84de..f02ab14ec1a 100644 --- a/src/object/snow_particle_system.cpp +++ b/src/object/snow_particle_system.cpp @@ -35,7 +35,12 @@ SnowParticleSystem::SnowParticleSystem() : m_state(RELEASING), m_timer(), m_gust_onset(0), - m_gust_current_velocity(0) + m_gust_current_velocity(0), + m_wind_speed(), + m_epsilon(), + m_spin_speed(), + m_state_length(), + m_snowimages() { init(); } @@ -45,7 +50,12 @@ SnowParticleSystem::SnowParticleSystem(const ReaderMapping& reader) : m_state(RELEASING), m_timer(), m_gust_onset(0), - m_gust_current_velocity(0) + m_gust_current_velocity(0), + m_wind_speed(), + m_epsilon(), + m_spin_speed(), + m_state_length(), + m_snowimages() { reader.get("state_length", m_state_length, 5.0f); reader.get("wind_speed", m_wind_speed, 30.0f); diff --git a/src/object/sound_object.cpp b/src/object/sound_object.cpp index 9b7e3ddfe7c..f883703cf12 100644 --- a/src/object/sound_object.cpp +++ b/src/object/sound_object.cpp @@ -18,6 +18,9 @@ #include +#include +#include + #include "audio/sound_manager.hpp" #include "audio/sound_source.hpp" #include "editor/editor.hpp" @@ -25,7 +28,6 @@ SoundObject::SoundObject(const ReaderMapping& mapping) : GameObject(mapping), - ExposedObject(this), m_sample(), m_sound_source(), m_volume(), @@ -38,7 +40,6 @@ SoundObject::SoundObject(const ReaderMapping& mapping) : } SoundObject::SoundObject(float vol, const std::string& file) : - ExposedObject(this), m_sample(file), m_sound_source(), m_volume(vol), @@ -128,4 +129,22 @@ SoundObject::set_volume(float volume) m_sound_source->set_gain(volume); } +float +SoundObject::get_volume() const +{ + return m_volume; +} + + +void +SoundObject::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("SoundObject", vm.findClass("GameObject")); + + cls.addFunc("start_playing", &SoundObject::play_looping_sounds); + cls.addFunc("stop_playing", &SoundObject::stop_looping_sounds); + cls.addFunc("set_volume", &SoundObject::set_volume); + cls.addFunc("get_volume", &SoundObject::get_volume); +} + /* EOF */ diff --git a/src/object/sound_object.hpp b/src/object/sound_object.hpp index 36537687261..c2ef56791ee 100644 --- a/src/object/sound_object.hpp +++ b/src/object/sound_object.hpp @@ -18,17 +18,15 @@ #define HEADER_SUPERTUX_SOUND_OBJECT_HPP #include "supertux/game_object.hpp" -#include "squirrel/exposed_object.hpp" -#include "scripting/sound_object.hpp" - -class ReaderMapping; class SoundSource; /** Plays sound at given interval with specified volume hearable in entire Sector */ -class SoundObject final : public GameObject, - public ExposedObject +class SoundObject final : public GameObject { +public: + static void register_class(ssq::VM& vm); + public: SoundObject(const ReaderMapping& mapping); SoundObject(float vol, const std::string& file); @@ -39,6 +37,7 @@ class SoundObject final : public GameObject, static std::string class_name() { return "sound-object"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "SoundObject"; } static std::string display_name() { return _("Sound"); } virtual std::string get_display_name() const override { return display_name(); } virtual const std::string get_icon_path() const override { return "images/engine/editor/sound.png"; } @@ -50,8 +49,28 @@ class SoundObject final : public GameObject, /** @name Scriptable methods @{ */ + +#ifdef DOXYGEN_SCRIPTING + /** + * Starts playing sound, if currently stopped. + */ + void start_playing(); + /** + * Stops playing sound. + */ + void stop_playing(); +#endif + + /** + * Sets the volume of sound played by SoundObject. + * @param float $volume + */ void set_volume(float volume); - float get_volume() const { return m_volume; } + /** + * Returns the volume of sound played by SoundObject. + */ + float get_volume() const; + /** @} */ private: diff --git a/src/object/spotlight.cpp b/src/object/spotlight.cpp index 4a446eb570b..9f06c3f89e4 100644 --- a/src/object/spotlight.cpp +++ b/src/object/spotlight.cpp @@ -16,6 +16,9 @@ #include "object/spotlight.hpp" +#include +#include + #include "sprite/sprite.hpp" #include "sprite/sprite_manager.hpp" #include "util/reader_mapping.hpp" @@ -51,15 +54,14 @@ Spotlight::Direction_to_string(Direction dir) Spotlight::Spotlight(const ReaderMapping& mapping) : MovingObject(mapping), - ExposedObject(this), - angle(), - center(SpriteManager::current()->create("images/objects/spotlight/spotlight_center.sprite")), - base(SpriteManager::current()->create("images/objects/spotlight/spotlight_base.sprite")), - lights(SpriteManager::current()->create("images/objects/spotlight/spotlight_lights.sprite")), - light(SpriteManager::current()->create("images/objects/spotlight/light.sprite")), - lightcone(SpriteManager::current()->create("images/objects/spotlight/lightcone.sprite")), - color(1.0f, 1.0f, 1.0f), - speed(50.0f), + m_angle(), + m_center(SpriteManager::current()->create("images/objects/spotlight/spotlight_center.sprite")), + m_base(SpriteManager::current()->create("images/objects/spotlight/spotlight_base.sprite")), + m_lights(SpriteManager::current()->create("images/objects/spotlight/spotlight_lights.sprite")), + m_light(SpriteManager::current()->create("images/objects/spotlight/light.sprite")), + m_lightcone(SpriteManager::current()->create("images/objects/spotlight/lightcone.sprite")), + m_color(1.0f, 1.0f, 1.0f), + m_speed(50.0f), m_direction(), m_layer(0), m_enabled(true) @@ -70,8 +72,8 @@ Spotlight::Spotlight(const ReaderMapping& mapping) : mapping.get("y", m_col.m_bbox.get_top(), 0.0f); m_col.m_bbox.set_size(32, 32); - mapping.get("angle", angle, 0.0f); - mapping.get("speed", speed, 50.0f); + mapping.get("angle", m_angle, 0.0f); + mapping.get("speed", m_speed, 50.0f); if (!mapping.get_custom("r-direction", m_direction, Direction_from_string)) { @@ -82,9 +84,8 @@ Spotlight::Spotlight(const ReaderMapping& mapping) : } std::vector vColor; - if ( mapping.get( "color", vColor ) ){ - color = Color( vColor ); - } + if (mapping.get("color", vColor)) + m_color = Color(vColor); mapping.get("layer", m_layer, 0); mapping.get("enabled", m_enabled, true); @@ -100,9 +101,9 @@ Spotlight::get_settings() ObjectSettings result = MovingObject::get_settings(); result.add_bool(_("Enabled"), &m_enabled, "enabled", true); - result.add_float(_("Angle"), &angle, "angle"); - result.add_color(_("Color"), &color, "color", Color::WHITE); - result.add_float(_("Speed"), &speed, "speed", 50.0f); + result.add_float(_("Angle"), &m_angle, "angle"); + result.add_color(_("Color"), &m_color, "color", Color::WHITE); + result.add_float(_("Speed"), &m_speed, "speed", 50.0f); result.add_enum(_("Direction"), reinterpret_cast(&m_direction), {_("Clockwise"), _("Counter-clockwise"), _("Stopped")}, {"clockwise", "counter-clockwise", "stopped"}, @@ -125,11 +126,11 @@ Spotlight::update(float dt_sec) switch (m_direction) { case Direction::CLOCKWISE: - angle += dt_sec * speed; + m_angle += dt_sec * m_speed; break; case Direction::COUNTERCLOCKWISE: - angle -= dt_sec * speed; + m_angle -= dt_sec * m_speed; break; case Direction::STOPPED: @@ -142,27 +143,27 @@ Spotlight::draw(DrawingContext& context) { if (m_enabled) { - light->set_color(color); - light->set_blend(Blend::ADD); - light->set_angle(angle); - light->draw(context.light(), m_col.m_bbox.p1(), m_layer); + m_light->set_color(m_color); + m_light->set_blend(Blend::ADD); + m_light->set_angle(m_angle); + m_light->draw(context.light(), m_col.m_bbox.p1(), m_layer); - //lightcone->set_angle(angle); - //lightcone->draw(context.color(), position, m_layer); + //m_lightcone->set_angle(angle); + //m_lightcone->draw(context.color(), position, m_layer); - lights->set_angle(angle); - lights->draw(context.color(), m_col.m_bbox.p1(), m_layer); + m_lights->set_angle(m_angle); + m_lights->draw(context.color(), m_col.m_bbox.p1(), m_layer); } - base->set_angle(angle); - base->draw(context.color(), m_col.m_bbox.p1(), m_layer); + m_base->set_angle(m_angle); + m_base->draw(context.color(), m_col.m_bbox.p1(), m_layer); - center->draw(context.color(), m_col.m_bbox.p1(), m_layer); + m_center->draw(context.color(), m_col.m_bbox.p1(), m_layer); if (m_enabled) { - lightcone->set_angle(angle); - lightcone->draw(context.color(), m_col.m_bbox.p1(), LAYER_FOREGROUND1 + 10); + m_lightcone->set_angle(m_angle); + m_lightcone->draw(context.color(), m_col.m_bbox.p1(), LAYER_FOREGROUND1 + 10); } } @@ -172,4 +173,121 @@ Spotlight::collision(GameObject& other, const CollisionHit& hit_) return FORCE_MOVE; } +void +Spotlight::set_enabled(bool enabled) +{ + m_enabled = enabled; +} + +bool +Spotlight::is_enabled() +{ + return m_enabled; +} + +void +Spotlight::set_direction(const std::string& direction) +{ + m_direction = Direction_from_string(direction); +} + +void +Spotlight::set_speed(float speed) +{ + m_speed = speed; +} + +void +Spotlight::fade_speed(float speed, float time) +{ + ease_speed(time, speed); +} + +void +Spotlight::ease_speed(float speed, float time, const std::string& easing_) +{ + ease_speed(time, speed, EasingMode_from_string(easing_)); +} + +void +Spotlight::set_angle(float angle) +{ + m_angle = angle; +} + +void +Spotlight::fade_angle(float angle, float time) +{ + ease_angle(time, angle); +} + +void +Spotlight::ease_angle(float angle, float time, const std::string& easing_) +{ + ease_angle(time, angle, EasingMode_from_string(easing_)); +} + +void +Spotlight::set_color_rgba(float r, float g, float b, float a) +{ + m_color = Color(r, g, b, a); +} + +void +Spotlight::fade_color_rgba(float r, float g, float b, float a, float time) +{ + ease_color(time, Color(r, g, b, a)); +} + +void +Spotlight::ease_color_rgba(float r, float g, float b, float a, float time, const std::string& easing_) +{ + ease_color(time, Color(r, g, b, a), EasingMode_from_string(easing_)); +} + +void +Spotlight::ease_angle(float time, float target, EasingMode ease) +{ + m_fade_helpers.push_back(std::make_unique(&m_angle, time, target, getEasingByName(ease))); +} + +void +Spotlight::ease_speed(float time, float target, EasingMode ease) +{ + m_fade_helpers.push_back(std::make_unique(&m_speed, time, target, getEasingByName(ease))); +} + +void +Spotlight::ease_color(float time, Color target, EasingMode ease) +{ + m_fade_helpers.push_back(std::make_unique(&m_color.red, time, target.red, getEasingByName(ease))); + m_fade_helpers.push_back(std::make_unique(&m_color.green, time, target.green, getEasingByName(ease))); + m_fade_helpers.push_back(std::make_unique(&m_color.blue, time, target.blue, getEasingByName(ease))); + m_fade_helpers.push_back(std::make_unique(&m_color.alpha, time, target.alpha, getEasingByName(ease))); +} + + +void +Spotlight::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("Spotlight", vm.findClass("MovingObject")); + + cls.addFunc("set_enabled", &Spotlight::set_enabled); + cls.addFunc("is_enabled", &Spotlight::is_enabled); + cls.addFunc("set_direction", &Spotlight::set_direction); + cls.addFunc("set_angle", &Spotlight::set_angle); + cls.addFunc("fade_angle", &Spotlight::fade_angle); + cls.addFunc("ease_angle", &Spotlight::ease_angle); + cls.addFunc("set_speed", &Spotlight::set_speed); + cls.addFunc("fade_speed", &Spotlight::fade_speed); + cls.addFunc("ease_speed", &Spotlight::ease_speed); + cls.addFunc("set_color_rgba", &Spotlight::set_color_rgba); + cls.addFunc("fade_color_rgba", &Spotlight::fade_color_rgba); + cls.addFunc("ease_color_rgba", &Spotlight::ease_color_rgba); + + cls.addVar("enabled", &Spotlight::m_enabled); + cls.addVar("angle", &Spotlight::m_angle); + cls.addVar("speed", &Spotlight::m_speed); +} + /* EOF */ diff --git a/src/object/spotlight.hpp b/src/object/spotlight.hpp index 94fbcf8e3bd..1f2c9422542 100644 --- a/src/object/spotlight.hpp +++ b/src/object/spotlight.hpp @@ -17,17 +17,23 @@ #ifndef HEADER_SUPERTUX_OBJECT_SPOTLIGHT_HPP #define HEADER_SUPERTUX_OBJECT_SPOTLIGHT_HPP -#include "scripting/spotlight.hpp" #include "sprite/sprite_ptr.hpp" -#include "squirrel/exposed_object.hpp" #include "supertux/moving_object.hpp" #include "video/color.hpp" class ReaderMapping; -class Spotlight final : public MovingObject, - public ExposedObject +/** + * @scripting + * @summary A ""Spotlight"" that was given a name can be controlled by scripts. + * @instances A ""Spotlight"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class Spotlight final : public MovingObject { +public: + static void register_class(ssq::VM& vm); + public: enum class Direction { CLOCKWISE, @@ -49,6 +55,7 @@ class Spotlight final : public MovingObject, static std::string class_name() { return "spotlight"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "Spotlight"; } static std::string display_name() { return _("Spotlight"); } virtual std::string get_display_name() const override { return display_name(); } @@ -56,44 +63,127 @@ class Spotlight final : public MovingObject, virtual int get_layer() const override { return m_layer; } - void set_enabled(bool enabled) { m_enabled = enabled; } - bool is_enabled() const { return m_enabled; } - - void set_angle(float angle_) { angle = angle_; } - void set_speed(float speed_) { speed = speed_; } - void set_color(Color color_) { color = color_; } - void set_direction(Direction dir) { m_direction = dir; } - - void ease_angle(float time, float target, EasingMode ease = EasingMode::EaseNone) - { - m_fade_helpers.push_back(std::make_unique(&angle, time, target, getEasingByName(ease))); - } - - void ease_speed(float time, float target, EasingMode ease = EasingMode::EaseNone) - { - m_fade_helpers.push_back(std::make_unique(&speed, time, target, getEasingByName(ease))); - } - - void ease_color(float time, Color target, EasingMode ease = EasingMode::EaseNone) - { - m_fade_helpers.push_back(std::make_unique(&color.red, time, target.red, getEasingByName(ease))); - m_fade_helpers.push_back(std::make_unique(&color.green, time, target.green, getEasingByName(ease))); - m_fade_helpers.push_back(std::make_unique(&color.blue, time, target.blue, getEasingByName(ease))); - m_fade_helpers.push_back(std::make_unique(&color.alpha, time, target.alpha, getEasingByName(ease))); - } + /** + * @scripting + * @deprecated Use the ""enabled"" property instead! + * @description Enables/disables the spotlight. + * @param bool $enabled + */ + void set_enabled(bool enabled); + /** + * @scripting + * @deprecated Use the ""enabled"" property instead! + * @description Returns ""true"" if the spotlight is enabled. + */ + bool is_enabled(); + + /** + * @scripting + * @description Sets the direction of the spotlight. + * @param string $direction + */ + void set_direction(const std::string& direction); + + /** + * @scripting + * @deprecated Use the ""angle"" property instead! + * @description Sets the angle of the spotlight. + * @param float $angle + */ + void set_angle(float angle); + /** + * @scripting + * @description Fades the angle of the spotlight in ""time"" seconds. + * @param float $angle + * @param float $time + */ + void fade_angle(float angle, float time); + /** + * @scripting + * @description Fades the angle of the spotlight in ""time"" seconds, with easing. + * @param float $angle + * @param float $time + * @param string $easing + */ + void ease_angle(float angle, float time, const std::string& easing); + + /** + * @scripting + * @deprecated Use the ""speed"" property instead! + * @description Sets the speed of the spotlight. + * @param float $speed + */ + void set_speed(float speed); + /** + * @scripting + * @description Fades the speed of the spotlight in ""time"" seconds. + * @param float $speed + * @param float $time + */ + void fade_speed(float speed, float time); + /** + * @scripting + * @description Fades the speed of the spotlight in ""time"" seconds, with easing. + * @param float $speed + * @param float $time + * @param string $easing + */ + void ease_speed(float speed, float time, const std::string& easing); + + /** + * @scripting + * @description Sets the RGBA color of the spotlight. + * @param float $r + * @param float $g + * @param float $b + * @param float $a + */ + void set_color_rgba(float r, float g, float b, float a); + /** + * @scripting + * @description Fades the spotlight to a new RGBA color in ""time"" seconds. + * @param float $r + * @param float $g + * @param float $b + * @param float $a + * @param float $time + */ + void fade_color_rgba(float r, float g, float b, float a, float time); + /** + * @scripting + * @description Fades the spotlight to a new RGBA color in ""time"" seconds, with easing. + * @param float $r + * @param float $g + * @param float $b + * @param float $a + * @param float $time + * @param string $easing + */ + void ease_color_rgba(float r, float g, float b, float a, float time, const std::string& easing); + + void ease_angle(float time, float target, EasingMode ease = EasingMode::EaseNone); + void ease_speed(float time, float target, EasingMode ease = EasingMode::EaseNone); + void ease_color(float time, Color target, EasingMode ease = EasingMode::EaseNone); private: - float angle; - SpritePtr center; - SpritePtr base; - SpritePtr lights; - SpritePtr light; - SpritePtr lightcone; - - Color color; - - /** Speed that the spotlight is rotating with */ - float speed; + /** + * @scripting + * @description The angle of the spotlight. + */ + float m_angle; + SpritePtr m_center; + SpritePtr m_base; + SpritePtr m_lights; + SpritePtr m_light; + SpritePtr m_lightcone; + + Color m_color; + + /** + * @scripting + * @description Speed that the spotlight is rotating with. + */ + float m_speed; /** The direction of the spotlight */ Direction m_direction; @@ -101,6 +191,10 @@ class Spotlight final : public MovingObject, /** The layer (z-pos) of the spotlight. */ int m_layer; + /** + * @scripting + * @description Determines whether the spotlight is enabled. + */ bool m_enabled; private: diff --git a/src/object/text_array_object.cpp b/src/object/text_array_object.cpp index 87bda134ff6..def73cbb4a0 100644 --- a/src/object/text_array_object.cpp +++ b/src/object/text_array_object.cpp @@ -15,14 +15,18 @@ // along with this program. If not, see . #include "object/text_array_object.hpp" + +#include +#include + #include "control/input_manager.hpp" +#include "supertux/sector.hpp" TextArrayObject::TextArrayObject(const std::string& name) : - ExposedObject(this), - m_isDone(false), - m_isAuto(false), - m_keepVisible(false), - m_fadeTransition(true), + m_finished(false), + m_is_auto(false), + m_keep_visible(false), + m_fade_transition(true), m_fadetime(1.0), m_texts(), m_curTextIndex(0), @@ -40,7 +44,13 @@ TextArrayObject::clear() } void -TextArrayObject::add_text(const std::string& text, float duration) +TextArrayObject::add_text(const std::string& text) +{ + add_text_duration(text, 3.f); +} + +void +TextArrayObject::add_text_duration(const std::string& text, float duration) { auto pText = std::make_unique(); assert(pText); @@ -51,7 +61,8 @@ TextArrayObject::add_text(const std::string& text, float duration) m_texts.push_back(std::move(pText)); } -void TextArrayObject::set_text_index(ta_index index) +void +TextArrayObject::set_text_index(ta_index index) { if (index < m_texts.size()) m_curTextIndex = index; @@ -66,11 +77,11 @@ TextArrayObject::set_fade_time(float fadetime) void TextArrayObject::next_text() { - if (m_isDone) + if (m_finished) return; if (m_curTextIndex + 1 >= m_texts.size()) { - m_isDone = true; + m_finished = true; return; } @@ -83,7 +94,7 @@ TextArrayObject::next_text() void TextArrayObject::prev_text() { - if (m_isDone) + if (m_finished) return; if (m_curTextIndex == 0) @@ -98,13 +109,13 @@ TextArrayObject::prev_text() void TextArrayObject::set_keep_visible(bool keep_visible) { - m_keepVisible = keep_visible; + m_keep_visible = keep_visible; } void TextArrayObject::set_fade_transition(bool fade_transition) { - m_fadeTransition = fade_transition; + m_fade_transition = fade_transition; } TextArrayItem* @@ -133,20 +144,20 @@ TextArrayObject::get_last_text_item() const void TextArrayObject::set_done(bool done) { - m_isDone = done; + m_finished = done; } void TextArrayObject::set_auto(bool is_auto) { - m_isAuto = is_auto; + m_is_auto = is_auto; reset_automation(); } void TextArrayObject::update(float dt_sec) { - if (m_isDone) + if (m_finished) return; // make sure there's anything to update @@ -157,7 +168,7 @@ TextArrayObject::update(float dt_sec) handle_input_requests(); // check if if should update auto narration - if (m_isAuto && m_waiting.check()) { + if (m_is_auto && m_waiting.check()) { next_text(); } @@ -178,7 +189,7 @@ TextArrayObject::update(float dt_sec) void TextArrayObject::draw(DrawingContext& context) { - if (m_isDone) + if (m_finished) return; auto* curTextItem = get_current_text_item(); @@ -199,7 +210,7 @@ TextArrayObject::draw(DrawingContext& context) void TextArrayObject::override_properties() { - if (!(should_fade() || m_keepVisible)) + if (!(should_fade() || m_keep_visible)) return; auto* curTextItem = get_current_text_item(); @@ -213,7 +224,7 @@ TextArrayObject::override_properties() lastTextItem->text_object.fade_out(m_fadetime); curTextItem->text_object.fade_in(m_fadetime); } - } else if (m_keepVisible) { // keep visible + } else if (m_keep_visible) { // keep visible curTextItem->text_object.set_visible(true); } } @@ -223,7 +234,7 @@ TextArrayObject::reset_automation() { m_waiting.stop(); - if (m_isAuto) { + if (m_is_auto) { auto* text = get_current_text_item(); if (text) m_waiting.start(text->duration); @@ -236,19 +247,223 @@ TextArrayObject::handle_input_requests() const Controller& controller = InputManager::current()->get_controller(); if (controller.pressed(Control::MENU_SELECT)) { - m_isAuto = false; + m_is_auto = false; next_text(); } else if (controller.pressed(Control::REMOVE)) { - m_isAuto = false; + m_is_auto = false; prev_text(); } - } bool TextArrayObject::should_fade() const { - return m_fadeTransition && (m_curTextIndex != m_lastTextIndex); + return m_fade_transition && (m_curTextIndex != m_lastTextIndex); +} + + +/** TextObject functions */ + +#define TEXT_OBJECT_FUNCTION_VOID(F) \ + TextArrayItem* item = get_current_text_item(); \ + if (item) { \ + item->text_object.F; \ + return; \ + } + +#define TEXT_OBJECT_FUNCTION_RETURN(F) \ + TextArrayItem* item = get_current_text_item(); \ + if (item) \ + return item->text_object.F; + +void +TextArrayObject::set_text(const std::string& text) +{ + TEXT_OBJECT_FUNCTION_VOID(set_text(text)) + + add_text(text); +} + +void +TextArrayObject::set_font(const std::string& fontname) +{ + TEXT_OBJECT_FUNCTION_VOID(set_font(fontname)) +} + +void +TextArrayObject::fade_in(float fadetime) +{ + TEXT_OBJECT_FUNCTION_VOID(fade_in(fadetime)) +} + +void +TextArrayObject::fade_out(float fadetime) +{ + TEXT_OBJECT_FUNCTION_VOID(fade_out(fadetime)) +} + +void +TextArrayObject::grow_in(float fadetime) +{ + TEXT_OBJECT_FUNCTION_VOID(grow_in(fadetime)) +} + +void +TextArrayObject::grow_out(float fadetime) +{ + TEXT_OBJECT_FUNCTION_VOID(grow_out(fadetime)) +} + +void +TextArrayObject::set_visible(bool visible) +{ + TEXT_OBJECT_FUNCTION_VOID(set_visible(visible)) +} + +void +TextArrayObject::set_centered(bool centered) +{ + TEXT_OBJECT_FUNCTION_VOID(set_centered(centered)) +} + +void +TextArrayObject::set_pos(float x, float y) +{ + TEXT_OBJECT_FUNCTION_VOID(set_pos(Vector(x, y))) +} + +float +TextArrayObject::get_x() const +{ + TEXT_OBJECT_FUNCTION_RETURN(get_pos().x) + + log_warning << "'TextArrayObject' position is not set. Assuming (0,0)." << std::endl; + return 0; +} + +float +TextArrayObject::get_y() const +{ + TEXT_OBJECT_FUNCTION_RETURN(get_pos().y) + + log_warning << "'TextArrayObject' position is not set. Assuming (0,0)." << std::endl; + return 0; +} + +void +TextArrayObject::set_anchor_point(int anchor) +{ + TEXT_OBJECT_FUNCTION_VOID(set_anchor_point(static_cast(anchor))) +} + +int +TextArrayObject::get_anchor_point() const +{ + TEXT_OBJECT_FUNCTION_RETURN(get_anchor_point()) + + return -1; +} + +void +TextArrayObject::set_anchor_offset(float x, float y) +{ + TEXT_OBJECT_FUNCTION_VOID(set_anchor_offset(x, y)) +} + +float +TextArrayObject::get_wrap_width() const +{ + TEXT_OBJECT_FUNCTION_RETURN(get_wrap_width()) + + return 0; +} + +void +TextArrayObject::set_wrap_width(float width) +{ + TEXT_OBJECT_FUNCTION_VOID(set_wrap_width(width)) +} + +void +TextArrayObject::set_front_fill_color(float red, float green, float blue, float alpha) +{ + TEXT_OBJECT_FUNCTION_VOID(set_front_fill_color(red, green, blue, alpha)) +} + +void +TextArrayObject::set_back_fill_color(float red, float green, float blue, float alpha) +{ + TEXT_OBJECT_FUNCTION_VOID(set_back_fill_color(red, green, blue, alpha)) +} + +void +TextArrayObject::set_text_color(float red, float green, float blue, float alpha) +{ + TEXT_OBJECT_FUNCTION_VOID(set_text_color(red, green, blue, alpha)) +} + +void +TextArrayObject::set_roundness(float roundness) +{ + TEXT_OBJECT_FUNCTION_VOID(set_roundness(roundness)) +} + +#undef TEXT_OBJECT_FUNCTION_VOID +#undef TEXT_OBJECT_FUNCTION_RETURN + + +void +TextArrayObject::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addClass("TextArrayObject", []() + { + if (!Sector::current()) + throw std::runtime_error("Tried to create 'TextArrayObject' without an active sector."); + + return &Sector::get().add(); + }, + false /* Do not free pointer from Squirrel */, + vm.findClass("GameObject")); + + cls.addFunc("clear", &TextArrayObject::clear); + cls.addFunc("add_text", &TextArrayObject::add_text); + cls.addFunc("add_text_duration", &TextArrayObject::add_text_duration); + cls.addFunc("set_text_index", &TextArrayObject::set_text_index); + cls.addFunc("set_keep_visible", &TextArrayObject::set_keep_visible); + cls.addFunc("set_fade_transition", &TextArrayObject::set_fade_transition); + cls.addFunc("set_fade_time", &TextArrayObject::set_fade_time); + cls.addFunc("set_done", &TextArrayObject::set_done); + cls.addFunc("set_auto", &TextArrayObject::set_auto); + cls.addFunc("next_text", &TextArrayObject::next_text); + cls.addFunc("prev_text", &TextArrayObject::prev_text); + + /* TextObject API related */ + cls.addFunc("set_text", &TextArrayObject::set_text); + cls.addFunc("set_font", &TextArrayObject::set_font); + cls.addFunc("fade_in", &TextArrayObject::fade_in); + cls.addFunc("fade_out", &TextArrayObject::fade_out); + cls.addFunc("grow_in", &TextArrayObject::grow_in); + cls.addFunc("grow_out", &TextArrayObject::grow_out); + cls.addFunc("set_visible", &TextArrayObject::set_visible); + cls.addFunc("set_centered", &TextArrayObject::set_centered); + cls.addFunc("set_pos", &TextArrayObject::set_pos); + cls.addFunc("get_x", &TextArrayObject::get_x); + cls.addFunc("get_y", &TextArrayObject::get_y); + cls.addFunc("get_pos_x", &TextArrayObject::get_x); // Deprecated + cls.addFunc("get_pos_y", &TextArrayObject::get_y); // Deprecated + cls.addFunc("set_anchor_point", &TextArrayObject::set_anchor_point); + cls.addFunc("get_anchor_point", &TextArrayObject::get_anchor_point); + cls.addFunc("set_anchor_offset", &TextArrayObject::set_anchor_offset); + cls.addFunc("get_wrap_width", &TextArrayObject::get_wrap_width); + cls.addFunc("set_wrap_width", &TextArrayObject::set_wrap_width); + cls.addFunc("set_front_fill_color", &TextArrayObject::set_front_fill_color); + cls.addFunc("set_back_fill_color", &TextArrayObject::set_back_fill_color); + cls.addFunc("set_text_color", &TextArrayObject::set_text_color); + cls.addFunc("set_roundness", &TextArrayObject::set_roundness); + + cls.addVar("keep_visible", &TextArrayObject::m_keep_visible); + cls.addVar("fade_transition", &TextArrayObject::m_fade_transition); + cls.addVar("finished", &TextArrayObject::m_finished); } /* EOF */ diff --git a/src/object/text_array_object.hpp b/src/object/text_array_object.hpp index 141184e2e27..bfbd8320ea6 100644 --- a/src/object/text_array_object.hpp +++ b/src/object/text_array_object.hpp @@ -17,22 +17,31 @@ #ifndef HEADER_SUPERTUX_OBJECT_TEXT_ARRAY_OBJECT_HPP #define HEADER_SUPERTUX_OBJECT_TEXT_ARRAY_OBJECT_HPP -#include - -#include "squirrel/exposed_object.hpp" #include "supertux/game_object.hpp" -#include "scripting/text_array_object.hpp" +#include + #include "supertux/timer.hpp" #include "object/text_object.hpp" #include "object/text_array_item.hpp" typedef size_t ta_index; -/** A text array object intended for narration */ -class TextArrayObject final : public GameObject, - public ExposedObject +/** + * An array of text objects, intended for narration. + + * @scripting + * @summary A ""TextArrayObject"" that was given a name can be controlled by scripts. + Supports all functions of ${SRG_REF_Text}, applying them to the current text item.${SRG_NEWPARAGRAPH} + Intended for scripts with narration. + * @instances A ""TextArrayObject"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class TextArrayObject final : public GameObject { +public: + static void register_class(ssq::VM& vm); + public: TextArrayObject(const std::string& name = ""); ~TextArrayObject() override = default; @@ -44,6 +53,7 @@ class TextArrayObject final : public GameObject, static std::string class_name() { return "text-array"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "TextArrayObject"; } static std::string display_name() { return _("Text array"); } virtual std::string get_display_name() const override { return display_name(); } @@ -51,57 +61,98 @@ class TextArrayObject final : public GameObject, return "images/engine/editor/textarray.png"; } - /////////// TextArray api related /////////// - - /** Empties the text array. */ + /** + * @scripting + * @description Clears all text objects from the stack. + */ void clear(); - - /** Adds a text with duration. - @param: text the text itself (can be multiline & formatted). - @param: duration (optional) the text display time in seconds, defaults to 3. */ - void add_text(const std::string& text, float duration = 3.0f); - - /** Sets the current text index. - @param: index the index to set to. */ + /** + * @scripting + * @description Adds a text object with a specific text at the end of the stack. + * @param string $text + */ + void add_text(const std::string& text); + /** + * @scripting + * @description Adds a text object with a specific text and duration at the end of the stack. + * @param string $text + * @param float $duration + */ + void add_text_duration(const std::string& text, float duration); + /** + * @scripting + * @description Sets the current text object by its index. + * @param int $index + */ void set_text_index(ta_index index); - - /** Sets the keep visible flag. - This flag overrides all texts to be visible. - @note: fade_transition overrides this - @param: keep_visible true to enable keep_visible; false to disable the flag. */ + /** + * @scripting + * @deprecated Use the ""keep_visible"" property instead! + * @description If set, keeps the current text object visible. + * @param bool $keep_visible + */ void set_keep_visible(bool keep_visible); - - /** Sets the fade transition flag. - This flag overrides all texts to be visible and fading. - @note: overrides keep_visible flag */ + /** + * @scripting + * @deprecated Use the ""fade_transition"" property instead! + * @description If set, allows for a fade-in and fade-out transition. + * @param bool $fade_transition + */ void set_fade_transition(bool fade_transition); - - /** Sets fadetime for fade_transition. - @param: fadetime the fade time. - @note: does NOT override the TextArray::fade_in() method. */ + /** + * @scripting + * @description Sets the fade-in and fade-out time. + * @param float $fadetime + */ void set_fade_time(float fadetime); - - /** Sets the done flag as on. This disables the text array. - @note: the text array is not cleared. - @param: done true for on; false for off. */ + /** + * @scripting + * @deprecated Use the ""finished"" property instead! + * @description If set, sets the text array as finished going through all text objects. + * @param bool $done + */ void set_done(bool done); - - /** Sets the auto flag on & starts the auto narration. - @note: this starts the auto narration immediately! - this is disabled once the user inputs a skip! */ + /** + * @scripting + * @description If set, lets the text array automatically go through all text objects. + * @param bool $is_auto + */ void set_auto(bool is_auto); - - /** Sets the current text to the next one. - @note: if the text is the last on the array, - the done flag is set, and the text array is disabled. */ + /** + * @scripting + * @description If available, goes to the next text object in the stack. + */ void next_text(); - - /** Sets the current text to the previous. - @note: if the current text is the first on the array, - it stays that way. */ + /** + * @scripting + * @description If available, goes to the previous text object in the stack. + */ void prev_text(); - /////////// TextArrayObject access /////////// + /* + * TextObject API related + * @see: text_object.hpp + */ + void set_text(const std::string& text); + void set_font(const std::string& fontname); + void fade_in(float fadetime); + void fade_out(float fadetime); + void grow_in(float fadetime); + void grow_out(float fadetime); + void set_visible(bool visible); + void set_centered(bool centered); + void set_pos(float x, float y); + float get_x() const; + float get_y() const; + void set_anchor_point(int anchor); + int get_anchor_point() const; + void set_anchor_offset(float x, float y); + float get_wrap_width() const; + void set_wrap_width(float width); + void set_front_fill_color(float red, float green, float blue, float alpha); + void set_back_fill_color(float red, float green, float blue, float alpha); + void set_text_color(float red, float green, float blue, float alpha); + void set_roundness(float roundness); /** Gets the text item at a certain index. @param: index the index of the text item to get. @@ -133,10 +184,23 @@ class TextArrayObject final : public GameObject, bool should_fade() const; private: - bool m_isDone; - bool m_isAuto; - bool m_keepVisible; - bool m_fadeTransition; + /** + * @scripting + * @description Determines whether the text array has finished going through all text objects. + */ + bool m_finished; + bool m_is_auto; + + /** + * @scripting + * @description Determines whether the current text object should be kept visible. + */ + bool m_keep_visible; + /** + * @scripting + * @description Allows for a fade-in and fade-out transition. + */ + bool m_fade_transition; float m_fadetime; diff --git a/src/object/text_object.cpp b/src/object/text_object.cpp index f68a1ceae90..ea7a31cc31b 100644 --- a/src/object/text_object.cpp +++ b/src/object/text_object.cpp @@ -16,17 +16,20 @@ #include "object/text_object.hpp" +#include +#include + #include "editor/editor.hpp" #include "supertux/sector.hpp" #include "util/reader.hpp" #include "util/reader_mapping.hpp" #include "supertux/globals.hpp" #include "supertux/resources.hpp" +#include "supertux/sector.hpp" #include "video/drawing_context.hpp" TextObject::TextObject(const std::string& name) : GameObject(name), - ExposedObject(this), m_font(Resources::normal_font), m_text(), m_wrapped_text(), @@ -151,21 +154,69 @@ TextObject::set_centered(bool centered) } void -TextObject::set_front_fill_color(Color frontfill) +TextObject::set_pos(float x, float y) +{ + m_pos = Vector(x, y); +} + +float +TextObject::get_x() const +{ + return m_pos.x; +} + +float +TextObject::get_y() const +{ + return m_pos.y; +} + +void +TextObject::set_anchor_point(int anchor) +{ + m_anchor = static_cast(anchor); +} + +int +TextObject::get_anchor_point() const { - m_front_fill_color = frontfill; + return static_cast(m_anchor); } void -TextObject::set_back_fill_color(Color backfill) +TextObject::set_anchor_offset(float x, float y) { - m_back_fill_color = backfill; + m_anchor_offset = Vector(x, y); +} + +float +TextObject::get_wrap_width() const +{ + return m_wrap_width; } void -TextObject::set_text_color(Color textcolor) +TextObject::set_wrap_width(float width) { - m_text_color = textcolor; + m_wrap_width = width; +} + +void +TextObject::set_front_fill_color(float red, float green, float blue, float alpha) +{ + m_front_fill_color = Color(red, green, blue, alpha); +} + +void +TextObject::set_back_fill_color(float red, float green, float blue, float alpha) +{ + m_back_fill_color = Color(red, green, blue, alpha); +} + +void +TextObject::set_text_color(float red, float green, float blue, float alpha) +{ + m_text_color = Color(red, green, blue, alpha); } void @@ -243,4 +294,48 @@ TextObject::update(float dt_sec) } } + +void +TextObject::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addClass("TextObject", []() + { + if (!Sector::current()) + throw std::runtime_error("Tried to create 'TextObject' without an active sector."); + + return &Sector::get().add(); + }, + false /* Do not free pointer from Squirrel */, + vm.findClass("GameObject")); + + /* NOTE: Any functions exposed here should also be exposed in TextArrayObject. */ + cls.addFunc("set_text", &TextObject::set_text); + cls.addFunc("set_font", &TextObject::set_font); + cls.addFunc("fade_in", &TextObject::fade_in); + cls.addFunc("fade_out", &TextObject::fade_out); + cls.addFunc("grow_in", &TextObject::grow_in); + cls.addFunc("grow_out", &TextObject::grow_out); + cls.addFunc("set_visible", &TextObject::set_visible); + cls.addFunc("set_centered", &TextObject::set_centered); + cls.addFunc("set_pos", &TextObject::set_pos); + cls.addFunc("get_x", &TextObject::get_x); + cls.addFunc("get_y", &TextObject::get_y); + cls.addFunc("get_pos_x", &TextObject::get_x); // Deprecated + cls.addFunc("get_pos_y", &TextObject::get_y); // Deprecated + cls.addFunc("set_anchor_point", &TextObject::set_anchor_point); + cls.addFunc("get_anchor_point", &TextObject::get_anchor_point); + cls.addFunc("set_anchor_offset", &TextObject::set_anchor_offset); + cls.addFunc("get_wrap_width", &TextObject::get_wrap_width); + cls.addFunc("set_wrap_width", &TextObject::set_wrap_width); + cls.addFunc("set_front_fill_color", &TextObject::set_front_fill_color); + cls.addFunc("set_back_fill_color", &TextObject::set_back_fill_color); + cls.addFunc("set_text_color", &TextObject::set_text_color); + cls.addFunc("set_roundness", &TextObject::set_roundness); + + cls.addVar("visible", &TextObject::m_visible); + cls.addVar("centered", &TextObject::m_centered); + cls.addVar("wrap_width", &TextObject::m_wrap_width); + cls.addVar("roundness", &TextObject::m_roundness); +} + /* EOF */ diff --git a/src/object/text_object.hpp b/src/object/text_object.hpp index 1b5a9c06747..33396c4cc33 100644 --- a/src/object/text_object.hpp +++ b/src/object/text_object.hpp @@ -17,11 +17,9 @@ #ifndef HEADER_SUPERTUX_OBJECT_TEXT_OBJECT_HPP #define HEADER_SUPERTUX_OBJECT_TEXT_OBJECT_HPP -#include "squirrel/exposed_object.hpp" #include "supertux/game_object.hpp" #include "math/anchor_point.hpp" -#include "scripting/text_object.hpp" #include "video/color.hpp" #include "video/drawing_context.hpp" #include "video/font_ptr.hpp" @@ -29,18 +27,28 @@ class DrawingContext; class ReaderMapping; -/** A text object intended for scripts that want to tell a story */ -class TextObject final : public GameObject, - public ExposedObject +/** + * A text object intended for scripts that want to tell a story. + + * @scripting + * @summary A ""TextObject"" that was given a name can be controlled by scripts. + * @instances A ""TextObject"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class TextObject final : public GameObject { static Color default_color; +public: + static void register_class(ssq::VM& vm); + public: TextObject(const std::string& name = ""); ~TextObject() override; static std::string class_name() { return "textobject"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "TextObject"; } static std::string display_name() { return _("Text"); } virtual std::string get_display_name() const override { return display_name(); } @@ -50,27 +58,156 @@ class TextObject final : public GameObject, virtual void update(float dt_sec) override; virtual bool is_saveable() const override { return false; } + /** + * @scripting + * @description Sets the text string to be displayed. + * @param string $text + */ void set_text(const std::string& text); - void set_font(const std::string& name); - void grow_in(float fadetime); - void grow_out(float fadetime); + /** + * @scripting + * @description Sets the font of the text to be displayed. + * @param string $fontname Valid values are normal, big and small. + */ + void set_font(const std::string& fontname); + /** + * @scripting + * @description Fades in the specified text for the next ""fadetime"" seconds. + * @param float $fadetime + */ void fade_in(float fadetime); + /** + * @scripting + * @description Fades out the specified text for the next ""fadetime"" seconds. + * @param float $fadetime + */ void fade_out(float fadetime); + /** + * @scripting + * @description Grows in the specified text for the next ""fadetime"" seconds. + * @param float $fadetime + */ + void grow_in(float fadetime); + /** + * @scripting + * @description Grows out the specified text for the next ""fadetime"" seconds. + * @param float $fadetime + */ + void grow_out(float fadetime); + /** + * @scripting + * @deprecated Use the ""visible"" property instead! (Does not apply for usage from a ""TextArray"".) + * @description Shows or hides the text abruptly (drastic counterpart to ""fade_in()"" and ""fade_out()""). + * @param bool $visible + */ void set_visible(bool visible); + /** + * @scripting + * @deprecated Use the ""centered"" property instead! (Does not apply for usage from a ""TextArray"".) + * @description If ""centered"" is ""true"", the text will be centered on the screen. Otherwise, it will be left-aligned. + * @param bool $centered + */ void set_centered(bool centered); - void set_front_fill_color(Color frontfill); - void set_back_fill_color(Color backfill); - void set_text_color(Color textcolor); + /** + * @scripting + * @description Sets the offset of the text, relative to the anchor point. + * @param float $x + * @param float $y + */ + void set_pos(float x, float y); + /** + * @scripting + * @description Returns the X offset of the text, relative to the anchor point. + */ + float get_x() const; + /** + * @scripting + * @description Returns the Y offset of the text, relative to the anchor point. + */ + float get_y() const; +#ifdef DOXYGEN_SCRIPTING + /** + * @scripting + * @deprecated Use ""get_x()"" instead! + * @description Returns the X offset of the text, relative to the anchor point. + */ + float get_pos_x() const; + /** + * @scripting + * @deprecated Use ""get_y()"" instead! + * @description Returns the Y offset of the text, relative to the anchor point. + */ + float get_pos_y() const; +#endif + /** + * @scripting + * @description Sets the anchor point of the text. + * @param int $anchor One of the ""ANCHOR_*"" constants (see ${SRG_REF_AnchorPoints}). + */ + void set_anchor_point(int anchor); + /** + * @scripting + * @description Returns the current anchor point of the text (one of the ""ANCHOR_*"" constants; see ${SRG_REF_AnchorPoints}). + */ + int get_anchor_point() const; + /** + * @scripting + * @description Sets the anchor offset of the text. + * @param float $x + * @param float $y + */ + void set_anchor_offset(float x, float y); + /** + * @scripting + * @deprecated Use the ""wrap_width"" property instead! (Does not apply for usage from a ""TextArray"".) + * @description Gets the text wrap width of the text. + */ + float get_wrap_width() const; + /** + * @scripting + * @deprecated Use the ""wrap_width"" property instead! (Does not apply for usage from a ""TextArray"".) + * @description Sets the text wrap width of the text. + * @param float $width + */ + void set_wrap_width(float width); + /** + * @scripting + * @description Sets the front fill color of the text. + * @param float $red + * @param float $green + * @param float $blue + * @param float $alpha + */ + void set_front_fill_color(float red, float green, float blue, float alpha); + /** + * @scripting + * @description Sets the back fill color of the text. + * @param float $red + * @param float $green + * @param float $blue + * @param float $alpha + */ + void set_back_fill_color(float red, float green, float blue, float alpha); + /** + * @scripting + * @description Sets the text color. + * @param float $red + * @param float $green + * @param float $blue + * @param float $alpha + */ + void set_text_color(float red, float green, float blue, float alpha); + /** + * @scripting + * @deprecated Use the ""roundness"" property instead! (Does not apply for usage from a ""TextArray"".) + * @description Sets the frame's roundness. + * @param float $roundness + */ void set_roundness(float roundness); - bool is_visible(); void set_anchor_point(AnchorPoint anchor) { m_anchor = anchor; } - AnchorPoint get_anchor_point() const { return m_anchor; } void set_anchor_offset(const Vector& offset) { m_anchor_offset = offset; } - float get_wrap_width() const { return m_wrap_width; } - void set_wrap_width(float width) { m_wrap_width = width; } - void set_pos(const Vector& pos) { m_pos = pos; } const Vector& get_pos() const { return m_pos; } @@ -83,15 +220,31 @@ class TextObject final : public GameObject, std::string m_wrapped_text; float m_fade_progress; float m_fadetime; + /** + * @scripting + * @description Determines whether the text is visible. + */ bool m_visible; + /** + * @scripting + * @description Determines whether the text is centered. + */ bool m_centered; AnchorPoint m_anchor; Vector m_anchor_offset; Vector m_pos; + /** + * @scripting + * @description Determines the maximum wrap width of the text. + */ float m_wrap_width; Color m_front_fill_color; Color m_back_fill_color; Color m_text_color; + /** + * @scripting + * @description Determines the roundness of the text frame. + */ float m_roundness; bool m_growing_in; bool m_growing_out; diff --git a/src/object/thunderstorm.cpp b/src/object/thunderstorm.cpp index 88f12181a9f..359edc3f648 100644 --- a/src/object/thunderstorm.cpp +++ b/src/object/thunderstorm.cpp @@ -16,6 +16,9 @@ #include "object/thunderstorm.hpp" +#include +#include + #include "audio/sound_manager.hpp" #include "editor/editor.hpp" #include "object/background.hpp" @@ -38,7 +41,6 @@ const float RESTORE_BACKGROUND_COLOR_TIME = 0.1f; Thunderstorm::Thunderstorm(const ReaderMapping& reader) : GameObject(reader), - ExposedObject(this), running(true), interval(10.0f), layer(LAYER_BACKGROUNDTILES-1), @@ -122,7 +124,7 @@ Thunderstorm::update(float ) time_to_lightning.start(LIGHTNING_DELAY); } if (time_to_lightning.check()) { - lightning_in_sequence(); + lightning_general(); time_to_thunder.start(interval); } } @@ -139,6 +141,18 @@ Thunderstorm::draw(DrawingContext& context) context.pop_transform(); } +void +Thunderstorm::lightning_general(bool is_scripted) +{ + flash(); + electrify(); + if (!m_strike_script.empty()) { + Sector::get().run_script(m_strike_script, "strike-script"); + } + + change_background_colors(true, is_scripted); +} + void Thunderstorm::start() { @@ -164,28 +178,10 @@ Thunderstorm::thunder() change_background_colors(false); } -void -Thunderstorm::lightning_general() -{ - flash(); - electrify(); - if (!m_strike_script.empty()) { - Sector::get().run_script(m_strike_script, "strike-script"); - } -} - void Thunderstorm::lightning() { - lightning_general(); - change_background_colors(true, true); -} - -void -Thunderstorm::lightning_in_sequence() -{ - lightning_general(); - change_background_colors(true, false); + lightning_general(true); } void @@ -233,4 +229,18 @@ Thunderstorm::restore_background_colors() } } + +void +Thunderstorm::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("Thunderstorm", vm.findClass("GameObject")); + + cls.addFunc("start", &Thunderstorm::start); + cls.addFunc("stop", &Thunderstorm::stop); + cls.addFunc("thunder", &Thunderstorm::thunder); + cls.addFunc("lightning", &Thunderstorm::lightning); + cls.addFunc("flash", &Thunderstorm::flash); + cls.addFunc("electrify", &Thunderstorm::electrify); +} + /* EOF */ diff --git a/src/object/thunderstorm.hpp b/src/object/thunderstorm.hpp index a285e65bfa4..0c888df48e1 100644 --- a/src/object/thunderstorm.hpp +++ b/src/object/thunderstorm.hpp @@ -20,19 +20,26 @@ #include #include -#include "squirrel/exposed_object.hpp" -#include "scripting/thunderstorm.hpp" #include "supertux/game_object.hpp" #include "supertux/timer.hpp" class DrawingContext; class ReaderMapping; -/** Thunderstorm scriptable GameObject; plays thunder, lightning and - electrifies water at regular interval */ -class Thunderstorm final : public GameObject, - public ExposedObject +/** + * Thunderstorm scriptable GameObject: Plays thunder, lightning and + electrifies water at regular interval. + + * @scripting + * @summary A ""Thunderstorm"" that was given a name can be controlled by scripts. + * @instances A ""Thunderstorm"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class Thunderstorm final : public GameObject { +public: + static void register_class(ssq::VM& vm); + public: Thunderstorm(const ReaderMapping& reader); @@ -41,6 +48,7 @@ class Thunderstorm final : public GameObject, static std::string class_name() { return "thunderstorm"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "Thunderstorm"; } static std::string display_name() { return _("Thunderstorm"); } virtual std::string get_display_name() const override { return display_name(); } @@ -51,29 +59,44 @@ class Thunderstorm final : public GameObject, /** @name Scriptable Methods @{ */ - /** Start playing thunder and lightning at configured interval */ + /** + * @scripting + * @description Starts playing thunder and lightning at a configured interval. + */ void start(); - - /** Stop playing thunder and lightning at configured interval */ + /** + * @scripting + * @description Stops playing thunder and lightning at a configured interval. + */ void stop(); - /** Play thunder */ + /** + * @scripting + * @description Plays thunder. + */ void thunder(); - - /** Methods for doing lightning by different methods. Necessary for the future implementation of SimpleSquirrel. */ - void lightning_general(); + /** + * @scripting + * @description Plays lightning, i.e. calls ""flash()"" and ""electrify()"". + */ void lightning(); - void lightning_in_sequence(); - /** Display a nice flash */ + /** + * @scripting + * @description Displays a flash. + */ void flash(); - - /** Electrify water throughout the whole sector for a short time */ + /** + * @scripting + * @description Electrifies water throughout the whole sector for a short time. + */ void electrify(); /** @} */ private: + void lightning_general(bool is_scripted = false); + void change_background_colors(bool is_lightning, bool is_scripted = false); void restore_background_colors(); diff --git a/src/object/tilemap.cpp b/src/object/tilemap.cpp index ab0d23f87bb..422474fc05e 100644 --- a/src/object/tilemap.cpp +++ b/src/object/tilemap.cpp @@ -18,6 +18,9 @@ #include +#include +#include + #include "editor/editor.hpp" #include "supertux/autotile.hpp" #include "supertux/debug.hpp" @@ -38,7 +41,6 @@ #include "video/surface.hpp" TileMap::TileMap(const TileSet *new_tileset) : - ExposedObject(this), PathObject(), m_editor_active(true), m_tileset(new_tileset), @@ -73,7 +75,6 @@ TileMap::TileMap(const TileSet *new_tileset) : TileMap::TileMap(const TileSet *tileset_, const ReaderMapping& reader) : GameObject(reader), - ExposedObject(this), PathObject(), m_editor_active(true), m_tileset(tileset_), @@ -515,34 +516,6 @@ TileMap::draw(DrawingContext& context) context.pop_transform(); } -void -TileMap::goto_node(int node_idx) -{ - if (!get_walker()) return; - get_walker()->goto_node(node_idx); -} - -void -TileMap::jump_to_node(int node_idx, bool instantaneous) -{ - if (!get_walker()) return; - get_walker()->jump_to_node(node_idx, instantaneous); -} - -void -TileMap::start_moving() -{ - if (!get_walker()) return; - get_walker()->start_moving(); -} - -void -TileMap::stop_moving() -{ - if (!get_walker()) return; - get_walker()->stop_moving(); -} - void TileMap::set(int newwidth, int newheight, const std::vector&newt, int new_z_pos, bool newsolid) @@ -688,7 +661,13 @@ uint32_t TileMap::get_tile_id_at(const Vector& pos) const { Vector xy = (pos - m_offset) / 32.0f; - return get_tile_id(int(xy.x), int(xy.y)); + return get_tile_id(static_cast(xy.x), static_cast(xy.y)); +} + +uint32_t +TileMap::get_tile_id_at(float x, float y) const +{ + return get_tile_id_at(Vector(x, y)); } const Tile& @@ -714,6 +693,12 @@ TileMap::change_at(const Vector& pos, uint32_t newtile) change(int(xy.x), int(xy.y), newtile); } +void +TileMap::change_at(float x, float y, uint32_t newtile) +{ + change_at(Vector(x, y), newtile); +} + void TileMap::change_all(uint32_t oldtile, uint32_t newtile) { @@ -918,23 +903,29 @@ TileMap::get_autotileset(uint32_t tile) const } void -TileMap::fade(float alpha_, float seconds) +TileMap::fade(float alpha_, float time) { m_alpha = alpha_; - m_remaining_fade_time = seconds; + m_remaining_fade_time = time; } void -TileMap::tint_fade(const Color& new_tint, float seconds) +TileMap::tint_fade(const Color& new_tint, float time) { m_tint = new_tint; - m_remaining_tint_fade_time = seconds; + m_remaining_tint_fade_time = time; } void -TileMap::set_alpha(float alpha_) +TileMap::tint_fade(float time, float red, float green, float blue, float alpha) { - m_alpha = alpha_; + tint_fade(Color(red, green, blue, alpha), time); +} + +void +TileMap::set_alpha(float alpha) +{ + m_alpha = alpha; m_current_alpha = m_alpha; m_remaining_fade_time = 0; update_effective_solid (); @@ -977,4 +968,24 @@ TileMap::set_tileset(const TileSet* new_tileset) m_tileset = new_tileset; } + +void +TileMap::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("TileMap", vm.findClass("GameObject")); + + PathObject::register_members(cls); + + cls.addFunc("get_tile_id", &TileMap::get_tile_id); + cls.addFunc("get_tile_id_at", &TileMap::get_tile_id_at); + cls.addFunc("change", &TileMap::change); + cls.addFunc("change_at", &TileMap::change_at); + cls.addFunc("change_all", &TileMap::change_all); + cls.addFunc("fade", &TileMap::fade); + cls.addFunc("tint_fade", &TileMap::tint_fade); + cls.addFunc("set_alpha", &TileMap::set_alpha); + cls.addFunc("get_alpha", &TileMap::get_alpha); + cls.addFunc("set_solid", &TileMap::set_solid); +} + /* EOF */ diff --git a/src/object/tilemap.hpp b/src/object/tilemap.hpp index faf0db746d0..332b52c3ec2 100644 --- a/src/object/tilemap.hpp +++ b/src/object/tilemap.hpp @@ -25,26 +25,33 @@ #include "math/size.hpp" #include "object/path_object.hpp" #include "object/path_walker.hpp" -#include "squirrel/exposed_object.hpp" -#include "scripting/tilemap.hpp" #include "supertux/autotile.hpp" #include "supertux/game_object.hpp" #include "video/color.hpp" #include "video/flip.hpp" #include "video/drawing_target.hpp" -class DrawingContext; class CollisionObject; class CollisionGroundMovementManager; +class DrawingContext; class Tile; class TileSet; -/** This class is responsible for drawing the level tiles */ -class TileMap final : - public GameObject, - public ExposedObject, - public PathObject +/** + * This class is responsible for managing an array of tiles. + + * @scripting + * @summary A ""TileMap"" that was given a name can be controlled by scripts. + The tilemap can be moved by specifying a path for it. + * @instances A ""TileMap"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class TileMap final : public GameObject, + public PathObject { +public: + static void register_class(ssq::VM& vm); + public: TileMap(const TileSet *tileset); TileMap(const TileSet *tileset, const ReaderMapping& reader); @@ -54,6 +61,7 @@ class TileMap final : static std::string class_name() { return "tilemap"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "TileMap"; } virtual const std::string get_icon_path() const override { return "images/engine/editor/tilemap.png"; } static std::string display_name() { return _("Tilemap"); } virtual std::string get_display_name() const override { return display_name(); } @@ -71,18 +79,6 @@ class TileMap final : virtual void on_flip(float height) override; - /** Move tilemap until at given node, then stop */ - void goto_node(int node_idx); - - /** Instantly jump to the given node */ - void jump_to_node(int node_idx, bool instantaneous = false); - - /** Start moving tilemap */ - void start_moving(); - - /** Stop tilemap at next node */ - void stop_moving(); - void set(int width, int height, const std::vector& vec, int z_pos, bool solid); @@ -148,21 +144,58 @@ class TileMap final : bool is_solid() const { return m_real_solid && m_effective_solid; } - /** Changes Tilemap's solidity, i.e. whether to consider it when - doing collision detection. */ + /** + * @scripting + * @description Switches the tilemap's real solidity to ""solid"".${SRG_TABLENEWPARAGRAPH} + Note: The effective solidity is also influenced by the alpha of the tilemap. + * @param bool $solid + */ void set_solid(bool solid = true); bool is_outside_bounds(const Vector& pos) const; const Tile& get_tile(int x, int y) const; const Tile& get_tile_at(const Vector& pos) const; + /** + * @scripting + * @description Returns the ID of the tile at the given coordinates or 0 if out of bounds. + The origin is at the top left. + * @param int $x + * @param int $y + */ uint32_t get_tile_id(int x, int y) const; + /** + * @scripting + * @description Returns the ID of the tile at the given position (in world coordinates). + * @param float $x + * @param float $y + */ + uint32_t get_tile_id_at(float x, float y) const; uint32_t get_tile_id_at(const Vector& pos) const; + /** + * @scripting + * @description Changes the tile at the given coordinates to ""newtile"". + The origin is at the top left. + * @param int $x + * @param int $y + * @param int $newtile + */ void change(int x, int y, uint32_t newtile); - + /** + * @scripting + * @description Changes the tile at the given position (in-world coordinates) to ""newtile"". + * @param float $x + * @param float $y + * @param int $newtile + */ + void change_at(float x, float y, uint32_t newtile); void change_at(const Vector& pos, uint32_t newtile); - - /** changes all tiles with the given ID */ + /** + * @scripting + * @description Changes all tiles with the given ID. + * @param int $oldtile + * @param int $newtile + */ void change_all(uint32_t oldtile, uint32_t newtile); /** Puts the correct autotile block at the given position */ @@ -191,23 +224,43 @@ class TileMap final : void set_flip(Flip flip) { m_flip = flip; } Flip get_flip() const { return m_flip; } - /** Start fading the tilemap to opacity given by @c alpha. - Destination opacity will be reached after @c seconds seconds. - Also influences solidity. */ - void fade(float alpha, float seconds = 0); + /** + * @scripting + * @description Starts fading the tilemap to the opacity given by ""alpha"". + Destination opacity will be reached after ""time"" seconds. Also influences solidity. + * @param float $alpha + * @param float $time + */ + void fade(float alpha, float time); /** Start fading the tilemap to tint given by RGBA. Destination opacity will be reached after @c seconds seconds. Doesn't influence solidity. */ - void tint_fade(const Color& new_tint, float seconds = 0); + void tint_fade(const Color& new_tint, float time = 0.f); + /** + * @scripting + * @description Starts fading the tilemap to tint given by RGBA. + Destination opacity will be reached after ""time"" seconds. Doesn't influence solidity. + * @param float $time + * @param float $red + * @param float $green + * @param float $blue + * @param float $alpha + */ + void tint_fade(float time, float red, float green, float blue, float alpha); Color get_current_tint() const { return m_current_tint; } - /** Instantly switch tilemap's opacity to @c alpha. Also influences solidity. */ + /** + * @scripting + * @description Instantly switches the tilemap's opacity to ""alpha"". Also influences solidity. + * @param float $alpha + */ void set_alpha(float alpha); - - /** Return tilemap's opacity. Note that while the tilemap is fading - in or out, this will return the current alpha value, not the - target alpha. */ + /** + * @scripting + * @description Returns the tilemap's opacity.${SRG_TABLENEWPARAGRAPH} + Note: While the tilemap is fading in or out, this will return the current alpha value, not the target alpha. + */ float get_alpha() const; float get_target_alpha() const { return m_alpha; } diff --git a/src/object/torch.cpp b/src/object/torch.cpp index 07acd062aca..b10359034d3 100644 --- a/src/object/torch.cpp +++ b/src/object/torch.cpp @@ -17,6 +17,9 @@ #include "object/torch.hpp" +#include +#include + #include "object/player.hpp" #include "sprite/sprite.hpp" #include "sprite/sprite_manager.hpp" @@ -25,7 +28,6 @@ Torch::Torch(const ReaderMapping& reader) : MovingSprite(reader, "images/objects/torch/torch1.sprite"), - ExposedObject(this), m_light_color(1.f, 1.f, 1.f), m_flame(SpriteManager::current()->create("images/objects/torch/flame.sprite")), m_flame_glow(SpriteManager::current()->create("images/objects/torch/flame_glow.sprite")), @@ -117,9 +119,9 @@ Torch::get_burning() const } void -Torch::set_burning(bool burning_) +Torch::set_burning(bool burning) { - m_burning = burning_; + m_burning = burning; } void @@ -129,4 +131,16 @@ Torch::on_flip(float height) FlipLevelTransformer::transform_flip(m_flip); } + +void +Torch::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("Torch", vm.findClass("MovingSprite")); + + cls.addFunc("get_burning", &Torch::get_burning); + cls.addFunc("set_burning", &Torch::set_burning); + + cls.addVar("burning", &Torch::m_burning); +} + /* EOF */ diff --git a/src/object/torch.hpp b/src/object/torch.hpp index 029542a1ea9..ea24ad4ac41 100644 --- a/src/object/torch.hpp +++ b/src/object/torch.hpp @@ -19,15 +19,20 @@ #define HEADER_SUPERTUX_OBJECT_TORCH_HPP #include "object/moving_sprite.hpp" -#include "squirrel/exposed_object.hpp" - -#include "scripting/torch.hpp" class ReaderMapping; -class Torch final : public MovingSprite, - public ExposedObject +/** + * @scripting + * @summary A ""Torch"" that was given a name can be controlled by scripts. + * @instances A ""Torch"" is instantiated by placing a definition inside a level. + It can then be accessed by its name from a script or via ""sector.name"" from the console. + */ +class Torch final : public MovingSprite { +public: + static void register_class(ssq::VM& vm); + public: Torch(const ReaderMapping& reader); @@ -38,6 +43,7 @@ class Torch final : public MovingSprite, static std::string class_name() { return "torch"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "Torch"; } static std::string display_name() { return _("Torch"); } virtual std::string get_display_name() const override { return display_name(); } @@ -48,18 +54,30 @@ class Torch final : public MovingSprite, virtual void on_flip(float height) override; - /** @name Scriptable Methods - @{ */ - bool get_burning() const; /**< returns true if torch is lighted */ - void set_burning(bool burning_); /**< true: light torch, false: extinguish - torch */ - /** @} */ + /** + * @scripting + * @deprecated Use the ""burning"" property instead! + * @description Returns ""true"" if the torch is burning. + */ + bool get_burning() const; + /** + * @scripting + * @deprecated Use the ""burning"" property instead! + * @description Switches the burning state of the torch. + * @param bool $burning + */ + void set_burning(bool burning); private: Color m_light_color; SpritePtr m_flame; SpritePtr m_flame_glow; SpritePtr m_flame_light; + + /** + * @scripting + * @description Determines whether the torch is burning. + */ bool m_burning; private: diff --git a/src/object/wind.cpp b/src/object/wind.cpp index 1a5d5da7ec8..b446c005243 100644 --- a/src/object/wind.cpp +++ b/src/object/wind.cpp @@ -16,6 +16,9 @@ #include "object/wind.hpp" +#include +#include + #include "badguy/badguy.hpp" #include "editor/editor.hpp" #include "math/random.hpp" @@ -31,7 +34,6 @@ Wind::Wind(const ReaderMapping& reader) : MovingObject(reader), - ExposedObject(this), blowing(), speed(0.0f, 0.0f), acceleration(), @@ -186,4 +188,14 @@ Wind::on_flip(float height) speed.y = -speed.y; } + +void +Wind::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("Wind", vm.findClass("MovingObject")); + + cls.addFunc("start", &Wind::start); + cls.addFunc("stop", &Wind::stop); +} + /* EOF */ diff --git a/src/object/wind.hpp b/src/object/wind.hpp index f9bdde1df96..bbc5ae21c1f 100644 --- a/src/object/wind.hpp +++ b/src/object/wind.hpp @@ -17,8 +17,6 @@ #ifndef HEADER_SUPERTUX_OBJECT_WIND_HPP #define HEADER_SUPERTUX_OBJECT_WIND_HPP -#include "squirrel/exposed_object.hpp" -#include "scripting/wind.hpp" #include "supertux/moving_object.hpp" #include "video/layer.hpp" @@ -26,10 +24,11 @@ class ReaderMapping; /** Defines an area that will gently push Players in one direction */ -class Wind final : - public MovingObject, - public ExposedObject +class Wind final : public MovingObject { +public: + static void register_class(ssq::VM& vm); + public: Wind(const ReaderMapping& reader); @@ -40,6 +39,7 @@ class Wind final : virtual bool has_variable_size() const override { return true; } static std::string class_name() { return "wind"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "Wind"; } static std::string display_name() { return _("Wind"); } virtual std::string get_display_name() const override { return display_name(); } @@ -49,17 +49,15 @@ class Wind final : virtual void on_flip(float height) override; - /** @name Scriptable Methods - @{ */ - - /** start blowing */ + /** + * Starts blowing. + */ void start(); - - /** stop blowing */ + /** + * Stops blowing. + */ void stop(); - /** @} */ - private: bool blowing; /**< true if wind is currently switched on */ Vector speed; diff --git a/src/scripting/ambient_sound.cpp b/src/scripting/ambient_sound.cpp deleted file mode 100644 index 98722887c14..00000000000 --- a/src/scripting/ambient_sound.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SuperTux -// Copyright (C) 2015 Ingo Ruhnke -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/ambient_sound.hpp" - -#include "object/ambient_sound.hpp" - -namespace scripting { - -void -AmbientSound::set_pos(float x, float y) -{ - SCRIPT_GUARD_VOID; - object.set_pos(x, y); -} - -float -AmbientSound::get_pos_x() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_pos_x(); -} - -float -AmbientSound::get_pos_y() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_pos_y(); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/ambient_sound.hpp b/src/scripting/ambient_sound.hpp deleted file mode 100644 index cfde50c5b4d..00000000000 --- a/src/scripting/ambient_sound.hpp +++ /dev/null @@ -1,68 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_AMBIENT_SOUND_HPP -#define HEADER_SUPERTUX_SCRIPTING_AMBIENT_SOUND_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class AmbientSound; -#endif - -namespace scripting { - -/** - * @summary An ""AmbientSound"" that was given a name can be controlled by scripts. - * @instances An ""AmbientSound"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class AmbientSound final -#ifndef SCRIPTING_API - : public GameObject<::AmbientSound> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; - -private: - AmbientSound(const AmbientSound&) = delete; - AmbientSound& operator=(const AmbientSound&) = delete; -#endif - -public: - /** - * Sets the position of the ambient sound. - * @param float $x - * @param float $y - */ - void set_pos(float x, float y); - /** - * Returns the ambient sound's X coordinate. - */ - float get_pos_x() const; - /** - * Returns the ambient sound's Y coordinate. - */ - float get_pos_y() const; -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/anchor_points.hpp b/src/scripting/anchor_points.hpp deleted file mode 100644 index a7f31780e6c..00000000000 --- a/src/scripting/anchor_points.hpp +++ /dev/null @@ -1,50 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_ANCHOR_POINTS_HPP -#define HEADER_SUPERTUX_SCRIPTING_ANCHOR_POINTS_HPP - -namespace scripting { - -#ifdef DOXYGEN_SCRIPTING -/** - * @summary This module contains global anchor constants. - */ -class AnchorPoints -{ -public: -#endif - -// TODO get these from the definitions in anchor.h (needs miniswig update) -static const int ANCHOR_TOP_LEFT = 0; /**< Top-left anchor point. */ -static const int ANCHOR_TOP = 1; /**< Top anchor point. */ -static const int ANCHOR_TOP_RIGHT = 2; /**< Top-right anchor point. */ -static const int ANCHOR_LEFT = 3; /**< Left anchor point. */ -static const int ANCHOR_MIDDLE = 4; /**< Middle anchor point. */ -static const int ANCHOR_RIGHT = 5; /**< Right anchor point. */ -static const int ANCHOR_BOTTOM_LEFT = 6; /**< Bottom-left anchor point. */ -static const int ANCHOR_BOTTOM = 7; /**< Bottom anchor point. */ -static const int ANCHOR_BOTTOM_RIGHT = 8; /**< Bottom-right anchor point. */ - -#ifdef DOXYGEN_SCRIPTING -} -#endif - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/background.cpp b/src/scripting/background.cpp deleted file mode 100644 index 62b89f9206c..00000000000 --- a/src/scripting/background.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// SuperTux -// Copyright (C) 2016 Hume2 -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/background.hpp" - -#include - -#include "object/background.hpp" - -namespace scripting { - -void -Background::set_image(const std::string& image) -{ - SCRIPT_GUARD_VOID; - - if (image.empty()) - { - log_info << "No filename / path for background image specified" << std::endl; - return; - } - - const std::string& default_dir = "images/background/"; - bool path_valid = true; - - if (!PHYSFS_exists(image.c_str())) - path_valid = false; - - object.set_image(path_valid ? image : default_dir + image); -} - -void -Background::set_images(const std::string& top_image, const std::string& middle_image, - const std::string& bottom_image) -{ - SCRIPT_GUARD_VOID; - - if (top_image.empty() || middle_image.empty() || bottom_image.empty()) - { - log_info << "No filename / path for background image specified" << std::endl; - return; - } - - const std::string& default_dir = "images/background/"; - bool top_image_valid = true, middle_image_valid = true, bottom_image_valid = true; - - if (!PHYSFS_exists(top_image.c_str())) - top_image_valid = false; - - if (!PHYSFS_exists(middle_image.c_str())) - middle_image_valid = false; - - if (!PHYSFS_exists(bottom_image.c_str())) - bottom_image_valid = false; - - object.set_images(top_image_valid ? top_image : default_dir + top_image, - middle_image_valid ? middle_image : default_dir + middle_image, - bottom_image_valid ? bottom_image : default_dir + bottom_image); -} - -void -Background::set_speed(float speed) -{ - SCRIPT_GUARD_VOID; - object.set_speed(speed); -} - -float -Background::get_color_red() -{ - SCRIPT_GUARD_RETURN(-1.f); - return object.get_color().red; -} - -float -Background::get_color_green() -{ - SCRIPT_GUARD_RETURN(-1.f); - return object.get_color().green; -} - -float -Background::get_color_blue() -{ - SCRIPT_GUARD_RETURN(-1.f); - return object.get_color().blue; -} - -float -Background::get_color_alpha() -{ - SCRIPT_GUARD_RETURN(-1.f); - return object.get_color().alpha; -} - -void -Background::set_color(float red, float green, float blue, float alpha) -{ - SCRIPT_GUARD_VOID; - object.set_color(Color(red, green, blue, alpha)); -} - -void -Background::fade_color(float red, float green, float blue, float alpha, float time) -{ - SCRIPT_GUARD_VOID; - object.fade_color(Color(red, green, blue, alpha), time); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/background.hpp b/src/scripting/background.hpp deleted file mode 100644 index b1c868c415a..00000000000 --- a/src/scripting/background.hpp +++ /dev/null @@ -1,107 +0,0 @@ -// SuperTux - Sector scripting -// Copyright (C) 2016 Hume2 -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_BACKGROUND_HPP -#define HEADER_SUPERTUX_SCRIPTING_BACKGROUND_HPP - -#ifndef SCRIPTING_API -#include - -#include "scripting/game_object.hpp" - -class Background; -#endif - -namespace scripting { - -/** - * @summary A ""Background"" that was given a name can be manipulated by scripts. - * @instances A ""Background"" can be accessed by its name from a script or via ""sector.name"" from the console. - */ -class Background final -#ifndef SCRIPTING_API - : public GameObject<::Background> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; - -private: - Background(const Background&) = delete; - Background& operator=(const Background&) = delete; -#endif - -public: - /** - * Sets the background's image. - * @param string $image - */ - void set_image(const std::string& image); - /** - * Sets the top, middle and bottom background images. - * @param string $top_image - * @param string $middle_image - * @param string $bottom_image - */ - void set_images(const std::string& top_image, const std::string& middle_image, - const std::string& bottom_image); - /** - * Sets the background speed. - * @param float $speed - */ - void set_speed(float speed); - - /** - * Returns the red color value. - */ - float get_color_red(); - /** - * Returns the green color value. - */ - float get_color_green(); - /** - * Returns the blue color value. - */ - float get_color_blue(); - /** - * Returns the alpha color value. - */ - float get_color_alpha(); - /** - * Sets the background color. - * @param float $red - * @param float $green - * @param float $blue - * @param float $alpha - */ - void set_color(float red, float green, float blue, float alpha); - /** - * Fades to specified background color in ""time"" seconds. - * @param float $red - * @param float $green - * @param float $blue - * @param float $alpha - * @param float $time - */ - void fade_color(float red, float green, float blue, float alpha, float time); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/badguy.cpp b/src/scripting/badguy.cpp deleted file mode 100644 index 68a872a0c78..00000000000 --- a/src/scripting/badguy.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// SuperTux -// Copyright (C) 2020 Tobias Markus -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/badguy.hpp" - -#include - -#include "badguy/badguy.hpp" - -namespace scripting { - -void -BadGuy::kill() -{ - SCRIPT_GUARD_VOID; - object.kill_fall(); -} - -void -BadGuy::ignite() -{ - SCRIPT_GUARD_VOID; - if(!object.is_flammable() || object.is_ignited()) - { - return; - } - - object.ignite(); -} - -void -BadGuy::set_action(const std::string& action, int loops) -{ - SCRIPT_GUARD_VOID; - object.set_action(action, loops); -} - -void -BadGuy::set_sprite(const std::string& sprite) -{ - SCRIPT_GUARD_VOID; - object.change_sprite(sprite); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/badguy.hpp b/src/scripting/badguy.hpp deleted file mode 100644 index c33a0a7b197..00000000000 --- a/src/scripting/badguy.hpp +++ /dev/null @@ -1,77 +0,0 @@ -// SuperTux - Sector scripting -// Copyright (C) 2020 Tobias Markus -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_BADGUY_HPP -#define HEADER_SUPERTUX_SCRIPTING_BADGUY_HPP - -#ifndef SCRIPTING_API -#include - -#include "scripting/game_object.hpp" - -class BadGuy; -#endif - -namespace scripting { - -/** - * @summary A ""BadGuy"" that was given a name can be controlled by scripts. - * @instances A ""BadGuy"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class BadGuy -#ifndef SCRIPTING_API - : virtual public GameObject<::BadGuy> -#endif -{ -#ifndef SCRIPTING_API -public: - BadGuy(const ::GameObject& object) : - GameObject<::BadGuy>(object) - {} - -private: - BadGuy(const BadGuy&) = delete; - BadGuy& operator=(const BadGuy&) = delete; -#endif - -public: - /** - * Kills the badguy. - */ - void kill(); - /** - * Kills the badguy by igniting it. - */ - void ignite(); - /** - * Sets the badguy's sprite action. - * @param string $action The sprite action name. - * @param int $loops The amount of loops the action should repeat for. - */ - void set_action(const std::string& action, int loops); - /** - * Sets the badguy's sprite. - * @param string $sprite - */ - void set_sprite(const std::string& sprite); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/camera.cpp b/src/scripting/camera.cpp deleted file mode 100644 index 1244b200aa8..00000000000 --- a/src/scripting/camera.cpp +++ /dev/null @@ -1,176 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "object/camera.hpp" - -#include "scripting/camera.hpp" -#include "supertux/sector.hpp" -#include "util/dynamic_scoped_ref.hpp" -#include "util/log.hpp" - -namespace scripting { - -void -Camera::shake(float duration, float x, float y) -{ - SCRIPT_GUARD_VOID; - BIND_SECTOR(::Sector::get()); - object.shake(duration, x, y); -} - -void -Camera::start_earthquake(float strength, float delay) -{ - SCRIPT_GUARD_VOID; - BIND_SECTOR(::Sector::get()); - object.start_earthquake(strength, delay); -} - -void -Camera::stop_earthquake() -{ - SCRIPT_GUARD_VOID; - BIND_SECTOR(::Sector::get()); - object.stop_earthquake(); -} - -void -Camera::set_pos(float x, float y) -{ - SCRIPT_GUARD_VOID; - BIND_SECTOR(::Sector::get()); - object.scroll_to(Vector(x, y), 0.0f); -} - -void -Camera::move(float x, float y) -{ - SCRIPT_GUARD_VOID; - BIND_SECTOR(::Sector::get()); - object.scroll_to(Vector(object.get_position().x + x,object.get_position().y + y), 0.0f); -} - -void -Camera::set_mode(const std::string& mode) -{ - SCRIPT_GUARD_VOID; - BIND_SECTOR(::Sector::get()); - - if (mode == "normal") { - object.set_mode(::Camera::Mode::NORMAL); - } else if (mode == "manual") { - object.set_mode(::Camera::Mode::MANUAL); - } else { - log_fatal << "Camera mode '" << mode << "' unknown."; - } -} - -void -Camera::scroll_to(float x, float y, float scrolltime) -{ - SCRIPT_GUARD_VOID; - BIND_SECTOR(::Sector::get()); - object.scroll_to(Vector(x, y), scrolltime); -} - -float -Camera::get_current_scale() -{ - SCRIPT_GUARD_DEFAULT; - BIND_SECTOR(::Sector::get()); - return object.get_current_scale(); -} - -float -Camera::get_target_scale() -{ - SCRIPT_GUARD_DEFAULT; - BIND_SECTOR(::Sector::get()); - return object.get_target_scale(); -} - -void -Camera::set_scale(float scale) -{ - ease_scale(scale, 0, ""); -} - -void -Camera::set_scale_anchor(float scale, int anchor) -{ - ease_scale_anchor(scale, 0, anchor, ""); -} - -void -Camera::scale(float scale, float time) -{ - ease_scale(scale, time, ""); -} - -void -Camera::scale_anchor(float scale, float time, int anchor) -{ - ease_scale_anchor(scale, time, anchor, ""); -} - -void -Camera::ease_scale(float scale, float time, const std::string& ease) -{ - ease_scale_anchor(scale, time, AnchorPoint::ANCHOR_MIDDLE, ease); -} - -void -Camera::ease_scale_anchor(float scale, float time, int anchor, const std::string& ease) -{ - SCRIPT_GUARD_VOID; - BIND_SECTOR(::Sector::get()); - object.ease_scale(scale, time, getEasingByName(EasingMode_from_string(ease)), static_cast(anchor)); -} - -float -Camera::get_screen_width() -{ - SCRIPT_GUARD_DEFAULT; - BIND_SECTOR(::Sector::get()); - return object.get_screen_size().width; -} - -float -Camera::get_screen_height() -{ - SCRIPT_GUARD_DEFAULT; - BIND_SECTOR(::Sector::get()); - return object.get_screen_size().height; -} - -float -Camera::get_x() -{ - SCRIPT_GUARD_DEFAULT; - BIND_SECTOR(::Sector::get()); - return object.get_position().x; -} - -float -Camera::get_y() -{ - SCRIPT_GUARD_DEFAULT; - BIND_SECTOR(::Sector::get()); - return object.get_position().y; -} -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/camera.hpp b/src/scripting/camera.hpp deleted file mode 100644 index ab0555549e7..00000000000 --- a/src/scripting/camera.hpp +++ /dev/null @@ -1,162 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_CAMERA_HPP -#define HEADER_SUPERTUX_SCRIPTING_CAMERA_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class Camera; -#endif - -namespace scripting { - -/** - * @summary A ""Camera"" that was given a name can be manipulated by scripts. - * @instances An instance named ""Camera"" (""sector.Camera"" in the console) is available.${SRG_NEWPARAGRAPH} - The mode of the camera is either normal (the camera is following the player) or autoscroll. In the latter mode the camera is forced along a specified ${SRG_REF_Path}. - */ -class Camera final -#ifndef SCRIPTING_API - : public GameObject<::Camera> -#endif -{ -public: -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; - -private: - Camera(const Camera&) = delete; - Camera& operator=(const Camera&) = delete; -#endif - -public: - /** - * Shakes the camera in a certain direction only 1 time. - * @param float $duration - * @param float $x - * @param float $y - */ - void shake(float duration, float x, float y); - /** - * Starts "earthquake" mode, which shakes the camera vertically with a specified average ""strength"", at a certain minimal ""delay"", until stopped. - * @param float $strength - * @param float $delay - */ - void start_earthquake(float strength, float delay); - /** - * Stops "earthquake" mode. - */ - void stop_earthquake(); - /** - * Moves the camera to the specified absolute position. The origin is at the top left. - * @param float $x - * @param float $y - */ - void set_pos(float x, float y); - /** - * Moves the camera ""x"" to the left and ""y"" down. - * @param float $x - * @param float $y - */ - void move(float x, float y); - /** - * Sets the camera mode. - * @param string $mode The mode can be "normal" or "manual". - */ - void set_mode(const std::string& mode); - /** - * Scrolls the camera to specific coordinates in ""scrolltime"" seconds. - * @param float $x - * @param float $y - * @param float $scrolltime - */ - void scroll_to(float x, float y, float scrolltime); - /** - * Returns the current scale factor of the camera. - */ - float get_current_scale(); - /** - * Returns the scale factor the camera is fading towards. - */ - float get_target_scale(); - /** - * Sets the scale factor. - * @param float $scale - */ - void set_scale(float scale); - /** - * Sets the scale factor and the target position anchor. - NOTE: Target position anchor is only applied, if the camera is in "manual" mode. - * @param float $scale - * @param int $anchor Anchor point as represented by the ""ANCHOR_*"" constants (see ${SRG_REF_AnchorPoints}). - */ - void set_scale_anchor(float scale, int anchor); - /** - * Fades to a specified scale factor in ""time"" seconds. - * @param float $scale - * @param float $time - */ - void scale(float scale, float time); - /** - * Fades to a specified scale factor and target position anchor in ""time"" seconds. - NOTE: Target position anchor is only applied, if the camera is in "manual" mode. - * @param float $scale - * @param float $time - * @param int $anchor Anchor point as represented by the ""ANCHOR_*"" constants (see ${SRG_REF_AnchorPoints}). - */ - void scale_anchor(float scale, float time, int anchor); - /** - * Fades to a specified scale factor in ""time"" seconds with easing (smooth movement). - * @param float $scale - * @param float $time - * @param string $ease - */ - void ease_scale(float scale, float time, const std::string& ease); - /** - * Fades to a specified scale factor and target position anchor in ""time"" seconds with easing (smooth movement). - NOTE: Target position anchor is only applied, if the camera is in "manual" mode. - * @param float $scale - * @param float $time - * @param int $anchor Anchor point as represented by the ""ANCHOR_*"" constants (see ${SRG_REF_AnchorPoints}). - * @param string $ease - */ - void ease_scale_anchor(float scale, float time, int anchor, const std::string& ease); - /** - * Gets the current width of the screen. - */ - float get_screen_width(); - /** - * Gets the current height of the screen. - */ - float get_screen_height(); - /** - * Gets the X coordinate of the top-left corner of the screen. - */ - float get_x(); - /** - * Gets the Y coordinate of the top-left corner of the screen. - */ - float get_y(); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/candle.cpp b/src/scripting/candle.cpp deleted file mode 100644 index 6eef051d723..00000000000 --- a/src/scripting/candle.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "object/candle.hpp" -#include "scripting/candle.hpp" - -namespace scripting { - -bool -Candle::get_burning() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_burning(); -} - -void Candle::set_burning(bool burning) -{ - SCRIPT_GUARD_VOID; - object.set_burning(burning); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/candle.hpp b/src/scripting/candle.hpp deleted file mode 100644 index db565baaecc..00000000000 --- a/src/scripting/candle.hpp +++ /dev/null @@ -1,63 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_CANDLE_HPP -#define HEADER_SUPERTUX_SCRIPTING_CANDLE_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class Candle; -#endif - -namespace scripting { - -/** - * @summary A ""Candle"" that was given a name can be controlled by scripts. - * @instances A ""Candle"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class Candle final -#ifndef SCRIPTING_API - : public GameObject<::Candle> -#endif -{ -public: -#ifndef SCRIPTING_API - using GameObject::GameObject; - -private: - Candle(const Candle&) = delete; - Candle& operator=(const Candle&) = delete; -#endif - -public: - /** - * Returns ""true"" if the candle is lit up. - */ - bool get_burning() const; - /** - * Sets the burning state of the candle. - * @param bool $burning If ""true"", the candle is lit up. If ""false"", it's extinguished. - */ - void set_burning(bool burning); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/clouds.cpp b/src/scripting/clouds.cpp deleted file mode 100644 index 167c7e32b7f..00000000000 --- a/src/scripting/clouds.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// SuperTux -// Copyright (C) 2020 A. Semphris -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "object/cloud_particle_system.hpp" -#include "scripting/clouds.hpp" - -namespace scripting { - -void Clouds::set_enabled(bool enable) -{ - SCRIPT_GUARD_VOID; - object.set_enabled(enable); -} - -bool Clouds::get_enabled() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_enabled(); -} - -void Clouds::fade_speed(float speed, float time) -{ - SCRIPT_GUARD_VOID; - object.fade_speed(speed, time); -} - -void Clouds::fade_amount(int amount, float time, float time_between) -{ - SCRIPT_GUARD_VOID; - object.fade_amount(amount, time, time_between); -} - -void Clouds::set_amount(int amount, float time) -{ - SCRIPT_GUARD_VOID; - object.fade_amount(amount, time); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/clouds.hpp b/src/scripting/clouds.hpp deleted file mode 100644 index 56c8480ed0c..00000000000 --- a/src/scripting/clouds.hpp +++ /dev/null @@ -1,85 +0,0 @@ -// SuperTux -// Copyright (C) 2020 A. Semphris -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_CLOUDS_HPP -#define HEADER_SUPERTUX_SCRIPTING_CLOUDS_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class CloudParticleSystem; -#endif - -namespace scripting { - -/** - * @summary A ""CloudParticleSystem"" that was given a name can be controlled by scripts. - * @instances A ""CloudParticleSystem"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class Clouds final -#ifndef SCRIPTING_API - : public GameObject<::CloudParticleSystem> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; - -private: - Clouds(const Clouds&) = delete; - Clouds& operator=(const Clouds&) = delete; -#endif - -public: - /** - * Enables/disables the system. - * @param bool $enable - */ - void set_enabled(bool enable); - /** - * Returns ""true"" if the system is enabled. - */ - bool get_enabled() const; - - /** - * Smoothly changes the rain speed to the given value in ""time"" seconds. - * @param float $speed - * @param float $time - */ - void fade_speed(float speed, float time); - - /** - * Smoothly changes the amount of particles to the given value in ""time"" seconds. - * @param int $amount - * @param float $time - * @param float $time_between - */ - void fade_amount(int amount, float time, float time_between); - - /** - * Smoothly changes the amount of particles to the given value in ""time"" seconds. - * @param int $amount - * @param float $time - */ - void set_amount(int amount, float time); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/conveyor_belt.cpp b/src/scripting/conveyor_belt.cpp deleted file mode 100644 index 9ef69806e51..00000000000 --- a/src/scripting/conveyor_belt.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// SuperTux -// Copyright (C) 2022 Raoul1808 -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "object/conveyor_belt.hpp" -#include "scripting/conveyor_belt.hpp" - -namespace scripting -{ - -void -ConveyorBelt::start() -{ - SCRIPT_GUARD_VOID; - object.start(); -} - -void -ConveyorBelt::stop() -{ - SCRIPT_GUARD_VOID; - object.stop(); -} - -void -ConveyorBelt::move_left() -{ - SCRIPT_GUARD_VOID; - object.move_left(); -} - -void -ConveyorBelt::move_right() -{ - SCRIPT_GUARD_VOID; - object.move_right(); -} - -void -ConveyorBelt::set_speed(float target_speed) -{ - SCRIPT_GUARD_VOID; - object.set_speed(target_speed); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/conveyor_belt.hpp b/src/scripting/conveyor_belt.hpp deleted file mode 100644 index eb6338ec57f..00000000000 --- a/src/scripting/conveyor_belt.hpp +++ /dev/null @@ -1,80 +0,0 @@ -// SuperTux -// Copyright (C) 2022 Raoul1808 -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_CONVEYOR_BELT_HPP -#define HEADER_SUPERTUX_SCRIPTING_CONVEYOR_BELT_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class ConveyorBelt; -#endif - -namespace scripting -{ - -/** - * @summary A ""ConveyorBelt"" that was given a name can be controlled by scripts. - * @instances A ""ConveyorBelt"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class ConveyorBelt final -#ifndef SCRIPTING_API - : public GameObject<::ConveyorBelt> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; - -private: - ConveyorBelt(const ConveyorBelt&) = delete; - ConveyorBelt& operator=(const ConveyorBelt&) = delete; -#endif - -public: - /** - * Starts the conveyor belt. - */ - void start(); - - /** - * Stops the conveyor belt. - */ - void stop(); - - /** - * Makes the conveyor shift objects to the left. - */ - void move_left(); - - /** - * Makes the conveyor shift objects to the right. - */ - void move_right(); - - /** - * Change the shifting speed of the conveyor. - * @param float $target_speed - */ - void set_speed(float target_speed); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/custom_particles.cpp b/src/scripting/custom_particles.cpp deleted file mode 100644 index 5507c02b411..00000000000 --- a/src/scripting/custom_particles.cpp +++ /dev/null @@ -1,925 +0,0 @@ -// SuperTux -// Copyright (C) 2020 A. Semphris -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "object/custom_particle_system.hpp" -#include "scripting/custom_particles.hpp" - -namespace scripting { - -void CustomParticles::set_enabled(bool enable) -{ - SCRIPT_GUARD_VOID; - object.set_enabled(enable); -} - -bool CustomParticles::get_enabled() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_enabled(); -} - -void CustomParticles::clear() -{ - SCRIPT_GUARD_VOID; - object.clear(); -} - -void CustomParticles::spawn_particles(int amount, bool instantly) -{ - SCRIPT_GUARD_VOID; - if (instantly) - { - for (int i = 0; i < amount; i++) - { - object.spawn_particles(0.f); - } - } - else - { - // TODO: Implement delayed spawn mode for scripting. - log_warning << "Delayed spawn mode is not yet implemented for scripting." << std::endl; - } -} - -// ============================================================================= -// ============================ ATTRIBUTES ================================= -// ============================================================================= - -int CustomParticles::get_max_amount() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_max_amount; -} - -void CustomParticles::set_max_amount(int amount) -{ - SCRIPT_GUARD_VOID; - object.m_max_amount = amount; -} - -bool CustomParticles::get_cover_screen() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_cover_screen; -} - -void CustomParticles::set_cover_screen(bool cover) -{ - SCRIPT_GUARD_VOID; - object.m_cover_screen = cover; -} - -std::string CustomParticles::get_birth_mode() -{ - SCRIPT_GUARD_DEFAULT; - switch (object.m_particle_birth_mode) - { - case CustomParticleSystem::FadeMode::None: - return "None"; - - case CustomParticleSystem::FadeMode::Fade: - return "Fade"; - - case CustomParticleSystem::FadeMode::Shrink: - return "Shrink"; - - default: - return ""; - } -} - -void CustomParticles::set_birth_mode(std::string mode) -{ - SCRIPT_GUARD_VOID; - if (mode == "None") - { - object.m_particle_birth_mode = CustomParticleSystem::FadeMode::None; - } - else if (mode == "Fade") - { - object.m_particle_birth_mode = CustomParticleSystem::FadeMode::Fade; - } - else if (mode == "Shrink") - { - object.m_particle_birth_mode = CustomParticleSystem::FadeMode::Shrink; - } - else - { - log_warning << "Invalid option " + mode + "; valid options are: None, Fade, Shrink." << std::endl; - } -} - -std::string CustomParticles::get_death_mode() -{ - SCRIPT_GUARD_DEFAULT; - switch (object.m_particle_death_mode) - { - case CustomParticleSystem::FadeMode::None: - return "None"; - - case CustomParticleSystem::FadeMode::Fade: - return "Fade"; - - case CustomParticleSystem::FadeMode::Shrink: - return "Shrink"; - - default: - return ""; - } -} - -void CustomParticles::set_death_mode(std::string mode) -{ - SCRIPT_GUARD_VOID; - if (mode == "None") - { - object.m_particle_death_mode = CustomParticleSystem::FadeMode::None; - } - else if (mode == "Fade") - { - object.m_particle_death_mode = CustomParticleSystem::FadeMode::Fade; - } - else if (mode == "Shrink") - { - object.m_particle_death_mode = CustomParticleSystem::FadeMode::Shrink; - } - else - { - log_warning << "Invalid option " + mode + "; valid options are: None, Fade, Shrink." << std::endl; - } -} - -std::string CustomParticles::get_rotation_mode() -{ - SCRIPT_GUARD_DEFAULT; - switch (object.m_particle_rotation_mode) - { - case CustomParticleSystem::RotationMode::Fixed: - return "Fixed"; - - case CustomParticleSystem::RotationMode::Facing: - return "Facing"; - - case CustomParticleSystem::RotationMode::Wiggling: - return "Wiggling"; - - default: - return ""; - } -} - -void CustomParticles::set_rotation_mode(std::string mode) -{ - SCRIPT_GUARD_VOID; - if (mode == "Fixed") - { - object.m_particle_rotation_mode = CustomParticleSystem::RotationMode::Fixed; - } - else if (mode == "Facing") - { - object.m_particle_rotation_mode = CustomParticleSystem::RotationMode::Facing; - } - else if (mode == "Wiggling") - { - object.m_particle_rotation_mode = CustomParticleSystem::RotationMode::Wiggling; - } - else - { - log_warning << "Invalid option " + mode + "; valid options are: Fixed, Facing, Wiggling." << std::endl; - } -} - -std::string CustomParticles::get_collision_mode() -{ - SCRIPT_GUARD_DEFAULT; - switch (object.m_particle_collision_mode) - { - case CustomParticleSystem::CollisionMode::Ignore: - return "Ignore"; - - case CustomParticleSystem::CollisionMode::Stick: - return "Stick"; - - case CustomParticleSystem::CollisionMode::StickForever: - return "StickForever"; - - case CustomParticleSystem::CollisionMode::BounceHeavy: - return "BounceHeavy"; - - case CustomParticleSystem::CollisionMode::BounceLight: - return "BounceLight"; - - case CustomParticleSystem::CollisionMode::Destroy: - return "Destroy"; - - default: - return ""; - } -} - -void CustomParticles::set_collision_mode(std::string mode) -{ - SCRIPT_GUARD_VOID; - if (mode == "Ignore") - { - object.m_particle_collision_mode = CustomParticleSystem::CollisionMode::Ignore; - } - else if (mode == "Stick") - { - object.m_particle_collision_mode = CustomParticleSystem::CollisionMode::Stick; - } - else if (mode == "StickForever") - { - object.m_particle_collision_mode = CustomParticleSystem::CollisionMode::StickForever; - } - else if (mode == "BounceHeavy") - { - object.m_particle_collision_mode = CustomParticleSystem::CollisionMode::BounceHeavy; - } - else if (mode == "BounceLight") - { - object.m_particle_collision_mode = CustomParticleSystem::CollisionMode::BounceLight; - } - else if (mode == "Destroy") - { - object.m_particle_collision_mode = CustomParticleSystem::CollisionMode::Destroy; - } - else - { - log_warning << "Invalid option " + mode + "; valid options are: Ignore, Stick, StickForever, BounceHeavy, BounceLight, Destroy." << std::endl; - } -} - -std::string CustomParticles::get_offscreen_mode() -{ - SCRIPT_GUARD_DEFAULT; - switch (object.m_particle_offscreen_mode) - { - case CustomParticleSystem::OffscreenMode::Never: - return "Never"; - - case CustomParticleSystem::OffscreenMode::OnlyOnExit: - return "OnlyOnExit"; - - case CustomParticleSystem::OffscreenMode::Always: - return "Always"; - - default: - return ""; - } -} - -void CustomParticles::set_offscreen_mode(std::string mode) -{ - SCRIPT_GUARD_VOID; - if (mode == "Never") - { - object.m_particle_offscreen_mode = CustomParticleSystem::OffscreenMode::Never; - } - else if (mode == "OnlyOnExit") - { - object.m_particle_offscreen_mode = CustomParticleSystem::OffscreenMode::OnlyOnExit; - } - else if (mode == "Always") - { - object.m_particle_offscreen_mode = CustomParticleSystem::OffscreenMode::Always; - } - else - { - log_warning << "Invalid option " + mode + "; valid options are: Never, OnlyOnExit, Always." << std::endl; - } -} - -// ============================================================================= -// Delay -// ----------------------------------------------------------------------------- - -float CustomParticles::get_delay() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_delay; -} - -void CustomParticles::set_delay(float delay) -{ - SCRIPT_GUARD_VOID; - object.m_delay = delay; -} - -void CustomParticles::fade_delay(float delay, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_delay, delay, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_delay(float delay, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_delay, delay, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// Lifetime -// ----------------------------------------------------------------------------- - -float CustomParticles::get_lifetime() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_lifetime; -} - -void CustomParticles::set_lifetime(float lifetime) -{ - SCRIPT_GUARD_VOID; - object.m_particle_lifetime = lifetime; -} - -void CustomParticles::fade_lifetime(float lifetime, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_lifetime, lifetime, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_lifetime(float lifetime, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_lifetime, lifetime, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// Lifetime variation -// ----------------------------------------------------------------------------- - -float CustomParticles::get_lifetime_variation() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_lifetime_variation; -} - -void CustomParticles::set_lifetime_variation(float lifetime_variation) -{ - SCRIPT_GUARD_VOID; - object.m_particle_lifetime_variation = lifetime_variation; -} - -void CustomParticles::fade_lifetime_variation(float lifetime_variation, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_lifetime_variation, lifetime_variation, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_lifetime_variation(float lifetime_variation, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_lifetime_variation, lifetime_variation, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// Birth time -// ----------------------------------------------------------------------------- - -float CustomParticles::get_birth_time() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_birth_time; -} - -void CustomParticles::set_birth_time(float birth_time) -{ - SCRIPT_GUARD_VOID; - object.m_particle_birth_time = birth_time; -} - -void CustomParticles::fade_birth_time(float birth_time, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_birth_time, birth_time, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_birth_time(float birth_time, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_birth_time, birth_time, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// Birth time variation -// ----------------------------------------------------------------------------- - -float CustomParticles::get_birth_time_variation() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_birth_time_variation; -} - -void CustomParticles::set_birth_time_variation(float birth_time_variation) -{ - SCRIPT_GUARD_VOID; - object.m_particle_birth_time_variation = birth_time_variation; -} - -void CustomParticles::fade_birth_time_variation(float birth_time_variation, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_birth_time_variation, birth_time_variation, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_birth_time_variation(float birth_time_variation, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_birth_time_variation, birth_time_variation, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// Death time -// ----------------------------------------------------------------------------- - -float CustomParticles::get_death_time() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_death_time; -} - -void CustomParticles::set_death_time(float death_time) -{ - SCRIPT_GUARD_VOID; - object.m_particle_death_time = death_time; -} - -void CustomParticles::fade_death_time(float death_time, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_death_time, death_time, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_death_time(float death_time, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_death_time, death_time, time, getEasingByName(EasingMode_from_string(easing))); -} - - - -// ============================================================================= -// Death time variation -// ----------------------------------------------------------------------------- -float CustomParticles::get_death_time_variation() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_death_time_variation; -} - -void CustomParticles::set_death_time_variation(float death_time_variation) -{ - SCRIPT_GUARD_VOID; - object.m_particle_death_time_variation = death_time_variation; -} - -void CustomParticles::fade_death_time_variation(float death_time_variation, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_death_time_variation, death_time_variation, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_death_time_variation(float death_time_variation, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_death_time_variation, death_time_variation, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// X speed -// ----------------------------------------------------------------------------- - -float CustomParticles::get_speed_x() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_speed_x; -} - -void CustomParticles::set_speed_x(float speed_x) -{ - SCRIPT_GUARD_VOID; - object.m_particle_speed_x = speed_x; -} - -void CustomParticles::fade_speed_x(float speed_x, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_speed_x, speed_x, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_speed_x(float speed_x, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_speed_x, speed_x, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// Y speed -// ----------------------------------------------------------------------------- - -float CustomParticles::get_speed_y() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_speed_y; -} - -void CustomParticles::set_speed_y(float speed_y) -{ - SCRIPT_GUARD_VOID; - object.m_particle_speed_y = speed_y; -} - -void CustomParticles::fade_speed_y(float speed_y, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_speed_y, speed_y, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_speed_y(float speed_y, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_speed_y, speed_y, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// X speed variation -// ----------------------------------------------------------------------------- - -float CustomParticles::get_speed_variation_x() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_speed_variation_x; -} - -void CustomParticles::set_speed_variation_x(float speed_variation_x) -{ - SCRIPT_GUARD_VOID; - object.m_particle_speed_variation_x = speed_variation_x; -} - -void CustomParticles::fade_speed_variation_x(float speed_variation_x, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_speed_variation_x, speed_variation_x, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_speed_variation_x(float speed_variation_x, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_speed_variation_x, speed_variation_x, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// Y speed variation -// ----------------------------------------------------------------------------- - -float CustomParticles::get_speed_variation_y() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_speed_variation_y; -} - -void CustomParticles::set_speed_variation_y(float speed_variation_y) -{ - SCRIPT_GUARD_VOID; - object.m_particle_speed_variation_y = speed_variation_y; -} - -void CustomParticles::fade_speed_variation_y(float speed_variation_y, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_speed_variation_y, speed_variation_y, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_speed_variation_y(float speed_variation_y, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_speed_variation_y, speed_variation_y, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// X acceleration -// ----------------------------------------------------------------------------- - -float CustomParticles::get_acceleration_x() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_acceleration_x; -} - -void CustomParticles::set_acceleration_x(float acceleration_x) -{ - SCRIPT_GUARD_VOID; - object.m_particle_acceleration_x = acceleration_x; -} - -void CustomParticles::fade_acceleration_x(float acceleration_x, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_acceleration_x, acceleration_x, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_acceleration_x(float acceleration_x, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_acceleration_x, acceleration_x, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// Y acceleration -// ----------------------------------------------------------------------------- - -float CustomParticles::get_acceleration_y() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_acceleration_y; -} - -void CustomParticles::set_acceleration_y(float acceleration_y) -{ - SCRIPT_GUARD_VOID; - object.m_particle_acceleration_y = acceleration_y; -} - -void CustomParticles::fade_acceleration_y(float acceleration_y, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_acceleration_y, acceleration_y, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_acceleration_y(float acceleration_y, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_acceleration_y, acceleration_y, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// X friction -// ----------------------------------------------------------------------------- - -float CustomParticles::get_friction_x() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_friction_x; -} - -void CustomParticles::set_friction_x(float friction_x) -{ - SCRIPT_GUARD_VOID; - object.m_particle_friction_x = friction_x; -} - -void CustomParticles::fade_friction_x(float friction_x, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_friction_x, friction_x, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_friction_x(float friction_x, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_friction_x, friction_x, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// Y friction -// ----------------------------------------------------------------------------- - -float CustomParticles::get_friction_y() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_friction_y; -} - -void CustomParticles::set_friction_y(float friction_y) -{ - SCRIPT_GUARD_VOID; - object.m_particle_friction_y = friction_y; -} - -void CustomParticles::fade_friction_y(float friction_y, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_friction_y, friction_y, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_friction_y(float friction_y, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_friction_y, friction_y, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// Feather factor -// ----------------------------------------------------------------------------- - -float CustomParticles::get_feather_factor() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_feather_factor; -} - -void CustomParticles::set_feather_factor(float feather_factor) -{ - SCRIPT_GUARD_VOID; - object.m_particle_feather_factor = feather_factor; -} - -void CustomParticles::fade_feather_factor(float feather_factor, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_feather_factor, feather_factor, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_feather_factor(float feather_factor, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_feather_factor, feather_factor, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// Rotation -// ----------------------------------------------------------------------------- - -float CustomParticles::get_rotation() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_rotation; -} - -void CustomParticles::set_rotation(float rotation) -{ - SCRIPT_GUARD_VOID; - object.m_particle_rotation = rotation; -} - -void CustomParticles::fade_rotation(float rotation, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_rotation, rotation, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_rotation(float rotation, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_rotation, rotation, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// Rotation variation -// ----------------------------------------------------------------------------- - -float CustomParticles::get_rotation_variation() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_rotation_variation; -} - -void CustomParticles::set_rotation_variation(float rotation_variation) -{ - SCRIPT_GUARD_VOID; - object.m_particle_rotation_variation = rotation_variation; -} - -void CustomParticles::fade_rotation_variation(float rotation_variation, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_rotation_variation, rotation_variation, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_rotation_variation(float rotation_variation, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_rotation_variation, rotation_variation, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// Rotation speed -// ----------------------------------------------------------------------------- - -float CustomParticles::get_rotation_speed() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_rotation_speed; -} - -void CustomParticles::set_rotation_speed(float rotation_speed) -{ - SCRIPT_GUARD_VOID; - object.m_particle_rotation_speed = rotation_speed; -} - -void CustomParticles::fade_rotation_speed(float rotation_speed, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_rotation_speed, rotation_speed, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_rotation_speed(float rotation_speed, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_rotation_speed, rotation_speed, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// Rotation speed variation -// ----------------------------------------------------------------------------- - -float CustomParticles::get_rotation_speed_variation() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_rotation_speed_variation; -} - -void CustomParticles::set_rotation_speed_variation(float rotation_speed_variation) -{ - SCRIPT_GUARD_VOID; - object.m_particle_rotation_speed_variation = rotation_speed_variation; -} - -void CustomParticles::fade_rotation_speed_variation(float rotation_speed_variation, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_rotation_speed_variation, rotation_speed_variation, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_rotation_speed_variation(float rotation_speed_variation, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_rotation_speed_variation, rotation_speed_variation, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// Rotation acceleration -// ----------------------------------------------------------------------------- - -float CustomParticles::get_rotation_acceleration() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_rotation_acceleration; -} - -void CustomParticles::set_rotation_acceleration(float rotation_acceleration) -{ - SCRIPT_GUARD_VOID; - object.m_particle_rotation_acceleration = rotation_acceleration; -} - -void CustomParticles::fade_rotation_acceleration(float rotation_acceleration, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_rotation_acceleration, rotation_acceleration, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_rotation_acceleration(float rotation_acceleration, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_rotation_acceleration, rotation_acceleration, time, getEasingByName(EasingMode_from_string(easing))); -} - -// ============================================================================= -// Rotation decceleration -// ----------------------------------------------------------------------------- - -float CustomParticles::get_rotation_decceleration() -{ - SCRIPT_GUARD_DEFAULT; - return object.m_particle_rotation_decceleration; -} - -void CustomParticles::set_rotation_decceleration(float rotation_decceleration) -{ - SCRIPT_GUARD_VOID; - object.m_particle_rotation_decceleration = rotation_decceleration; -} - -void CustomParticles::fade_rotation_decceleration(float rotation_decceleration, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_rotation_decceleration, rotation_decceleration, time, getEasingByName(EasingMode::EaseNone)); -} - -void CustomParticles::ease_rotation_decceleration(float rotation_decceleration, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_value(&object.m_particle_rotation_decceleration, rotation_decceleration, time, getEasingByName(EasingMode_from_string(easing))); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/custom_particles.hpp b/src/scripting/custom_particles.hpp deleted file mode 100644 index 640f95ee45c..00000000000 --- a/src/scripting/custom_particles.hpp +++ /dev/null @@ -1,493 +0,0 @@ -// SuperTux -// Copyright (C) 2020 A. Semphris -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_CUSTOM_PARTICLES_HPP -#define HEADER_SUPERTUX_SCRIPTING_CUSTOM_PARTICLES_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class CustomParticleSystem; -#endif - -namespace scripting { - -/** - * @summary A ""CustomParticleSystem"" that was given a name can be controlled by scripts. - * @instances A ""CustomParticleSystem"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class CustomParticles final -#ifndef SCRIPTING_API - : public GameObject<::CustomParticleSystem> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; - -private: - CustomParticles(const CustomParticles&) = delete; - CustomParticles& operator=(const CustomParticles&) = delete; -#endif - -public: - /** - * Enables/disables the system. - * @param bool $enable - */ - void set_enabled(bool enable); - /** - * Returns ""true"" if the system is enabled. - */ - bool get_enabled() const; - - /** - * Instantly removes all particles of that type on the screen - */ - void clear(); - - /** - * Spawns particles regardless of whether or not the particles are enabled. - * @param int $amount - * @param bool $instantly If ""true"", disregard the delay settings. - */ - void spawn_particles(int amount, bool instantly); - - - int get_max_amount(); - /** - * @param int $amount - */ - void set_max_amount(int amount); - - std::string get_birth_mode(); - /** - * @param string $mode - */ - void set_birth_mode(std::string mode); - - std::string get_death_mode(); - /** - * @param string $mode - */ - void set_death_mode(std::string mode); - - std::string get_rotation_mode(); - /** - * @param string $mode - */ - void set_rotation_mode(std::string mode); - - std::string get_collision_mode(); - /** - * @param string $mode - */ - void set_collision_mode(std::string mode); - - std::string get_offscreen_mode(); - /** - * @param string $mode - */ - void set_offscreen_mode(std::string mode); - - bool get_cover_screen(); - /** - * @param bool $cover - */ - void set_cover_screen(bool cover); - - float get_delay(); - /** - * @param float $delay - */ - void set_delay(float delay); - /** - * @param float $delay - * @param float $time - */ - void fade_delay(float delay, float time); - /** - * @param float $delay - * @param float $time - * @param string $easing - */ - void ease_delay(float delay, float time, std::string easing); - - float get_lifetime(); - /** - * @param float $lifetime - */ - void set_lifetime(float lifetime); - /** - * @param float $lifetime - * @param float $time - */ - void fade_lifetime(float lifetime, float time); - /** - * @param float $lifetime - * @param float $time - * @param string $easing - */ - void ease_lifetime(float lifetime, float time, std::string easing); - - float get_lifetime_variation(); - /** - * @param float $lifetime_variation - */ - void set_lifetime_variation(float lifetime_variation); - /** - * @param float $lifetime_variation - * @param float $time - */ - void fade_lifetime_variation(float lifetime_variation, float time); - /** - * @param float $lifetime_variation - * @param float $time - * @param string $easing - */ - void ease_lifetime_variation(float lifetime_variation, float time, std::string easing); - - float get_birth_time(); - /** - * @param float $birth_time - */ - void set_birth_time(float birth_time); - /** - * @param float $birth_time - * @param float $time - */ - void fade_birth_time(float birth_time, float time); - /** - * @param float $birth_time - * @param float $time - * @param string $easing - */ - void ease_birth_time(float birth_time, float time, std::string easing); - - float get_birth_time_variation(); - /** - * @param float $birth_time_variation - */ - void set_birth_time_variation(float birth_time_variation); - /** - * @param float $birth_time_variation - * @param float $time - */ - void fade_birth_time_variation(float birth_time_variation, float time); - /** - * @param float $birth_time_variation - * @param float $time - * @param string $easing - */ - void ease_birth_time_variation(float birth_time_variation, float time, std::string easing); - - float get_death_time(); - /** - * @param float $death_time - */ - void set_death_time(float death_time); - /** - * @param float $death_time - * @param float $time - */ - void fade_death_time(float death_time, float time); - /** - * @param float $death_time - * @param float $time - * @param string $easing - */ - void ease_death_time(float death_time, float time, std::string easing); - - float get_death_time_variation(); - /** - * @param float $death_time_variation - */ - void set_death_time_variation(float death_time_variation); - /** - * @param float $death_time_variation - * @param float $time - */ - void fade_death_time_variation(float death_time_variation, float time); - /** - * @param float $death_time_variation - * @param float $time - * @param string $easing - */ - void ease_death_time_variation(float death_time_variation, float time, std::string easing); - - float get_speed_x(); - /** - * @param float $speed_x - */ - void set_speed_x(float speed_x); - /** - * @param float $speed_x - * @param float $time - */ - void fade_speed_x(float speed_x, float time); - /** - * @param float $speed_x - * @param float $time - * @param string $easing - */ - void ease_speed_x(float speed_x, float time, std::string easing); - - float get_speed_y(); - /** - * @param float $speed_y - */ - void set_speed_y(float speed_y); - /** - * @param float $speed_y - * @param float $time - */ - void fade_speed_y(float speed_y, float time); - /** - * @param float $speed_y - * @param float $time - * @param string $easing - */ - void ease_speed_y(float speed_y, float time, std::string easing); - - float get_speed_variation_x(); - /** - * @param float $speed_variation_x - */ - void set_speed_variation_x(float speed_variation_x); - /** - * @param float $speed_variation_x - * @param float $time - */ - void fade_speed_variation_x(float speed_variation_x, float time); - /** - * @param float $speed_variation_x - * @param float $time - * @param string $easing - */ - void ease_speed_variation_x(float speed_variation_x, float time, std::string easing); - - float get_speed_variation_y(); - /** - * @param float $speed_variation_y - */ - void set_speed_variation_y(float speed_variation_y); - /** - * @param float $speed_variation_y - * @param float $time - */ - void fade_speed_variation_y(float speed_variation_y, float time); - /** - * @param float $speed_variation_y - * @param float $time - * @param string $easing - */ - void ease_speed_variation_y(float speed_variation_y, float time, std::string easing); - - float get_acceleration_x(); - /** - * @param float $acceleration_x - */ - void set_acceleration_x(float acceleration_x); - /** - * @param float $acceleration_x - * @param float $time - */ - void fade_acceleration_x(float acceleration_x, float time); - /** - * @param float $acceleration_x - * @param float $time - * @param string $easing - */ - void ease_acceleration_x(float acceleration_x, float time, std::string easing); - - float get_acceleration_y(); - /** - * @param float $acceleration_y - */ - void set_acceleration_y(float acceleration_y); - /** - * @param float $acceleration_y - * @param float $time - */ - void fade_acceleration_y(float acceleration_y, float time); - /** - * @param float $acceleration_y - * @param float $time - * @param string $easing - */ - void ease_acceleration_y(float acceleration_y, float time, std::string easing); - - float get_friction_x(); - /** - * @param float $friction_x - */ - void set_friction_x(float friction_x); - /** - * @param float $friction_x - * @param float $time - */ - void fade_friction_x(float friction_x, float time); - /** - * @param float $friction_x - * @param float $time - * @param string $easing - */ - void ease_friction_x(float friction_x, float time, std::string easing); - - float get_friction_y(); - /** - * @param float $friction_y - */ - void set_friction_y(float friction_y); - /** - * @param float $friction_y - * @param float $time - */ - void fade_friction_y(float friction_y, float time); - /** - * @param float $friction_y - * @param float $time - * @param string $easing - */ - void ease_friction_y(float friction_y, float time, std::string easing); - - float get_feather_factor(); - /** - * @param float $feather_factor - */ - void set_feather_factor(float feather_factor); - /** - * @param float $feather_factor - * @param float $time - */ - void fade_feather_factor(float feather_factor, float time); - /** - * @param float $feather_factor - * @param float $time - * @param string $easing - */ - void ease_feather_factor(float feather_factor, float time, std::string easing); - - float get_rotation(); - /** - * @param float $rotation - */ - void set_rotation(float rotation); - /** - * @param float $rotation - * @param float $time - */ - void fade_rotation(float rotation, float time); - /** - * @param float $rotation - * @param float $time - * @param string $easing - */ - void ease_rotation(float rotation, float time, std::string easing); - - float get_rotation_variation(); - /** - * @param float $rotation_variation - */ - void set_rotation_variation(float rotation_variation); - /** - * @param float $rotation_variation - * @param float $time - */ - void fade_rotation_variation(float rotation_variation, float time); - /** - * @param float $rotation_variation - * @param float $time - * @param string $easing - */ - void ease_rotation_variation(float rotation_variation, float time, std::string easing); - - float get_rotation_speed(); - /** - * @param float $rotation_speed - */ - void set_rotation_speed(float rotation_speed); - /** - * @param float $rotation_speed - * @param float $time - */ - void fade_rotation_speed(float rotation_speed, float time); - /** - * @param float $rotation_speed - * @param float $time - * @param string $easing - */ - void ease_rotation_speed(float rotation_speed, float time, std::string easing); - - float get_rotation_speed_variation(); - /** - * @param float $rotation_speed_variation - */ - void set_rotation_speed_variation(float rotation_speed_variation); - /** - * @param float $rotation_speed_variation - * @param float $time - */ - void fade_rotation_speed_variation(float rotation_speed_variation, float time); - /** - * @param float $rotation_speed_variation - * @param float $time - * @param string $easing - */ - void ease_rotation_speed_variation(float rotation_speed_variation, float time, std::string easing); - - float get_rotation_acceleration(); - /** - * @param float $rotation_acceleration - */ - void set_rotation_acceleration(float rotation_acceleration); - /** - * @param float $rotation_acceleration - * @param float $time - */ - void fade_rotation_acceleration(float rotation_acceleration, float time); - /** - * @param float $rotation_acceleration - * @param float $time - * @param string $easing - */ - void ease_rotation_acceleration(float rotation_acceleration, float time, std::string easing); - - float get_rotation_decceleration(); - /** - * @param float $rotation_decceleration - */ - void set_rotation_decceleration(float rotation_decceleration); - /** - * @param float $rotation_decceleration - * @param float $time - */ - void fade_rotation_decceleration(float rotation_decceleration, float time); - /** - * @param float $rotation_decceleration - * @param float $time - * @param string $easing - */ - void ease_rotation_decceleration(float rotation_decceleration, float time, std::string easing); - -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/decal.cpp b/src/scripting/decal.cpp deleted file mode 100644 index 472ea2221d2..00000000000 --- a/src/scripting/decal.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// SuperTux -// Copyright (C) 2020 Grzegorz Przybylski -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "object/decal.hpp" -#include "scripting/decal.hpp" - -namespace scripting { - -void -Decal::change_sprite(const std::string& sprite) -{ - SCRIPT_GUARD_VOID; - object.change_sprite(sprite); -} - -void -Decal::fade_sprite(const std::string& sprite, float time) -{ - SCRIPT_GUARD_VOID; - object.fade_sprite(sprite, time); -} - -void -Decal::fade_in(float time) -{ - SCRIPT_GUARD_VOID; - object.fade_in(time); -} - -void -Decal::fade_out(float time) -{ - SCRIPT_GUARD_VOID; - object.fade_out(time); -} - -void -Decal::set_action(const std::string& action) -{ - SCRIPT_GUARD_VOID; - object.set_action(action); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/decal.hpp b/src/scripting/decal.hpp deleted file mode 100644 index d14a1a4693d..00000000000 --- a/src/scripting/decal.hpp +++ /dev/null @@ -1,79 +0,0 @@ -// SuperTux -// Copyright (C) 2020 Grzegorz Przybylski -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_DECAL_HPP -#define HEADER_SUPERTUX_SCRIPTING_DECAL_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class Decal; -#endif - -namespace scripting { - -/** - * @summary A ""Decal"" that was given a name can be controlled by scripts. - * @instances A ""Decal"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class Decal final -#ifndef SCRIPTING_API - : public GameObject<::Decal> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; -private: - Decal(const Decal&) = delete; - Decal& operator=(const Decal&) = delete; -#endif - -public: - /** - * Fades the decal sprite to a new one in ""time"" seconds. - * @param string $sprite - * @param float $time - */ - void fade_sprite(const std::string& sprite, float time); - /** - * Changes the decal sprite. - * @param string $sprite - */ - void change_sprite(const std::string& sprite); - /** - * Fades in the decal in ""time"" seconds. - * @param float $time - */ - void fade_in(float time); - /** - * Fades out the decal in ""time"" seconds. - * @param float $time - */ - void fade_out(float time); - /** - * Sets the action for the decal's sprite. - * @param string $action - */ - void set_action(const std::string& action); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/dispenser.cpp b/src/scripting/dispenser.cpp deleted file mode 100644 index 2a8d5f9ac23..00000000000 --- a/src/scripting/dispenser.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SuperTux -// Copyright (C) 2018 Ashish Bhattarai -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "badguy/dispenser.hpp" -#include "scripting/dispenser.hpp" - -namespace scripting { - -void Dispenser::activate() -{ - SCRIPT_GUARD_VOID_T(Dispenser); - object.activate(); -} - -void Dispenser::deactivate() -{ - SCRIPT_GUARD_VOID_T(Dispenser); - object.deactivate(); -} - -} - -/* EOF */ diff --git a/src/scripting/dispenser.hpp b/src/scripting/dispenser.hpp deleted file mode 100644 index c3c63456df7..00000000000 --- a/src/scripting/dispenser.hpp +++ /dev/null @@ -1,67 +0,0 @@ -// SuperTux -// Copyright (C) 2018 Ashish Bhattarai -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_DISPENSER_HPP -#define HEADER_SUPERTUX_SCRIPTING_DISPENSER_HPP - -#ifndef SCRIPTING_API - -#include "scripting/badguy.hpp" - -class Dispenser; -#endif - -namespace scripting { - -/** - * @summary A ""Dispenser"" that was given a name can be controlled by scripts. - * @instances A ""Dispenser"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class Dispenser final : public scripting::BadGuy -#ifndef SCRIPTING_API - , virtual public GameObject<::Dispenser> -#endif -{ -#ifndef SCRIPTING_API -public: - Dispenser(const ::GameObject& object) : - GameObject<::BadGuy>(object), - GameObject<::Dispenser>(object), - BadGuy(object) - {} - -private: - Dispenser(const Dispenser&) = delete; - Dispenser& operator=(const Dispenser&) = delete; -#endif - -public: - /** - * Makes the dispenser start dispensing badguys. - */ - void activate(); - /** - * Stops the dispenser from dispensing badguys. - */ - void deactivate(); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/display_effect.cpp b/src/scripting/display_effect.cpp deleted file mode 100644 index c134e2f9abf..00000000000 --- a/src/scripting/display_effect.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// SuperTux -// Copyright (C) 2015 Ingo Ruhnke -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/display_effect.hpp" - -#include "object/display_effect.hpp" - -namespace scripting { - -void -DisplayEffect::fade_out(float time) -{ - SCRIPT_GUARD_VOID; - object.fade_out(time); -} - -void -DisplayEffect::fade_in(float time) -{ - SCRIPT_GUARD_VOID; - object.fade_in(time); -} - -void -DisplayEffect::set_black(bool black) -{ - SCRIPT_GUARD_VOID; - object.set_black(black); -} - -bool -DisplayEffect::is_black() const -{ - SCRIPT_GUARD_DEFAULT; - return object.is_black(); -} - -void -DisplayEffect::sixteen_to_nine(float time) -{ - SCRIPT_GUARD_VOID; - object.sixteen_to_nine(time); -} - -void -DisplayEffect::four_to_three(float time) -{ - SCRIPT_GUARD_VOID; - object.four_to_three(time); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/display_effect.hpp b/src/scripting/display_effect.hpp deleted file mode 100644 index 40e605f1bf4..00000000000 --- a/src/scripting/display_effect.hpp +++ /dev/null @@ -1,87 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_DISPLAY_EFFECT_HPP -#define HEADER_SUPERTUX_SCRIPTING_DISPLAY_EFFECT_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class DisplayEffect; -#endif - -namespace scripting { - -/** - * @summary ""DisplayEffect"" is an interface for toying with the display. - * @instances SuperTux creates an instance named ""Effect"" when starting the scripting engine. - Its usage is preferred – creating another instance might have unexpected side effects and is strongly discouraged. - (Use ""sector.Effect"" in the console.) - */ -class DisplayEffect final -#ifndef SCRIPTING_API - : public GameObject<::DisplayEffect> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; - -private: - DisplayEffect(const DisplayEffect&) = delete; - DisplayEffect& operator=(const DisplayEffect&) = delete; -#endif - -public: - /** - * Gradually fades out the screen to black for the next ""time"" seconds. - * @param float $time - */ - void fade_out(float time); - /** - * Gradually fades in the screen from black for the next ""time"" seconds. - * @param float $time - */ - void fade_in(float time); - /** - * Blackens or un-blackens the screen (depending on the value of ""black""). - * @param bool $black - */ - void set_black(bool black); - /** - * Returns ""true"" if the screen has been blackened by ""set_black"". - Note: Calling ""fade_in"" or ""fade_out"" resets the return value to ""false"". - */ - bool is_black() const; - /** - * Sets the display ratio to 16:9, effectively adding black bars at the top and bottom of the screen. - Should be used before cutscenes. Gradually fades to this state for the next ""time"" seconds. - * @param float $time - */ - void sixteen_to_nine(float time); - /** - * Sets the display ratio to 4:3, removing the black bars added by ""sixteen_to_nine()"". - Should be used after cutscenes. Gradually fades to this state for the next ""time"" seconds. - * @param float $time - */ - void four_to_three(float time); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/floating_image.cpp b/src/scripting/floating_image.cpp deleted file mode 100644 index 6eedf572489..00000000000 --- a/src/scripting/floating_image.cpp +++ /dev/null @@ -1,124 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include - -#include "object/floating_image.hpp" -#include "scripting/floating_image.hpp" -#include "supertux/sector.hpp" -#include "worldmap/worldmap.hpp" - -namespace scripting { - -FloatingImage::FloatingImage(const std::string& spritefile) : - GameObject(get_sector().add<::FloatingImage>(spritefile)) -{ -} - -void -FloatingImage::set_layer(int layer) -{ - SCRIPT_GUARD_VOID; - object.set_layer(layer); -} - -int -FloatingImage::get_layer() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_layer(); -} - -void -FloatingImage::set_pos(float x, float y) -{ - SCRIPT_GUARD_VOID; - object.set_pos(Vector(x, y)); -} - -float -FloatingImage::get_pos_x() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_pos().x; -} - -float -FloatingImage::get_pos_y() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_pos().y; -} - -void -FloatingImage::set_anchor_point(int anchor) -{ - SCRIPT_GUARD_VOID; - object.set_anchor_point(static_cast(anchor)); -} - -int -FloatingImage::get_anchor_point() const -{ - SCRIPT_GUARD_DEFAULT; - return static_cast(object.get_anchor_point()); -} - -bool -FloatingImage::get_visible() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_visible(); -} - -void -FloatingImage::set_visible(bool visible) -{ - SCRIPT_GUARD_VOID; - object.set_visible(visible); -} - -void -FloatingImage::set_action(const std::string& action) -{ - SCRIPT_GUARD_VOID; - object.set_action(action); -} - -std::string -FloatingImage::get_action() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_action(); -} - -void -FloatingImage::fade_in(float time) -{ - SCRIPT_GUARD_VOID; - object.fade_in(time); -} - -void -FloatingImage::fade_out(float time) -{ - SCRIPT_GUARD_VOID; - object.fade_out(time); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/floating_image.hpp b/src/scripting/floating_image.hpp deleted file mode 100644 index 21188fad88c..00000000000 --- a/src/scripting/floating_image.hpp +++ /dev/null @@ -1,119 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_FLOATING_IMAGE_HPP -#define HEADER_SUPERTUX_SCRIPTING_FLOATING_IMAGE_HPP - -#ifndef SCRIPTING_API -#include - -class FloatingImage; - -#include "scripting/game_object.hpp" -#endif - -namespace scripting { - -/** - * @summary This class provides the ability to create, edit, and remove images floating in midair on the screen, such as the SuperTux logo. - It is implemented as a wrapper around a sprite, so any sprite actions are applicable. - * @instances Floating Images are created in a script or from the console. Constructor:${SRG_NEWPARAGRAPH} - """""" <- FloatingImage(string filename)""""""${SRG_NEWPARAGRAPH} - This creates a ""FloatingImage"" from ""filename"" (which is relative to the data directory root). - */ -class FloatingImage final -#ifndef SCRIPTING_API - : public GameObject<::FloatingImage> -#endif -{ -public: - FloatingImage(const std::string& spritefile); - - /** - * Sets the layer of the floating image. - * @param int $layer - */ - void set_layer(int layer); - /** - * Returns the layer the floating image is on. - */ - int get_layer() const; - /** - * Sets the location of the image in relation to the current anchor point. - * @param float $x - * @param float $y - */ - void set_pos(float x, float y); - /** - * Returns the image's X coordinate relative to the current anchor point. - */ - float get_pos_x() const; - /** - * Returns the image's Y coordinate relative to the current anchor point. - */ - float get_pos_y() const; - /** - * Sets the image's anchor point. - * @param int $anchor Anchor point as represented by the ""ANCHOR_*"" constants (see ${SRG_REF_AnchorPoints}). - */ - void set_anchor_point(int anchor); - /** - * Returns the current anchor point. - */ - int get_anchor_point() const; - /** - * Sets the visibility of the floating image. - * @param bool $visible - */ - void set_visible(bool visible); - /** - * Returns the visibility state of the floating image. - */ - bool get_visible() const; - /** - * Sets the action of the image. - * This is only useful when the image is a sprite. - * @param string $action Name of the action, as defined in the sprite. - */ - void set_action(const std::string& action); - /** - * Returns the name of the action of the image, as defined in the sprite. - * This is only useful when the image is a sprite. - */ - std::string get_action() const; - /** - * Fades in the image for the next ""time"" seconds. - * @param float $time - */ - void fade_in(float time); - /** - * Fades out the image for the next ""time"" seconds. - * @param float $time - */ - void fade_out(float time); - -#ifndef SCRIPTING_API -private: - FloatingImage(const FloatingImage&) = delete; - FloatingImage& operator=(const FloatingImage&) = delete; -#endif -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/functions.cpp b/src/scripting/functions.cpp deleted file mode 100644 index 115cc0abc20..00000000000 --- a/src/scripting/functions.cpp +++ /dev/null @@ -1,475 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/functions.hpp" - -#include "audio/sound_manager.hpp" -#include "math/random.hpp" -#include "object/camera.hpp" -#include "object/player.hpp" -#include "physfs/ifile_stream.hpp" -#include "supertux/console.hpp" -#include "supertux/debug.hpp" -#include "supertux/game_manager.hpp" -#include "supertux/game_session.hpp" -#include "supertux/gameconfig.hpp" -#include "supertux/level.hpp" -#include "supertux/screen_manager.hpp" -#include "supertux/sector.hpp" -#include "supertux/shrinkfade.hpp" -#include "supertux/textscroller_screen.hpp" -#include "supertux/tile.hpp" -#include "supertux/title_screen.hpp" -#include "video/renderer.hpp" -#include "video/video_system.hpp" -#include "video/viewport.hpp" -#include "worldmap/tux.hpp" -#include "worldmap/worldmap.hpp" - -namespace { - -// Not added to header, function to only be used by others -// in this file. -bool validate_sector_player() -{ - if (::Sector::current() == nullptr) - { - log_info << "No current sector." << std::endl; - return false; - } - - return true; -} - -} // namespace - -namespace scripting { - -SQInteger display(HSQUIRRELVM vm) -{ - ConsoleBuffer::output << squirrel2string(vm, -1) << std::endl; - return 0; -} - -void print_stacktrace(HSQUIRRELVM vm) -{ - print_squirrel_stack(vm); -} - -SQInteger get_current_thread(HSQUIRRELVM vm) -{ - sq_pushthread(vm, vm); - return 1; -} - -bool is_christmas() -{ - return g_config->christmas_mode; -} - -void start_cutscene() -{ - auto session = GameSession::current(); - if (session == nullptr) - { - log_info << "No game session" << std::endl; - return; - } - - if (session->get_current_level().m_is_in_cutscene) - { - log_warning << "start_cutscene(): starting a new cutscene above another one, ending preceding cutscene (use end_cutscene() in scripts!)" << std::endl; - - // Remove all sounds that started playing while skipping. - if (session->get_current_level().m_skip_cutscene) - SoundManager::current()->stop_sounds(); - } - - session->get_current_level().m_is_in_cutscene = true; - session->get_current_level().m_skip_cutscene = false; -} - -void end_cutscene() -{ - auto session = GameSession::current(); - if (session == nullptr) - { - log_info << "No game session." << std::endl; - return; - } - - if (!session->get_current_level().m_is_in_cutscene) - { - log_warning << "end_cutscene(): no cutscene to end, resetting status anyways." << std::endl; - } - - // Remove all sounds that started playing while skipping. - if (session->get_current_level().m_skip_cutscene) - SoundManager::current()->stop_sounds(); - - session->get_current_level().m_is_in_cutscene = false; - session->get_current_level().m_skip_cutscene = false; -} - -bool check_cutscene() -{ - auto session = GameSession::current(); - if (session == nullptr) - { - log_info << "No game session" << std::endl; - return false; - } - - return session->get_current_level().m_is_in_cutscene; -} - -void wait(HSQUIRRELVM vm, float seconds) -{ - auto session = GameSession::current(); - - if(session && session->get_current_level().m_skip_cutscene) - { - if (auto squirrelenv = static_cast(sq_getforeignptr(vm))) - { - // Wait anyways, to prevent scripts like `while (true) {wait(0.1); ...}`. - squirrelenv->wait_for_seconds(vm, 0); - } - else if (auto squirrelvm = static_cast(sq_getsharedforeignptr(vm))) - { - squirrelvm->wait_for_seconds(vm, 0); - } - else - { - log_warning << "wait(): no VM or environment available\n"; - } - } - else if(session && session->get_current_level().m_is_in_cutscene) - { - if (auto squirrelenv = static_cast(sq_getforeignptr(vm))) - { - // Wait anyways, to prevent scripts like `while (true) {wait(0.1); ...}` from freezing the game. - squirrelenv->skippable_wait_for_seconds(vm, seconds); - //session->set_scheduler(squirrelenv->get_scheduler()); - } - else if (auto squirrelvm = static_cast(sq_getsharedforeignptr(vm))) - { - squirrelvm->skippable_wait_for_seconds(vm, seconds); - //session->set_scheduler(squirrelvm->get_scheduler()); - } - else - { - log_warning << "wait(): no VM or environment available\n"; - } - } - else - { - if (auto squirrelenv = static_cast(sq_getforeignptr(vm))) - { - squirrelenv->wait_for_seconds(vm, seconds); - } - else if (auto squirrelvm = static_cast(sq_getsharedforeignptr(vm))) - { - squirrelvm->wait_for_seconds(vm, seconds); - } - else - { - log_warning << "wait(): no VM or environment available\n"; - } - } -} - -void wait_for_screenswitch(HSQUIRRELVM vm) -{ - auto squirrelvm = static_cast(sq_getsharedforeignptr(vm)); - //auto squirrelenv = static_cast(sq_getforeignptr(vm)); - squirrelvm->wait_for_screenswitch(vm); -} - -void exit_screen() -{ - ScreenManager::current()->pop_screen(); -} - -std::string translate(const std::string& text) -{ - return g_dictionary_manager->get_dictionary().translate(text); -} - -std::string _(const std::string& text) -{ - return translate(text); -} - -std::string translate_plural(const std::string& text, const std::string& text_plural, int num) -{ - return g_dictionary_manager->get_dictionary().translate_plural(text, text_plural, num); -} - -std::string __(const std::string& text, const std::string& text_plural, int num) -{ - return translate_plural(text, text_plural, num); -} - -void display_text_file(const std::string& filename) -{ - ScreenManager::current()->push_screen(std::make_unique(filename)); -} - -void load_worldmap(const std::string& filename, const std::string& sector, const std::string& spawnpoint) -{ - using namespace worldmap; - - if (!WorldMap::current()) - { - throw std::runtime_error("Can't start Worldmap without active WorldMap"); - } - else - { - WorldMap::current()->change(filename, sector, spawnpoint); - } -} - -void set_next_worldmap(const std::string& dirname, const std::string& sector, const std::string& spawnpoint) -{ - GameManager::current()->set_next_worldmap(dirname, sector, spawnpoint); -} - -void load_level(const std::string& filename) -{ - if (!GameSession::current()) - { - throw std::runtime_error("Can't start level without active level."); - } - else - { - ScreenManager::current()->push_screen(std::make_unique(filename, GameSession::current()->get_savegame())); - } -} - -void import(HSQUIRRELVM vm, const std::string& filename) -{ - IFileStream in(filename); - compile_and_run(vm, in, filename); -} - -void debug_collrects(bool enable) -{ - g_debug.show_collision_rects = enable; -} - -void debug_show_fps(bool enable) -{ - g_config->show_fps = enable; -} - -void debug_draw_solids_only(bool enable) -{ - ::Sector::s_draw_solids_only = enable; -} - -void debug_draw_editor_images(bool enable) -{ - Tile::draw_editor_images = enable; -} - -void debug_worldmap_ghost(bool enable) -{ - auto worldmap_sector = worldmap::WorldMapSector::current(); - - if (worldmap_sector == nullptr) - throw std::runtime_error("Can't change ghost mode without active WorldMapSector."); - - auto& tux = worldmap_sector->get_singleton_by_type(); - tux.set_ghost_mode(enable); -} - -void save_state() -{ - auto worldmap = worldmap::WorldMap::current(); - - if (!worldmap) - { - throw std::runtime_error("Can't save state without active Worldmap."); - } - else - { - worldmap->save_state(); - } -} - -void load_state() -{ - auto worldmap = worldmap::WorldMap::current(); - - if (!worldmap) - { - throw std::runtime_error("Can't save state without active Worldmap."); - } - else - { - worldmap->load_state(); - } -} - -void play_music(const std::string& filename) -{ - SoundManager::current()->play_music(filename); -} - -void stop_music(float fadetime) -{ - SoundManager::current()->stop_music(fadetime); -} - -void fade_in_music(const std::string& filename, float fadetime) -{ - SoundManager::current()->play_music(filename, fadetime); -} - -void resume_music(float fadetime) -{ - SoundManager::current()->resume_music(fadetime); -} - -void pause_music(float fadetime) -{ - SoundManager::current()->pause_music(fadetime); -} - -void play_sound(const std::string& filename) -{ - SoundManager::current()->play(filename); -} - -void grease() -{ - if (!validate_sector_player()) return; - // FIXME: This only has effect on the first player. - ::Player& tux = *(::Sector::get().get_players()[0]); // scripting::Player != ::Player - tux.get_physic().set_velocity_x(tux.get_physic().get_velocity_x()*3); -} - -void invincible() -{ - if (!validate_sector_player()) return; - // FIXME: This only has effect on the first player. - ::Player& tux = *(::Sector::get().get_players()[0]); - tux.m_invincible_timer.start(10000); -} - -void ghost() -{ - if (!validate_sector_player()) return; - // FIXME: This only has effect on the first player. - ::Player& tux = *(::Sector::get().get_players()[0]); - tux.set_ghost_mode(true); -} - -void mortal() -{ - if (!validate_sector_player()) return; - // FIXME: This only has effect on the first player. - ::Player& tux = *(::Sector::get().get_players()[0]); - tux.m_invincible_timer.stop(); - tux.set_ghost_mode(false); -} - -void restart() -{ - auto session = GameSession::current(); - if (session == nullptr) - { - log_info << "No game session." << std::endl; - return; - } - session->reset_button = true; -} - -void whereami() -{ - if (!validate_sector_player()) return; - // FIXME: This only has effect on the first player. - ::Player& tux = *(::Sector::get().get_players()[0]); - log_info << "You are at x " << (static_cast(tux.get_pos().x)) << ", y " << (static_cast(tux.get_pos().y)) << std::endl; -} - -void gotoend() -{ - if (!validate_sector_player()) return; - // FIXME: This only has effect on the first player. - ::Player& tux = *(::Sector::get().get_players()[0]); - tux.move(Vector( - (::Sector::get().get_width()) - (static_cast(SCREEN_WIDTH) * 2.0f), 0)); - ::Sector::get().get_camera().reset( - Vector(tux.get_pos().x, tux.get_pos().y)); -} - -void warp(float offset_x, float offset_y) -{ - if (!validate_sector_player()) return; - // FIXME: This only has effect on the first player. - ::Player& tux = *(::Sector::get().get_players()[0]); - tux.move(Vector( - tux.get_pos().x + (offset_x*32), tux.get_pos().y - (offset_y*32))); - ::Sector::get().get_camera().reset( - Vector(tux.get_pos().x, tux.get_pos().y)); -} - -void camera() -{ - if (!validate_sector_player()) return; - const auto& cam_pos = ::Sector::get().get_camera().get_translation(); - log_info << "Camera is at " << cam_pos.x << "," << cam_pos.y << std::endl; -} - -void set_gamma(float gamma) -{ - VideoSystem::current()->set_gamma(gamma); -} - -int rand() -{ - return gameRandom.rand(); -} - -void set_game_speed(float speed) -{ - if (speed < 0.05f) - { - // Always put a minimum speed above 0 - if the user enabled transitions, - // executing transitions would take an unreaonably long time if we allow - // game speeds like 0.00001. - log_warning << "Cannot set game speed to less than 0.05" << std::endl; - throw std::runtime_error("Cannot set game speed to less than 0.05"); - } - - ::g_debug.set_game_speed_multiplier(speed); -} - -void set_title_frame(const std::string& image) -{ - auto title_screen = TitleScreen::current(); - if (!title_screen) - { - log_info << "No title screen loaded." << std::endl; - return; - } - title_screen->set_frame(image); -} - -} - -/* EOF */ diff --git a/src/scripting/functions.hpp b/src/scripting/functions.hpp deleted file mode 100644 index 84322943390..00000000000 --- a/src/scripting/functions.hpp +++ /dev/null @@ -1,306 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_FUNCTIONS_HPP -#define HEADER_SUPERTUX_SCRIPTING_FUNCTIONS_HPP - -#ifndef SCRIPTING_API -#include -#include - -#define __suspend -#define __custom(x) -#endif - -namespace scripting { - -#ifdef DOXYGEN_SCRIPTING -/** - * @summary This module contains global methods. - */ -class Globals -{ -public: -#endif - -/** - * Displays the value of an argument. This is useful for inspecting tables. - * @param ANY $object - */ -SQInteger display(HSQUIRRELVM vm) __custom("t."); - -/** - * Displays the contents of the current stack. - */ -void print_stacktrace(HSQUIRRELVM vm); - -/** - * Returns the currently running thread. - */ -SQInteger get_current_thread(HSQUIRRELVM vm) __custom("t"); - -/** - * Returns whether the game is in christmas mode. - */ -bool is_christmas(); - -/** - * Displays a text file and scrolls it over the screen (on next screenswitch). - * @param string $filename - */ -void display_text_file(const std::string& filename); - -/** - * Loads and displays a worldmap (on next screenswitch), using the savegame of the current worldmap. - * @param string $filename - * @param string $sector Forced sector to spawn in the worldmap on. Leave empty to use last sector from savegame. - * @param string $spawnpoint Forced spawnpoint to spawn in the worldmap on. Leave empty to use last position from savegame. - */ -void load_worldmap(const std::string& filename, const std::string& sector, const std::string& spawnpoint); - -/** - * Switches to a different worldmap after unloading the current one, after ""exit_screen()"" is called. - * @param string $dirname The world directory, where the "worldmap.stwm" file is located. - * @param string $sector Forced sector to spawn in the worldmap on. Leave empty to use last sector from savegame. - * @param string $spawnpoint Forced spawnpoint to spawn in the worldmap on. Leave empty to use last position from savegame. - */ -void set_next_worldmap(const std::string& dirname, const std::string& sector, const std::string& spawnpoint); - -/** - * Loads and displays a level (on next screenswitch), using the savegame of the current level. - * @param string $filename - */ -void load_level(const std::string& filename); - -/** - * Starts a skippable cutscene. - */ -void start_cutscene(); -/** - * Ends a skippable cutscene. - */ -void end_cutscene(); -/** - * Checks if a skippable cutscene is currently running. - */ -bool check_cutscene(); - -/** - * Suspends the script execution for a specified number of seconds. - * @param float $seconds - */ -void wait(HSQUIRRELVM vm, float seconds) __suspend; - -/** - * Suspends the script execution until the current screen has been changed. - */ -void wait_for_screenswitch(HSQUIRRELVM vm) __suspend; - -/** - * Exits the currently running screen (for example, force exits from worldmap or scrolling text). - */ -void exit_screen(); - -/** - * Translates a text into the user's language (by looking in the "".po"" files). - * @param string $text - */ -std::string translate(const std::string& text); -/** - * Same function as ""translate()"". - * @param string $text - */ -std::string _(const std::string& text); - -/** - * Translates a text into the user's language (by looking in the "".po"" files). - Returns ""text"" or ""text_plural"", depending on ""num"" and the locale. - * @param string $text - * @param string $text_plural - * @param int $num - */ -std::string translate_plural(const std::string& text, const std::string& - text_plural, int num); -/** - * Same function as ""translate_plural()"". - * @param string $text - * @param string $text_plural - * @param int $num - */ -std::string __(const std::string& text, const std::string& text_plural, int num); - -/** - * Loads a script file and executes it. This is typically used to import functions from external files. - * @param string $filename - */ -void import(HSQUIRRELVM v, const std::string& filename); - -/** - * Saves world state to scripting table. - */ -void save_state(); - -/** - * Loads world state from scripting table. - */ -void load_state(); - -/** - * Enables/disables drawing of collision rectangles. - * @param bool $enable - */ -void debug_collrects(bool enable); - -/** - * Enables/disables drawing of FPS. - * @param bool $enable - */ -void debug_show_fps(bool enable); - -/** - * Enables/disables drawing of non-solid layers. - * @param bool $enable - */ -void debug_draw_solids_only(bool enable); - -/** - * Enables/disables drawing of editor images. - * @param bool $enable - */ -void debug_draw_editor_images(bool enable); - -/** - * Enables/disables worldmap ghost mode. - * @param bool $enable - */ -void debug_worldmap_ghost(bool enable); - -/** - * Changes the music to ""musicfile"". - * @param string $musicfile - */ -void play_music(const std::string& musicfile); - -/** - * Fades in the music from ""musicfile"" for ""fadetime"" seconds. - * @param string $musicfile - * @param float $fadetime - */ -void fade_in_music(const std::string& musicfile, float fadetime); - -/** - * Fades out the music for ""fadetime"" seconds. - * @param float $fadetime Set to "0" for no fade-out. - */ -void stop_music(float fadetime); - -/** - * Resumes and fades in the music for ""fadetime"" seconds. - * @param float $fadetime Set to "0" for no fade-in. - */ -void resume_music(float fadetime); - -/** - * Pauses the music with a fade-out for ""fadetime"" seconds. - * @param float $fadetime Set to "0" for no fade-out. - */ -void pause_music(float fadetime); - -/** - * Plays ""soundfile"" as a sound. - * @param string $soundfile - */ -void play_sound(const std::string& soundfile); - -/** - * Sets the game speed to ""speed"". - * @param float $speed - */ -void set_game_speed(float speed); - -/** - * Speeds Tux up. - */ -void grease(); - -/** - * Makes Tux invincible for 10000 units of time. - */ -void invincible(); - -/** - * Makes Tux a ghost, i.e. lets him float around and through solid objects. - */ -void ghost(); - -/** - * Recalls Tux's invincibility and ghost status. - */ -void mortal(); - -/** - * Re-initializes and respawns Tux at the beginning of the current level. - */ -void restart(); - -/** - * Prints Tux's current coordinates in the current level. - */ -void whereami(); - -/** - * Moves Tux near the end of the current level. - */ -void gotoend(); - -/** - * Moves Tux to the X and Y blocks, relative to his position. - * @param float $offset_x - * @param float $offset_y - */ -void warp(float offset_x, float offset_y); - -/** - * Shows the camera's coordinates. - */ -void camera(); - -/** - * Adjusts the gamma. - * @param float $gamma - */ -void set_gamma(float gamma); - -/** - * Returns a random integer. - */ -int rand(); - -/** - * Sets the frame, displayed on the title screen. - * @param string $image - */ -void set_title_frame(const std::string& image); - -#ifdef DOXYGEN_SCRIPTING -} -#endif - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/game_object.cpp b/src/scripting/game_object.cpp deleted file mode 100644 index 05ff99ac6d4..00000000000 --- a/src/scripting/game_object.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// SuperTux -// Copyright (C) 2018 Ingo Ruhnke -// 2023 Vankata453 -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/game_object.hpp" - -#include "supertux/sector.hpp" - -namespace scripting { - -::Sector& get_sector() -{ - if (::Sector::current()) - return ::Sector::get(); - - throw std::runtime_error("Unable to perform scripting action: No active Sector."); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/game_object.hpp b/src/scripting/game_object.hpp deleted file mode 100644 index 3c17b0342f6..00000000000 --- a/src/scripting/game_object.hpp +++ /dev/null @@ -1,116 +0,0 @@ -// SuperTux -// Copyright (C) 2018 Ingo Ruhnke -// 2023 Vankata453 -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_GAME_OBJECT_HPP -#define HEADER_SUPERTUX_SCRIPTING_GAME_OBJECT_HPP - -#include "supertux/game_object_manager.hpp" -#include "util/log.hpp" -#include "util/uid.hpp" - -#ifndef SCRIPTING_API - -#define SCRIPT_GUARD_VOID \ - auto object_ptr = get_object_ptr(); \ - if (object_ptr == nullptr) { \ - log_fatal << "error: script is accessing a dead object: " \ - << m_uid << std::endl; \ - return; \ - } \ - auto& object = *object_ptr - -#define SCRIPT_GUARD_DEFAULT \ - auto object_ptr = get_object_ptr(); \ - if (object_ptr == nullptr) { \ - log_fatal << "error: script is accessing a dead object: " \ - << m_uid << std::endl; \ - return {}; \ - } \ - auto& object = *object_ptr - -#define SCRIPT_GUARD_RETURN(x) \ - auto object_ptr = get_object_ptr(); \ - if (object_ptr == nullptr) { \ - log_fatal << "error: script is accessing a dead object: " \ - << m_uid << std::endl; \ - return x; \ - } \ - auto& object = *object_ptr - -#define SCRIPT_GUARD_VOID_T(OBJECT) \ - auto object_ptr = GameObject<::OBJECT>::get_object_ptr(); \ - if (object_ptr == nullptr) { \ - log_fatal << "error: script is accessing a dead object: " \ - << GameObject<::OBJECT>::m_uid << std::endl; \ - return; \ - } \ - auto& object = *object_ptr - -#define SCRIPT_GUARD_DEFAULT_T(OBJECT) \ - auto object_ptr = GameObject<::OBJECT>::get_object_ptr(); \ - if (object_ptr == nullptr) { \ - log_fatal << "error: script is accessing a dead object: " \ - << GameObject<::OBJECT>::m_uid << std::endl; \ - return {}; \ - } \ - auto& object = *object_ptr - -#define SCRIPT_GUARD_RETURN_T(OBJECT, x) \ - auto object_ptr = GameObject<::OBJECT>::get_object_ptr(); \ - if (object_ptr == nullptr) { \ - log_fatal << "error: script is accessing a dead object: " \ - << GameObject<::OBJECT>::m_uid << std::endl; \ - return x; \ - } \ - auto& object = *object_ptr - -class Sector; - -namespace scripting { - -::Sector& get_sector(); - -template -class GameObject -{ -public: - GameObject(const ::GameObject& object) : - m_uid(object.get_uid()), - m_parent(*object.get_parent()) - {} - - T* get_object_ptr() const - { - return m_parent.get_object_by_uid(m_uid); - } - -protected: - UID m_uid; - ::GameObjectManager& m_parent; - -private: - GameObject(const GameObject&) = delete; - GameObject& operator=(const GameObject&) = delete; -}; - -} // namespace scripting - -#endif - -#endif - -/* EOF */ diff --git a/src/scripting/game_object_manager.cpp b/src/scripting/game_object_manager.cpp deleted file mode 100644 index 3b1f4d9dc0d..00000000000 --- a/src/scripting/game_object_manager.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// SuperTux -// Copyright (C) 2015 Ingo Ruhnke -// 2021 A. Semphris -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/game_object_manager.hpp" - -#include "object/ambient_light.hpp" -#include "object/music_object.hpp" -#include "supertux/game_object_manager.hpp" -#include "video/color.hpp" - -namespace scripting { - -GameObjectManager::GameObjectManager(::GameObjectManager* parent) : - m_gom_parent(parent) -{ -} - -void -GameObjectManager::fade_to_ambient_light(float red, float green, float blue, float fadetime) -{ - auto& ambient_light = m_gom_parent->get_singleton_by_type(); - ambient_light.fade_to_ambient_light(red, green, blue, fadetime); -} - -void -GameObjectManager::set_ambient_light(float red, float green, float blue) -{ - auto& ambient_light = m_gom_parent->get_singleton_by_type(); - ambient_light.set_ambient_light(Color(red, green, blue)); -} - -float -GameObjectManager::get_ambient_red() const -{ - auto& ambient_light = m_gom_parent->get_singleton_by_type(); - return ambient_light.get_ambient_light().red; -} - -float -GameObjectManager::get_ambient_green() const -{ - auto& ambient_light = m_gom_parent->get_singleton_by_type(); - return ambient_light.get_ambient_light().green; -} - -float -GameObjectManager::get_ambient_blue() const -{ - auto& ambient_light = m_gom_parent->get_singleton_by_type(); - return ambient_light.get_ambient_light().blue; -} - -void -GameObjectManager::set_music(const std::string& filename) -{ - auto& music = m_gom_parent->get_singleton_by_type(); - music.set_music(filename); -} - -void -GameObjectManager::add_object(const std::string& class_name, const std::string& name, - int posX, int posY, const std::string& direction, - const std::string& data) -{ - m_gom_parent->add_object_scripting(class_name, name, Vector(posX, posY), direction, data); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/game_object_manager.hpp b/src/scripting/game_object_manager.hpp deleted file mode 100644 index 55047a65e48..00000000000 --- a/src/scripting/game_object_manager.hpp +++ /dev/null @@ -1,100 +0,0 @@ -// SuperTux -// Copyright (C) 2021 A. Semphris -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_GAME_OBJECT_MANAGER_HPP -#define HEADER_SUPERTUX_SCRIPTING_GAME_OBJECT_MANAGER_HPP - -#ifndef SCRIPTING_API -#include -class GameObjectManager; -#endif - -namespace scripting { - -/** - * @summary This class provides basic controlling functions for a sector. Applies for both worldmap and in-level sectors. - * @instances For in-level sectors, an instance under ""sector.settings"" is available from scripts and the console.${SRG_NEWPARAGRAPH} - For worldmap sectors, such instance is available under ""worldmap.settings"". - */ -class GameObjectManager -{ -#ifndef SCRIPTING_API -private: - ::GameObjectManager* m_gom_parent; - -public: - GameObjectManager(::GameObjectManager* parent); - -private: - GameObjectManager(const GameObjectManager&) = delete; - GameObjectManager& operator=(const GameObjectManager&) = delete; -#endif - -public: - /** - * Sets the sector's ambient light to the specified color. - * @param float $red - * @param float $green - * @param float $blue - */ - void set_ambient_light(float red, float green, float blue); - /** - * Fades to a specified ambient light color in ""fadetime"" seconds. - * @param float $red - * @param float $green - * @param float $blue - * @param float $fadetime - */ - void fade_to_ambient_light(float red, float green, float blue, float fadetime); - /** - * Returns the red channel of the ambient light color. - */ - float get_ambient_red() const; - /** - * Returns the green channel of the ambient light color. - */ - float get_ambient_green() const; - /** - * Returns the blue channel of the ambient light color. - */ - float get_ambient_blue() const; - - /** - * Sets the sector's music. - * @param string $music Full filename, relative to the "music" folder. - */ - void set_music(const std::string& music); - - /** - * Adds a ""MovingObject"" to the manager. - Note: If adding objects to a worldmap sector, ""posX"" and ""posY"" have to be tile positions (sector position / 32). - * @param string $class_name GameObject's class. - * @param string $name Name of the created object. - * @param int $posX X position inside the current sector. - * @param int $posY Y position inside the current sector. - * @param string $direction Direction. - * @param string $data Additional data in S-Expression format (check object definitions in level files). - */ - void add_object(const std::string& class_name, const std::string& name, - int posX, int posY, const std::string& direction, - const std::string& data); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/gradient.cpp b/src/scripting/gradient.cpp deleted file mode 100644 index 0df9839a2f8..00000000000 --- a/src/scripting/gradient.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// SuperTux -// Copyright (C) 2016 Hume2 -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/gradient.hpp" - -#include "object/gradient.hpp" - -namespace scripting { - -void -Gradient::set_direction(const std::string& direction) -{ - SCRIPT_GUARD_VOID; - object.set_direction(direction); -} - -std::string -Gradient::get_direction() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_direction_string(); -} - -void -Gradient::set_color1(float red, float green, float blue) -{ - SCRIPT_GUARD_VOID; - object.set_gradient(Color(red, green, blue), object.get_gradient_bottom()); -} - -void -Gradient::set_color2(float red, float green, float blue) -{ - SCRIPT_GUARD_VOID; - object.set_gradient(object.get_gradient_top(), Color(red, green, blue)); -} - -void -Gradient::set_colors(float red1, float green1, float blue1, float red2, float green2, float blue2) -{ - SCRIPT_GUARD_VOID; - object.set_gradient(Color(red1, green1, blue1), Color(red2, green2, blue2)); -} - -void -Gradient::fade_color1(float red, float green, float blue, float time) -{ - SCRIPT_GUARD_VOID; - object.fade_gradient(Color(red, green, blue), object.get_gradient_bottom(), time); -} - -void -Gradient::fade_color2(float red, float green, float blue, float time) -{ - SCRIPT_GUARD_VOID; - object.fade_gradient(object.get_gradient_top(), Color(red, green, blue), time); -} - -void -Gradient::fade_colors(float red1, float green1, float blue1, float red2, float green2, float blue2, float time) -{ - SCRIPT_GUARD_VOID; - object.fade_gradient(Color(red1, green1, blue1), Color(red2, green2, blue2), time); -} - -void -Gradient::swap_colors() -{ - SCRIPT_GUARD_VOID; - object.set_gradient(object.get_gradient_bottom(), object.get_gradient_top()); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/gradient.hpp b/src/scripting/gradient.hpp deleted file mode 100644 index 2215d58e54b..00000000000 --- a/src/scripting/gradient.hpp +++ /dev/null @@ -1,123 +0,0 @@ -// SuperTux - Sector scripting -// Copyright (C) 2016 Hume2 -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_GRADIENT_HPP -#define HEADER_SUPERTUX_SCRIPTING_GRADIENT_HPP - -#ifndef SCRIPTING_API -#include - -#include "scripting/game_object.hpp" - -class Gradient; -#endif - -namespace scripting { - -/** - * @summary A ""Gradient"" that was given a name can be controlled by scripts. - * @instances A ""Gradient"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class Gradient final -#ifndef SCRIPTING_API - : public GameObject<::Gradient> -#endif -{ -#ifndef SCRIPTING_API -private: - using GameObject::GameObject; - -private: - Gradient(const Gradient&) = delete; - Gradient& operator=(const Gradient&) = delete; -#endif - -public: - /** - * Sets the direction of the gradient. - * @param string $direction Can be "horizontal", "vertical", "horizontal_sector" or "vertical_sector". - */ - void set_direction(const std::string& direction); - /** - * Returns the direction of the gradient. - Possible values are "horizontal", "vertical", "horizontal_sector" or "vertical_sector". - */ - std::string get_direction() const; - - /** - * Set top gradient color. - * @param float $red - * @param float $green - * @param float $blue - */ - void set_color1(float red, float green, float blue); - /** - * Set bottom gradient color. - * @param float $red - * @param float $green - * @param float $blue - */ - void set_color2(float red, float green, float blue); - /** - * Set both gradient colors. - * @param float $red1 - * @param float $green1 - * @param float $blue1 - * @param float $red2 - * @param float $green2 - * @param float $blue2 - */ - void set_colors(float red1, float green1, float blue1, float red2, float green2, float blue2); - /** - * Fade the top gradient color to a specified new color in ""time"" seconds. - * @param float $red - * @param float $green - * @param float $blue - * @param float $time - */ - void fade_color1(float red, float green, float blue, float time); - /** - * Fade the bottom gradient color to a specified new color in ""time"" seconds. - * @param float $red - * @param float $green - * @param float $blue - * @param float $time - */ - void fade_color2(float red, float green, float blue, float time); - /** - * Fade both gradient colors to specified new colors in ""time"" seconds. - * @param float $red1 - * @param float $green1 - * @param float $blue1 - * @param float $red2 - * @param float $green2 - * @param float $blue2 - * @param float $time - */ - void fade_colors(float red1, float green1, float blue1, float red2, float green2, float blue2, float time); - - /** - * Swap top and bottom gradient colors. - */ - void swap_colors(); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/level.cpp b/src/scripting/level.cpp deleted file mode 100644 index 8efaa9d4758..00000000000 --- a/src/scripting/level.cpp +++ /dev/null @@ -1,126 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// 2023 Vankata453 -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/level.hpp" - -#include "supertux/d_scope.hpp" -#include "supertux/flip_level_transformer.hpp" -#include "supertux/game_session.hpp" -#include "supertux/sector.hpp" -#include "util/log.hpp" - -namespace scripting { - -void -Level_finish(bool win) -{ - SCRIPT_GUARD_GAMESESSION(); - game_session.finish(win); -} - -bool -Level_has_active_sequence() -{ - SCRIPT_GUARD_GAMESESSION(false); - return game_session.has_active_sequence(); -} - -void -Level_spawn(const std::string& sector, const std::string& spawnpoint) -{ - SCRIPT_GUARD_GAMESESSION(); - game_session.respawn(sector, spawnpoint); -} - -void -Level_spawn_transition(const std::string& sector, const std::string& spawnpoint, const std::string& transition) -{ - SCRIPT_GUARD_GAMESESSION(); - - ScreenFade::FadeType fade_type = ScreenFade::FadeType::NONE; - - if (transition == "fade") - fade_type = ScreenFade::FadeType::FADE; - else if (transition == "circle") - fade_type = ScreenFade::FadeType::CIRCLE; - else - log_warning << "Invalid transition type '" << transition << "'." << std::endl; - - game_session.respawn_with_fade(sector, spawnpoint, fade_type, {0.0f, 0.0f}, true); -} - -void -Level_set_start_point(const std::string& sector, const std::string& spawnpoint) -{ - SCRIPT_GUARD_GAMESESSION(); - game_session.set_start_point(sector, spawnpoint); -} - -void -Level_set_start_pos(const std::string& sector, float x, float y) -{ - SCRIPT_GUARD_GAMESESSION(); - game_session.set_start_pos(sector, Vector(x, y)); -} - -void -Level_set_respawn_point(const std::string& sector, const std::string& spawnpoint) -{ - SCRIPT_GUARD_GAMESESSION(); - game_session.set_respawn_point(sector, spawnpoint); -} - -void -Level_set_respawn_pos(const std::string& sector, float x, float y) -{ - SCRIPT_GUARD_GAMESESSION(); - game_session.set_respawn_pos(sector, Vector(x, y)); -} - -void -Level_flip_vertically() -{ - SCRIPT_GUARD_GAMESESSION(); - BIND_SECTOR(::Sector::get()); - FlipLevelTransformer flip_transformer; - flip_transformer.transform(game_session.get_current_level()); -} - -void -Level_toggle_pause() -{ - SCRIPT_GUARD_GAMESESSION(); - game_session.toggle_pause(); -} - -void -Level_pause_target_timer() -{ - SCRIPT_GUARD_GAMESESSION(); - game_session.set_target_timer_paused(true); -} - -void -Level_resume_target_timer() -{ - SCRIPT_GUARD_GAMESESSION(); - game_session.set_target_timer_paused(false); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/level.hpp b/src/scripting/level.hpp deleted file mode 100644 index 2ed2b534b41..00000000000 --- a/src/scripting/level.hpp +++ /dev/null @@ -1,141 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// 2023 Vankata453 -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_LEVEL_HPP -#define HEADER_SUPERTUX_SCRIPTING_LEVEL_HPP - -#ifndef SCRIPTING_API - -#include - -/** Macro to help easily check if there is a current GameSession and define it, if so. **/ -#define SCRIPT_GUARD_GAMESESSION(returnvalue) \ - if (!GameSession::current()) return returnvalue; \ - GameSession& game_session = *GameSession::current() - -#endif - -namespace scripting { - -/** - NOTE: For Level functions to be binded to the Level class in the Squirrel root VM, - they must be added to the Level class definition in "data/scripts/default.nut". -**/ - -#ifdef DOXYGEN_SCRIPTING -/** - * @summary The ""Level"" class provides basic controlling functions for the current level. - * @instances An instance named ""Level"" is available from scripts and the console. - */ -class Level -{ -public: -#endif - -/** - * Ends the current level. - * @param bool $win If ""true"", the level is marked as completed if launched from a worldmap. - */ -void Level_finish(bool win); -/** - * Gets whether an end sequence has started. (AKA when the stats at the end are visible) - */ -bool Level_has_active_sequence(); - -/** - * Respawns Tux in sector named ""sector"" at spawnpoint named ""spawnpoint"".${SRG_TABLENEWPARAGRAPH} - Exceptions: If ""sector"" or ""spawnpoint"" are empty, or the specified sector does not exist, the function will bail out the first chance it gets. - If the specified spawnpoint doesn't exist, Tux will be spawned at the spawnpoint named “main”. - If that spawnpoint doesn't exist either, Tux will simply end up at the origin (top-left 0, 0). - * @param string $sector - * @param string $spawnpoint - */ -void Level_spawn(const std::string& sector, const std::string& spawnpoint); - - -/** - * Respawns Tux in sector named ""sector"" at spawnpoint named ""spawnpoint"" with the given transition ""transition"".${SRG_TABLENEWPARAGRAPH} - Exceptions: If ""sector"" or ""spawnpoint"" are empty, or the specified sector does not exist, the function will bail out the first chance it gets. - If the specified spawnpoint doesn't exist, Tux will be spawned at the spawnpoint named “main”. - If that spawnpoint doesn't exist either, Tux will simply end up at the origin (top-left 0, 0). - * @param string $sector - * @param string $spawnpoint - * @param string $transition Valid transitions are ""circle"" and ""fade"". If any other value is specified, no transition effect is drawn. - */ -void Level_spawn_transition(const std::string& sector, const std::string& spawnpoint, const std::string& transition); - - -/** - * Sets the default start spawnpoint of the level. - * @param string $sector - * @param string $spawnpoint - */ -void Level_set_start_point(const std::string& sector, const std::string& spawnpoint); - -/** - * Sets the default start spawn position of the level. - * @param string $sector - * @param float $x - * @param float $y - */ -void Level_set_start_pos(const std::string& sector, float x, float y); - -/** - * Sets the default respawn spawnpoint of the level. - * @param string $sector - * @param string $spawnpoint - */ -void Level_set_respawn_point(const std::string& sector, const std::string& spawnpoint); - -/** - * Sets the default respawn position of the level. - * @param string $sector - * @param float $x - * @param float $y - */ -void Level_set_respawn_pos(const std::string& sector, float x, float y); - -/** - * Flips the level vertically (i.e. top is now bottom and vice versa). - Call again to revert the effect. Make sure the player can land on something after the level is flipped! - */ -void Level_flip_vertically(); - -/** - * Toggle pause. - */ -void Level_toggle_pause(); - -/** - * Pauses the target timer. - */ -void Level_pause_target_timer(); - -/** - * Resumes the target timer. - */ -void Level_resume_target_timer(); - -#ifdef DOXYGEN_SCRIPTING -} -#endif - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/level_time.cpp b/src/scripting/level_time.cpp deleted file mode 100644 index c00dc756544..00000000000 --- a/src/scripting/level_time.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "object/level_time.hpp" -#include "scripting/level_time.hpp" - -namespace scripting { - -void LevelTime::start() -{ - SCRIPT_GUARD_VOID; - object.start(); -} - -void LevelTime::stop() -{ - SCRIPT_GUARD_VOID; - object.stop(); -} - -float LevelTime::get_time() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_time(); -} - -void LevelTime::set_time(float time_left) -{ - SCRIPT_GUARD_VOID; - object.set_time(time_left); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/level_time.hpp b/src/scripting/level_time.hpp deleted file mode 100644 index d2a968730c1..00000000000 --- a/src/scripting/level_time.hpp +++ /dev/null @@ -1,75 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_LEVEL_TIME_HPP -#define HEADER_SUPERTUX_SCRIPTING_LEVEL_TIME_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class LevelTime; -#endif - -namespace scripting { - -/** - * @summary A ""LevelTime"" that was given a name can be controlled by scripts. - * @instances A ""LevelTime"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class LevelTime final -#ifndef SCRIPTING_API - : public GameObject<::LevelTime> -#endif -{ -public: -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; - -private: - LevelTime(const LevelTime&) = delete; - LevelTime& operator=(const LevelTime&) = delete; -#endif - -public: - /** - * Resumes the countdown (assuming it isn't already started, in which case it does nothing). - */ - void start(); - - /** - * Pauses the countdown (assuming it isn't already stopped, in which case it does nothing). - */ - void stop(); - - /** - * Returns the number of seconds left on the clock. - */ - float get_time() const; - - /** - * Sets the number of seconds left on the clock. - * @param float $time_left - */ - void set_time(float time_left); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/lit_object.cpp b/src/scripting/lit_object.cpp deleted file mode 100644 index e1168ed25bb..00000000000 --- a/src/scripting/lit_object.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// Copyright (C) 2017 M. Teufel -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "object/lit_object.hpp" -#include "scripting/lit_object.hpp" - -namespace scripting { - -std::string -LitObject::get_action() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_action(); -} - -void -LitObject::set_action(const std::string& action) -{ - SCRIPT_GUARD_VOID; - object.set_action(action); -} - -std::string -LitObject::get_light_action() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_light_action(); -} - -void -LitObject::set_light_action(const std::string& action) -{ - SCRIPT_GUARD_VOID; - object.set_light_action(action); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/lit_object.hpp b/src/scripting/lit_object.hpp deleted file mode 100644 index 557a3497fcc..00000000000 --- a/src/scripting/lit_object.hpp +++ /dev/null @@ -1,74 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// Copyright (C) 2017 M. Teufel -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_LIT_OBJECT_HPP -#define HEADER_SUPERTUX_SCRIPTING_LIT_OBJECT_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class LitObject; -#endif - -namespace scripting { - -/** - * @summary A ""LitObject"" that was given a name can be controlled by scripts. - * @instances A ""LitObject"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class LitObject final -#ifndef SCRIPTING_API - : public GameObject<::LitObject> -#endif -{ -public: -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; -private: - LitObject(const LitObject&) = delete; - LitObject& operator=(const LitObject&) = delete; -#endif - -public: - /** - * Returns the current sprite action. - */ - std::string get_action() const; - /** - * Sets the sprite action. - * @param string $action - */ - void set_action(const std::string& action); - - /** - * Returns the current light sprite action. - */ - std::string get_light_action() const; - /** - * Sets the light sprite action. - * @param string $action - */ - void set_light_action(const std::string& action); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/particlesystem.cpp b/src/scripting/particlesystem.cpp deleted file mode 100644 index 4986d26ed82..00000000000 --- a/src/scripting/particlesystem.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SuperTux -// Copyright (C) 2016 Tobias Markus -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/particlesystem.hpp" - -#include "object/particlesystem.hpp" - -namespace scripting { - -void ParticleSystem::set_enabled(bool enable) -{ - SCRIPT_GUARD_VOID; - object.set_enabled(enable); -} - -bool ParticleSystem::get_enabled() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_enabled(); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/particlesystem.hpp b/src/scripting/particlesystem.hpp deleted file mode 100644 index b1cd32412d2..00000000000 --- a/src/scripting/particlesystem.hpp +++ /dev/null @@ -1,64 +0,0 @@ -// SuperTux - Sector scripting -// Copyright (C) 2016 Tobias Markus -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_PARTICLESYSTEM_HPP -#define HEADER_SUPERTUX_SCRIPTING_PARTICLESYSTEM_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class ParticleSystem; -#endif - -namespace scripting { - -/** - * @summary A ""ParticleSystem"" that was given a name can be controlled by scripts. - * @instances A ""ParticleSystem"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class ParticleSystem final -#ifndef SCRIPTING_API - : public GameObject<::ParticleSystem> -#endif -{ -public: -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; - -private: - ParticleSystem(const ParticleSystem&) = delete; - ParticleSystem& operator=(const ParticleSystem&) = delete; -#endif - -public: - /** - * Enables/disables the system. - * @param bool $enable - */ - void set_enabled(bool enable); - /** - * Returns whether the system is enabled. - */ - bool get_enabled() const; -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/platform.cpp b/src/scripting/platform.cpp deleted file mode 100644 index ddae013f0dd..00000000000 --- a/src/scripting/platform.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "object/platform.hpp" -#include "scripting/platform.hpp" - -namespace scripting { - -void -Platform::goto_node(int node_idx) -{ - SCRIPT_GUARD_VOID; - object.goto_node(node_idx); -} - -void -Platform::set_node(int node_idx) -{ - SCRIPT_GUARD_VOID; - object.jump_to_node(node_idx, /* instantaneous = */ true); -} - -void -Platform::start_moving() -{ - SCRIPT_GUARD_VOID; - object.start_moving(); -} - -void -Platform::stop_moving() -{ - SCRIPT_GUARD_VOID; - object.stop_moving(); -} - -std::string -Platform::get_action() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_action(); -} - -void -Platform::set_action(const std::string& action, int loops) -{ - SCRIPT_GUARD_VOID; - object.set_action(action, loops); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/platform.hpp b/src/scripting/platform.hpp deleted file mode 100644 index cb822c45ee0..00000000000 --- a/src/scripting/platform.hpp +++ /dev/null @@ -1,86 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_PLATFORM_HPP -#define HEADER_SUPERTUX_SCRIPTING_PLATFORM_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class Platform; -#endif - -namespace scripting { - -/** - * @summary A ""Platform"" that was given a name can be controlled by scripts. - It moves along a specified path. - * @instances A ""Platform"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class Platform final -#ifndef SCRIPTING_API - : public GameObject<::Platform> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; -private: - Platform(const Platform&) = delete; - Platform& operator=(const Platform&) = delete; -#endif - -public: - /** - * Moves the platform until at given node, then stops. - * @param int $node_idx - */ - void goto_node(int node_idx); - - /** - * Jumps instantly to the given node. - * @param int $node_idx - */ - void set_node(int node_idx); - - /** - * Starts moving the platform automatically. - */ - void start_moving(); - - /** - * Stops moving the platform. - */ - void stop_moving(); - - /** - * Returns the current sprite action. - */ - std::string get_action() const; - /** - * Sets the sprite action. - * @param string $action - * @param int $loops - */ - void set_action(const std::string& action, int loops); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/player.cpp b/src/scripting/player.cpp deleted file mode 100644 index 49bbf425831..00000000000 --- a/src/scripting/player.cpp +++ /dev/null @@ -1,272 +0,0 @@ -// SuperTux -// Copyright (C) 2015 Ingo Ruhnke -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/player.hpp" - -#include "control/controller.hpp" -#include "object/player.hpp" - -namespace scripting { - -bool -Player::add_bonus(const std::string& bonus) -{ - SCRIPT_GUARD_DEFAULT; - return object.add_bonus(bonus); -} - -bool -Player::set_bonus(const std::string& bonus) -{ - SCRIPT_GUARD_DEFAULT; - return object.set_bonus(bonus); -} - -std::string -Player::get_bonus() const -{ - SCRIPT_GUARD_DEFAULT; - return object.bonus_to_string(); -} - -void -Player::add_coins(int count) -{ - SCRIPT_GUARD_VOID; - object.add_coins(count); -} - -int -Player::get_coins() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_coins(); -} - -void -Player::make_invincible() -{ - SCRIPT_GUARD_VOID; - object.make_invincible(); -} - -void -Player::deactivate() -{ - SCRIPT_GUARD_VOID; - object.deactivate(); -} - -void -Player::activate() -{ - SCRIPT_GUARD_VOID; - object.activate(); -} - -void -Player::walk(float speed) -{ - SCRIPT_GUARD_VOID; - object.walk(speed); -} - -void -Player::set_dir(bool right) -{ - SCRIPT_GUARD_VOID; - object.set_dir(right); -} - -void -Player::set_visible(bool visible) -{ - SCRIPT_GUARD_VOID; - object.set_visible(visible); -} - -bool -Player::get_visible() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_visible(); -} - -void -Player::kill(bool completely) -{ - SCRIPT_GUARD_VOID; - object.kill(completely); -} - -void -Player::set_ghost_mode(bool enable) -{ - SCRIPT_GUARD_VOID; - object.set_ghost_mode(enable); -} - -bool -Player::get_ghost_mode() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_ghost_mode(); -} - -void -Player::kick() -{ - SCRIPT_GUARD_VOID; - object.kick(); -} - -void -Player::do_cheer() -{ - SCRIPT_GUARD_VOID; - object.do_cheer(); -} - -void -Player::do_duck() -{ - SCRIPT_GUARD_VOID; - object.do_duck(); -} - -void -Player::do_standup() -{ - SCRIPT_GUARD_VOID; - // Force standup for backwards compatibility - object.do_standup(true); -} - -void -Player::do_backflip() -{ - SCRIPT_GUARD_VOID; - object.do_backflip(); -} - -void -Player::do_jump(float yspeed) -{ - SCRIPT_GUARD_VOID; - object.do_jump(yspeed); -} - -void -Player::trigger_sequence(const std::string& sequence_name) -{ - SCRIPT_GUARD_VOID; - object.trigger_sequence(sequence_name); -} - -void -Player::use_scripting_controller(bool enable) -{ - SCRIPT_GUARD_VOID; - object.use_scripting_controller(enable); -} - -void -Player::do_scripting_controller(const std::string& control, bool pressed) -{ - SCRIPT_GUARD_VOID; - object.do_scripting_controller(control, pressed); -} - -float -Player::get_velocity_x() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_physic().get_velocity_x(); -} - -float -Player::get_velocity_y() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_physic().get_velocity_y(); -} - -void -Player::set_velocity(float x, float y) -{ - SCRIPT_GUARD_VOID; - object.get_physic().set_velocity(x, y); -} - -bool -Player::has_grabbed(const std::string& name) const -{ - SCRIPT_GUARD_DEFAULT; - return object.has_grabbed(name); -} - -float -Player::get_x() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_bbox().get_left(); -} - -float -Player::get_y() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_bbox().get_top(); -} - -void -Player::set_pos(float x, float y) -{ - SCRIPT_GUARD_VOID; - object.set_pos(Vector(x, y)); -} - -std::string -Player::get_action() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_action(); -} - -bool -Player::get_input_pressed(const std::string& input) -{ - SCRIPT_GUARD_DEFAULT; - return object.get_controller().pressed(Control_from_string(input).value()); -} - -bool -Player::get_input_held(const std::string& input) -{ - SCRIPT_GUARD_DEFAULT; - return object.get_controller().hold(Control_from_string(input).value()); -} - -bool -Player::get_input_released(const std::string& input) -{ - SCRIPT_GUARD_DEFAULT; - return object.get_controller().released(Control_from_string(input).value()); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/player.hpp b/src/scripting/player.hpp deleted file mode 100644 index 653d9187142..00000000000 --- a/src/scripting/player.hpp +++ /dev/null @@ -1,248 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_PLAYER_HPP -#define HEADER_SUPERTUX_SCRIPTING_PLAYER_HPP - -#ifndef SCRIPTING_API -#include - -#include "scripting/game_object.hpp" - -class Player; -#endif - -namespace scripting { - -/** - * @summary This module contains methods controlling the player. (No, SuperTux doesn't use mind control. ""Player"" refers to the type of the player object.) - * @instances The first player can be accessed using ""Tux"", or ""sector.Tux"" from the console. - All following players (2nd, 3rd, etc...) can be accessed by ""Tux{index}"". - For example, to access the 2nd player, use ""Tux1"" (or ""sector.Tux1"" from the console). - */ -class Player final -#ifndef SCRIPTING_API - : public GameObject<::Player> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; - -private: - Player(const Player&) = delete; - Player& operator=(const Player&) = delete; -#endif - -public: - /** - * Gives Tux the specified bonus unless Tux’s current bonus is superior. - * @param string $bonus Can be "grow", "fireflower", "iceflower", "airflower" or "earthflower" at the moment. - */ - bool add_bonus(const std::string& bonus); - /** - * Gives Tux the specified bonus. - * @param string $bonus Can be "grow", "fireflower", "iceflower", "airflower" or "earthflower" at the moment. - */ - bool set_bonus(const std::string& bonus); - /** - * Gets Tux's current bonus. - */ - std::string get_bonus() const; - - /** - * Gives the player a number of coins.${SRG_TABLENEWPARAGRAPH} - * If count is a negative amount of coins, that number of coins will be taken - * from the player (until the number of coins the player has is 0, when it - * will stop changing). - * @param int $count - */ - void add_coins(int count); - /** - * Returns the number of coins the player currently has. - */ - int get_coins() const; - /** - * Make Tux invincible for a short amount of time. - */ - void make_invincible(); - /** - * Deactivate user/scripting input for Tux. - Carried items like trampolines won't be dropped. - */ - void deactivate(); - /** - * Give control back to user/scripting. - */ - void activate(); - /** - * Makes Tux walk. - * @param float $speed - */ - void walk(float speed); - /** - * Face Tux in the proper direction. - * @param bool $right Set to ""true"" to make Tux face right, ""false"" to face left. - */ - void set_dir(bool right); - /** - * Set Tux visible or invisible. - * @param bool $visible - */ - void set_visible(bool visible); - /** - * Returns ""true"" if Tux is currently visible (has not been set invisible by the ""set_visible()"" method). - */ - bool get_visible() const; - - /** - * Hurts Tux. - * @param bool $completely If true, he will be killed even if he had "grow" or a superior bonus. - */ - void kill(bool completely); - - /** - * Switches ghost mode on/off. Lets Tux float around and through solid objects. - * @param bool $enable - */ - void set_ghost_mode(bool enable); - - /** - * Returns whether ghost mode is currently enabled. - */ - bool get_ghost_mode() const; - - /** - * Start kick animation. - */ - void kick(); - - /** - * Play cheer animation.${SRG_TABLENEWPARAGRAPH} - * This might need some space and behave in an unpredictable way. It's best to use this at level end. - */ - void do_cheer(); - - /** - * Makes Tux duck down, if possible. Won't last long, as long as input is enabled. - */ - void do_duck(); - - /** - * Makes Tux stand back up, if possible. - */ - void do_standup(); - - /** - * Makes Tux do a backflip, if possible. - */ - void do_backflip(); - - /** - * Makes Tux jump in the air, if possible. - * @param float $yspeed - */ - void do_jump(float yspeed); - - /** - * Orders the current ""GameSession"" to start a sequence. - * @param string $sequence_name One of “stoptux”, “endsequence” or “fireworks”. - */ - void trigger_sequence(const std::string& sequence_name); - - /** - * Uses a scriptable controller for all user input (or restores controls). - * @param bool $enable - */ - void use_scripting_controller(bool enable); - - /** - * Instructs the scriptable controller to press or release a button. - * @param string $control Can be “left”, “right”, “up”, “down”, “jump”, “action”, “start”, “escape”, - “menu-select”, “menu-select-space”, “menu-back”, “remove”, “cheat-menu”, “debug-menu”, “console”, - “peek-left”, “peek-right”, “peek-up” or “peek-down”. - * @param bool $pressed - */ - void do_scripting_controller(const std::string& control, bool pressed); - - /** - * Returns whether the player is carrying a certain object. - * @param string $name Name of the portable object to check for. - */ - bool has_grabbed(const std::string& name) const; - - /** - * Returns Tux’s velocity in X direction. - */ - float get_velocity_x() const; - /** - * Returns Tux’s velocity in Y direction. - */ - float get_velocity_y() const; - - /** - * Sets the velocity of the player to a programmable/variable speed. - * @param float $x The speed Tux will move on the x axis. - * @param float $y The speed Tux will move on the y axis. - */ - void set_velocity(float x, float y); - - /** - * Gets the X coordinate of the player. - */ - float get_x() const; - /** - * Gets the Y coordinate of the player. - */ - float get_y() const; - - /** - * Sets the position of the player to a programmable/variable position. - * @param float $x X position. - * @param float $y Y position. - */ - void set_pos(float x, float y); - - /** - * Gets the player's current action/animation. - */ - std::string get_action() const; - - /** - * Gets whether the current input on the keyboard/controller/touchpad has been pressed. - * @param string $input Can be “left”, “right”, “up”, “down”, “jump”, “action”, “start”, “escape”, - “menu-select”, “menu-select-space”, “menu-back”, “remove”, “cheat-menu”, “debug-menu”, “console”, - “peek-left”, “peek-right”, “peek-up” or “peek-down”. - */ - bool get_input_pressed(const std::string& input); - - /** - * Gets whether the current input on the keyboard/controller/touchpad is being held. - * @param string $input Valid values are listed above. - */ - bool get_input_held(const std::string& input); - /** - * Gets whether the current input on the keyboard/controller/touchpad has been released. - * @param string $input Valid values are listed above. - */ - bool get_input_released(const std::string& input); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/rain.cpp b/src/scripting/rain.cpp deleted file mode 100644 index e5db4c3c35e..00000000000 --- a/src/scripting/rain.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "math/easing.hpp" -#include "object/rain_particle_system.hpp" -#include "scripting/rain.hpp" - -namespace scripting { - -void Rain::set_enabled(bool enable) -{ - SCRIPT_GUARD_VOID; - object.set_enabled(enable); -} - -bool Rain::get_enabled() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_enabled(); -} - -void Rain::fade_speed(float speed, float time) -{ - SCRIPT_GUARD_VOID; - object.fade_speed(speed, time); -} - -void Rain::fade_amount(float amount, float time) -{ - SCRIPT_GUARD_VOID; - object.fade_amount(amount, time); -} - -void Rain::fade_angle(float angle, float time, const std::string& ease) -{ - SCRIPT_GUARD_VOID; - object.fade_angle(angle, time, getEasingByName(EasingMode_from_string(ease))); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/rain.hpp b/src/scripting/rain.hpp deleted file mode 100644 index dabe44c31b6..00000000000 --- a/src/scripting/rain.hpp +++ /dev/null @@ -1,86 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_RAIN_HPP -#define HEADER_SUPERTUX_SCRIPTING_RAIN_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class RainParticleSystem; -#endif - -namespace scripting { - -/** - * @summary A ""RainParticleSystem"" that was given a name can be controlled by scripts. - * @instances A ""RainParticleSystem"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class Rain final -#ifndef SCRIPTING_API - : public GameObject<::RainParticleSystem> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; - -private: - Rain(const Rain&) = delete; - Rain& operator=(const Rain&) = delete; -#endif - -public: - /** - * Enables/disables the system. - * @param bool $enable - */ - void set_enabled(bool enable); - /** - * Returns ""true"" if the system is enabled. - */ - bool get_enabled() const; - - /** - * Smoothly changes the rain speed to the given value in ""time"" seconds. - * @param float $speed - * @param float $time - */ - void fade_speed(float speed, float time); - - /** - * Smoothly changes the amount of particles to the given value in ""time"" seconds. - * @param float $amount - * @param float $time - */ - void fade_amount(float amount, float time); - - /** - * Smoothly changes the angle of the rain the given value in ""time"" seconds, according to the provided easing function. - * @param float $angle - * @param float $time - * @param string $ease - */ - /** */ - void fade_angle(float angle, float time, const std::string& ease); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/rock.hpp b/src/scripting/rock.hpp deleted file mode 100644 index 0fdce8a1bb6..00000000000 --- a/src/scripting/rock.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// SuperTux -// Copyright (C) 2016 Tobias Markus -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_ROCK_HPP -#define HEADER_SUPERTUX_SCRIPTING_ROCK_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class Rock; -#endif - -namespace scripting { - -/** - * @summary A ""Rock"" that was given a name can be controlled by scripts. - * @instances A ""Rock"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class Rock final -#ifndef SCRIPTING_API - : public GameObject<::Rock> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; - -private: - Rock(const Rock&) = delete; - Rock& operator=(const Rock&) = delete; -#endif -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/scripted_object.cpp b/src/scripting/scripted_object.cpp deleted file mode 100644 index fe2baafd98e..00000000000 --- a/src/scripting/scripted_object.cpp +++ /dev/null @@ -1,137 +0,0 @@ -// SuperTux -// Copyright (C) 2016 Ingo Ruhnke -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/scripted_object.hpp" - -#include "object/scripted_object.hpp" - -namespace scripting { - -void -ScriptedObject::set_action(const std::string& animation) -{ - SCRIPT_GUARD_VOID; - object.set_action(animation); -} - -std::string -ScriptedObject::get_action() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_action(); -} - -std::string -ScriptedObject::get_name() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_name(); -} - -void -ScriptedObject::move(float x, float y) -{ - SCRIPT_GUARD_VOID; - object.move(x, y); -} - -void -ScriptedObject::set_pos(float x, float y) -{ - SCRIPT_GUARD_VOID; - object.set_pos(Vector(x, y)); -} - -float -ScriptedObject::get_pos_x() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_pos_x(); -} - -float -ScriptedObject::get_pos_y() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_pos_y(); -} - -void -ScriptedObject::set_velocity(float x, float y) -{ - SCRIPT_GUARD_VOID; - object.set_velocity(x, y); -} - -float -ScriptedObject::get_velocity_x() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_velocity_x(); -} - -float -ScriptedObject::get_velocity_y() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_velocity_y(); -} - -void -ScriptedObject::enable_gravity(bool enabled) -{ - SCRIPT_GUARD_VOID; - object.enable_gravity(enabled); -} - -bool -ScriptedObject::gravity_enabled() const -{ - SCRIPT_GUARD_DEFAULT; - return object.gravity_enabled(); -} - -void -ScriptedObject::set_visible(bool visible) -{ - SCRIPT_GUARD_VOID; - object.set_visible(visible); -} - -bool -ScriptedObject::is_visible() const -{ - SCRIPT_GUARD_DEFAULT; - return object.is_visible(); -} - -void -ScriptedObject::set_solid(bool solid) -{ - SCRIPT_GUARD_VOID; - return object.set_solid(solid); -} - -bool -ScriptedObject::is_solid() const -{ - SCRIPT_GUARD_DEFAULT; - return object.is_solid(); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/scripted_object.hpp b/src/scripting/scripted_object.hpp deleted file mode 100644 index 4b3199bc210..00000000000 --- a/src/scripting/scripted_object.hpp +++ /dev/null @@ -1,135 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_SCRIPTED_OBJECT_HPP -#define HEADER_SUPERTUX_SCRIPTING_SCRIPTED_OBJECT_HPP - -#ifndef SCRIPTING_API -#include -#include "scripting/game_object.hpp" - -class ScriptedObject; -#endif - -namespace scripting { - -/** - * @summary A ""ScriptedObject"" that was given a name can be controlled by scripts. - * @instances A ""ScriptedObject"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class ScriptedObject final -#ifndef SCRIPTING_API - : public GameObject<::ScriptedObject> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; - -private: - ScriptedObject(const ScriptedObject&) = delete; - ScriptedObject& operator=(const ScriptedObject&) = delete; -#endif - -public: - /** - * Sets the sprite action/animation. - * @param string $animation - */ - void set_action(const std::string& animation); - /** - * Returns the current sprite action. - */ - std::string get_action() const; - - /** - * Returns the name of the object. - */ - std::string get_name() const; - - /** - * Moves the object by ""x"" units to the right and ""y"" down, relative to its current position. - * @param float $x - * @param float $y - */ - void move(float x, float y); - /** - * Identical to ""move()"", except it's relative to the sector origin. - * @param float $x - * @param float $y - */ - void set_pos(float x, float y); - /** - * Returns the X coordinate of the object's position. - */ - float get_pos_x() const; - /** - * Returns the Y coordinate of the object's position. - */ - float get_pos_y() const; - - /** - * Makes the object move in a certain ""x"" and ""y"" direction (with a certain speed). - * @param float $x - * @param float $y - */ - void set_velocity(float x, float y); - /** - * Returns the X coordinate of the object's velocity. - */ - float get_velocity_x() const; - /** - * Returns the Y coordinate of the object's velocity. - */ - float get_velocity_y() const; - - /** - * Enables or disables gravity, according to the value of ""enabled"". - * @param bool $enabled - */ - void enable_gravity(bool enabled); - /** - * Returns ""true"" if the object's gravity is enabled. - */ - bool gravity_enabled() const; - - /** - * Shows or hides the object, according to the value of ""visible"". - * @param bool $visible - */ - void set_visible(bool visible); - /** - * Returns ""true"" if the object is visible. - */ - bool is_visible() const; - - /** - * Changes the solidity, according to the value of ""solid"". - * @param bool $solid - */ - void set_solid(bool solid); - /** - * Returns ""true"" if the object is solid. - */ - bool is_solid() const; -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/sector.cpp b/src/scripting/sector.cpp deleted file mode 100644 index 7c2a0bff808..00000000000 --- a/src/scripting/sector.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// SuperTux -// Copyright (C) 2015 Ingo Ruhnke -// 2021 A. Semphris -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/sector.hpp" - -#include "supertux/sector.hpp" - -namespace scripting { - -Sector::Sector(::Sector* parent) : - GameObjectManager(parent), - m_parent(parent) -{ -} - -void -Sector::set_gravity(float gravity) -{ - m_parent->set_gravity(gravity); -} - -bool -Sector::is_free_of_solid_tiles(float left, float top, float right, float bottom, - bool ignore_unisolid) const -{ - return m_parent->is_free_of_tiles(Rectf(Vector(left, top), Vector(right, bottom)), - ignore_unisolid, Tile::SOLID); -} - -bool -Sector::is_free_of_statics(float left, float top, float right, float bottom, - bool ignore_unisolid) const -{ - return m_parent->is_free_of_statics(Rectf(Vector(left, top), Vector(right, bottom)), - nullptr, ignore_unisolid); -} - -bool -Sector::is_free_of_movingstatics(float left, float top, float right, float bottom) const -{ - return m_parent->is_free_of_movingstatics(Rectf(Vector(left, top), Vector(right, bottom))); -} - -bool -Sector::is_free_of_specifically_movingstatics(float left, float top, float right, float bottom) const -{ - return m_parent->is_free_of_specifically_movingstatics(Rectf(Vector(left, top), Vector(right, bottom))); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/sector.hpp b/src/scripting/sector.hpp deleted file mode 100644 index bd3b8ed1b96..00000000000 --- a/src/scripting/sector.hpp +++ /dev/null @@ -1,103 +0,0 @@ -// SuperTux - Sector scripting -// Copyright (C) 2006 Wolfgang Becker -// 2021 A. Semphris -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_SECTOR_HPP -#define HEADER_SUPERTUX_SCRIPTING_SECTOR_HPP - -#ifndef SCRIPTING_API -#include -#include "scripting/game_object_manager.hpp" -class Sector; -#endif - -namespace scripting { - -/** - * @summary This class provides additional controlling functions for a sector, other than the ones listed at ${SRG_REF_GameObjectManager}. - * @instances An instance under ""sector.settings"" is available from scripts and the console. - */ -class Sector final : public GameObjectManager -{ -#ifndef SCRIPTING_API -private: - ::Sector* m_parent; - -public: - Sector(::Sector* parent); - -private: - Sector(const Sector&) = delete; - Sector& operator=(const Sector&) = delete; -#endif - -public: - /** - * Sets the sector's gravity. - * @param float $gravity - */ - void set_gravity(float gravity); - - /** - * Checks if the specified sector-relative rectangle is free of solid tiles. - * @param float $left - * @param float $top - * @param float $right - * @param float $bottom - * @param bool $ignore_unisolid If ""true"", unisolid tiles will be ignored. - */ - bool is_free_of_solid_tiles(float left, float top, float right, float bottom, - bool ignore_unisolid) const; - /** - * Checks if the specified sector-relative rectangle is free of both: - 1) Solid tiles. - 2) ""MovingObject""s in ""COLGROUP_STATIC"". - Note that this does not include badguys or players. - * @param float $left - * @param float $top - * @param float $right - * @param float $bottom - * @param bool $ignore_unisolid If ""true"", unisolid tiles will be ignored. - */ - bool is_free_of_statics(float left, float top, float right, float bottom, - bool ignore_unisolid) const; - /** - * Checks if the specified sector-relative rectangle is free of both: - 1) Solid tiles. - 2) ""MovingObject""s in ""COLGROUP_STATIC"", ""COLGROUP_MOVINGSTATIC"" or ""COLGROUP_MOVING"". - This includes badguys and players. - * @param float $left - * @param float $top - * @param float $right - * @param float $bottom - */ - bool is_free_of_movingstatics(float left, float top, float right, float bottom) const; - /** - * Checks if the specified sector-relative rectangle is free of ""MovingObject""s in ""COLGROUP_MOVINGSTATIC"". - Note that this does not include moving badguys or players. - * @param float $left - * @param float $top - * @param float $right - * @param float $bottom - */ - bool is_free_of_specifically_movingstatics(float left, float top, float right, float bottom) const; -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/sound_object.cpp b/src/scripting/sound_object.cpp deleted file mode 100644 index d43442696f8..00000000000 --- a/src/scripting/sound_object.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// SuperTux -// Copyright (C) 2023 mrkubax10 -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/sound_object.hpp" - -#include "object/sound_object.hpp" - -namespace scripting { - -void -SoundObject::start_playing() -{ - SCRIPT_GUARD_VOID; - object.play_looping_sounds(); -} - -void -SoundObject::stop_playing() -{ - SCRIPT_GUARD_VOID; - object.stop_looping_sounds(); -} - -void -SoundObject::set_volume(float volume) -{ - SCRIPT_GUARD_VOID; - object.set_volume(volume); -} - -float -SoundObject::get_volume() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_volume(); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/sound_object.hpp b/src/scripting/sound_object.hpp deleted file mode 100644 index a6df79b9f5b..00000000000 --- a/src/scripting/sound_object.hpp +++ /dev/null @@ -1,74 +0,0 @@ -// SuperTux -// Copyright (C) 2023 mrkubax10 -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_SOUND_OBJECT_HPP -#define HEADER_SUPERTUX_SCRIPTING_SOUND_OBJECT_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class SoundObject; -#endif - -namespace scripting { - -/** - * @summary A ""SoundObject"" that was given a name can be controlled by scripts. - * @instances A ""SoundObject"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class SoundObject final -#ifndef SCRIPTING_API - : public GameObject<::SoundObject> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; - -private: - SoundObject(const SoundObject&) = delete; - SoundObject& operator=(const SoundObject&) = delete; -#endif - -public: - /** - * Starts playing sound if it was stopped previously. - */ - void start_playing(); - - /** - * Stops playing sound. - */ - void stop_playing(); - - /** - * Sets the volume of sound played by SoundObject. - * @param float $volume - */ - void set_volume(float volume); - - /** - * Returns the volume of sound played by SoundObject. - */ - float get_volume() const; -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/spotlight.cpp b/src/scripting/spotlight.cpp deleted file mode 100644 index 26d4c3c060a..00000000000 --- a/src/scripting/spotlight.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// SuperTux -// Copyright (C) 2021 A. Semphris -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/spotlight.hpp" - -#include "object/spotlight.hpp" - -namespace scripting { - - -void -Spotlight::set_enabled(bool enabled) -{ - SCRIPT_GUARD_VOID; - object.set_enabled(enabled); -} - -bool -Spotlight::is_enabled() -{ - SCRIPT_GUARD_DEFAULT; - return object.is_enabled(); -} - -void -Spotlight::set_direction(const std::string& direction) -{ - SCRIPT_GUARD_VOID; - object.set_direction(::Spotlight::Direction_from_string(direction)); -} - -void -Spotlight::set_speed(float speed) -{ - SCRIPT_GUARD_VOID; - object.set_speed(speed); -} - -void -Spotlight::fade_speed(float speed, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_speed(time, speed); -} - -void -Spotlight::ease_speed(float speed, float time, const std::string& easing) -{ - SCRIPT_GUARD_VOID; - object.ease_speed(time, speed, EasingMode_from_string(easing)); -} - -void -Spotlight::set_angle(float angle) -{ - SCRIPT_GUARD_VOID; - object.set_angle(angle); -} - -void -Spotlight::fade_angle(float angle, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_angle(time, angle); -} - -void -Spotlight::ease_angle(float angle, float time, const std::string& easing) -{ - SCRIPT_GUARD_VOID; - object.ease_angle(time, angle, EasingMode_from_string(easing)); -} - -void -Spotlight::set_color_rgba(float r, float g, float b, float a) -{ - SCRIPT_GUARD_VOID; - object.set_color(Color(r, g, b, a)); -} - -void -Spotlight::fade_color_rgba(float r, float g, float b, float a, float time) -{ - SCRIPT_GUARD_VOID; - object.ease_color(time, Color(r, g, b, a)); -} - -void -Spotlight::ease_color_rgba(float r, float g, float b, float a, float time, std::string easing) -{ - SCRIPT_GUARD_VOID; - object.ease_color(time, Color(r, g, b, a), EasingMode_from_string(easing)); -} - - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/spotlight.hpp b/src/scripting/spotlight.hpp deleted file mode 100644 index a9db34a4d88..00000000000 --- a/src/scripting/spotlight.hpp +++ /dev/null @@ -1,137 +0,0 @@ -// SuperTux -// Copyright (C) 2021 A. Semphris -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_SPOTLIGHT_HPP -#define HEADER_SUPERTUX_SCRIPTING_SPOTLIGHT_HPP - -#ifndef SCRIPTING_API -#include - -#include "scripting/game_object.hpp" - -class Spotlight; -#endif - -namespace scripting { - -/** - * @summary A ""Spotlight"" that was given a name can be controlled by scripts. - * @instances A ""Spotlight"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class Spotlight final -#ifndef SCRIPTING_API - : public GameObject<::Spotlight> -#endif -{ -#ifndef SCRIPTING_API -private: - using GameObject::GameObject; - -private: - Spotlight(const Spotlight&) = delete; - Spotlight& operator=(const Spotlight&) = delete; -#endif - -public: - /** - * Enables/disables the spotlight. - * @param bool $enabled - */ - void set_enabled(bool enabled); - /** - * Returns ""true"" if the spotlight is enabled. - */ - bool is_enabled(); - - /** - * Sets the direction of the spotlight. - * @param string $direction - */ - void set_direction(const std::string& direction); - - /** - * Sets the angle of the spotlight. - * @param float $angle - */ - void set_angle(float angle); - /** - * Fades the angle of the spotlight in ""time"" seconds. - * @param float $angle - * @param float $time - */ - void fade_angle(float angle, float time); - /** - * Fades the angle of the spotlight in ""time"" seconds, with easing. - * @param float $angle - * @param float $time - * @param string $easing - */ - void ease_angle(float angle, float time, const std::string& easing); - - /** - * Sets the speed of the spotlight. - * @param float $speed - */ - void set_speed(float speed); - /** - * Fades the speed of the spotlight in ""time"" seconds. - * @param float $speed - * @param float $time - */ - void fade_speed(float speed, float time); - /** - * Fades the speed of the spotlight in ""time"" seconds, with easing. - * @param float $speed - * @param float $time - * @param string $easing - */ - void ease_speed(float speed, float time, const std::string& easing); - - /** - * Sets the RGBA color of the spotlight. - * @param float $r - * @param float $g - * @param float $b - * @param float $a - */ - void set_color_rgba(float r, float g, float b, float a); - /** - * Fades the spotlight to a new RGBA color in ""time"" seconds. - * @param float $r - * @param float $g - * @param float $b - * @param float $a - * @param float $time - */ - void fade_color_rgba(float r, float g, float b, float a, float time); - /** - * Fades the spotlight to a new RGBA color in ""time"" seconds, with easing. - * @param float $r - * @param float $g - * @param float $b - * @param float $a - * @param float $time - * @param string $easing - */ - void ease_color_rgba(float r, float g, float b, float a, float time, std::string easing); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/text_array_object.cpp b/src/scripting/text_array_object.cpp deleted file mode 100644 index 23b88aa37b6..00000000000 --- a/src/scripting/text_array_object.cpp +++ /dev/null @@ -1,320 +0,0 @@ -// SuperTux -// Copyright (C) 2018 Nir -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/text_array_object.hpp" - -#include "object/text_array_object.hpp" -#include "object/text_object.hpp" -#include "supertux/sector.hpp" - -namespace scripting { - -TextArrayObject::TextArrayObject() : - GameObject(get_sector().add<::TextArrayObject>()) -{ -} - -void -TextArrayObject::add_text_duration(const std::string& text, float duration) -{ - SCRIPT_GUARD_VOID; - object.add_text(text, duration); -} - -void -TextArrayObject::add_text(const std::string& text) -{ - SCRIPT_GUARD_VOID; - object.add_text(text); -} - -void -TextArrayObject::clear() -{ - SCRIPT_GUARD_VOID; - object.clear(); -} - -void -TextArrayObject::set_fade_transition(bool fade_transition) -{ - SCRIPT_GUARD_VOID; - object.set_fade_transition(fade_transition); -} - -void -TextArrayObject::set_fade_time(float fadetime) -{ - SCRIPT_GUARD_VOID; - object.set_fade_time(fadetime); -} - -void -TextArrayObject::set_text_index(int index) -{ - SCRIPT_GUARD_VOID; - object.set_text_index(index); -} - -void -TextArrayObject::next_text() -{ - SCRIPT_GUARD_VOID; - object.next_text(); -} - -void -TextArrayObject::prev_text() -{ - SCRIPT_GUARD_VOID; - object.prev_text(); -} - -void -TextArrayObject::set_keep_visible(bool keep_visible) -{ - SCRIPT_GUARD_VOID; - object.set_keep_visible(keep_visible); -} - -void -TextArrayObject::set_done(bool done) -{ - SCRIPT_GUARD_VOID; - object.set_done(done); -} - -void -TextArrayObject::set_auto(bool is_auto) -{ - SCRIPT_GUARD_VOID; - object.set_auto(is_auto); -} - -/////////// text api - -void -TextArrayObject::set_text(const std::string& text) -{ - SCRIPT_GUARD_VOID; - - if (auto* textItem = object.get_current_text_item()) { - textItem->text_object.set_text(text); - } - else { - object.add_text(text); - } -} - -void -TextArrayObject::set_font(const std::string& fontname) -{ - SCRIPT_GUARD_VOID; - - if (auto* textItem = object.get_current_text_item()) { - textItem->text_object.set_font(fontname); - } -} - -void -TextArrayObject::fade_in(float fadetime) -{ - SCRIPT_GUARD_VOID; - - if (auto* textItem = object.get_current_text_item()) { - textItem->text_object.fade_in(fadetime); - } -} - -void -TextArrayObject::fade_out(float fadetime) -{ - SCRIPT_GUARD_VOID; - - if (auto* textItem = object.get_current_text_item()) { - textItem->text_object.fade_out(fadetime); - } -} - -void -TextArrayObject::grow_in(float fadetime) -{ - SCRIPT_GUARD_VOID; - - if (auto* textItem = object.get_current_text_item()) { - textItem->text_object.grow_in(fadetime); - } -} - -void -TextArrayObject::grow_out(float fadetime) -{ - SCRIPT_GUARD_VOID; - - if (auto* textItem = object.get_current_text_item()) { - textItem->text_object.grow_out(fadetime); - } -} - -void -TextArrayObject::set_visible(bool visible) -{ - SCRIPT_GUARD_VOID; - - if (auto* textItem = object.get_current_text_item()) { - textItem->text_object.set_visible(visible); - } -} - -void -TextArrayObject::set_centered(bool centered) -{ - SCRIPT_GUARD_VOID; - - if (auto* textItem = object.get_current_text_item()) { - textItem->text_object.set_centered(centered); - } -} - -void -TextArrayObject::set_pos(float x, float y) -{ - SCRIPT_GUARD_VOID; - - if (auto* textItem = object.get_current_text_item()) { - textItem->text_object.set_pos(Vector(x, y)); - } -} - -float -TextArrayObject::get_pos_x() const -{ - SCRIPT_GUARD_DEFAULT; - - if (auto* textItem = object.get_current_text_item()) { - return textItem->text_object.get_pos().x; - } else { - log_warning << "TextArrayObject position is not set. Assuming (0,0)" << std::endl; - return 0; - } -} - -float -TextArrayObject::get_pos_y() const -{ - SCRIPT_GUARD_DEFAULT; - - if (auto* textItem = object.get_current_text_item()) { - return textItem->text_object.get_pos().y; - } else { - log_warning << "TextArrayObject position is not set. Assuming (0,0)" << std::endl; - return 0; - } -} - -void -TextArrayObject::set_anchor_point(int anchor) -{ - SCRIPT_GUARD_VOID; - - if (auto* textItem = object.get_current_text_item()) { - textItem->text_object.set_anchor_point(static_cast(anchor)); - } -} - -int -TextArrayObject::get_anchor_point() const -{ - SCRIPT_GUARD_DEFAULT; - - if (auto* textItem = object.get_current_text_item()) { - return textItem->text_object.get_anchor_point(); - } else { - return -1; - } -} - -void -TextArrayObject::set_anchor_offset(float x, float y) -{ - SCRIPT_GUARD_VOID; - - if (auto* textItem = object.get_current_text_item()) { - textItem->text_object.set_anchor_offset(Vector(x, y)); - } -} - -float -TextArrayObject::get_wrap_width() const -{ - SCRIPT_GUARD_DEFAULT; - - if (auto* textItem = object.get_current_text_item()) { - return textItem->text_object.get_wrap_width(); - } else { - return 0; - } -} - -void -TextArrayObject::set_wrap_width(float width) -{ - SCRIPT_GUARD_VOID; - - if (auto* textItem = object.get_current_text_item()) { - textItem->text_object.set_wrap_width(width); - } -} - -void -TextArrayObject::set_front_fill_color(float red, float green, float blue, float alpha) -{ - SCRIPT_GUARD_VOID; - if (auto* textItem = object.get_current_text_item()) { - textItem->text_object.set_front_fill_color(Color(red, green, blue, alpha)); - } -} - -void -TextArrayObject::set_back_fill_color(float red, float green, float blue, float alpha) -{ - SCRIPT_GUARD_VOID; - if (auto* textItem = object.get_current_text_item()) { - textItem->text_object.set_back_fill_color(Color(red, green, blue, alpha)); - } -} - -void -TextArrayObject::set_text_color(float red, float green, float blue, float alpha) -{ - SCRIPT_GUARD_VOID; - if (auto* textItem = object.get_current_text_item()) { - textItem->text_object.set_text_color(Color(red, green, blue, alpha)); - } -} - -void -TextArrayObject::set_roundness(float roundness) -{ - SCRIPT_GUARD_VOID; - if (auto* textItem = object.get_current_text_item()) { - textItem->text_object.set_roundness(roundness); - } -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/text_array_object.hpp b/src/scripting/text_array_object.hpp deleted file mode 100644 index 880254f0077..00000000000 --- a/src/scripting/text_array_object.hpp +++ /dev/null @@ -1,146 +0,0 @@ -// SuperTux -// Copyright (C) 2018 Nir -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_TEXT_ARRAY_OBJECT_HPP -#define HEADER_SUPERTUX_SCRIPTING_TEXT_ARRAY_OBJECT_HPP - -#ifndef SCRIPTING_API -#include - -#include "scripting/game_object.hpp" - -class TextArrayObject; -#endif - - -namespace scripting { - -/** - * @summary A ""TextArrayObject"" that was given a name (or manually instantiated) can be controlled by scripts. - Supports all functions of ${SRG_REF_Text}, applying them to the current text item.${SRG_NEWPARAGRAPH} - Intended for scripts with narration. - * @instances A ""TextArrayObject"" instance is already provided in sectors under ""sector.TextArray"".${SRG_NEWPARAGRAPH} - A ""TextArrayObject"" can also be created in a script or from the console. Constructor:${SRG_NEWPARAGRAPH} - """""" <- TextArrayObject()"""""" - */ -class TextArrayObject final -#ifndef SCRIPTING_API - : public GameObject<::TextArrayObject> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; - -private: - TextArrayObject(const TextArrayObject&) = delete; - TextArrayObject& operator=(const TextArrayObject&) = delete; -#endif - -public: - TextArrayObject(); - - /* - * The text array api. - * @see: text_array_object.hpp - */ - /** - * Clears all text objects from the stack. - */ - void clear(); - /** - * Adds a text object with a specific text at the end of the stack. - * @param string $text - */ - void add_text(const std::string& text); - /** - * Adds a text object with a specific text and duration at the end of the stack. - * @param string $text - * @param float $duration - */ - void add_text_duration(const std::string& text, float duration); - /** - * Sets the current text object by its index. - * @param int $index - */ - void set_text_index(int index); - /** - * If set, keeps the current text object visible. - * @param bool $keep_visible - */ - void set_keep_visible(bool keep_visible); - /** - * If set, allows for a fade-in and fade-out transition. - * @param bool $fade_transition - */ - void set_fade_transition(bool fade_transition); - /** - * Sets the fade-in and fade-out time. - * @param float $fadetime - */ - void set_fade_time(float fadetime); - /** - * If set, sets the text array as finished going through all text objects. - * @param bool $done - */ - void set_done(bool done); - /** - * If set, lets the text array automatically go through all text objects. - * @param bool $is_auto - */ - void set_auto(bool is_auto); - /** - * If available, goes to the next text object in the stack. - */ - void next_text(); - /** - * If available, goes to the previous text object in the stack. - */ - void prev_text(); - -#ifndef DOXYGEN_SCRIPTING - /* - * Text object api related - * @see: text_object.hpp - */ - void set_text(const std::string& text); - void set_font(const std::string& fontname); - void fade_in(float fadetime); - void fade_out(float fadetime); - void grow_in(float fadetime); - void grow_out(float fadetime); - void set_visible(bool visible); - void set_centered(bool centered); - void set_pos(float x, float y); - float get_pos_x() const; - float get_pos_y() const; - void set_anchor_point(int anchor); - int get_anchor_point() const; - void set_anchor_offset(float x, float y); - float get_wrap_width() const; - void set_wrap_width(float width); - void set_front_fill_color(float red, float green, float blue, float alpha); - void set_back_fill_color(float red, float green, float blue, float alpha); - void set_text_color(float red, float green, float blue, float alpha); - void set_roundness(float roundness); -#endif -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/text_object.cpp b/src/scripting/text_object.cpp deleted file mode 100644 index 4639710dd42..00000000000 --- a/src/scripting/text_object.cpp +++ /dev/null @@ -1,172 +0,0 @@ -// SuperTux -// Copyright (C) 2015 Ingo Ruhnke -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/text_object.hpp" - -#include "object/text_object.hpp" -#include "supertux/sector.hpp" -#include "worldmap/worldmap.hpp" - -namespace scripting { - -TextObject::TextObject() : - GameObject(get_sector().add<::TextObject>()) -{ -} - -void -TextObject::set_text(const std::string& text) -{ - SCRIPT_GUARD_VOID; - object.set_text(text); -} - -void -TextObject::set_font(const std::string& fontname) -{ - SCRIPT_GUARD_VOID; - object.set_font(fontname); -} - -void -TextObject::fade_in(float fadetime) -{ - SCRIPT_GUARD_VOID; - object.fade_in(fadetime); -} - -void -TextObject::fade_out(float fadetime) -{ - SCRIPT_GUARD_VOID; - object.fade_out(fadetime); -} - -void -TextObject::grow_in(float fadetime) -{ - SCRIPT_GUARD_VOID; - object.grow_in(fadetime); -} - -void -TextObject::grow_out(float fadetime) -{ - SCRIPT_GUARD_VOID; - object.grow_out(fadetime); -} - -void -TextObject::set_visible(bool visible) -{ - SCRIPT_GUARD_VOID; - object.set_visible(visible); -} - -void -TextObject::set_centered(bool centered) -{ - SCRIPT_GUARD_VOID; - object.set_centered(centered); -} - -void -TextObject::set_pos(float x, float y) -{ - SCRIPT_GUARD_VOID; - object.set_pos(Vector(x, y)); -} - -float -TextObject::get_pos_x() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_pos().x; -} - -float -TextObject::get_pos_y() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_pos().y; -} - -void -TextObject::set_anchor_point(int anchor) -{ - SCRIPT_GUARD_VOID; - object.set_anchor_point(static_cast(anchor)); -} - -int -TextObject::get_anchor_point() const -{ - SCRIPT_GUARD_DEFAULT; - return static_cast(object.get_anchor_point()); -} - -void -TextObject::set_anchor_offset(float x, float y) -{ - SCRIPT_GUARD_VOID; - object.set_anchor_offset(Vector(x, y)); -} - -float -TextObject::get_wrap_width() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_wrap_width(); -} - -void -TextObject::set_wrap_width(float width) -{ - SCRIPT_GUARD_VOID; - object.set_wrap_width(width); -} - -void -TextObject::set_front_fill_color(float red, float green, float blue, float alpha) -{ - SCRIPT_GUARD_VOID; - object.set_front_fill_color(Color(red, green, blue, alpha)); -} - -void -TextObject::set_back_fill_color(float red, float green, float blue, float alpha) -{ - SCRIPT_GUARD_VOID; - object.set_back_fill_color(Color(red, green, blue, alpha)); -} - -void -TextObject::set_text_color(float red, float green, float blue, float alpha) -{ - SCRIPT_GUARD_VOID; - object.set_text_color(Color(red, green, blue, alpha)); -} - -void -TextObject::set_roundness(float roundness) -{ - SCRIPT_GUARD_VOID; - object.set_roundness(roundness); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/text_object.hpp b/src/scripting/text_object.hpp deleted file mode 100644 index 2c80c05f8d6..00000000000 --- a/src/scripting/text_object.hpp +++ /dev/null @@ -1,165 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_TEXT_OBJECT_HPP -#define HEADER_SUPERTUX_SCRIPTING_TEXT_OBJECT_HPP - -#ifndef SCRIPTING_API -#include -#include "scripting/game_object.hpp" - -class TextObject; -#endif - -namespace scripting { - -/** - * @summary A ""TextObject"" that was given a name (or manually instantiated) can be controlled by scripts. - * @instances A ""TextObject"" instance is already provided in sectors under ""sector.Text"".${SRG_NEWPARAGRAPH} - A ""TextObject"" can also be created in a script or from the console. Constructor:${SRG_NEWPARAGRAPH} - """""" <- TextObject()"""""" - */ -class TextObject final -#ifndef SCRIPTING_API - : public GameObject<::TextObject> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; - -private: - TextObject(const TextObject&) = delete; - TextObject& operator=(const TextObject&) = delete; -#endif - -public: - TextObject(); - - /** - * Sets the text string to be displayed. - * @param string $text - */ - void set_text(const std::string& text); - /** - * Sets the font of the text to be displayed. - * @param string $fontname Valid values are normal, big and small. - */ - void set_font(const std::string& fontname); - /** - * Fades in the specified text for the next ""fadetime"" seconds. - * @param float $fadetime - */ - void fade_in(float fadetime); - /** - * Fades out the specified text for the next ""fadetime"" seconds. - * @param float $fadetime - */ - void fade_out(float fadetime); - /** - * Grows in the specified text for the next ""fadetime"" seconds. - * @param float $fadetime - */ - void grow_in(float fadetime); - /** - * Grows out the specified text for the next ""fadetime"" seconds. - * @param float $fadetime - */ - void grow_out(float fadetime); - /** - * Shows or hides the text abruptly (drastic counterpart to ""fade_in()"" and ""fade_out()""). - * @param bool $visible - */ - void set_visible(bool visible); - /** - * If ""centered"" is ""true"", the text will be centered on the screen. Otherwise, it will be left-aligned. - * @param bool $centered - */ - void set_centered(bool centered); - /** - * Sets the offset of the text, relative to the anchor point. - * @param float $x - * @param float $y - */ - void set_pos(float x, float y); - /** - * Returns the X offset of the text, relative to the anchor point. - */ - float get_pos_x() const; - /** - * Returns the Y offset of the text, relative to the anchor point. - */ - float get_pos_y() const; - /** - * Sets the anchor point of the text. - * @param int $anchor One of the ""ANCHOR_*"" constants (see ${SRG_REF_AnchorPoints}). - */ - void set_anchor_point(int anchor); - /** - * Returns the current anchor point of the text (one of the ""ANCHOR_*"" constants; see ${SRG_REF_AnchorPoints}). - */ - int get_anchor_point() const; - /** - * Sets the anchor offset of the text. - * @param float $x - * @param float $y - */ - void set_anchor_offset(float x, float y); - /** - * Gets the text wrap width of the text. - */ - float get_wrap_width() const; - /** - * Sets the text wrap width of the text. - * @param float $width - */ - void set_wrap_width(float width); - /** - * Sets the front fill color of the text. - * @param float $red - * @param float $green - * @param float $blue - * @param float $alpha - */ - void set_front_fill_color(float red, float green, float blue, float alpha); - /** - * Sets the back fill color of the text. - * @param float $red - * @param float $green - * @param float $blue - * @param float $alpha - */ - void set_back_fill_color(float red, float green, float blue, float alpha); - /** - * Sets the text color. - * @param float $red - * @param float $green - * @param float $blue - * @param float $alpha - */ - void set_text_color(float red, float green, float blue, float alpha); - /** - * Sets the frame's roundness. - * @param float $roundness - */ - void set_roundness(float roundness); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/thunderstorm.cpp b/src/scripting/thunderstorm.cpp deleted file mode 100644 index 3eb5ac873e7..00000000000 --- a/src/scripting/thunderstorm.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "object/thunderstorm.hpp" - -namespace scripting { - -void Thunderstorm::start() -{ - SCRIPT_GUARD_VOID; - object.start(); -} - -void Thunderstorm::stop() -{ - SCRIPT_GUARD_VOID; - object.stop(); -} - -void Thunderstorm::thunder() -{ - SCRIPT_GUARD_VOID; - object.thunder(); -} - -void Thunderstorm::lightning() -{ - SCRIPT_GUARD_VOID; - object.lightning(); -} - -void Thunderstorm::flash() -{ - SCRIPT_GUARD_VOID; - object.flash(); -} - -void Thunderstorm::electrify() -{ - SCRIPT_GUARD_VOID; - object.electrify(); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/thunderstorm.hpp b/src/scripting/thunderstorm.hpp deleted file mode 100644 index 1e2ca560865..00000000000 --- a/src/scripting/thunderstorm.hpp +++ /dev/null @@ -1,82 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_THUNDERSTORM_HPP -#define HEADER_SUPERTUX_SCRIPTING_THUNDERSTORM_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class Thunderstorm; -#endif - -namespace scripting { - -/** - * @summary A ""Thunderstorm"" that was given a name can be controlled by scripts. - * @instances A ""Thunderstorm"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class Thunderstorm final -#ifndef SCRIPTING_API - : public GameObject<::Thunderstorm> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; -private: - Thunderstorm(const Thunderstorm&) = delete; - Thunderstorm& operator=(const Thunderstorm&) = delete; -#endif - -public: - /** - * Starts playing thunder and lightning at a configured interval. - */ - void start(); - - /** - * Stops playing thunder and lightning at a configured interval. - */ - void stop(); - - /** - * Plays thunder. - */ - void thunder(); - - /** - * Plays lightning, i.e. calls ""flash()"" and ""electrify()"". - */ - void lightning(); - - /** - * Displays a flash. - */ - void flash(); - - /** - * Electrifies water throughout the whole sector for a short time. - */ - void electrify(); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/tilemap.cpp b/src/scripting/tilemap.cpp deleted file mode 100644 index b78dc5fa7c9..00000000000 --- a/src/scripting/tilemap.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "object/tilemap.hpp" -#include "scripting/tilemap.hpp" - -namespace scripting { - -void -TileMap::goto_node(int node_idx) -{ - SCRIPT_GUARD_VOID; - object.goto_node(node_idx); -} - -void -TileMap::set_node(int node_idx) -{ - SCRIPT_GUARD_VOID; - object.jump_to_node(node_idx, /* instantaneous = */ true); -} - -void -TileMap::start_moving() -{ - SCRIPT_GUARD_VOID; - object.start_moving(); -} - -void -TileMap::stop_moving() -{ - SCRIPT_GUARD_VOID; - object.stop_moving(); -} - -int -TileMap::get_tile_id(int x, int y) const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_tile_id(x, y); -} - -int -TileMap::get_tile_id_at(float x, float y) const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_tile_id_at( Vector(x, y) ); -} - -void -TileMap::change(int x, int y, int newtile) -{ - SCRIPT_GUARD_VOID; - object.change(x, y, newtile); -} - -void -TileMap::change_at(float x, float y, int newtile) -{ - SCRIPT_GUARD_VOID; - object.change_at(Vector(x, y), newtile); -} - -void -TileMap::fade(float alpha, float time) -{ - SCRIPT_GUARD_VOID; - object.fade(alpha, time); -} - -void -TileMap::tint_fade(float time, float red, float green, float blue, float alpha) -{ - SCRIPT_GUARD_VOID; - object.tint_fade(Color(red, green, blue, alpha), time); -} - -void -TileMap::set_alpha(float alpha) -{ - SCRIPT_GUARD_VOID; - object.set_alpha(alpha); -} - -float -TileMap::get_alpha() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_alpha(); -} - -void -TileMap::set_solid(bool solid) -{ - SCRIPT_GUARD_VOID; - object.set_solid(solid); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/tilemap.hpp b/src/scripting/tilemap.hpp deleted file mode 100644 index bb3943ff96a..00000000000 --- a/src/scripting/tilemap.hpp +++ /dev/null @@ -1,146 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_TILEMAP_HPP -#define HEADER_SUPERTUX_SCRIPTING_TILEMAP_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class TileMap; -#endif - -namespace scripting { - -/** - * @summary A ""TileMap"" that was given a name can be controlled by scripts. - The tilemap can be moved by specifying a path for it. - * @instances A ""TileMap"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class TileMap final -#ifndef SCRIPTING_API - : public GameObject<::TileMap> -#endif -{ -public: -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; -private: - TileMap(const TileMap&) = delete; - TileMap& operator=(const TileMap&) = delete; -#endif - -public: - /** - * Moves the tilemap along a path until at given node, then stops. - * @param int $node_idx - */ - void goto_node(int node_idx); - - /** - * Jumps instantly to the given node. - * @param int $node_idx - */ - void set_node(int node_idx); - - /** - * Starts moving the tilemap. - */ - void start_moving(); - - /** - * Stops the tilemap at the next node. - */ - void stop_moving(); - - /** - * Returns the ID of the tile at the given coordinates or 0 if out of bounds. - The origin is at the top left. - * @param int $x - * @param int $y - */ - int get_tile_id(int x, int y) const; - - /** - * Returns the ID of the tile at the given position (in-world coordinates). - * @param float $x - * @param float $y - */ - int get_tile_id_at(float x, float y) const; - - /** - * Changes the tile at the given coordinates to ""newtile"". - The origin is at the top left. - * @param int $x - * @param int $y - * @param int $newtile - */ - void change(int x, int y, int newtile); - - /** - * Changes the tile at the given position (in-world coordinates) to ""newtile"". - * @param float $x - * @param float $y - * @param int $newtile - */ - void change_at(float x, float y, int newtile); - - /** - * Starts fading the tilemap to the opacity given by ""alpha"". - * Destination opacity will be reached after ""time"" seconds. Also influences solidity. - * @param float $alpha - * @param float $time - */ - void fade(float alpha, float time); - - /** - * Starts fading the tilemap to tint given by RGBA. - * Destination opacity will be reached after ""time"" seconds. Doesn't influence solidity. - * @param float $time - * @param float $red - * @param float $green - * @param float $blue - * @param float $alpha - */ - void tint_fade(float time, float red, float green, float blue, float alpha); - - /** - * Instantly switches the tilemap's opacity to ""alpha"". Also influences solidity. - * @param float $alpha - */ - void set_alpha(float alpha); - - /** - * Returns the tilemap's opacity.${SRG_TABLENEWPARAGRAPH} - Note that while the tilemap is fading in or out, this will return the current alpha value, not the target alpha. - */ - float get_alpha() const; - - /** - * Switches the tilemap's real solidity to ""solid"".${SRG_TABLENEWPARAGRAPH} - Note that the effective solidity is also influenced by the alpha of the tilemap. - * @param bool $solid - */ - void set_solid(bool solid); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/torch.cpp b/src/scripting/torch.cpp deleted file mode 100644 index 3ce0098ceb0..00000000000 --- a/src/scripting/torch.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// Copyright (C) 2017 M. Teufel -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "object/torch.hpp" -#include "scripting/torch.hpp" - -namespace scripting { - -bool -Torch::get_burning() const -{ - SCRIPT_GUARD_DEFAULT; - return object.get_burning(); -} - -void -Torch::set_burning(bool burning) -{ - SCRIPT_GUARD_VOID; - object.set_burning(burning); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/torch.hpp b/src/scripting/torch.hpp deleted file mode 100644 index ae80c5f4624..00000000000 --- a/src/scripting/torch.hpp +++ /dev/null @@ -1,64 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// Copyright (C) 2017 M. Teufel -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_TORCH_HPP -#define HEADER_SUPERTUX_SCRIPTING_TORCH_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class Torch; -#endif - -namespace scripting { - -/** - * @summary A ""Torch"" that was given a name can be controlled by scripts. - * @instances A ""Torch"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class Torch final -#ifndef SCRIPTING_API - : public GameObject<::Torch> -#endif -{ -public: -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; -private: - Torch(const Torch&) = delete; - Torch& operator=(const Torch&) = delete; -#endif - -public: - /** - * Returns ""true"" if the torch is burning. - */ - bool get_burning() const; - /** - * Switches the burning state of the torch. - * @param bool $burning - */ - void set_burning(bool burning); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/willowisp.cpp b/src/scripting/willowisp.cpp deleted file mode 100644 index fe749b5b603..00000000000 --- a/src/scripting/willowisp.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// SuperTux -// Copyright (C) 2015 Ingo Ruhnke -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/willowisp.hpp" - -#include "badguy/willowisp.hpp" - -namespace scripting { - -void -WillOWisp::goto_node(int node_idx) -{ - SCRIPT_GUARD_VOID_T(WillOWisp); - object.goto_node(node_idx); -} - -void -WillOWisp::set_state(const std::string& state) -{ - SCRIPT_GUARD_VOID_T(WillOWisp); - object.set_state(state); -} - -void -WillOWisp::start_moving() -{ - SCRIPT_GUARD_VOID_T(WillOWisp); - object.start_moving(); -} - -void -WillOWisp::stop_moving() -{ - SCRIPT_GUARD_VOID_T(WillOWisp); - object.stop_moving(); -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/willowisp.hpp b/src/scripting/willowisp.hpp deleted file mode 100644 index fac13883c4a..00000000000 --- a/src/scripting/willowisp.hpp +++ /dev/null @@ -1,84 +0,0 @@ -// SuperTux -// Copyright (C) 2007 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_WILLOWISP_HPP -#define HEADER_SUPERTUX_SCRIPTING_WILLOWISP_HPP - -#ifndef SCRIPTING_API -#include - -#include "scripting/badguy.hpp" - -class WillOWisp; -#endif - -namespace scripting { - -/** - * @summary A ""WillOWisp"" that was given a name can be controlled by scripts. - The WillOWisp can be moved by specifying a path for it. - * @instances A ""WillOWisp"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class WillOWisp final : public scripting::BadGuy -#ifndef SCRIPTING_API - , virtual public GameObject<::WillOWisp> -#endif -{ -#ifndef SCRIPTING_API -public: - WillOWisp(const ::GameObject& object) : - GameObject<::BadGuy>(object), - GameObject<::WillOWisp>(object), - BadGuy(object) - {} - -private: - WillOWisp(const WillOWisp&) = delete; - WillOWisp& operator=(const WillOWisp&) = delete; -#endif - -public: - /** - * Moves the WillOWisp along a path until at given node, then stops. - * @param int $node_idx - */ - void goto_node(int node_idx); - - /** - * Sets the state of the WillOWisp. - * @param string $state One of the following: "stopped", "move_path" (moves along a path), - "move_path_track" (moves along a path but catches Tux when he is near), "normal" (starts tracking Tux when he is near enough), - "vanish". - */ - void set_state(const std::string& state); - - /** - * Starts following a path. - */ - void start_moving(); - /** - * Stops following a path. - */ - void stop_moving(); -}; - -} // namespace scripting - -#endif - -/* EOF - */ diff --git a/src/scripting/wind.hpp b/src/scripting/wind.hpp deleted file mode 100644 index 4f4e12aacca..00000000000 --- a/src/scripting/wind.hpp +++ /dev/null @@ -1,62 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_WIND_HPP -#define HEADER_SUPERTUX_SCRIPTING_WIND_HPP - -#ifndef SCRIPTING_API -#include "scripting/game_object.hpp" - -class Wind; -#endif - -namespace scripting { - -/** - * @summary A ""Wind"" that was given a name can be controlled by scripts. - * @instances A ""Wind"" is instantiated by placing a definition inside a level. - It can then be accessed by its name from a script or via ""sector.name"" from the console. - */ -class Wind final -#ifndef SCRIPTING_API - : public GameObject<::Wind> -#endif -{ -#ifndef SCRIPTING_API -public: - using GameObject::GameObject; -private: - Wind(const Wind&) = delete; - Wind& operator=(const Wind&) = delete; -#endif - -public: - /** - * Starts blowing. - */ - void start(); - - /** - * Stops blowing. - */ - void stop(); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/worldmap_sector.cpp b/src/scripting/worldmap_sector.cpp deleted file mode 100644 index 9230317c8d6..00000000000 --- a/src/scripting/worldmap_sector.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// SuperTux -// Copyright (C) 2021 A. Semphris -// 2023 Vankata453 -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "scripting/worldmap_sector.hpp" - -#include "worldmap/worldmap.hpp" - -namespace scripting { - -WorldMapSector::WorldMapSector(::worldmap::WorldMapSector* parent) : - GameObjectManager(parent), - m_parent(parent) -{ -} - -float -WorldMapSector::get_tux_x() const -{ - return m_parent->get_tux_pos().x; -} - -float -WorldMapSector::get_tux_y() const -{ - return m_parent->get_tux_pos().y; -} - -void -WorldMapSector::set_sector(const std::string& sector) -{ - SCRIPT_GUARD_WORLDMAP; - worldmap.set_sector(sector); -} - -void -WorldMapSector::spawn(const std::string& sector, const std::string& spawnpoint) -{ - SCRIPT_GUARD_WORLDMAP; - worldmap.set_sector(sector, spawnpoint); -} - -void -WorldMapSector::move_to_spawnpoint(const std::string& spawnpoint) -{ - m_parent->move_to_spawnpoint(spawnpoint); -} - -std::string -WorldMapSector::get_filename() const -{ - SCRIPT_GUARD_WORLDMAP; - return worldmap.get_filename(); -} - -void -WorldMapSector::set_title_level(const std::string& filename) -{ - SCRIPT_GUARD_WORLDMAP; - worldmap.get_savegame().get_player_status().title_level = filename; -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/worldmap_sector.hpp b/src/scripting/worldmap_sector.hpp deleted file mode 100644 index 4f01e0830de..00000000000 --- a/src/scripting/worldmap_sector.hpp +++ /dev/null @@ -1,104 +0,0 @@ -// SuperTux -// Copyright (C) 2021 A. Semphris -// 2023 Vankata453 -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SCRIPTING_WORLDMAP_SECTOR_HPP -#define HEADER_SUPERTUX_SCRIPTING_WORLDMAP_SECTOR_HPP - -#ifndef SCRIPTING_API - -#include - -#include "scripting/game_object_manager.hpp" - -namespace worldmap { - class WorldMapSector; -} - -/** Macro to allow quick and easy access to the parent worldmap. **/ -#define SCRIPT_GUARD_WORLDMAP \ - auto& worldmap = m_parent->get_worldmap() - -#endif - -namespace scripting { - -/** - * @summary This class provides additional controlling functions for a worldmap sector, other than the ones listed at ${SRG_REF_GameObjectManager}. - * @instances An instance under ""worldmap.settings"" is available from scripts and the console. - */ -class WorldMapSector final : public GameObjectManager -{ -#ifndef SCRIPTING_API -private: - ::worldmap::WorldMapSector* m_parent; - -public: - WorldMapSector(::worldmap::WorldMapSector* parent); - -private: - WorldMapSector(const WorldMapSector&) = delete; - WorldMapSector& operator=(const WorldMapSector&) = delete; -#endif - -public: - /** - * Gets Tux's X position on the worldmap. - */ - float get_tux_x() const; - /** - * Gets Tux's Y position on the worldmap. - */ - float get_tux_y() const; - - /** - * Changes the current sector of the worldmap to a specified new sector. - * @param string $sector - */ - void set_sector(const std::string& sector); - - /** - * Changes the current sector of the worldmap to a specified new sector, - moving Tux to the specified spawnpoint. - * @param string $sector - * @param string $spawnpoint - */ - void spawn(const std::string& sector, const std::string& spawnpoint); - - /** - * Moves Tux to a specified spawnpoint. - * @param string $spawnpoint - */ - void move_to_spawnpoint(const std::string& spawnpoint); - - /** - * Gets the path to the worldmap file. Useful for saving worldmap specific data. - */ - std::string get_filename() const; - - /** - * Overrides the "Title Screen Level" property for the world with ""filename"". - The newly set level will be used for the title screen, after exiting the world. - * @param string $filename - */ - void set_title_level(const std::string& filename); -}; - -} // namespace scripting - -#endif - -/* EOF */ diff --git a/src/scripting/wrapper.cpp b/src/scripting/wrapper.cpp deleted file mode 100644 index 7ba6b422615..00000000000 --- a/src/scripting/wrapper.cpp +++ /dev/null @@ -1,17624 +0,0 @@ -/** - * WARNING: This file is automatically generated from: - * 'src/scripting/wrapper.interface.hpp' - * DO NOT CHANGE - */ - -#include "scripting/wrapper.hpp" - -#include -#include -#include -#include - -#include "scripting/wrapper.interface.hpp" - -#include "squirrel/squirrel_error.hpp" - -namespace scripting { -namespace wrapper { - -static SQInteger AmbientSound_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::AmbientSound* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger AmbientSound_set_pos_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_pos' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->set_pos(arg0, arg1); - - 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_pos'")); - return SQ_ERROR; - } - -} - -static SQInteger AmbientSound_get_pos_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_pos_x' called without instance")); - return SQ_ERROR; - } - scripting::AmbientSound* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_pos_x(); - - sq_pushfloat(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 'get_pos_x'")); - return SQ_ERROR; - } - -} - -static SQInteger AmbientSound_get_pos_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_pos_y' called without instance")); - return SQ_ERROR; - } - scripting::AmbientSound* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_pos_y(); - - sq_pushfloat(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 'get_pos_y'")); - return SQ_ERROR; - } - -} - -static SQInteger Background_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::Background* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger Background_set_image_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_image' called without instance")); - return SQ_ERROR; - } - scripting::Background* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_image(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 'set_image'")); - return SQ_ERROR; - } - -} - -static SQInteger Background_set_images_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_images' called without instance")); - return SQ_ERROR; - } - scripting::Background* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - const SQChar* arg1; - if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a string")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->set_images(arg0, arg1, arg2); - - 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_images'")); - return SQ_ERROR; - } - -} - -static SQInteger Background_set_speed_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_speed' called without instance")); - return SQ_ERROR; - } - scripting::Background* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_speed(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 'set_speed'")); - return SQ_ERROR; - } - -} - -static SQInteger Background_get_color_red_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_color_red' called without instance")); - return SQ_ERROR; - } - scripting::Background* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_color_red(); - - sq_pushfloat(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 'get_color_red'")); - return SQ_ERROR; - } - -} - -static SQInteger Background_get_color_green_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_color_green' called without instance")); - return SQ_ERROR; - } - scripting::Background* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_color_green(); - - sq_pushfloat(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 'get_color_green'")); - return SQ_ERROR; - } - -} - -static SQInteger Background_get_color_blue_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_color_blue' called without instance")); - return SQ_ERROR; - } - scripting::Background* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_color_blue(); - - sq_pushfloat(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 'get_color_blue'")); - return SQ_ERROR; - } - -} - -static SQInteger Background_get_color_alpha_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_color_alpha' called without instance")); - return SQ_ERROR; - } - scripting::Background* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_color_alpha(); - - sq_pushfloat(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 'get_color_alpha'")); - return SQ_ERROR; - } - -} - -static SQInteger Background_set_color_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_color' called without instance")); - return SQ_ERROR; - } - scripting::Background* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - - try { - _this->set_color(arg0, arg1, arg2, arg3); - - 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_color'")); - return SQ_ERROR; - } - -} - -static SQInteger Background_fade_color_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_color' called without instance")); - return SQ_ERROR; - } - scripting::Background* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - SQFloat arg4; - if(SQ_FAILED(sq_getfloat(vm, 6, &arg4))) { - sq_throwerror(vm, _SC("Argument 5 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_color(arg0, arg1, arg2, arg3, arg4); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_color'")); - return SQ_ERROR; - } - -} - -static SQInteger BadGuy_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::BadGuy* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger BadGuy_kill_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'kill' called without instance")); - return SQ_ERROR; - } - scripting::BadGuy* _this = reinterpret_cast (data); - - - try { - _this->kill(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'")); - return SQ_ERROR; - } - -} - -static SQInteger BadGuy_ignite_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ignite' called without instance")); - return SQ_ERROR; - } - scripting::BadGuy* _this = reinterpret_cast (data); - - - try { - _this->ignite(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ignite'")); - return SQ_ERROR; - } - -} - -static SQInteger BadGuy_set_action_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_action' called without instance")); - return SQ_ERROR; - } - scripting::BadGuy* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - SQInteger arg1; - if(SQ_FAILED(sq_getinteger(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not an integer")); - return SQ_ERROR; - } - - try { - _this->set_action(arg0, static_cast (arg1)); - - 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_action'")); - return SQ_ERROR; - } - -} - -static SQInteger BadGuy_set_sprite_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_sprite' called without instance")); - return SQ_ERROR; - } - scripting::BadGuy* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_sprite(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 'set_sprite'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::Camera* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger Camera_shake_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'shake' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - - try { - _this->shake(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'shake'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_start_earthquake_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'start_earthquake' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->start_earthquake(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_earthquake'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_stop_earthquake_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'stop_earthquake' called without instance")); - return SQ_ERROR; - } - scripting::Camera* _this = reinterpret_cast (data); - - - try { - _this->stop_earthquake(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_earthquake'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_set_pos_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_pos' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->set_pos(arg0, arg1); - - 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_pos'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_move_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'move' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->move(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_set_mode_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_mode' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->set_mode(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 'set_mode'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_scroll_to_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'scroll_to' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - - try { - _this->scroll_to(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'scroll_to'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_get_current_scale_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_current_scale' called without instance")); - return SQ_ERROR; - } - scripting::Camera* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_current_scale(); - - sq_pushfloat(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 'get_current_scale'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_get_target_scale_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_target_scale' called without instance")); - return SQ_ERROR; - } - scripting::Camera* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_target_scale(); - - sq_pushfloat(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 'get_target_scale'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_set_scale_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_scale' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->set_scale(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 'set_scale'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_set_scale_anchor_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_scale_anchor' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQInteger arg1; - if(SQ_FAILED(sq_getinteger(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not an integer")); - return SQ_ERROR; - } - - try { - _this->set_scale_anchor(arg0, static_cast (arg1)); - - 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_scale_anchor'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_scale_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'scale' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->scale(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'scale'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_scale_anchor_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'scale_anchor' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQInteger arg2; - if(SQ_FAILED(sq_getinteger(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not an integer")); - return SQ_ERROR; - } - - try { - _this->scale_anchor(arg0, arg1, static_cast (arg2)); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'scale_anchor'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_ease_scale_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_scale' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_scale(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_scale'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_ease_scale_anchor_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_scale_anchor' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQInteger arg2; - if(SQ_FAILED(sq_getinteger(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not an integer")); - return SQ_ERROR; - } - const SQChar* arg3; - if(SQ_FAILED(sq_getstring(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_scale_anchor(arg0, arg1, static_cast (arg2), arg3); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_scale_anchor'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_get_screen_width_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_screen_width' called without instance")); - return SQ_ERROR; - } - scripting::Camera* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_screen_width(); - - sq_pushfloat(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 'get_screen_width'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_get_screen_height_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_screen_height' called without instance")); - return SQ_ERROR; - } - scripting::Camera* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_screen_height(); - - sq_pushfloat(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 'get_screen_height'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_get_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_x' called without instance")); - return SQ_ERROR; - } - scripting::Camera* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_x(); - - sq_pushfloat(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 'get_x'")); - return SQ_ERROR; - } - -} - -static SQInteger Camera_get_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_y' called without instance")); - return SQ_ERROR; - } - scripting::Camera* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_y(); - - sq_pushfloat(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 'get_y'")); - return SQ_ERROR; - } - -} - -static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::Candle* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger Candle_get_burning_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_burning' called without instance")); - return SQ_ERROR; - } - scripting::Candle* _this = reinterpret_cast (data); - - - try { - bool return_value = _this->get_burning(); - - 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 'get_burning'")); - return SQ_ERROR; - } - -} - -static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_burning' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->set_burning(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_burning'")); - return SQ_ERROR; - } - -} - -static SQInteger Clouds_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::Clouds* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger Clouds_set_enabled_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_enabled' called without instance")); - return SQ_ERROR; - } - scripting::Clouds* _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_enabled(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_enabled'")); - return SQ_ERROR; - } - -} - -static SQInteger Clouds_get_enabled_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_enabled' called without instance")); - return SQ_ERROR; - } - scripting::Clouds* _this = reinterpret_cast (data); - - - try { - bool return_value = _this->get_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 'get_enabled'")); - return SQ_ERROR; - } - -} - -static SQInteger Clouds_fade_speed_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_speed' called without instance")); - return SQ_ERROR; - } - scripting::Clouds* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_speed(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_speed'")); - return SQ_ERROR; - } - -} - -static SQInteger Clouds_fade_amount_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_amount' called without instance")); - return SQ_ERROR; - } - scripting::Clouds* _this = reinterpret_cast (data); - - SQInteger arg0; - if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not an integer")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_amount(static_cast (arg0), arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_amount'")); - return SQ_ERROR; - } - -} - -static SQInteger Clouds_set_amount_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_amount' called without instance")); - return SQ_ERROR; - } - scripting::Clouds* _this = reinterpret_cast (data); - - SQInteger arg0; - if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not an integer")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->set_amount(static_cast (arg0), arg1); - - 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_amount'")); - return SQ_ERROR; - } - -} - -static SQInteger ConveyorBelt_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::ConveyorBelt* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger ConveyorBelt_start_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'start' called without instance")); - return SQ_ERROR; - } - scripting::ConveyorBelt* _this = reinterpret_cast (data); - - - try { - _this->start(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'")); - return SQ_ERROR; - } - -} - -static SQInteger ConveyorBelt_stop_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'stop' called without instance")); - return SQ_ERROR; - } - scripting::ConveyorBelt* _this = reinterpret_cast (data); - - - try { - _this->stop(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'")); - return SQ_ERROR; - } - -} - -static SQInteger ConveyorBelt_move_left_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'move_left' called without instance")); - return SQ_ERROR; - } - scripting::ConveyorBelt* _this = reinterpret_cast (data); - - - try { - _this->move_left(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'move_left'")); - return SQ_ERROR; - } - -} - -static SQInteger ConveyorBelt_move_right_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'move_right' called without instance")); - return SQ_ERROR; - } - scripting::ConveyorBelt* _this = reinterpret_cast (data); - - - try { - _this->move_right(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'move_right'")); - return SQ_ERROR; - } - -} - -static SQInteger ConveyorBelt_set_speed_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_speed' called without instance")); - return SQ_ERROR; - } - scripting::ConveyorBelt* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_speed(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 'set_speed'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::CustomParticles* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger CustomParticles_set_enabled_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_enabled' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _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_enabled(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_enabled'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_enabled_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_enabled' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - bool return_value = _this->get_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 'get_enabled'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_clear_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'clear' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - _this->clear(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'clear'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_spawn_particles_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'spawn_particles' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQInteger arg0; - if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not an integer")); - return SQ_ERROR; - } - SQBool arg1; - if(SQ_FAILED(sq_getbool(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a bool")); - return SQ_ERROR; - } - - try { - _this->spawn_particles(static_cast (arg0), arg1 == 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 'spawn_particles'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_max_amount_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_max_amount' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - int return_value = _this->get_max_amount(); - - sq_pushinteger(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 'get_max_amount'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_max_amount_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_max_amount' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQInteger arg0; - if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not an integer")); - return SQ_ERROR; - } - - try { - _this->set_max_amount(static_cast (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 'set_max_amount'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_birth_mode_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_birth_mode' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - std::string return_value = _this->get_birth_mode(); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_birth_mode'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_birth_mode_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_birth_mode' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_birth_mode(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 'set_birth_mode'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_death_mode_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_death_mode' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - std::string return_value = _this->get_death_mode(); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_death_mode'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_death_mode_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_death_mode' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_death_mode(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 'set_death_mode'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_rotation_mode_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_rotation_mode' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - std::string return_value = _this->get_rotation_mode(); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_rotation_mode'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_rotation_mode_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_rotation_mode' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_rotation_mode(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 'set_rotation_mode'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_collision_mode_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_collision_mode' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - std::string return_value = _this->get_collision_mode(); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_collision_mode'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_collision_mode_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_collision_mode' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_collision_mode(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 'set_collision_mode'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_offscreen_mode_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_offscreen_mode' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - std::string return_value = _this->get_offscreen_mode(); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_offscreen_mode'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_offscreen_mode_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_offscreen_mode' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_offscreen_mode(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 'set_offscreen_mode'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_cover_screen_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_cover_screen' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - bool return_value = _this->get_cover_screen(); - - 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 'get_cover_screen'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_cover_screen_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_cover_screen' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _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_cover_screen(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_cover_screen'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_delay_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_delay' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_delay(); - - sq_pushfloat(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 'get_delay'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_delay_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_delay' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_delay(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 'set_delay'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_delay_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_delay' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_delay(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_delay'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_delay_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_delay' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_delay(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_delay'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_lifetime_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_lifetime' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_lifetime(); - - sq_pushfloat(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 'get_lifetime'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_lifetime_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_lifetime' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_lifetime(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 'set_lifetime'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_lifetime_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_lifetime' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_lifetime(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_lifetime'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_lifetime_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_lifetime' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_lifetime(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_lifetime'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_lifetime_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_lifetime_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_lifetime_variation(); - - sq_pushfloat(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 'get_lifetime_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_lifetime_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_lifetime_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_lifetime_variation(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 'set_lifetime_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_lifetime_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_lifetime_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_lifetime_variation(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_lifetime_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_lifetime_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_lifetime_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_lifetime_variation(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_lifetime_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_birth_time_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_birth_time' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_birth_time(); - - sq_pushfloat(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 'get_birth_time'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_birth_time_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_birth_time' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_birth_time(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 'set_birth_time'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_birth_time_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_birth_time' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_birth_time(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_birth_time'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_birth_time_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_birth_time' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_birth_time(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_birth_time'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_birth_time_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_birth_time_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_birth_time_variation(); - - sq_pushfloat(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 'get_birth_time_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_birth_time_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_birth_time_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_birth_time_variation(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 'set_birth_time_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_birth_time_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_birth_time_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_birth_time_variation(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_birth_time_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_birth_time_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_birth_time_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_birth_time_variation(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_birth_time_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_death_time_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_death_time' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_death_time(); - - sq_pushfloat(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 'get_death_time'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_death_time_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_death_time' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_death_time(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 'set_death_time'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_death_time_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_death_time' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_death_time(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_death_time'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_death_time_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_death_time' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_death_time(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_death_time'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_death_time_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_death_time_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_death_time_variation(); - - sq_pushfloat(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 'get_death_time_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_death_time_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_death_time_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_death_time_variation(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 'set_death_time_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_death_time_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_death_time_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_death_time_variation(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_death_time_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_death_time_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_death_time_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_death_time_variation(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_death_time_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_speed_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_speed_x' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_speed_x(); - - sq_pushfloat(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 'get_speed_x'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_speed_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_speed_x' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_speed_x(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 'set_speed_x'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_speed_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_speed_x' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_speed_x(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_speed_x'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_speed_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_speed_x' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_speed_x(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_speed_x'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_speed_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_speed_y' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_speed_y(); - - sq_pushfloat(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 'get_speed_y'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_speed_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_speed_y' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_speed_y(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 'set_speed_y'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_speed_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_speed_y' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_speed_y(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_speed_y'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_speed_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_speed_y' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_speed_y(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_speed_y'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_speed_variation_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_speed_variation_x' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_speed_variation_x(); - - sq_pushfloat(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 'get_speed_variation_x'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_speed_variation_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_speed_variation_x' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_speed_variation_x(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 'set_speed_variation_x'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_speed_variation_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_speed_variation_x' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_speed_variation_x(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_speed_variation_x'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_speed_variation_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_speed_variation_x' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_speed_variation_x(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_speed_variation_x'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_speed_variation_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_speed_variation_y' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_speed_variation_y(); - - sq_pushfloat(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 'get_speed_variation_y'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_speed_variation_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_speed_variation_y' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_speed_variation_y(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 'set_speed_variation_y'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_speed_variation_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_speed_variation_y' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_speed_variation_y(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_speed_variation_y'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_speed_variation_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_speed_variation_y' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_speed_variation_y(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_speed_variation_y'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_acceleration_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_acceleration_x' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_acceleration_x(); - - sq_pushfloat(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 'get_acceleration_x'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_acceleration_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_acceleration_x' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_acceleration_x(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 'set_acceleration_x'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_acceleration_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_acceleration_x' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_acceleration_x(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_acceleration_x'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_acceleration_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_acceleration_x' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_acceleration_x(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_acceleration_x'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_acceleration_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_acceleration_y' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_acceleration_y(); - - sq_pushfloat(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 'get_acceleration_y'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_acceleration_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_acceleration_y' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_acceleration_y(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 'set_acceleration_y'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_acceleration_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_acceleration_y' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_acceleration_y(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_acceleration_y'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_acceleration_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_acceleration_y' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_acceleration_y(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_acceleration_y'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_friction_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_friction_x' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_friction_x(); - - sq_pushfloat(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 'get_friction_x'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_friction_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_friction_x' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_friction_x(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 'set_friction_x'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_friction_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_friction_x' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_friction_x(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_friction_x'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_friction_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_friction_x' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_friction_x(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_friction_x'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_friction_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_friction_y' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_friction_y(); - - sq_pushfloat(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 'get_friction_y'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_friction_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_friction_y' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_friction_y(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 'set_friction_y'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_friction_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_friction_y' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_friction_y(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_friction_y'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_friction_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_friction_y' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_friction_y(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_friction_y'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_feather_factor_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_feather_factor' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_feather_factor(); - - sq_pushfloat(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 'get_feather_factor'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_feather_factor_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_feather_factor' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_feather_factor(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 'set_feather_factor'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_feather_factor_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_feather_factor' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_feather_factor(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_feather_factor'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_feather_factor_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_feather_factor' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_feather_factor(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_feather_factor'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_rotation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_rotation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_rotation(); - - sq_pushfloat(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 'get_rotation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_rotation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_rotation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_rotation(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 'set_rotation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_rotation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_rotation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_rotation(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_rotation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_rotation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_rotation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_rotation(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_rotation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_rotation_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_rotation_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_rotation_variation(); - - sq_pushfloat(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 'get_rotation_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_rotation_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_rotation_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_rotation_variation(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 'set_rotation_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_rotation_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_rotation_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_rotation_variation(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_rotation_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_rotation_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_rotation_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_rotation_variation(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_rotation_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_rotation_speed_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_rotation_speed' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_rotation_speed(); - - sq_pushfloat(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 'get_rotation_speed'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_rotation_speed_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_rotation_speed' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_rotation_speed(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 'set_rotation_speed'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_rotation_speed_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_rotation_speed' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_rotation_speed(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_rotation_speed'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_rotation_speed_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_rotation_speed' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_rotation_speed(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_rotation_speed'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_rotation_speed_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_rotation_speed_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_rotation_speed_variation(); - - sq_pushfloat(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 'get_rotation_speed_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_rotation_speed_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_rotation_speed_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_rotation_speed_variation(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 'set_rotation_speed_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_rotation_speed_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_rotation_speed_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_rotation_speed_variation(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_rotation_speed_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_rotation_speed_variation_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_rotation_speed_variation' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_rotation_speed_variation(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_rotation_speed_variation'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_rotation_acceleration_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_rotation_acceleration' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_rotation_acceleration(); - - sq_pushfloat(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 'get_rotation_acceleration'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_rotation_acceleration_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_rotation_acceleration' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_rotation_acceleration(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 'set_rotation_acceleration'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_rotation_acceleration_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_rotation_acceleration' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_rotation_acceleration(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_rotation_acceleration'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_rotation_acceleration_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_rotation_acceleration' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_rotation_acceleration(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_rotation_acceleration'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_get_rotation_decceleration_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_rotation_decceleration' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_rotation_decceleration(); - - sq_pushfloat(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 'get_rotation_decceleration'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_set_rotation_decceleration_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_rotation_decceleration' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_rotation_decceleration(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 'set_rotation_decceleration'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_fade_rotation_decceleration_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_rotation_decceleration' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_rotation_decceleration(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_rotation_decceleration'")); - return SQ_ERROR; - } - -} - -static SQInteger CustomParticles_ease_rotation_decceleration_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_rotation_decceleration' called without instance")); - return SQ_ERROR; - } - scripting::CustomParticles* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_rotation_decceleration(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_rotation_decceleration'")); - return SQ_ERROR; - } - -} - -static SQInteger Decal_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::Decal* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger Decal_fade_sprite_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_sprite' called without instance")); - return SQ_ERROR; - } - scripting::Decal* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_sprite(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_sprite'")); - return SQ_ERROR; - } - -} - -static SQInteger Decal_change_sprite_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'change_sprite' called without instance")); - return SQ_ERROR; - } - scripting::Decal* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->change_sprite(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 'change_sprite'")); - return SQ_ERROR; - } - -} - -static SQInteger Decal_fade_in_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_in' called without instance")); - return SQ_ERROR; - } - scripting::Decal* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_in(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 'fade_in'")); - return SQ_ERROR; - } - -} - -static SQInteger Decal_fade_out_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_out' called without instance")); - return SQ_ERROR; - } - scripting::Decal* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_out(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 'fade_out'")); - return SQ_ERROR; - } - -} - -static SQInteger Decal_set_action_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_action' called without instance")); - return SQ_ERROR; - } - scripting::Decal* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_action(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 'set_action'")); - return SQ_ERROR; - } - -} - -static SQInteger Dispenser_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::Dispenser* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger Dispenser_activate_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'activate' called without instance")); - return SQ_ERROR; - } - scripting::Dispenser* _this = reinterpret_cast (data); - - - try { - _this->activate(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'")); - return SQ_ERROR; - } - -} - -static SQInteger Dispenser_deactivate_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'deactivate' called without instance")); - return SQ_ERROR; - } - scripting::Dispenser* _this = reinterpret_cast (data); - - - try { - _this->deactivate(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'")); - return SQ_ERROR; - } - -} - -static SQInteger DisplayEffect_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::DisplayEffect* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger DisplayEffect_fade_out_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_out' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->fade_out(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 'fade_out'")); - return SQ_ERROR; - } - -} - -static SQInteger DisplayEffect_fade_in_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_in' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->fade_in(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 'fade_in'")); - return SQ_ERROR; - } - -} - -static SQInteger DisplayEffect_set_black_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_black' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->set_black(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_black'")); - return SQ_ERROR; - } - -} - -static SQInteger DisplayEffect_is_black_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'is_black' called without instance")); - return SQ_ERROR; - } - scripting::DisplayEffect* _this = reinterpret_cast (data); - - - try { - bool return_value = _this->is_black(); - - 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 'is_black'")); - return SQ_ERROR; - } - -} - -static SQInteger DisplayEffect_sixteen_to_nine_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'sixteen_to_nine' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->sixteen_to_nine(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 'sixteen_to_nine'")); - return SQ_ERROR; - } - -} - -static SQInteger DisplayEffect_four_to_three_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'four_to_three' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->four_to_three(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 'four_to_three'")); - return SQ_ERROR; - } - -} - -static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::FloatingImage* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger FloatingImage_constructor_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 { - auto _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; - } - sq_setreleasehook(vm, 1, FloatingImage_release_hook); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'")); - return SQ_ERROR; - } - -} - -static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_layer' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->set_layer(static_cast (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 'set_layer'")); - return SQ_ERROR; - } - -} - -static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_layer' called without instance")); - return SQ_ERROR; - } - scripting::FloatingImage* _this = reinterpret_cast (data); - - - try { - int return_value = _this->get_layer(); - - sq_pushinteger(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 'get_layer'")); - return SQ_ERROR; - } - -} - -static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_pos' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->set_pos(arg0, arg1); - - 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_pos'")); - return SQ_ERROR; - } - -} - -static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_pos_x' called without instance")); - return SQ_ERROR; - } - scripting::FloatingImage* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_pos_x(); - - sq_pushfloat(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 'get_pos_x'")); - return SQ_ERROR; - } - -} - -static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_pos_y' called without instance")); - return SQ_ERROR; - } - scripting::FloatingImage* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_pos_y(); - - sq_pushfloat(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 'get_pos_y'")); - return SQ_ERROR; - } - -} - -static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_anchor_point' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->set_anchor_point(static_cast (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 'set_anchor_point'")); - return SQ_ERROR; - } - -} - -static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_anchor_point' called without instance")); - return SQ_ERROR; - } - scripting::FloatingImage* _this = reinterpret_cast (data); - - - try { - int return_value = _this->get_anchor_point(); - - sq_pushinteger(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 'get_anchor_point'")); - return SQ_ERROR; - } - -} - -static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_visible' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->set_visible(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_visible'")); - return SQ_ERROR; - } - -} - -static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_visible' called without instance")); - return SQ_ERROR; - } - scripting::FloatingImage* _this = reinterpret_cast (data); - - - try { - bool return_value = _this->get_visible(); - - 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 'get_visible'")); - return SQ_ERROR; - } - -} - -static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_action' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->set_action(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 'set_action'")); - return SQ_ERROR; - } - -} - -static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_action' called without instance")); - return SQ_ERROR; - } - scripting::FloatingImage* _this = reinterpret_cast (data); - - - try { - std::string return_value = _this->get_action(); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'")); - return SQ_ERROR; - } - -} - -static SQInteger FloatingImage_fade_in_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_in' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->fade_in(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 'fade_in'")); - return SQ_ERROR; - } - -} - -static SQInteger FloatingImage_fade_out_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_out' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->fade_out(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 'fade_out'")); - return SQ_ERROR; - } - -} - -static SQInteger GameObjectManager_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::GameObjectManager* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger GameObjectManager_set_ambient_light_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_ambient_light' called without instance")); - return SQ_ERROR; - } - scripting::GameObjectManager* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - - try { - _this->set_ambient_light(arg0, arg1, arg2); - - 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_ambient_light'")); - return SQ_ERROR; - } - -} - -static SQInteger GameObjectManager_fade_to_ambient_light_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_to_ambient_light' called without instance")); - return SQ_ERROR; - } - scripting::GameObjectManager* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_to_ambient_light(arg0, arg1, arg2, arg3); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_to_ambient_light'")); - return SQ_ERROR; - } - -} - -static SQInteger GameObjectManager_get_ambient_red_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_ambient_red' called without instance")); - return SQ_ERROR; - } - scripting::GameObjectManager* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_ambient_red(); - - sq_pushfloat(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 'get_ambient_red'")); - return SQ_ERROR; - } - -} - -static SQInteger GameObjectManager_get_ambient_green_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_ambient_green' called without instance")); - return SQ_ERROR; - } - scripting::GameObjectManager* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_ambient_green(); - - sq_pushfloat(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 'get_ambient_green'")); - return SQ_ERROR; - } - -} - -static SQInteger GameObjectManager_get_ambient_blue_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_ambient_blue' called without instance")); - return SQ_ERROR; - } - scripting::GameObjectManager* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_ambient_blue(); - - sq_pushfloat(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 'get_ambient_blue'")); - return SQ_ERROR; - } - -} - -static SQInteger GameObjectManager_set_music_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_music' called without instance")); - return SQ_ERROR; - } - scripting::GameObjectManager* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_music(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 'set_music'")); - return SQ_ERROR; - } - -} - -static SQInteger GameObjectManager_add_object_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'add_object' called without instance")); - return SQ_ERROR; - } - scripting::GameObjectManager* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - const SQChar* arg1; - if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a string")); - return SQ_ERROR; - } - SQInteger arg2; - if(SQ_FAILED(sq_getinteger(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not an integer")); - return SQ_ERROR; - } - SQInteger arg3; - if(SQ_FAILED(sq_getinteger(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not an integer")); - return SQ_ERROR; - } - const SQChar* arg4; - if(SQ_FAILED(sq_getstring(vm, 6, &arg4))) { - sq_throwerror(vm, _SC("Argument 5 not a string")); - return SQ_ERROR; - } - const SQChar* arg5; - if(SQ_FAILED(sq_getstring(vm, 7, &arg5))) { - sq_throwerror(vm, _SC("Argument 6 not a string")); - return SQ_ERROR; - } - - try { - _this->add_object(arg0, arg1, static_cast (arg2), static_cast (arg3), arg4, arg5); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_object'")); - return SQ_ERROR; - } - -} - -static SQInteger Gradient_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::Gradient* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger Gradient_set_direction_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_direction' called without instance")); - return SQ_ERROR; - } - scripting::Gradient* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_direction(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 'set_direction'")); - return SQ_ERROR; - } - -} - -static SQInteger Gradient_get_direction_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_direction' called without instance")); - return SQ_ERROR; - } - scripting::Gradient* _this = reinterpret_cast (data); - - - try { - std::string return_value = _this->get_direction(); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_direction'")); - return SQ_ERROR; - } - -} - -static SQInteger Gradient_set_color1_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_color1' called without instance")); - return SQ_ERROR; - } - scripting::Gradient* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - - try { - _this->set_color1(arg0, arg1, arg2); - - 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_color1'")); - return SQ_ERROR; - } - -} - -static SQInteger Gradient_set_color2_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_color2' called without instance")); - return SQ_ERROR; - } - scripting::Gradient* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - - try { - _this->set_color2(arg0, arg1, arg2); - - 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_color2'")); - return SQ_ERROR; - } - -} - -static SQInteger Gradient_set_colors_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_colors' called without instance")); - return SQ_ERROR; - } - scripting::Gradient* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - SQFloat arg4; - if(SQ_FAILED(sq_getfloat(vm, 6, &arg4))) { - sq_throwerror(vm, _SC("Argument 5 not a float")); - return SQ_ERROR; - } - SQFloat arg5; - if(SQ_FAILED(sq_getfloat(vm, 7, &arg5))) { - sq_throwerror(vm, _SC("Argument 6 not a float")); - return SQ_ERROR; - } - - try { - _this->set_colors(arg0, arg1, arg2, arg3, arg4, arg5); - - 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_colors'")); - return SQ_ERROR; - } - -} - -static SQInteger Gradient_fade_color1_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_color1' called without instance")); - return SQ_ERROR; - } - scripting::Gradient* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_color1(arg0, arg1, arg2, arg3); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_color1'")); - return SQ_ERROR; - } - -} - -static SQInteger Gradient_fade_color2_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_color2' called without instance")); - return SQ_ERROR; - } - scripting::Gradient* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_color2(arg0, arg1, arg2, arg3); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_color2'")); - return SQ_ERROR; - } - -} - -static SQInteger Gradient_fade_colors_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_colors' called without instance")); - return SQ_ERROR; - } - scripting::Gradient* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - SQFloat arg4; - if(SQ_FAILED(sq_getfloat(vm, 6, &arg4))) { - sq_throwerror(vm, _SC("Argument 5 not a float")); - return SQ_ERROR; - } - SQFloat arg5; - if(SQ_FAILED(sq_getfloat(vm, 7, &arg5))) { - sq_throwerror(vm, _SC("Argument 6 not a float")); - return SQ_ERROR; - } - SQFloat arg6; - if(SQ_FAILED(sq_getfloat(vm, 8, &arg6))) { - sq_throwerror(vm, _SC("Argument 7 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_colors(arg0, arg1, arg2, arg3, arg4, arg5, arg6); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_colors'")); - return SQ_ERROR; - } - -} - -static SQInteger Gradient_swap_colors_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'swap_colors' called without instance")); - return SQ_ERROR; - } - scripting::Gradient* _this = reinterpret_cast (data); - - - try { - _this->swap_colors(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'swap_colors'")); - return SQ_ERROR; - } - -} - -static SQInteger LevelTime_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::LevelTime* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger LevelTime_start_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'start' called without instance")); - return SQ_ERROR; - } - scripting::LevelTime* _this = reinterpret_cast (data); - - - try { - _this->start(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'")); - return SQ_ERROR; - } - -} - -static SQInteger LevelTime_stop_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'stop' called without instance")); - return SQ_ERROR; - } - scripting::LevelTime* _this = reinterpret_cast (data); - - - try { - _this->stop(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'")); - return SQ_ERROR; - } - -} - -static SQInteger LevelTime_get_time_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_time' called without instance")); - return SQ_ERROR; - } - scripting::LevelTime* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_time(); - - sq_pushfloat(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 'get_time'")); - return SQ_ERROR; - } - -} - -static SQInteger LevelTime_set_time_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_time' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->set_time(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 'set_time'")); - return SQ_ERROR; - } - -} - -static SQInteger LitObject_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::LitObject* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger LitObject_get_action_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_action' called without instance")); - return SQ_ERROR; - } - scripting::LitObject* _this = reinterpret_cast (data); - - - try { - std::string return_value = _this->get_action(); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'")); - return SQ_ERROR; - } - -} - -static SQInteger LitObject_set_action_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_action' called without instance")); - return SQ_ERROR; - } - scripting::LitObject* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_action(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 'set_action'")); - return SQ_ERROR; - } - -} - -static SQInteger LitObject_get_light_action_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_light_action' called without instance")); - return SQ_ERROR; - } - scripting::LitObject* _this = reinterpret_cast (data); - - - try { - std::string return_value = _this->get_light_action(); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_light_action'")); - return SQ_ERROR; - } - -} - -static SQInteger LitObject_set_light_action_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_light_action' called without instance")); - return SQ_ERROR; - } - scripting::LitObject* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_light_action(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 'set_light_action'")); - return SQ_ERROR; - } - -} - -static SQInteger ParticleSystem_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::ParticleSystem* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger ParticleSystem_set_enabled_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_enabled' called without instance")); - return SQ_ERROR; - } - scripting::ParticleSystem* _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_enabled(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_enabled'")); - return SQ_ERROR; - } - -} - -static SQInteger ParticleSystem_get_enabled_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_enabled' called without instance")); - return SQ_ERROR; - } - scripting::ParticleSystem* _this = reinterpret_cast (data); - - - try { - bool return_value = _this->get_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 'get_enabled'")); - return SQ_ERROR; - } - -} - -static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::Platform* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'goto_node' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->goto_node(static_cast (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 'goto_node'")); - return SQ_ERROR; - } - -} - -static SQInteger Platform_set_node_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_node' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->set_node(static_cast (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 'set_node'")); - return SQ_ERROR; - } - -} - -static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'start_moving' called without instance")); - return SQ_ERROR; - } - scripting::Platform* _this = reinterpret_cast (data); - - - try { - _this->start_moving(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'")); - return SQ_ERROR; - } - -} - -static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'stop_moving' called without instance")); - return SQ_ERROR; - } - scripting::Platform* _this = reinterpret_cast (data); - - - try { - _this->stop_moving(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'")); - return SQ_ERROR; - } - -} - -static SQInteger Platform_get_action_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_action' called without instance")); - return SQ_ERROR; - } - scripting::Platform* _this = reinterpret_cast (data); - - - try { - std::string return_value = _this->get_action(); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'")); - return SQ_ERROR; - } - -} - -static SQInteger Platform_set_action_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_action' called without instance")); - return SQ_ERROR; - } - scripting::Platform* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - SQInteger arg1; - if(SQ_FAILED(sq_getinteger(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not an integer")); - return SQ_ERROR; - } - - try { - _this->set_action(arg0, static_cast (arg1)); - - 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_action'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::Player* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger Player_add_bonus_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'add_bonus' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - bool return_value = _this->add_bonus(arg0); - - 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 'add_bonus'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_set_bonus_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_bonus' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - bool return_value = _this->set_bonus(arg0); - - 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 'set_bonus'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_get_bonus_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_bonus' called without instance")); - return SQ_ERROR; - } - scripting::Player* _this = reinterpret_cast (data); - - - try { - std::string return_value = _this->get_bonus(); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_bonus'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'add_coins' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->add_coins(static_cast (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 'add_coins'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_get_coins_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_coins' called without instance")); - return SQ_ERROR; - } - scripting::Player* _this = reinterpret_cast (data); - - - try { - int return_value = _this->get_coins(); - - sq_pushinteger(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 'get_coins'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'make_invincible' called without instance")); - return SQ_ERROR; - } - scripting::Player* _this = reinterpret_cast (data); - - - try { - _this->make_invincible(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'deactivate' called without instance")); - return SQ_ERROR; - } - scripting::Player* _this = reinterpret_cast (data); - - - try { - _this->deactivate(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_activate_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'activate' called without instance")); - return SQ_ERROR; - } - scripting::Player* _this = reinterpret_cast (data); - - - try { - _this->activate(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_walk_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'walk' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->walk(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 'walk'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_set_dir_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !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; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_visible' 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_visible(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_visible'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_visible' called without instance")); - return SQ_ERROR; - } - scripting::Player* _this = reinterpret_cast (data); - - - try { - bool return_value = _this->get_visible(); - - 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 'get_visible'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_kill_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'kill' 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->kill(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 'kill'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_set_ghost_mode_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_ghost_mode' 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_ghost_mode(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_ghost_mode'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_ghost_mode' called without instance")); - return SQ_ERROR; - } - scripting::Player* _this = reinterpret_cast (data); - - - try { - bool return_value = _this->get_ghost_mode(); - - 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 'get_ghost_mode'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_kick_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !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; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'do_cheer' called without instance")); - return SQ_ERROR; - } - scripting::Player* _this = reinterpret_cast (data); - - - try { - _this->do_cheer(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_cheer'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_do_duck_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'do_duck' called without instance")); - return SQ_ERROR; - } - scripting::Player* _this = reinterpret_cast (data); - - - try { - _this->do_duck(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_duck'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_do_standup_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'do_standup' called without instance")); - return SQ_ERROR; - } - scripting::Player* _this = reinterpret_cast (data); - - - try { - _this->do_standup(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_standup'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_do_backflip_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'do_backflip' called without instance")); - return SQ_ERROR; - } - scripting::Player* _this = reinterpret_cast (data); - - - try { - _this->do_backflip(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_backflip'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_do_jump_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'do_jump' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->do_jump(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 'do_jump'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_trigger_sequence_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'trigger_sequence' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->trigger_sequence(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 'trigger_sequence'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_use_scripting_controller_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'use_scripting_controller' 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->use_scripting_controller(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 'use_scripting_controller'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_do_scripting_controller_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'do_scripting_controller' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQBool arg1; - if(SQ_FAILED(sq_getbool(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a bool")); - return SQ_ERROR; - } - - try { - _this->do_scripting_controller(arg0, arg1 == 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 'do_scripting_controller'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_has_grabbed_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'has_grabbed' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - bool return_value = _this->has_grabbed(arg0); - - 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 'has_grabbed'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_get_velocity_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_velocity_x' called without instance")); - return SQ_ERROR; - } - scripting::Player* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_velocity_x(); - - sq_pushfloat(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 'get_velocity_x'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_get_velocity_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_velocity_y' called without instance")); - return SQ_ERROR; - } - scripting::Player* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_velocity_y(); - - sq_pushfloat(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 'get_velocity_y'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_set_velocity_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_velocity' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->set_velocity(arg0, arg1); - - 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_velocity'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_get_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_x' called without instance")); - return SQ_ERROR; - } - scripting::Player* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_x(); - - sq_pushfloat(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 'get_x'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_get_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_y' called without instance")); - return SQ_ERROR; - } - scripting::Player* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_y(); - - sq_pushfloat(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 'get_y'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_set_pos_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_pos' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->set_pos(arg0, arg1); - - 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_pos'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_get_action_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_action' called without instance")); - return SQ_ERROR; - } - scripting::Player* _this = reinterpret_cast (data); - - - try { - std::string return_value = _this->get_action(); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_get_input_pressed_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_input_pressed' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - bool return_value = _this->get_input_pressed(arg0); - - 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 'get_input_pressed'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_get_input_held_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_input_held' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - bool return_value = _this->get_input_held(arg0); - - 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 'get_input_held'")); - return SQ_ERROR; - } - -} - -static SQInteger Player_get_input_released_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_input_released' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - bool return_value = _this->get_input_released(arg0); - - 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 'get_input_released'")); - return SQ_ERROR; - } - -} - -static SQInteger Rain_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::Rain* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger Rain_set_enabled_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_enabled' called without instance")); - return SQ_ERROR; - } - scripting::Rain* _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_enabled(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_enabled'")); - return SQ_ERROR; - } - -} - -static SQInteger Rain_get_enabled_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_enabled' called without instance")); - return SQ_ERROR; - } - scripting::Rain* _this = reinterpret_cast (data); - - - try { - bool return_value = _this->get_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 'get_enabled'")); - return SQ_ERROR; - } - -} - -static SQInteger Rain_fade_speed_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_speed' called without instance")); - return SQ_ERROR; - } - scripting::Rain* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_speed(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_speed'")); - return SQ_ERROR; - } - -} - -static SQInteger Rain_fade_amount_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_amount' called without instance")); - return SQ_ERROR; - } - scripting::Rain* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_amount(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_amount'")); - return SQ_ERROR; - } - -} - -static SQInteger Rain_fade_angle_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_angle' called without instance")); - return SQ_ERROR; - } - scripting::Rain* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->fade_angle(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_angle'")); - return SQ_ERROR; - } - -} - -static SQInteger Rock_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::Rock* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::ScriptedObject* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_action' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->set_action(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 'set_action'")); - return SQ_ERROR; - } - -} - -static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_action' called without instance")); - return SQ_ERROR; - } - scripting::ScriptedObject* _this = reinterpret_cast (data); - - - try { - std::string return_value = _this->get_action(); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'")); - return SQ_ERROR; - } - -} - -static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_name' called without instance")); - return SQ_ERROR; - } - scripting::ScriptedObject* _this = reinterpret_cast (data); - - - try { - std::string return_value = _this->get_name(); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'")); - return SQ_ERROR; - } - -} - -static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'move' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->move(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'")); - return SQ_ERROR; - } - -} - -static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_pos' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->set_pos(arg0, arg1); - - 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_pos'")); - return SQ_ERROR; - } - -} - -static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_pos_x' called without instance")); - return SQ_ERROR; - } - scripting::ScriptedObject* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_pos_x(); - - sq_pushfloat(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 'get_pos_x'")); - return SQ_ERROR; - } - -} - -static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_pos_y' called without instance")); - return SQ_ERROR; - } - scripting::ScriptedObject* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_pos_y(); - - sq_pushfloat(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 'get_pos_y'")); - return SQ_ERROR; - } - -} - -static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_velocity' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->set_velocity(arg0, arg1); - - 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_velocity'")); - return SQ_ERROR; - } - -} - -static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_velocity_x' called without instance")); - return SQ_ERROR; - } - scripting::ScriptedObject* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_velocity_x(); - - sq_pushfloat(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 'get_velocity_x'")); - return SQ_ERROR; - } - -} - -static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_velocity_y' called without instance")); - return SQ_ERROR; - } - scripting::ScriptedObject* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_velocity_y(); - - sq_pushfloat(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 'get_velocity_y'")); - return SQ_ERROR; - } - -} - -static SQInteger ScriptedObject_enable_gravity_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !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, nullptr, SQTrue)) || !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; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_visible' 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->set_visible(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_visible'")); - return SQ_ERROR; - } - -} - -static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'is_visible' called without instance")); - return SQ_ERROR; - } - scripting::ScriptedObject* _this = reinterpret_cast (data); - - - try { - bool return_value = _this->is_visible(); - - 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 'is_visible'")); - return SQ_ERROR; - } - -} - -static SQInteger ScriptedObject_set_solid_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_solid' 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->set_solid(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_solid'")); - return SQ_ERROR; - } - -} - -static SQInteger ScriptedObject_is_solid_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'is_solid' called without instance")); - return SQ_ERROR; - } - scripting::ScriptedObject* _this = reinterpret_cast (data); - - - try { - bool return_value = _this->is_solid(); - - 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 'is_solid'")); - return SQ_ERROR; - } - -} - -static SQInteger Sector_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::Sector* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger Sector_set_gravity_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_gravity' called without instance")); - return SQ_ERROR; - } - scripting::Sector* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_gravity(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 'set_gravity'")); - return SQ_ERROR; - } - -} - -static SQInteger Sector_is_free_of_solid_tiles_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'is_free_of_solid_tiles' called without instance")); - return SQ_ERROR; - } - scripting::Sector* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - SQBool arg4; - if(SQ_FAILED(sq_getbool(vm, 6, &arg4))) { - sq_throwerror(vm, _SC("Argument 5 not a bool")); - return SQ_ERROR; - } - - try { - bool return_value = _this->is_free_of_solid_tiles(arg0, arg1, arg2, arg3, arg4 == SQTrue); - - 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 'is_free_of_solid_tiles'")); - return SQ_ERROR; - } - -} - -static SQInteger Sector_is_free_of_statics_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'is_free_of_statics' called without instance")); - return SQ_ERROR; - } - scripting::Sector* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - SQBool arg4; - if(SQ_FAILED(sq_getbool(vm, 6, &arg4))) { - sq_throwerror(vm, _SC("Argument 5 not a bool")); - return SQ_ERROR; - } - - try { - bool return_value = _this->is_free_of_statics(arg0, arg1, arg2, arg3, arg4 == SQTrue); - - 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 'is_free_of_statics'")); - return SQ_ERROR; - } - -} - -static SQInteger Sector_is_free_of_movingstatics_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'is_free_of_movingstatics' called without instance")); - return SQ_ERROR; - } - scripting::Sector* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - - try { - bool return_value = _this->is_free_of_movingstatics(arg0, arg1, arg2, arg3); - - 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 'is_free_of_movingstatics'")); - return SQ_ERROR; - } - -} - -static SQInteger Sector_is_free_of_specifically_movingstatics_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'is_free_of_specifically_movingstatics' called without instance")); - return SQ_ERROR; - } - scripting::Sector* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - - try { - bool return_value = _this->is_free_of_specifically_movingstatics(arg0, arg1, arg2, arg3); - - 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 'is_free_of_specifically_movingstatics'")); - return SQ_ERROR; - } - -} - -static SQInteger SoundObject_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::SoundObject* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger SoundObject_start_playing_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'start_playing' called without instance")); - return SQ_ERROR; - } - scripting::SoundObject* _this = reinterpret_cast (data); - - - try { - _this->start_playing(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_playing'")); - return SQ_ERROR; - } - -} - -static SQInteger SoundObject_stop_playing_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'stop_playing' called without instance")); - return SQ_ERROR; - } - scripting::SoundObject* _this = reinterpret_cast (data); - - - try { - _this->stop_playing(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_playing'")); - return SQ_ERROR; - } - -} - -static SQInteger SoundObject_set_volume_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_volume' called without instance")); - return SQ_ERROR; - } - scripting::SoundObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_volume(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 'set_volume'")); - return SQ_ERROR; - } - -} - -static SQInteger SoundObject_get_volume_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_volume' called without instance")); - return SQ_ERROR; - } - scripting::SoundObject* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_volume(); - - sq_pushfloat(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 'get_volume'")); - return SQ_ERROR; - } - -} - -static SQInteger Spotlight_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::Spotlight* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger Spotlight_set_enabled_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_enabled' called without instance")); - return SQ_ERROR; - } - scripting::Spotlight* _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_enabled(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_enabled'")); - return SQ_ERROR; - } - -} - -static SQInteger Spotlight_is_enabled_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'is_enabled' called without instance")); - return SQ_ERROR; - } - scripting::Spotlight* _this = reinterpret_cast (data); - - - try { - bool return_value = _this->is_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 'is_enabled'")); - return SQ_ERROR; - } - -} - -static SQInteger Spotlight_set_direction_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_direction' called without instance")); - return SQ_ERROR; - } - scripting::Spotlight* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_direction(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 'set_direction'")); - return SQ_ERROR; - } - -} - -static SQInteger Spotlight_set_angle_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_angle' called without instance")); - return SQ_ERROR; - } - scripting::Spotlight* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_angle(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 'set_angle'")); - return SQ_ERROR; - } - -} - -static SQInteger Spotlight_fade_angle_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_angle' called without instance")); - return SQ_ERROR; - } - scripting::Spotlight* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_angle(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_angle'")); - return SQ_ERROR; - } - -} - -static SQInteger Spotlight_ease_angle_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_angle' called without instance")); - return SQ_ERROR; - } - scripting::Spotlight* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_angle(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_angle'")); - return SQ_ERROR; - } - -} - -static SQInteger Spotlight_set_speed_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_speed' called without instance")); - return SQ_ERROR; - } - scripting::Spotlight* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_speed(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 'set_speed'")); - return SQ_ERROR; - } - -} - -static SQInteger Spotlight_fade_speed_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_speed' called without instance")); - return SQ_ERROR; - } - scripting::Spotlight* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_speed(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_speed'")); - return SQ_ERROR; - } - -} - -static SQInteger Spotlight_ease_speed_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_speed' called without instance")); - return SQ_ERROR; - } - scripting::Spotlight* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_speed(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_speed'")); - return SQ_ERROR; - } - -} - -static SQInteger Spotlight_set_color_rgba_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_color_rgba' called without instance")); - return SQ_ERROR; - } - scripting::Spotlight* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - - try { - _this->set_color_rgba(arg0, arg1, arg2, arg3); - - 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_color_rgba'")); - return SQ_ERROR; - } - -} - -static SQInteger Spotlight_fade_color_rgba_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_color_rgba' called without instance")); - return SQ_ERROR; - } - scripting::Spotlight* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - SQFloat arg4; - if(SQ_FAILED(sq_getfloat(vm, 6, &arg4))) { - sq_throwerror(vm, _SC("Argument 5 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_color_rgba(arg0, arg1, arg2, arg3, arg4); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_color_rgba'")); - return SQ_ERROR; - } - -} - -static SQInteger Spotlight_ease_color_rgba_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'ease_color_rgba' called without instance")); - return SQ_ERROR; - } - scripting::Spotlight* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - SQFloat arg4; - if(SQ_FAILED(sq_getfloat(vm, 6, &arg4))) { - sq_throwerror(vm, _SC("Argument 5 not a float")); - return SQ_ERROR; - } - const SQChar* arg5; - if(SQ_FAILED(sq_getstring(vm, 7, &arg5))) { - sq_throwerror(vm, _SC("Argument 6 not a string")); - return SQ_ERROR; - } - - try { - _this->ease_color_rgba(arg0, arg1, arg2, arg3, arg4, arg5); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ease_color_rgba'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::TextObject* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger TextObject_constructor_wrapper(HSQUIRRELVM vm) -{ - - try { - auto _this = new scripting::TextObject(); - if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) { - sq_throwerror(vm, _SC("Couldn't setup instance of 'TextObject' class")); - return SQ_ERROR; - } - sq_setreleasehook(vm, 1, TextObject_release_hook); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_set_text_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_text' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_text(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 'set_text'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_set_font_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_font' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_font(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 'set_font'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_fade_in_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_in' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_in(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 'fade_in'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_fade_out_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_out' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_out(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 'fade_out'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_grow_in_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'grow_in' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->grow_in(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 'grow_in'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_grow_out_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'grow_out' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->grow_out(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 'grow_out'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_set_visible_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_visible' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _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_visible(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_visible'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_set_centered_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_centered' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _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_centered(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_centered'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_set_pos_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_pos' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->set_pos(arg0, arg1); - - 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_pos'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_get_pos_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_pos_x' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_pos_x(); - - sq_pushfloat(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 'get_pos_x'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_get_pos_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_pos_y' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_pos_y(); - - sq_pushfloat(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 'get_pos_y'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_set_anchor_point_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_anchor_point' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - SQInteger arg0; - if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not an integer")); - return SQ_ERROR; - } - - try { - _this->set_anchor_point(static_cast (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 'set_anchor_point'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_get_anchor_point_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_anchor_point' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - - try { - int return_value = _this->get_anchor_point(); - - sq_pushinteger(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 'get_anchor_point'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_set_anchor_offset_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_anchor_offset' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->set_anchor_offset(arg0, arg1); - - 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_anchor_offset'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_get_wrap_width_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_wrap_width' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_wrap_width(); - - sq_pushfloat(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 'get_wrap_width'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_set_wrap_width_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_wrap_width' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_wrap_width(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 'set_wrap_width'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_set_front_fill_color_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_front_fill_color' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - - try { - _this->set_front_fill_color(arg0, arg1, arg2, arg3); - - 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_front_fill_color'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_set_back_fill_color_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_back_fill_color' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - - try { - _this->set_back_fill_color(arg0, arg1, arg2, arg3); - - 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_back_fill_color'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_set_text_color_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_text_color' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - - try { - _this->set_text_color(arg0, arg1, arg2, arg3); - - 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_text_color'")); - return SQ_ERROR; - } - -} - -static SQInteger TextObject_set_roundness_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_roundness' called without instance")); - return SQ_ERROR; - } - scripting::TextObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_roundness(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 'set_roundness'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::TextArrayObject* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger TextArrayObject_constructor_wrapper(HSQUIRRELVM vm) -{ - - try { - auto _this = new scripting::TextArrayObject(); - if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) { - sq_throwerror(vm, _SC("Couldn't setup instance of 'TextArrayObject' class")); - return SQ_ERROR; - } - sq_setreleasehook(vm, 1, TextArrayObject_release_hook); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_clear_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'clear' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - - try { - _this->clear(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'clear'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_add_text_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'add_text' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->add_text(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 'add_text'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_add_text_duration_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'add_text_duration' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->add_text_duration(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_text_duration'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_text_index_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_text_index' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - SQInteger arg0; - if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not an integer")); - return SQ_ERROR; - } - - try { - _this->set_text_index(static_cast (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 'set_text_index'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_keep_visible_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_keep_visible' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _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_keep_visible(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_keep_visible'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_fade_transition_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_fade_transition' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _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_fade_transition(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_fade_transition'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_fade_time_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_fade_time' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_fade_time(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 'set_fade_time'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_done_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_done' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _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_done(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_done'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_auto_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_auto' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _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_auto(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_auto'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_next_text_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'next_text' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - - try { - _this->next_text(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'next_text'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_prev_text_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'prev_text' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - - try { - _this->prev_text(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'prev_text'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_text_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_text' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_text(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 'set_text'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_font_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_font' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_font(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 'set_font'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_fade_in_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_in' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_in(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 'fade_in'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_fade_out_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade_out' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->fade_out(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 'fade_out'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_grow_in_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'grow_in' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->grow_in(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 'grow_in'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_grow_out_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'grow_out' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->grow_out(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 'grow_out'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_visible_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_visible' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _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_visible(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_visible'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_centered_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_centered' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _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_centered(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_centered'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_pos_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_pos' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->set_pos(arg0, arg1); - - 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_pos'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_get_pos_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_pos_x' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_pos_x(); - - sq_pushfloat(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 'get_pos_x'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_get_pos_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_pos_y' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_pos_y(); - - sq_pushfloat(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 'get_pos_y'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_anchor_point_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_anchor_point' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - SQInteger arg0; - if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not an integer")); - return SQ_ERROR; - } - - try { - _this->set_anchor_point(static_cast (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 'set_anchor_point'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_get_anchor_point_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_anchor_point' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - - try { - int return_value = _this->get_anchor_point(); - - sq_pushinteger(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 'get_anchor_point'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_anchor_offset_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_anchor_offset' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->set_anchor_offset(arg0, arg1); - - 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_anchor_offset'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_get_wrap_width_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_wrap_width' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_wrap_width(); - - sq_pushfloat(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 'get_wrap_width'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_wrap_width_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_wrap_width' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_wrap_width(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 'set_wrap_width'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_front_fill_color_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_front_fill_color' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - - try { - _this->set_front_fill_color(arg0, arg1, arg2, arg3); - - 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_front_fill_color'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_back_fill_color_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_back_fill_color' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - - try { - _this->set_back_fill_color(arg0, arg1, arg2, arg3); - - 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_back_fill_color'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_text_color_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_text_color' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - - try { - _this->set_text_color(arg0, arg1, arg2, arg3); - - 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_text_color'")); - return SQ_ERROR; - } - -} - -static SQInteger TextArrayObject_set_roundness_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_roundness' called without instance")); - return SQ_ERROR; - } - scripting::TextArrayObject* _this = reinterpret_cast (data); - - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - _this->set_roundness(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 'set_roundness'")); - return SQ_ERROR; - } - -} - -static SQInteger Thunderstorm_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::Thunderstorm* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger Thunderstorm_start_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'start' called without instance")); - return SQ_ERROR; - } - scripting::Thunderstorm* _this = reinterpret_cast (data); - - - try { - _this->start(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'")); - return SQ_ERROR; - } - -} - -static SQInteger Thunderstorm_stop_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'stop' called without instance")); - return SQ_ERROR; - } - scripting::Thunderstorm* _this = reinterpret_cast (data); - - - try { - _this->stop(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'")); - return SQ_ERROR; - } - -} - -static SQInteger Thunderstorm_thunder_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'thunder' called without instance")); - return SQ_ERROR; - } - scripting::Thunderstorm* _this = reinterpret_cast (data); - - - try { - _this->thunder(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'thunder'")); - return SQ_ERROR; - } - -} - -static SQInteger Thunderstorm_lightning_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'lightning' called without instance")); - return SQ_ERROR; - } - scripting::Thunderstorm* _this = reinterpret_cast (data); - - - try { - _this->lightning(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'lightning'")); - return SQ_ERROR; - } - -} - -static SQInteger Thunderstorm_flash_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'flash' called without instance")); - return SQ_ERROR; - } - scripting::Thunderstorm* _this = reinterpret_cast (data); - - - try { - _this->flash(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'flash'")); - return SQ_ERROR; - } - -} - -static SQInteger Thunderstorm_electrify_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'electrify' called without instance")); - return SQ_ERROR; - } - scripting::Thunderstorm* _this = reinterpret_cast (data); - - - try { - _this->electrify(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'electrify'")); - return SQ_ERROR; - } - -} - -static SQInteger TileMap_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::TileMap* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger TileMap_goto_node_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'goto_node' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->goto_node(static_cast (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 'goto_node'")); - return SQ_ERROR; - } - -} - -static SQInteger TileMap_set_node_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_node' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->set_node(static_cast (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 'set_node'")); - return SQ_ERROR; - } - -} - -static SQInteger TileMap_start_moving_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'start_moving' called without instance")); - return SQ_ERROR; - } - scripting::TileMap* _this = reinterpret_cast (data); - - - try { - _this->start_moving(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'")); - return SQ_ERROR; - } - -} - -static SQInteger TileMap_stop_moving_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'stop_moving' called without instance")); - return SQ_ERROR; - } - scripting::TileMap* _this = reinterpret_cast (data); - - - try { - _this->stop_moving(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'")); - return SQ_ERROR; - } - -} - -static SQInteger TileMap_get_tile_id_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_tile_id' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQInteger arg1; - if(SQ_FAILED(sq_getinteger(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not an integer")); - return SQ_ERROR; - } - - try { - int return_value = _this->get_tile_id(static_cast (arg0), static_cast (arg1)); - - sq_pushinteger(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 'get_tile_id'")); - return SQ_ERROR; - } - -} - -static SQInteger TileMap_get_tile_id_at_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_tile_id_at' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - int return_value = _this->get_tile_id_at(arg0, arg1); - - sq_pushinteger(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 'get_tile_id_at'")); - return SQ_ERROR; - } - -} - -static SQInteger TileMap_change_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'change' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQInteger arg1; - if(SQ_FAILED(sq_getinteger(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not an integer")); - return SQ_ERROR; - } - SQInteger arg2; - if(SQ_FAILED(sq_getinteger(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not an integer")); - return SQ_ERROR; - } - - try { - _this->change(static_cast (arg0), static_cast (arg1), static_cast (arg2)); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'change'")); - return SQ_ERROR; - } - -} - -static SQInteger TileMap_change_at_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'change_at' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQInteger arg2; - if(SQ_FAILED(sq_getinteger(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not an integer")); - return SQ_ERROR; - } - - try { - _this->change_at(arg0, arg1, static_cast (arg2)); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'change_at'")); - return SQ_ERROR; - } - -} - -static SQInteger TileMap_fade_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'fade' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - _this->fade(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade'")); - return SQ_ERROR; - } - -} - -static SQInteger TileMap_tint_fade_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'tint_fade' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - SQFloat arg3; - if(SQ_FAILED(sq_getfloat(vm, 5, &arg3))) { - sq_throwerror(vm, _SC("Argument 4 not a float")); - return SQ_ERROR; - } - SQFloat arg4; - if(SQ_FAILED(sq_getfloat(vm, 6, &arg4))) { - sq_throwerror(vm, _SC("Argument 5 not a float")); - return SQ_ERROR; - } - - try { - _this->tint_fade(arg0, arg1, arg2, arg3, arg4); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'tint_fade'")); - return SQ_ERROR; - } - -} - -static SQInteger TileMap_set_alpha_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_alpha' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->set_alpha(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 'set_alpha'")); - return SQ_ERROR; - } - -} - -static SQInteger TileMap_get_alpha_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_alpha' called without instance")); - return SQ_ERROR; - } - scripting::TileMap* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_alpha(); - - sq_pushfloat(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 'get_alpha'")); - return SQ_ERROR; - } - -} - -static SQInteger TileMap_set_solid_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_solid' called without instance")); - return SQ_ERROR; - } - scripting::TileMap* _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_solid(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_solid'")); - return SQ_ERROR; - } - -} - -static SQInteger Torch_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::Torch* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger Torch_get_burning_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_burning' called without instance")); - return SQ_ERROR; - } - scripting::Torch* _this = reinterpret_cast (data); - - - try { - bool return_value = _this->get_burning(); - - 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 'get_burning'")); - return SQ_ERROR; - } - -} - -static SQInteger Torch_set_burning_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_burning' called without instance")); - return SQ_ERROR; - } - scripting::Torch* _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_burning(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_burning'")); - return SQ_ERROR; - } - -} - -static SQInteger WillOWisp_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::WillOWisp* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger WillOWisp_goto_node_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'goto_node' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->goto_node(static_cast (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 'goto_node'")); - return SQ_ERROR; - } - -} - -static SQInteger WillOWisp_set_state_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_state' called without instance")); - return SQ_ERROR; - } - 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")); - return SQ_ERROR; - } - - try { - _this->set_state(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 'set_state'")); - return SQ_ERROR; - } - -} - -static SQInteger WillOWisp_start_moving_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'start_moving' called without instance")); - return SQ_ERROR; - } - scripting::WillOWisp* _this = reinterpret_cast (data); - - - try { - _this->start_moving(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'")); - return SQ_ERROR; - } - -} - -static SQInteger WillOWisp_stop_moving_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'stop_moving' called without instance")); - return SQ_ERROR; - } - scripting::WillOWisp* _this = reinterpret_cast (data); - - - try { - _this->stop_moving(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'")); - return SQ_ERROR; - } - -} - -static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::Wind* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger Wind_start_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'start' called without instance")); - return SQ_ERROR; - } - scripting::Wind* _this = reinterpret_cast (data); - - - try { - _this->start(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'")); - return SQ_ERROR; - } - -} - -static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'stop' called without instance")); - return SQ_ERROR; - } - scripting::Wind* _this = reinterpret_cast (data); - - - try { - _this->stop(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'")); - return SQ_ERROR; - } - -} - -static SQInteger WorldMapSector_release_hook(SQUserPointer ptr, SQInteger ) -{ - scripting::WorldMapSector* _this = reinterpret_cast (ptr); - delete _this; - return 0; -} - -static SQInteger WorldMapSector_get_tux_x_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_tux_x' called without instance")); - return SQ_ERROR; - } - scripting::WorldMapSector* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_tux_x(); - - sq_pushfloat(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 'get_tux_x'")); - return SQ_ERROR; - } - -} - -static SQInteger WorldMapSector_get_tux_y_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_tux_y' called without instance")); - return SQ_ERROR; - } - scripting::WorldMapSector* _this = reinterpret_cast (data); - - - try { - float return_value = _this->get_tux_y(); - - sq_pushfloat(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 'get_tux_y'")); - return SQ_ERROR; - } - -} - -static SQInteger WorldMapSector_set_sector_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_sector' called without instance")); - return SQ_ERROR; - } - scripting::WorldMapSector* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_sector(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 'set_sector'")); - return SQ_ERROR; - } - -} - -static SQInteger WorldMapSector_spawn_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'spawn' called without instance")); - return SQ_ERROR; - } - scripting::WorldMapSector* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - const SQChar* arg1; - if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a string")); - return SQ_ERROR; - } - - try { - _this->spawn(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'spawn'")); - return SQ_ERROR; - } - -} - -static SQInteger WorldMapSector_move_to_spawnpoint_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'move_to_spawnpoint' called without instance")); - return SQ_ERROR; - } - scripting::WorldMapSector* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->move_to_spawnpoint(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 'move_to_spawnpoint'")); - return SQ_ERROR; - } - -} - -static SQInteger WorldMapSector_get_filename_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'get_filename' called without instance")); - return SQ_ERROR; - } - scripting::WorldMapSector* _this = reinterpret_cast (data); - - - try { - std::string return_value = _this->get_filename(); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_filename'")); - return SQ_ERROR; - } - -} - -static SQInteger WorldMapSector_set_title_level_wrapper(HSQUIRRELVM vm) -{ - SQUserPointer data; - if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, nullptr, SQTrue)) || !data) { - sq_throwerror(vm, _SC("'set_title_level' called without instance")); - return SQ_ERROR; - } - scripting::WorldMapSector* _this = reinterpret_cast (data); - - const SQChar* arg0; - if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - _this->set_title_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 'set_title_level'")); - return SQ_ERROR; - } - -} - -static SQInteger display_wrapper(HSQUIRRELVM vm) -{ - return scripting::display(vm); -} - -static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm) -{ - HSQUIRRELVM arg0 = vm; - - try { - scripting::print_stacktrace(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 'print_stacktrace'")); - return SQ_ERROR; - } - -} - -static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm) -{ - return scripting::get_current_thread(vm); -} - -static SQInteger is_christmas_wrapper(HSQUIRRELVM vm) -{ - - try { - bool return_value = scripting::is_christmas(); - - 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 'is_christmas'")); - return SQ_ERROR; - } - -} - -static SQInteger display_text_file_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::display_text_file(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 'display_text_file'")); - return SQ_ERROR; - } - -} - -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; - } - const SQChar* arg1; - if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a string")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - scripting::load_worldmap(arg0, arg1, arg2); - - 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 set_next_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; - } - const SQChar* arg1; - if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a string")); - return SQ_ERROR; - } - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - scripting::set_next_worldmap(arg0, arg1, arg2); - - 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_next_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 start_cutscene_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - - try { - scripting::start_cutscene(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_cutscene'")); - return SQ_ERROR; - } - -} - -static SQInteger end_cutscene_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - - try { - scripting::end_cutscene(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'end_cutscene'")); - return SQ_ERROR; - } - -} - -static SQInteger check_cutscene_wrapper(HSQUIRRELVM vm) -{ - - try { - bool return_value = scripting::check_cutscene(); - - 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 'check_cutscene'")); - return SQ_ERROR; - } - -} - -static SQInteger wait_wrapper(HSQUIRRELVM vm) -{ - HSQUIRRELVM arg0 = vm; - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - scripting::wait(arg0, arg1); - - return sq_suspendvm(vm); - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'")); - return SQ_ERROR; - } - -} - -static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm) -{ - HSQUIRRELVM arg0 = vm; - - try { - scripting::wait_for_screenswitch(arg0); - - return sq_suspendvm(vm); - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'")); - return SQ_ERROR; - } - -} - -static SQInteger exit_screen_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - - try { - scripting::exit_screen(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'")); - return SQ_ERROR; - } - -} - -static SQInteger translate_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 { - std::string return_value = scripting::translate(arg0); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'")); - return SQ_ERROR; - } - -} - -static SQInteger __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 { - std::string return_value = scripting::_(arg0); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function '_'")); - return SQ_ERROR; - } - -} - -static SQInteger translate_plural_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; - } - const SQChar* arg1; - if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a string")); - return SQ_ERROR; - } - SQInteger arg2; - if(SQ_FAILED(sq_getinteger(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not an integer")); - return SQ_ERROR; - } - - try { - std::string return_value = scripting::translate_plural(arg0, arg1, static_cast (arg2)); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate_plural'")); - return SQ_ERROR; - } - -} - -static SQInteger ___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; - } - const SQChar* arg1; - if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a string")); - return SQ_ERROR; - } - SQInteger arg2; - if(SQ_FAILED(sq_getinteger(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not an integer")); - return SQ_ERROR; - } - - try { - std::string return_value = scripting::__(arg0, arg1, static_cast (arg2)); - - assert(return_value.size() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, return_value.c_str(), static_cast(return_value.size())); - return 1; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function '__'")); - return SQ_ERROR; - } - -} - -static SQInteger import_wrapper(HSQUIRRELVM vm) -{ - HSQUIRRELVM arg0 = vm; - const SQChar* arg1; - if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) { - sq_throwerror(vm, _SC("Argument 1 not a string")); - return SQ_ERROR; - } - - try { - scripting::import(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'")); - return SQ_ERROR; - } - -} - -static SQInteger save_state_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'")); - return SQ_ERROR; - } - -} - -static SQInteger load_state_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - - try { - scripting::load_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 'load_state'")); - return SQ_ERROR; - } - -} - -static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm) -{ - SQBool arg0; - if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a bool")); - return SQ_ERROR; - } - - try { - scripting::debug_collrects(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 'debug_collrects'")); - return SQ_ERROR; - } - -} - -static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm) -{ - SQBool arg0; - if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a bool")); - return SQ_ERROR; - } - - try { - scripting::debug_show_fps(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 'debug_show_fps'")); - return SQ_ERROR; - } - -} - -static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm) -{ - SQBool arg0; - if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a bool")); - return SQ_ERROR; - } - - try { - scripting::debug_draw_solids_only(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 'debug_draw_solids_only'")); - return SQ_ERROR; - } - -} - -static SQInteger debug_draw_editor_images_wrapper(HSQUIRRELVM vm) -{ - SQBool arg0; - if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a bool")); - return SQ_ERROR; - } - - try { - scripting::debug_draw_editor_images(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 'debug_draw_editor_images'")); - return SQ_ERROR; - } - -} - -static SQInteger debug_worldmap_ghost_wrapper(HSQUIRRELVM vm) -{ - SQBool arg0; - if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a bool")); - return SQ_ERROR; - } - - try { - scripting::debug_worldmap_ghost(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 'debug_worldmap_ghost'")); - return SQ_ERROR; - } - -} - -static SQInteger play_music_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::play_music(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 'play_music'")); - return SQ_ERROR; - } - -} - -static SQInteger fade_in_music_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; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - scripting::fade_in_music(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in_music'")); - return SQ_ERROR; - } - -} - -static SQInteger stop_music_wrapper(HSQUIRRELVM vm) -{ - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - scripting::stop_music(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 'stop_music'")); - return SQ_ERROR; - } - -} - -static SQInteger resume_music_wrapper(HSQUIRRELVM vm) -{ - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - scripting::resume_music(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 'resume_music'")); - return SQ_ERROR; - } - -} - -static SQInteger pause_music_wrapper(HSQUIRRELVM vm) -{ - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - scripting::pause_music(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 'pause_music'")); - return SQ_ERROR; - } - -} - -static SQInteger play_sound_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::play_sound(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 'play_sound'")); - return SQ_ERROR; - } - -} - -static SQInteger set_game_speed_wrapper(HSQUIRRELVM vm) -{ - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - scripting::set_game_speed(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 'set_game_speed'")); - return SQ_ERROR; - } - -} - -static SQInteger grease_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - - try { - scripting::grease(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'")); - return SQ_ERROR; - } - -} - -static SQInteger invincible_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - - try { - scripting::invincible(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'")); - return SQ_ERROR; - } - -} - -static SQInteger ghost_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - - try { - scripting::ghost(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'")); - return SQ_ERROR; - } - -} - -static SQInteger mortal_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - - try { - scripting::mortal(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'")); - return SQ_ERROR; - } - -} - -static SQInteger restart_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - - try { - scripting::restart(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'")); - return SQ_ERROR; - } - -} - -static SQInteger whereami_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - - try { - scripting::whereami(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'")); - return SQ_ERROR; - } - -} - -static SQInteger gotoend_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - - try { - scripting::gotoend(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'")); - return SQ_ERROR; - } - -} - -static SQInteger warp_wrapper(HSQUIRRELVM vm) -{ - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - - try { - scripting::warp(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'warp'")); - return SQ_ERROR; - } - -} - -static SQInteger camera_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - - try { - scripting::camera(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'")); - return SQ_ERROR; - } - -} - -static SQInteger set_gamma_wrapper(HSQUIRRELVM vm) -{ - SQFloat arg0; - if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a float")); - return SQ_ERROR; - } - - try { - scripting::set_gamma(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 'set_gamma'")); - return SQ_ERROR; - } - -} - -static SQInteger rand_wrapper(HSQUIRRELVM vm) -{ - - try { - int return_value = scripting::rand(); - - sq_pushinteger(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 'rand'")); - return SQ_ERROR; - } - -} - -static SQInteger set_title_frame_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::set_title_frame(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 'set_title_frame'")); - return SQ_ERROR; - } - -} - -static SQInteger Level_finish_wrapper(HSQUIRRELVM vm) -{ - SQBool arg0; - if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) { - sq_throwerror(vm, _SC("Argument 1 not a bool")); - return SQ_ERROR; - } - - try { - scripting::Level_finish(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 'Level_finish'")); - return SQ_ERROR; - } - -} - -static SQInteger Level_has_active_sequence_wrapper(HSQUIRRELVM vm) -{ - - try { - bool return_value = scripting::Level_has_active_sequence(); - - 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 'Level_has_active_sequence'")); - return SQ_ERROR; - } - -} - -static SQInteger Level_spawn_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; - } - const SQChar* arg1; - if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a string")); - return SQ_ERROR; - } - - try { - scripting::Level_spawn(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_spawn'")); - return SQ_ERROR; - } - -} - -static SQInteger Level_spawn_transition_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; - } - const SQChar* arg1; - if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a string")); - return SQ_ERROR; - } - - const SQChar* arg2; - if(SQ_FAILED(sq_getstring(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a string")); - return SQ_ERROR; - } - - try { - scripting::Level_spawn_transition(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_spawn_transition'")); - return SQ_ERROR; - } - -} - -static SQInteger Level_set_start_point_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; - } - const SQChar* arg1; - if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a string")); - return SQ_ERROR; - } - - try { - scripting::Level_set_start_point(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_set_start_point'")); - return SQ_ERROR; - } - -} - -static SQInteger Level_set_start_pos_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; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - - try { - scripting::Level_set_start_pos(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_set_start_pos'")); - return SQ_ERROR; - } - -} - -static SQInteger Level_set_respawn_point_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; - } - const SQChar* arg1; - if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a string")); - return SQ_ERROR; - } - - try { - scripting::Level_set_respawn_point(arg0, arg1); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_set_respawn_point'")); - return SQ_ERROR; - } - -} - -static SQInteger Level_set_respawn_pos_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; - } - SQFloat arg1; - if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) { - sq_throwerror(vm, _SC("Argument 2 not a float")); - return SQ_ERROR; - } - SQFloat arg2; - if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) { - sq_throwerror(vm, _SC("Argument 3 not a float")); - return SQ_ERROR; - } - - try { - scripting::Level_set_respawn_pos(arg0, arg1, arg2); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_set_respawn_pos'")); - return SQ_ERROR; - } - -} - -static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - - try { - scripting::Level_flip_vertically(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_flip_vertically'")); - return SQ_ERROR; - } - -} - -static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - - try { - scripting::Level_toggle_pause(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_toggle_pause'")); - return SQ_ERROR; - } - -} - -static SQInteger Level_pause_target_timer_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - - try { - scripting::Level_pause_target_timer(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_pause_target_timer'")); - return SQ_ERROR; - } - -} - -static SQInteger Level_resume_target_timer_wrapper(HSQUIRRELVM vm) -{ - (void) vm; - - try { - scripting::Level_resume_target_timer(); - - return 0; - - } catch(std::exception& e) { - sq_throwerror(vm, e.what()); - return SQ_ERROR; - } catch(...) { - sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_resume_target_timer'")); - return SQ_ERROR; - } - -} - -} // namespace wrapper -void create_squirrel_instance(HSQUIRRELVM v, scripting::AmbientSound* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "AmbientSound", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'AmbientSound'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'AmbientSound'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, AmbientSound_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::Background* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "Background", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'Background'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'Background'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, Background_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::BadGuy* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "BadGuy", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'BadGuy'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'BadGuy'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, BadGuy_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::Camera* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "Camera", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'Camera'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'Camera'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, Camera_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::Candle* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "Candle", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'Candle'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'Candle'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, Candle_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::Clouds* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "Clouds", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'Clouds'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'Clouds'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, Clouds_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::ConveyorBelt* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "ConveyorBelt", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'ConveyorBelt'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'ConveyorBelt'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, ConveyorBelt_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::CustomParticles* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "CustomParticles", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'CustomParticles'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'CustomParticles'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, CustomParticles_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::Decal* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "Decal", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'Decal'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'Decal'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, Decal_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::Dispenser* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "Dispenser", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'Dispenser'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'Dispenser'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, Dispenser_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::DisplayEffect* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "DisplayEffect", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'DisplayEffect'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, DisplayEffect_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::FloatingImage* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "FloatingImage", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'FloatingImage'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, FloatingImage_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::GameObjectManager* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "GameObjectManager", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'GameObjectManager'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'GameObjectManager'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, GameObjectManager_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::Gradient* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "Gradient", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'Gradient'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'Gradient'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, Gradient_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::LevelTime* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "LevelTime", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'LevelTime'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'LevelTime'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, LevelTime_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::LitObject* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "LitObject", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'LitObject'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'LitObject'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, LitObject_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::ParticleSystem* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "ParticleSystem", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'ParticleSystem'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'ParticleSystem'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, ParticleSystem_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::Platform* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "Platform", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'Platform'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'Platform'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, Platform_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::Player* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "Player", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'Player'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'Player'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, Player_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::Rain* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "Rain", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'Rain'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'Rain'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, Rain_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::Rock* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "Rock", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'Rock'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'Rock'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, Rock_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::ScriptedObject* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "ScriptedObject", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'ScriptedObject'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, ScriptedObject_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::Sector* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "Sector", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'Sector'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'Sector'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, Sector_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::SoundObject* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "SoundObject", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'SoundObject'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'SoundObject'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, SoundObject_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::Spotlight* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "Spotlight", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'Spotlight'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'Spotlight'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, Spotlight_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::TextObject* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "TextObject", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'TextObject'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'TextObject'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, TextObject_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::TextArrayObject* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "TextArrayObject", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'TextArrayObject'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'TextArrayObject'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, TextArrayObject_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::Thunderstorm* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "Thunderstorm", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'Thunderstorm'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'Thunderstorm'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, Thunderstorm_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::TileMap* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "TileMap", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'TileMap'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'TileMap'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, TileMap_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::Torch* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "Torch", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'Torch'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'Torch'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, Torch_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::WillOWisp* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "WillOWisp", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'WillOWisp'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'WillOWisp'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, WillOWisp_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::Wind* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "Wind", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'Wind'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'Wind'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, Wind_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void create_squirrel_instance(HSQUIRRELVM v, scripting::WorldMapSector* object, bool setup_releasehook) -{ - using namespace wrapper; - - sq_pushroottable(v); - sq_pushstring(v, "WorldMapSector", -1); - if(SQ_FAILED(sq_get(v, -2))) { - std::ostringstream msg; - msg << "Couldn't resolved squirrel type 'WorldMapSector'"; - throw SquirrelError(v, msg.str()); - } - - if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) { - std::ostringstream msg; - msg << "Couldn't setup squirrel instance for object of type 'WorldMapSector'"; - throw SquirrelError(v, msg.str()); - } - sq_remove(v, -2); // remove object name - - if(setup_releasehook) { - sq_setreleasehook(v, -1, WorldMapSector_release_hook); - } - - sq_remove(v, -2); // remove root table -} - -void register_supertux_wrapper(HSQUIRRELVM v) -{ - using namespace wrapper; - - sq_pushstring(v, "ANCHOR_TOP_LEFT", -1); - sq_pushinteger(v, 0); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'"); - } - - sq_pushstring(v, "ANCHOR_TOP", -1); - sq_pushinteger(v, 1); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'"); - } - - sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1); - sq_pushinteger(v, 2); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'"); - } - - sq_pushstring(v, "ANCHOR_LEFT", -1); - sq_pushinteger(v, 3); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'"); - } - - sq_pushstring(v, "ANCHOR_MIDDLE", -1); - sq_pushinteger(v, 4); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'"); - } - - sq_pushstring(v, "ANCHOR_RIGHT", -1); - sq_pushinteger(v, 5); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'"); - } - - sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1); - sq_pushinteger(v, 6); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'"); - } - - sq_pushstring(v, "ANCHOR_BOTTOM", -1); - sq_pushinteger(v, 7); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'"); - } - - sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1); - sq_pushinteger(v, 8); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'"); - } - - sq_pushstring(v, "display", -1); - sq_newclosure(v, &display_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "t."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'display'"); - } - - sq_pushstring(v, "print_stacktrace", -1); - sq_newclosure(v, &print_stacktrace_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'print_stacktrace'"); - } - - sq_pushstring(v, "get_current_thread", -1); - sq_newclosure(v, &get_current_thread_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "t"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_current_thread'"); - } - - sq_pushstring(v, "is_christmas", -1); - sq_newclosure(v, &is_christmas_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'is_christmas'"); - } - - sq_pushstring(v, "display_text_file", -1); - sq_newclosure(v, &display_text_file_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - 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, ".sss"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'load_worldmap'"); - } - - sq_pushstring(v, "set_next_worldmap", -1); - sq_newclosure(v, &set_next_worldmap_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".sss"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_next_worldmap'"); - } - - sq_pushstring(v, "load_level", -1); - sq_newclosure(v, &load_level_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'load_level'"); - } - - sq_pushstring(v, "start_cutscene", -1); - sq_newclosure(v, &start_cutscene_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'start_cutscene'"); - } - - sq_pushstring(v, "end_cutscene", -1); - sq_newclosure(v, &end_cutscene_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'end_cutscene'"); - } - - sq_pushstring(v, "check_cutscene", -1); - sq_newclosure(v, &check_cutscene_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'check_cutscene'"); - } - - sq_pushstring(v, "wait", -1); - sq_newclosure(v, &wait_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'wait'"); - } - - sq_pushstring(v, "wait_for_screenswitch", -1); - sq_newclosure(v, &wait_for_screenswitch_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'"); - } - - sq_pushstring(v, "exit_screen", -1); - sq_newclosure(v, &exit_screen_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'exit_screen'"); - } - - sq_pushstring(v, "translate", -1); - sq_newclosure(v, &translate_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'translate'"); - } - - sq_pushstring(v, "_", -1); - sq_newclosure(v, &__wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function '_'"); - } - - sq_pushstring(v, "translate_plural", -1); - sq_newclosure(v, &translate_plural_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".ssb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'translate_plural'"); - } - - sq_pushstring(v, "__", -1); - sq_newclosure(v, &___wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".ssb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function '__'"); - } - - sq_pushstring(v, "import", -1); - sq_newclosure(v, &import_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - 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, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'save_state'"); - } - - sq_pushstring(v, "load_state", -1); - sq_newclosure(v, &load_state_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'load_state'"); - } - - sq_pushstring(v, "debug_collrects", -1); - sq_newclosure(v, &debug_collrects_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'debug_collrects'"); - } - - sq_pushstring(v, "debug_show_fps", -1); - sq_newclosure(v, &debug_show_fps_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'debug_show_fps'"); - } - - sq_pushstring(v, "debug_draw_solids_only", -1); - sq_newclosure(v, &debug_draw_solids_only_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - 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, ".b|n"); - 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, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'debug_worldmap_ghost'"); - } - - sq_pushstring(v, "play_music", -1); - sq_newclosure(v, &play_music_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'play_music'"); - } - - sq_pushstring(v, "fade_in_music", -1); - sq_newclosure(v, &fade_in_music_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".sb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_in_music'"); - } - - sq_pushstring(v, "stop_music", -1); - sq_newclosure(v, &stop_music_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'stop_music'"); - } - - sq_pushstring(v, "resume_music", -1); - sq_newclosure(v, &resume_music_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'resume_music'"); - } - - sq_pushstring(v, "pause_music", -1); - sq_newclosure(v, &pause_music_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'pause_music'"); - } - - sq_pushstring(v, "play_sound", -1); - sq_newclosure(v, &play_sound_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'play_sound'"); - } - - sq_pushstring(v, "set_game_speed", -1); - sq_newclosure(v, &set_game_speed_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_game_speed'"); - } - - sq_pushstring(v, "grease", -1); - sq_newclosure(v, &grease_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'grease'"); - } - - sq_pushstring(v, "invincible", -1); - sq_newclosure(v, &invincible_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'invincible'"); - } - - sq_pushstring(v, "ghost", -1); - sq_newclosure(v, &ghost_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ghost'"); - } - - sq_pushstring(v, "mortal", -1); - sq_newclosure(v, &mortal_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'mortal'"); - } - - sq_pushstring(v, "restart", -1); - sq_newclosure(v, &restart_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'restart'"); - } - - sq_pushstring(v, "whereami", -1); - sq_newclosure(v, &whereami_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'whereami'"); - } - - sq_pushstring(v, "gotoend", -1); - sq_newclosure(v, &gotoend_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'gotoend'"); - } - - sq_pushstring(v, "warp", -1); - sq_newclosure(v, &warp_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'warp'"); - } - - sq_pushstring(v, "camera", -1); - sq_newclosure(v, &camera_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'camera'"); - } - - sq_pushstring(v, "set_gamma", -1); - sq_newclosure(v, &set_gamma_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_gamma'"); - } - - sq_pushstring(v, "rand", -1); - sq_newclosure(v, &rand_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'rand'"); - } - - sq_pushstring(v, "set_title_frame", -1); - sq_newclosure(v, &set_title_frame_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_title_frame'"); - } - - sq_pushstring(v, "Level_finish", -1); - sq_newclosure(v, &Level_finish_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'Level_finish'"); - } - - sq_pushstring(v, "Level_has_active_sequence", -1); - sq_newclosure(v, &Level_has_active_sequence_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'Level_has_active_sequence'"); - } - - sq_pushstring(v, "Level_spawn", -1); - sq_newclosure(v, &Level_spawn_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".ss"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'Level_spawn'"); - } - - sq_pushstring(v, "Level_spawn_transition", -1); - sq_newclosure(v, &Level_spawn_transition_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".sss"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'Level_spawn_transition'"); - } - - sq_pushstring(v, "Level_set_start_point", -1); - sq_newclosure(v, &Level_set_start_point_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".ss"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'Level_set_start_point'"); - } - - sq_pushstring(v, "Level_set_start_pos", -1); - sq_newclosure(v, &Level_set_start_pos_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".sb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'Level_set_start_pos'"); - } - - sq_pushstring(v, "Level_set_respawn_point", -1); - sq_newclosure(v, &Level_set_respawn_point_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".ss"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'Level_set_respawn_point'"); - } - - sq_pushstring(v, "Level_set_respawn_pos", -1); - sq_newclosure(v, &Level_set_respawn_pos_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".sb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'Level_set_respawn_pos'"); - } - - sq_pushstring(v, "Level_flip_vertically", -1); - sq_newclosure(v, &Level_flip_vertically_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'Level_flip_vertically'"); - } - - sq_pushstring(v, "Level_toggle_pause", -1); - sq_newclosure(v, &Level_toggle_pause_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'Level_toggle_pause'"); - } - - sq_pushstring(v, "Level_pause_target_timer", -1); - sq_newclosure(v, &Level_pause_target_timer_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'Level_pause_target_timer'"); - } - - sq_pushstring(v, "Level_resume_target_timer", -1); - sq_newclosure(v, &Level_resume_target_timer_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'Level_resume_target_timer'"); - } - - // Register class AmbientSound - sq_pushstring(v, "AmbientSound", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'AmbientSound'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "set_pos", -1); - sq_newclosure(v, &AmbientSound_set_pos_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_pos'"); - } - - sq_pushstring(v, "get_pos_x", -1); - sq_newclosure(v, &AmbientSound_get_pos_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_pos_x'"); - } - - sq_pushstring(v, "get_pos_y", -1); - sq_newclosure(v, &AmbientSound_get_pos_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_pos_y'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'AmbientSound'"); - } - - // Register class Background - sq_pushstring(v, "Background", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'Background'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "set_image", -1); - sq_newclosure(v, &Background_set_image_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_image'"); - } - - sq_pushstring(v, "set_images", -1); - sq_newclosure(v, &Background_set_images_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".sss"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_images'"); - } - - sq_pushstring(v, "set_speed", -1); - sq_newclosure(v, &Background_set_speed_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_speed'"); - } - - sq_pushstring(v, "get_color_red", -1); - sq_newclosure(v, &Background_get_color_red_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_color_red'"); - } - - sq_pushstring(v, "get_color_green", -1); - sq_newclosure(v, &Background_get_color_green_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_color_green'"); - } - - sq_pushstring(v, "get_color_blue", -1); - sq_newclosure(v, &Background_get_color_blue_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_color_blue'"); - } - - sq_pushstring(v, "get_color_alpha", -1); - sq_newclosure(v, &Background_get_color_alpha_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_color_alpha'"); - } - - sq_pushstring(v, "set_color", -1); - sq_newclosure(v, &Background_set_color_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_color'"); - } - - sq_pushstring(v, "fade_color", -1); - sq_newclosure(v, &Background_fade_color_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_color'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'Background'"); - } - - // Register class BadGuy - sq_pushstring(v, "BadGuy", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'BadGuy'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "kill", -1); - sq_newclosure(v, &BadGuy_kill_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'kill'"); - } - - sq_pushstring(v, "ignite", -1); - sq_newclosure(v, &BadGuy_ignite_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ignite'"); - } - - sq_pushstring(v, "set_action", -1); - sq_newclosure(v, &BadGuy_set_action_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".sb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_action'"); - } - - sq_pushstring(v, "set_sprite", -1); - sq_newclosure(v, &BadGuy_set_sprite_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_sprite'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'BadGuy'"); - } - - // Register class Dispenser - sq_pushstring(v, "Dispenser", -1); - sq_pushstring(v, "BadGuy", -1); - sq_get(v, -3); - if(sq_newclass(v, SQTrue) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'Dispenser'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "activate", -1); - sq_newclosure(v, &Dispenser_activate_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'activate'"); - } - - sq_pushstring(v, "deactivate", -1); - sq_newclosure(v, &Dispenser_deactivate_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'deactivate'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'Dispenser'"); - } - - // Register class WillOWisp - sq_pushstring(v, "WillOWisp", -1); - sq_pushstring(v, "BadGuy", -1); - sq_get(v, -3); - if(sq_newclass(v, SQTrue) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'WillOWisp'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "goto_node", -1); - sq_newclosure(v, &WillOWisp_goto_node_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'goto_node'"); - } - - sq_pushstring(v, "set_state", -1); - sq_newclosure(v, &WillOWisp_set_state_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_state'"); - } - - sq_pushstring(v, "start_moving", -1); - sq_newclosure(v, &WillOWisp_start_moving_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'start_moving'"); - } - - sq_pushstring(v, "stop_moving", -1); - sq_newclosure(v, &WillOWisp_stop_moving_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'stop_moving'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'WillOWisp'"); - } - - // Register class Camera - sq_pushstring(v, "Camera", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'Camera'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "shake", -1); - sq_newclosure(v, &Camera_shake_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'shake'"); - } - - sq_pushstring(v, "start_earthquake", -1); - sq_newclosure(v, &Camera_start_earthquake_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'start_earthquake'"); - } - - sq_pushstring(v, "stop_earthquake", -1); - sq_newclosure(v, &Camera_stop_earthquake_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'stop_earthquake'"); - } - - sq_pushstring(v, "set_pos", -1); - sq_newclosure(v, &Camera_set_pos_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_pos'"); - } - - sq_pushstring(v, "move", -1); - sq_newclosure(v, &Camera_move_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'move'"); - } - - sq_pushstring(v, "set_mode", -1); - sq_newclosure(v, &Camera_set_mode_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_mode'"); - } - - sq_pushstring(v, "scroll_to", -1); - sq_newclosure(v, &Camera_scroll_to_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'scroll_to'"); - } - - sq_pushstring(v, "get_current_scale", -1); - sq_newclosure(v, &Camera_get_current_scale_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_current_scale'"); - } - - sq_pushstring(v, "get_target_scale", -1); - sq_newclosure(v, &Camera_get_target_scale_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_target_scale'"); - } - - sq_pushstring(v, "set_scale", -1); - sq_newclosure(v, &Camera_set_scale_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_scale'"); - } - - sq_pushstring(v, "set_scale_anchor", -1); - sq_newclosure(v, &Camera_set_scale_anchor_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_scale_anchor'"); - } - - sq_pushstring(v, "scale", -1); - sq_newclosure(v, &Camera_scale_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'scale'"); - } - - sq_pushstring(v, "scale_anchor", -1); - sq_newclosure(v, &Camera_scale_anchor_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'scale_anchor'"); - } - - sq_pushstring(v, "ease_scale", -1); - sq_newclosure(v, &Camera_ease_scale_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_scale'"); - } - - sq_pushstring(v, "ease_scale_anchor", -1); - sq_newclosure(v, &Camera_ease_scale_anchor_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_scale_anchor'"); - } - - sq_pushstring(v, "get_screen_width", -1); - sq_newclosure(v, &Camera_get_screen_width_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_screen_width'"); - } - - sq_pushstring(v, "get_screen_height", -1); - sq_newclosure(v, &Camera_get_screen_height_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_screen_height'"); - } - - sq_pushstring(v, "get_x", -1); - sq_newclosure(v, &Camera_get_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_x'"); - } - - sq_pushstring(v, "get_y", -1); - sq_newclosure(v, &Camera_get_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_y'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'Camera'"); - } - - // Register class Candle - sq_pushstring(v, "Candle", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'Candle'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "get_burning", -1); - sq_newclosure(v, &Candle_get_burning_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_burning'"); - } - - sq_pushstring(v, "set_burning", -1); - sq_newclosure(v, &Candle_set_burning_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_burning'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'Candle'"); - } - - // Register class Clouds - sq_pushstring(v, "Clouds", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'Clouds'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "set_enabled", -1); - sq_newclosure(v, &Clouds_set_enabled_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_enabled'"); - } - - sq_pushstring(v, "get_enabled", -1); - sq_newclosure(v, &Clouds_get_enabled_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_enabled'"); - } - - sq_pushstring(v, "fade_speed", -1); - sq_newclosure(v, &Clouds_fade_speed_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_speed'"); - } - - sq_pushstring(v, "fade_amount", -1); - sq_newclosure(v, &Clouds_fade_amount_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_amount'"); - } - - sq_pushstring(v, "set_amount", -1); - sq_newclosure(v, &Clouds_set_amount_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_amount'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'Clouds'"); - } - - // Register class ConveyorBelt - sq_pushstring(v, "ConveyorBelt", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'ConveyorBelt'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "start", -1); - sq_newclosure(v, &ConveyorBelt_start_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'start'"); - } - - sq_pushstring(v, "stop", -1); - sq_newclosure(v, &ConveyorBelt_stop_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'stop'"); - } - - sq_pushstring(v, "move_left", -1); - sq_newclosure(v, &ConveyorBelt_move_left_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'move_left'"); - } - - sq_pushstring(v, "move_right", -1); - sq_newclosure(v, &ConveyorBelt_move_right_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'move_right'"); - } - - sq_pushstring(v, "set_speed", -1); - sq_newclosure(v, &ConveyorBelt_set_speed_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_speed'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'ConveyorBelt'"); - } - - // Register class CustomParticles - sq_pushstring(v, "CustomParticles", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'CustomParticles'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "set_enabled", -1); - sq_newclosure(v, &CustomParticles_set_enabled_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_enabled'"); - } - - sq_pushstring(v, "get_enabled", -1); - sq_newclosure(v, &CustomParticles_get_enabled_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_enabled'"); - } - - sq_pushstring(v, "clear", -1); - sq_newclosure(v, &CustomParticles_clear_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'clear'"); - } - - sq_pushstring(v, "spawn_particles", -1); - sq_newclosure(v, &CustomParticles_spawn_particles_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'spawn_particles'"); - } - - sq_pushstring(v, "get_max_amount", -1); - sq_newclosure(v, &CustomParticles_get_max_amount_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_max_amount'"); - } - - sq_pushstring(v, "set_max_amount", -1); - sq_newclosure(v, &CustomParticles_set_max_amount_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_max_amount'"); - } - - sq_pushstring(v, "get_birth_mode", -1); - sq_newclosure(v, &CustomParticles_get_birth_mode_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_birth_mode'"); - } - - sq_pushstring(v, "set_birth_mode", -1); - sq_newclosure(v, &CustomParticles_set_birth_mode_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_birth_mode'"); - } - - sq_pushstring(v, "get_death_mode", -1); - sq_newclosure(v, &CustomParticles_get_death_mode_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_death_mode'"); - } - - sq_pushstring(v, "set_death_mode", -1); - sq_newclosure(v, &CustomParticles_set_death_mode_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_death_mode'"); - } - - sq_pushstring(v, "get_rotation_mode", -1); - sq_newclosure(v, &CustomParticles_get_rotation_mode_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_rotation_mode'"); - } - - sq_pushstring(v, "set_rotation_mode", -1); - sq_newclosure(v, &CustomParticles_set_rotation_mode_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_rotation_mode'"); - } - - sq_pushstring(v, "get_collision_mode", -1); - sq_newclosure(v, &CustomParticles_get_collision_mode_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_collision_mode'"); - } - - sq_pushstring(v, "set_collision_mode", -1); - sq_newclosure(v, &CustomParticles_set_collision_mode_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_collision_mode'"); - } - - sq_pushstring(v, "get_offscreen_mode", -1); - sq_newclosure(v, &CustomParticles_get_offscreen_mode_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_offscreen_mode'"); - } - - sq_pushstring(v, "set_offscreen_mode", -1); - sq_newclosure(v, &CustomParticles_set_offscreen_mode_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_offscreen_mode'"); - } - - sq_pushstring(v, "get_cover_screen", -1); - sq_newclosure(v, &CustomParticles_get_cover_screen_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_cover_screen'"); - } - - sq_pushstring(v, "set_cover_screen", -1); - sq_newclosure(v, &CustomParticles_set_cover_screen_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_cover_screen'"); - } - - sq_pushstring(v, "get_delay", -1); - sq_newclosure(v, &CustomParticles_get_delay_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_delay'"); - } - - sq_pushstring(v, "set_delay", -1); - sq_newclosure(v, &CustomParticles_set_delay_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_delay'"); - } - - sq_pushstring(v, "fade_delay", -1); - sq_newclosure(v, &CustomParticles_fade_delay_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_delay'"); - } - - sq_pushstring(v, "ease_delay", -1); - sq_newclosure(v, &CustomParticles_ease_delay_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_delay'"); - } - - sq_pushstring(v, "get_lifetime", -1); - sq_newclosure(v, &CustomParticles_get_lifetime_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_lifetime'"); - } - - sq_pushstring(v, "set_lifetime", -1); - sq_newclosure(v, &CustomParticles_set_lifetime_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_lifetime'"); - } - - sq_pushstring(v, "fade_lifetime", -1); - sq_newclosure(v, &CustomParticles_fade_lifetime_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_lifetime'"); - } - - sq_pushstring(v, "ease_lifetime", -1); - sq_newclosure(v, &CustomParticles_ease_lifetime_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_lifetime'"); - } - - sq_pushstring(v, "get_lifetime_variation", -1); - sq_newclosure(v, &CustomParticles_get_lifetime_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_lifetime_variation'"); - } - - sq_pushstring(v, "set_lifetime_variation", -1); - sq_newclosure(v, &CustomParticles_set_lifetime_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_lifetime_variation'"); - } - - sq_pushstring(v, "fade_lifetime_variation", -1); - sq_newclosure(v, &CustomParticles_fade_lifetime_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_lifetime_variation'"); - } - - sq_pushstring(v, "ease_lifetime_variation", -1); - sq_newclosure(v, &CustomParticles_ease_lifetime_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_lifetime_variation'"); - } - - sq_pushstring(v, "get_birth_time", -1); - sq_newclosure(v, &CustomParticles_get_birth_time_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_birth_time'"); - } - - sq_pushstring(v, "set_birth_time", -1); - sq_newclosure(v, &CustomParticles_set_birth_time_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_birth_time'"); - } - - sq_pushstring(v, "fade_birth_time", -1); - sq_newclosure(v, &CustomParticles_fade_birth_time_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_birth_time'"); - } - - sq_pushstring(v, "ease_birth_time", -1); - sq_newclosure(v, &CustomParticles_ease_birth_time_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_birth_time'"); - } - - sq_pushstring(v, "get_birth_time_variation", -1); - sq_newclosure(v, &CustomParticles_get_birth_time_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_birth_time_variation'"); - } - - sq_pushstring(v, "set_birth_time_variation", -1); - sq_newclosure(v, &CustomParticles_set_birth_time_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_birth_time_variation'"); - } - - sq_pushstring(v, "fade_birth_time_variation", -1); - sq_newclosure(v, &CustomParticles_fade_birth_time_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_birth_time_variation'"); - } - - sq_pushstring(v, "ease_birth_time_variation", -1); - sq_newclosure(v, &CustomParticles_ease_birth_time_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_birth_time_variation'"); - } - - sq_pushstring(v, "get_death_time", -1); - sq_newclosure(v, &CustomParticles_get_death_time_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_death_time'"); - } - - sq_pushstring(v, "set_death_time", -1); - sq_newclosure(v, &CustomParticles_set_death_time_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_death_time'"); - } - - sq_pushstring(v, "fade_death_time", -1); - sq_newclosure(v, &CustomParticles_fade_death_time_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_death_time'"); - } - - sq_pushstring(v, "ease_death_time", -1); - sq_newclosure(v, &CustomParticles_ease_death_time_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_death_time'"); - } - - sq_pushstring(v, "get_death_time_variation", -1); - sq_newclosure(v, &CustomParticles_get_death_time_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_death_time_variation'"); - } - - sq_pushstring(v, "set_death_time_variation", -1); - sq_newclosure(v, &CustomParticles_set_death_time_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_death_time_variation'"); - } - - sq_pushstring(v, "fade_death_time_variation", -1); - sq_newclosure(v, &CustomParticles_fade_death_time_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_death_time_variation'"); - } - - sq_pushstring(v, "ease_death_time_variation", -1); - sq_newclosure(v, &CustomParticles_ease_death_time_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_death_time_variation'"); - } - - sq_pushstring(v, "get_speed_x", -1); - sq_newclosure(v, &CustomParticles_get_speed_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_speed_x'"); - } - - sq_pushstring(v, "set_speed_x", -1); - sq_newclosure(v, &CustomParticles_set_speed_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_speed_x'"); - } - - sq_pushstring(v, "fade_speed_x", -1); - sq_newclosure(v, &CustomParticles_fade_speed_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_speed_x'"); - } - - sq_pushstring(v, "ease_speed_x", -1); - sq_newclosure(v, &CustomParticles_ease_speed_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_speed_x'"); - } - - sq_pushstring(v, "get_speed_y", -1); - sq_newclosure(v, &CustomParticles_get_speed_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_speed_y'"); - } - - sq_pushstring(v, "set_speed_y", -1); - sq_newclosure(v, &CustomParticles_set_speed_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_speed_y'"); - } - - sq_pushstring(v, "fade_speed_y", -1); - sq_newclosure(v, &CustomParticles_fade_speed_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_speed_y'"); - } - - sq_pushstring(v, "ease_speed_y", -1); - sq_newclosure(v, &CustomParticles_ease_speed_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_speed_y'"); - } - - sq_pushstring(v, "get_speed_variation_x", -1); - sq_newclosure(v, &CustomParticles_get_speed_variation_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_speed_variation_x'"); - } - - sq_pushstring(v, "set_speed_variation_x", -1); - sq_newclosure(v, &CustomParticles_set_speed_variation_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_speed_variation_x'"); - } - - sq_pushstring(v, "fade_speed_variation_x", -1); - sq_newclosure(v, &CustomParticles_fade_speed_variation_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_speed_variation_x'"); - } - - sq_pushstring(v, "ease_speed_variation_x", -1); - sq_newclosure(v, &CustomParticles_ease_speed_variation_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_speed_variation_x'"); - } - - sq_pushstring(v, "get_speed_variation_y", -1); - sq_newclosure(v, &CustomParticles_get_speed_variation_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_speed_variation_y'"); - } - - sq_pushstring(v, "set_speed_variation_y", -1); - sq_newclosure(v, &CustomParticles_set_speed_variation_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_speed_variation_y'"); - } - - sq_pushstring(v, "fade_speed_variation_y", -1); - sq_newclosure(v, &CustomParticles_fade_speed_variation_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_speed_variation_y'"); - } - - sq_pushstring(v, "ease_speed_variation_y", -1); - sq_newclosure(v, &CustomParticles_ease_speed_variation_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_speed_variation_y'"); - } - - sq_pushstring(v, "get_acceleration_x", -1); - sq_newclosure(v, &CustomParticles_get_acceleration_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_acceleration_x'"); - } - - sq_pushstring(v, "set_acceleration_x", -1); - sq_newclosure(v, &CustomParticles_set_acceleration_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_acceleration_x'"); - } - - sq_pushstring(v, "fade_acceleration_x", -1); - sq_newclosure(v, &CustomParticles_fade_acceleration_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_acceleration_x'"); - } - - sq_pushstring(v, "ease_acceleration_x", -1); - sq_newclosure(v, &CustomParticles_ease_acceleration_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_acceleration_x'"); - } - - sq_pushstring(v, "get_acceleration_y", -1); - sq_newclosure(v, &CustomParticles_get_acceleration_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_acceleration_y'"); - } - - sq_pushstring(v, "set_acceleration_y", -1); - sq_newclosure(v, &CustomParticles_set_acceleration_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_acceleration_y'"); - } - - sq_pushstring(v, "fade_acceleration_y", -1); - sq_newclosure(v, &CustomParticles_fade_acceleration_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_acceleration_y'"); - } - - sq_pushstring(v, "ease_acceleration_y", -1); - sq_newclosure(v, &CustomParticles_ease_acceleration_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_acceleration_y'"); - } - - sq_pushstring(v, "get_friction_x", -1); - sq_newclosure(v, &CustomParticles_get_friction_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_friction_x'"); - } - - sq_pushstring(v, "set_friction_x", -1); - sq_newclosure(v, &CustomParticles_set_friction_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_friction_x'"); - } - - sq_pushstring(v, "fade_friction_x", -1); - sq_newclosure(v, &CustomParticles_fade_friction_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_friction_x'"); - } - - sq_pushstring(v, "ease_friction_x", -1); - sq_newclosure(v, &CustomParticles_ease_friction_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_friction_x'"); - } - - sq_pushstring(v, "get_friction_y", -1); - sq_newclosure(v, &CustomParticles_get_friction_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_friction_y'"); - } - - sq_pushstring(v, "set_friction_y", -1); - sq_newclosure(v, &CustomParticles_set_friction_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_friction_y'"); - } - - sq_pushstring(v, "fade_friction_y", -1); - sq_newclosure(v, &CustomParticles_fade_friction_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_friction_y'"); - } - - sq_pushstring(v, "ease_friction_y", -1); - sq_newclosure(v, &CustomParticles_ease_friction_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_friction_y'"); - } - - sq_pushstring(v, "get_feather_factor", -1); - sq_newclosure(v, &CustomParticles_get_feather_factor_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_feather_factor'"); - } - - sq_pushstring(v, "set_feather_factor", -1); - sq_newclosure(v, &CustomParticles_set_feather_factor_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_feather_factor'"); - } - - sq_pushstring(v, "fade_feather_factor", -1); - sq_newclosure(v, &CustomParticles_fade_feather_factor_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_feather_factor'"); - } - - sq_pushstring(v, "ease_feather_factor", -1); - sq_newclosure(v, &CustomParticles_ease_feather_factor_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_feather_factor'"); - } - - sq_pushstring(v, "get_rotation", -1); - sq_newclosure(v, &CustomParticles_get_rotation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_rotation'"); - } - - sq_pushstring(v, "set_rotation", -1); - sq_newclosure(v, &CustomParticles_set_rotation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_rotation'"); - } - - sq_pushstring(v, "fade_rotation", -1); - sq_newclosure(v, &CustomParticles_fade_rotation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_rotation'"); - } - - sq_pushstring(v, "ease_rotation", -1); - sq_newclosure(v, &CustomParticles_ease_rotation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_rotation'"); - } - - sq_pushstring(v, "get_rotation_variation", -1); - sq_newclosure(v, &CustomParticles_get_rotation_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_rotation_variation'"); - } - - sq_pushstring(v, "set_rotation_variation", -1); - sq_newclosure(v, &CustomParticles_set_rotation_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_rotation_variation'"); - } - - sq_pushstring(v, "fade_rotation_variation", -1); - sq_newclosure(v, &CustomParticles_fade_rotation_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_rotation_variation'"); - } - - sq_pushstring(v, "ease_rotation_variation", -1); - sq_newclosure(v, &CustomParticles_ease_rotation_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_rotation_variation'"); - } - - sq_pushstring(v, "get_rotation_speed", -1); - sq_newclosure(v, &CustomParticles_get_rotation_speed_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_rotation_speed'"); - } - - sq_pushstring(v, "set_rotation_speed", -1); - sq_newclosure(v, &CustomParticles_set_rotation_speed_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_rotation_speed'"); - } - - sq_pushstring(v, "fade_rotation_speed", -1); - sq_newclosure(v, &CustomParticles_fade_rotation_speed_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_rotation_speed'"); - } - - sq_pushstring(v, "ease_rotation_speed", -1); - sq_newclosure(v, &CustomParticles_ease_rotation_speed_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_rotation_speed'"); - } - - sq_pushstring(v, "get_rotation_speed_variation", -1); - sq_newclosure(v, &CustomParticles_get_rotation_speed_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_rotation_speed_variation'"); - } - - sq_pushstring(v, "set_rotation_speed_variation", -1); - sq_newclosure(v, &CustomParticles_set_rotation_speed_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_rotation_speed_variation'"); - } - - sq_pushstring(v, "fade_rotation_speed_variation", -1); - sq_newclosure(v, &CustomParticles_fade_rotation_speed_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_rotation_speed_variation'"); - } - - sq_pushstring(v, "ease_rotation_speed_variation", -1); - sq_newclosure(v, &CustomParticles_ease_rotation_speed_variation_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_rotation_speed_variation'"); - } - - sq_pushstring(v, "get_rotation_acceleration", -1); - sq_newclosure(v, &CustomParticles_get_rotation_acceleration_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_rotation_acceleration'"); - } - - sq_pushstring(v, "set_rotation_acceleration", -1); - sq_newclosure(v, &CustomParticles_set_rotation_acceleration_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_rotation_acceleration'"); - } - - sq_pushstring(v, "fade_rotation_acceleration", -1); - sq_newclosure(v, &CustomParticles_fade_rotation_acceleration_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_rotation_acceleration'"); - } - - sq_pushstring(v, "ease_rotation_acceleration", -1); - sq_newclosure(v, &CustomParticles_ease_rotation_acceleration_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_rotation_acceleration'"); - } - - sq_pushstring(v, "get_rotation_decceleration", -1); - sq_newclosure(v, &CustomParticles_get_rotation_decceleration_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_rotation_decceleration'"); - } - - sq_pushstring(v, "set_rotation_decceleration", -1); - sq_newclosure(v, &CustomParticles_set_rotation_decceleration_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_rotation_decceleration'"); - } - - sq_pushstring(v, "fade_rotation_decceleration", -1); - sq_newclosure(v, &CustomParticles_fade_rotation_decceleration_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_rotation_decceleration'"); - } - - sq_pushstring(v, "ease_rotation_decceleration", -1); - sq_newclosure(v, &CustomParticles_ease_rotation_decceleration_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_rotation_decceleration'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'CustomParticles'"); - } - - // Register class Decal - sq_pushstring(v, "Decal", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'Decal'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "fade_sprite", -1); - sq_newclosure(v, &Decal_fade_sprite_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".sb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_sprite'"); - } - - sq_pushstring(v, "change_sprite", -1); - sq_newclosure(v, &Decal_change_sprite_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'change_sprite'"); - } - - sq_pushstring(v, "fade_in", -1); - sq_newclosure(v, &Decal_fade_in_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_in'"); - } - - sq_pushstring(v, "fade_out", -1); - sq_newclosure(v, &Decal_fade_out_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_out'"); - } - - sq_pushstring(v, "set_action", -1); - sq_newclosure(v, &Decal_set_action_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_action'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'Decal'"); - } - - // Register class DisplayEffect - sq_pushstring(v, "DisplayEffect", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'DisplayEffect'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "fade_out", -1); - sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_out'"); - } - - sq_pushstring(v, "fade_in", -1); - sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_in'"); - } - - sq_pushstring(v, "set_black", -1); - sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_black'"); - } - - sq_pushstring(v, "is_black", -1); - sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'is_black'"); - } - - sq_pushstring(v, "sixteen_to_nine", -1); - sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'"); - } - - sq_pushstring(v, "four_to_three", -1); - sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'four_to_three'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'DisplayEffect'"); - } - - // Register class FloatingImage - sq_pushstring(v, "FloatingImage", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'FloatingImage'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "constructor", -1); - sq_newclosure(v, &FloatingImage_constructor_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'constructor'"); - } - - sq_pushstring(v, "set_layer", -1); - sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_layer'"); - } - - sq_pushstring(v, "get_layer", -1); - sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_layer'"); - } - - sq_pushstring(v, "set_pos", -1); - sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_pos'"); - } - - sq_pushstring(v, "get_pos_x", -1); - sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_pos_x'"); - } - - sq_pushstring(v, "get_pos_y", -1); - sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_pos_y'"); - } - - sq_pushstring(v, "set_anchor_point", -1); - sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_anchor_point'"); - } - - sq_pushstring(v, "get_anchor_point", -1); - sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_anchor_point'"); - } - - sq_pushstring(v, "set_visible", -1); - sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_visible'"); - } - - sq_pushstring(v, "get_visible", -1); - sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_visible'"); - } - - sq_pushstring(v, "set_action", -1); - sq_newclosure(v, &FloatingImage_set_action_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_action'"); - } - - sq_pushstring(v, "get_action", -1); - sq_newclosure(v, &FloatingImage_get_action_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_action'"); - } - - sq_pushstring(v, "fade_in", -1); - sq_newclosure(v, &FloatingImage_fade_in_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_in'"); - } - - sq_pushstring(v, "fade_out", -1); - sq_newclosure(v, &FloatingImage_fade_out_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_out'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'FloatingImage'"); - } - - // Register class GameObjectManager - sq_pushstring(v, "GameObjectManager", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'GameObjectManager'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "set_ambient_light", -1); - sq_newclosure(v, &GameObjectManager_set_ambient_light_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_ambient_light'"); - } - - sq_pushstring(v, "fade_to_ambient_light", -1); - sq_newclosure(v, &GameObjectManager_fade_to_ambient_light_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_to_ambient_light'"); - } - - sq_pushstring(v, "get_ambient_red", -1); - sq_newclosure(v, &GameObjectManager_get_ambient_red_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_ambient_red'"); - } - - sq_pushstring(v, "get_ambient_green", -1); - sq_newclosure(v, &GameObjectManager_get_ambient_green_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_ambient_green'"); - } - - sq_pushstring(v, "get_ambient_blue", -1); - sq_newclosure(v, &GameObjectManager_get_ambient_blue_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_ambient_blue'"); - } - - sq_pushstring(v, "set_music", -1); - sq_newclosure(v, &GameObjectManager_set_music_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_music'"); - } - - sq_pushstring(v, "add_object", -1); - sq_newclosure(v, &GameObjectManager_add_object_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".ssb|nb|nss"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'add_object'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'GameObjectManager'"); - } - - // Register class Sector - sq_pushstring(v, "Sector", -1); - sq_pushstring(v, "GameObjectManager", -1); - sq_get(v, -3); - if(sq_newclass(v, SQTrue) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'Sector'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "set_gravity", -1); - sq_newclosure(v, &Sector_set_gravity_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_gravity'"); - } - - sq_pushstring(v, "is_free_of_solid_tiles", -1); - sq_newclosure(v, &Sector_is_free_of_solid_tiles_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'is_free_of_solid_tiles'"); - } - - sq_pushstring(v, "is_free_of_statics", -1); - sq_newclosure(v, &Sector_is_free_of_statics_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'is_free_of_statics'"); - } - - sq_pushstring(v, "is_free_of_movingstatics", -1); - sq_newclosure(v, &Sector_is_free_of_movingstatics_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'is_free_of_movingstatics'"); - } - - sq_pushstring(v, "is_free_of_specifically_movingstatics", -1); - sq_newclosure(v, &Sector_is_free_of_specifically_movingstatics_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'is_free_of_specifically_movingstatics'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'Sector'"); - } - - // Register class WorldMapSector - sq_pushstring(v, "WorldMapSector", -1); - sq_pushstring(v, "GameObjectManager", -1); - sq_get(v, -3); - if(sq_newclass(v, SQTrue) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'WorldMapSector'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "get_tux_x", -1); - sq_newclosure(v, &WorldMapSector_get_tux_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_tux_x'"); - } - - sq_pushstring(v, "get_tux_y", -1); - sq_newclosure(v, &WorldMapSector_get_tux_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_tux_y'"); - } - - sq_pushstring(v, "set_sector", -1); - sq_newclosure(v, &WorldMapSector_set_sector_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_sector'"); - } - - sq_pushstring(v, "spawn", -1); - sq_newclosure(v, &WorldMapSector_spawn_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".ss"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'spawn'"); - } - - sq_pushstring(v, "move_to_spawnpoint", -1); - sq_newclosure(v, &WorldMapSector_move_to_spawnpoint_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'move_to_spawnpoint'"); - } - - sq_pushstring(v, "get_filename", -1); - sq_newclosure(v, &WorldMapSector_get_filename_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_filename'"); - } - - sq_pushstring(v, "set_title_level", -1); - sq_newclosure(v, &WorldMapSector_set_title_level_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_title_level'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'WorldMapSector'"); - } - - // Register class Gradient - sq_pushstring(v, "Gradient", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'Gradient'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "set_direction", -1); - sq_newclosure(v, &Gradient_set_direction_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_direction'"); - } - - sq_pushstring(v, "get_direction", -1); - sq_newclosure(v, &Gradient_get_direction_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_direction'"); - } - - sq_pushstring(v, "set_color1", -1); - sq_newclosure(v, &Gradient_set_color1_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_color1'"); - } - - sq_pushstring(v, "set_color2", -1); - sq_newclosure(v, &Gradient_set_color2_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_color2'"); - } - - sq_pushstring(v, "set_colors", -1); - sq_newclosure(v, &Gradient_set_colors_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_colors'"); - } - - sq_pushstring(v, "fade_color1", -1); - sq_newclosure(v, &Gradient_fade_color1_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_color1'"); - } - - sq_pushstring(v, "fade_color2", -1); - sq_newclosure(v, &Gradient_fade_color2_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_color2'"); - } - - sq_pushstring(v, "fade_colors", -1); - sq_newclosure(v, &Gradient_fade_colors_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_colors'"); - } - - sq_pushstring(v, "swap_colors", -1); - sq_newclosure(v, &Gradient_swap_colors_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'swap_colors'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'Gradient'"); - } - - // Register class LevelTime - sq_pushstring(v, "LevelTime", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'LevelTime'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "start", -1); - sq_newclosure(v, &LevelTime_start_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'start'"); - } - - sq_pushstring(v, "stop", -1); - sq_newclosure(v, &LevelTime_stop_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'stop'"); - } - - sq_pushstring(v, "get_time", -1); - sq_newclosure(v, &LevelTime_get_time_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_time'"); - } - - sq_pushstring(v, "set_time", -1); - sq_newclosure(v, &LevelTime_set_time_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_time'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'LevelTime'"); - } - - // Register class LitObject - sq_pushstring(v, "LitObject", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'LitObject'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "get_action", -1); - sq_newclosure(v, &LitObject_get_action_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_action'"); - } - - sq_pushstring(v, "set_action", -1); - sq_newclosure(v, &LitObject_set_action_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_action'"); - } - - sq_pushstring(v, "get_light_action", -1); - sq_newclosure(v, &LitObject_get_light_action_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_light_action'"); - } - - sq_pushstring(v, "set_light_action", -1); - sq_newclosure(v, &LitObject_set_light_action_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_light_action'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'LitObject'"); - } - - // Register class ParticleSystem - sq_pushstring(v, "ParticleSystem", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'ParticleSystem'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "set_enabled", -1); - sq_newclosure(v, &ParticleSystem_set_enabled_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_enabled'"); - } - - sq_pushstring(v, "get_enabled", -1); - sq_newclosure(v, &ParticleSystem_get_enabled_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_enabled'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'ParticleSystem'"); - } - - // Register class Platform - sq_pushstring(v, "Platform", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'Platform'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "goto_node", -1); - sq_newclosure(v, &Platform_goto_node_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'goto_node'"); - } - - sq_pushstring(v, "set_node", -1); - sq_newclosure(v, &Platform_set_node_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_node'"); - } - - sq_pushstring(v, "start_moving", -1); - sq_newclosure(v, &Platform_start_moving_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'start_moving'"); - } - - sq_pushstring(v, "stop_moving", -1); - sq_newclosure(v, &Platform_stop_moving_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'stop_moving'"); - } - - sq_pushstring(v, "get_action", -1); - sq_newclosure(v, &Platform_get_action_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_action'"); - } - - sq_pushstring(v, "set_action", -1); - sq_newclosure(v, &Platform_set_action_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".sb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_action'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'Platform'"); - } - - // Register class Player - sq_pushstring(v, "Player", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'Player'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "add_bonus", -1); - sq_newclosure(v, &Player_add_bonus_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'add_bonus'"); - } - - sq_pushstring(v, "set_bonus", -1); - sq_newclosure(v, &Player_set_bonus_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_bonus'"); - } - - sq_pushstring(v, "get_bonus", -1); - sq_newclosure(v, &Player_get_bonus_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_bonus'"); - } - - sq_pushstring(v, "add_coins", -1); - sq_newclosure(v, &Player_add_coins_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'add_coins'"); - } - - sq_pushstring(v, "get_coins", -1); - sq_newclosure(v, &Player_get_coins_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_coins'"); - } - - sq_pushstring(v, "make_invincible", -1); - sq_newclosure(v, &Player_make_invincible_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'make_invincible'"); - } - - sq_pushstring(v, "deactivate", -1); - sq_newclosure(v, &Player_deactivate_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'deactivate'"); - } - - sq_pushstring(v, "activate", -1); - sq_newclosure(v, &Player_activate_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'activate'"); - } - - sq_pushstring(v, "walk", -1); - sq_newclosure(v, &Player_walk_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - 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, ".b|n"); - 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, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_visible'"); - } - - sq_pushstring(v, "get_visible", -1); - sq_newclosure(v, &Player_get_visible_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_visible'"); - } - - sq_pushstring(v, "kill", -1); - sq_newclosure(v, &Player_kill_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'kill'"); - } - - sq_pushstring(v, "set_ghost_mode", -1); - sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'"); - } - - sq_pushstring(v, "get_ghost_mode", -1); - sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - 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, "."); - 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, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'do_cheer'"); - } - - sq_pushstring(v, "do_duck", -1); - sq_newclosure(v, &Player_do_duck_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'do_duck'"); - } - - sq_pushstring(v, "do_standup", -1); - sq_newclosure(v, &Player_do_standup_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'do_standup'"); - } - - sq_pushstring(v, "do_backflip", -1); - sq_newclosure(v, &Player_do_backflip_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'do_backflip'"); - } - - sq_pushstring(v, "do_jump", -1); - sq_newclosure(v, &Player_do_jump_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'do_jump'"); - } - - sq_pushstring(v, "trigger_sequence", -1); - sq_newclosure(v, &Player_trigger_sequence_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'trigger_sequence'"); - } - - sq_pushstring(v, "use_scripting_controller", -1); - sq_newclosure(v, &Player_use_scripting_controller_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'use_scripting_controller'"); - } - - sq_pushstring(v, "do_scripting_controller", -1); - sq_newclosure(v, &Player_do_scripting_controller_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".sb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'do_scripting_controller'"); - } - - sq_pushstring(v, "has_grabbed", -1); - sq_newclosure(v, &Player_has_grabbed_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'has_grabbed'"); - } - - sq_pushstring(v, "get_velocity_x", -1); - sq_newclosure(v, &Player_get_velocity_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_velocity_x'"); - } - - sq_pushstring(v, "get_velocity_y", -1); - sq_newclosure(v, &Player_get_velocity_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_velocity_y'"); - } - - sq_pushstring(v, "set_velocity", -1); - sq_newclosure(v, &Player_set_velocity_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_velocity'"); - } - - sq_pushstring(v, "get_x", -1); - sq_newclosure(v, &Player_get_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_x'"); - } - - sq_pushstring(v, "get_y", -1); - sq_newclosure(v, &Player_get_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_y'"); - } - - sq_pushstring(v, "set_pos", -1); - sq_newclosure(v, &Player_set_pos_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_pos'"); - } - - sq_pushstring(v, "get_action", -1); - sq_newclosure(v, &Player_get_action_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_action'"); - } - - sq_pushstring(v, "get_input_pressed", -1); - sq_newclosure(v, &Player_get_input_pressed_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_input_pressed'"); - } - - sq_pushstring(v, "get_input_held", -1); - sq_newclosure(v, &Player_get_input_held_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_input_held'"); - } - - sq_pushstring(v, "get_input_released", -1); - sq_newclosure(v, &Player_get_input_released_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_input_released'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'Player'"); - } - - // Register class Rain - sq_pushstring(v, "Rain", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'Rain'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "set_enabled", -1); - sq_newclosure(v, &Rain_set_enabled_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_enabled'"); - } - - sq_pushstring(v, "get_enabled", -1); - sq_newclosure(v, &Rain_get_enabled_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_enabled'"); - } - - sq_pushstring(v, "fade_speed", -1); - sq_newclosure(v, &Rain_fade_speed_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_speed'"); - } - - sq_pushstring(v, "fade_amount", -1); - sq_newclosure(v, &Rain_fade_amount_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_amount'"); - } - - sq_pushstring(v, "fade_angle", -1); - sq_newclosure(v, &Rain_fade_angle_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_angle'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'Rain'"); - } - - // Register class Rock - sq_pushstring(v, "Rock", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'Rock'"; - throw SquirrelError(v, msg.str()); - } - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'Rock'"); - } - - // Register class ScriptedObject - sq_pushstring(v, "ScriptedObject", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'ScriptedObject'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "set_action", -1); - sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_action'"); - } - - sq_pushstring(v, "get_action", -1); - sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_action'"); - } - - sq_pushstring(v, "get_name", -1); - sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_name'"); - } - - sq_pushstring(v, "move", -1); - sq_newclosure(v, &ScriptedObject_move_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'move'"); - } - - sq_pushstring(v, "set_pos", -1); - sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_pos'"); - } - - sq_pushstring(v, "get_pos_x", -1); - sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_pos_x'"); - } - - sq_pushstring(v, "get_pos_y", -1); - sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_pos_y'"); - } - - sq_pushstring(v, "set_velocity", -1); - sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_velocity'"); - } - - sq_pushstring(v, "get_velocity_x", -1); - sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_velocity_x'"); - } - - sq_pushstring(v, "get_velocity_y", -1); - sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - 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, ".b|n"); - 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, "."); - 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, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_visible'"); - } - - sq_pushstring(v, "is_visible", -1); - sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'is_visible'"); - } - - sq_pushstring(v, "set_solid", -1); - sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_solid'"); - } - - sq_pushstring(v, "is_solid", -1); - sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'is_solid'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'ScriptedObject'"); - } - - // Register class SoundObject - sq_pushstring(v, "SoundObject", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'SoundObject'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "start_playing", -1); - sq_newclosure(v, &SoundObject_start_playing_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'start_playing'"); - } - - sq_pushstring(v, "stop_playing", -1); - sq_newclosure(v, &SoundObject_stop_playing_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'stop_playing'"); - } - - sq_pushstring(v, "set_volume", -1); - sq_newclosure(v, &SoundObject_set_volume_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_volume'"); - } - - sq_pushstring(v, "get_volume", -1); - sq_newclosure(v, &SoundObject_get_volume_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_volume'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'SoundObject'"); - } - - // Register class Spotlight - sq_pushstring(v, "Spotlight", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'Spotlight'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "set_enabled", -1); - sq_newclosure(v, &Spotlight_set_enabled_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_enabled'"); - } - - sq_pushstring(v, "is_enabled", -1); - sq_newclosure(v, &Spotlight_is_enabled_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'is_enabled'"); - } - - sq_pushstring(v, "set_direction", -1); - sq_newclosure(v, &Spotlight_set_direction_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_direction'"); - } - - sq_pushstring(v, "set_angle", -1); - sq_newclosure(v, &Spotlight_set_angle_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_angle'"); - } - - sq_pushstring(v, "fade_angle", -1); - sq_newclosure(v, &Spotlight_fade_angle_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_angle'"); - } - - sq_pushstring(v, "ease_angle", -1); - sq_newclosure(v, &Spotlight_ease_angle_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_angle'"); - } - - sq_pushstring(v, "set_speed", -1); - sq_newclosure(v, &Spotlight_set_speed_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_speed'"); - } - - sq_pushstring(v, "fade_speed", -1); - sq_newclosure(v, &Spotlight_fade_speed_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_speed'"); - } - - sq_pushstring(v, "ease_speed", -1); - sq_newclosure(v, &Spotlight_ease_speed_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_speed'"); - } - - sq_pushstring(v, "set_color_rgba", -1); - sq_newclosure(v, &Spotlight_set_color_rgba_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_color_rgba'"); - } - - sq_pushstring(v, "fade_color_rgba", -1); - sq_newclosure(v, &Spotlight_fade_color_rgba_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_color_rgba'"); - } - - sq_pushstring(v, "ease_color_rgba", -1); - sq_newclosure(v, &Spotlight_ease_color_rgba_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|nb|ns"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'ease_color_rgba'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'Spotlight'"); - } - - // Register class TextObject - sq_pushstring(v, "TextObject", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'TextObject'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "constructor", -1); - sq_newclosure(v, &TextObject_constructor_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'constructor'"); - } - - sq_pushstring(v, "set_text", -1); - sq_newclosure(v, &TextObject_set_text_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_text'"); - } - - sq_pushstring(v, "set_font", -1); - sq_newclosure(v, &TextObject_set_font_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_font'"); - } - - sq_pushstring(v, "fade_in", -1); - sq_newclosure(v, &TextObject_fade_in_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_in'"); - } - - sq_pushstring(v, "fade_out", -1); - sq_newclosure(v, &TextObject_fade_out_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_out'"); - } - - sq_pushstring(v, "grow_in", -1); - sq_newclosure(v, &TextObject_grow_in_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'grow_in'"); - } - - sq_pushstring(v, "grow_out", -1); - sq_newclosure(v, &TextObject_grow_out_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'grow_out'"); - } - - sq_pushstring(v, "set_visible", -1); - sq_newclosure(v, &TextObject_set_visible_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_visible'"); - } - - sq_pushstring(v, "set_centered", -1); - sq_newclosure(v, &TextObject_set_centered_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_centered'"); - } - - sq_pushstring(v, "set_pos", -1); - sq_newclosure(v, &TextObject_set_pos_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_pos'"); - } - - sq_pushstring(v, "get_pos_x", -1); - sq_newclosure(v, &TextObject_get_pos_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_pos_x'"); - } - - sq_pushstring(v, "get_pos_y", -1); - sq_newclosure(v, &TextObject_get_pos_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_pos_y'"); - } - - sq_pushstring(v, "set_anchor_point", -1); - sq_newclosure(v, &TextObject_set_anchor_point_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_anchor_point'"); - } - - sq_pushstring(v, "get_anchor_point", -1); - sq_newclosure(v, &TextObject_get_anchor_point_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_anchor_point'"); - } - - sq_pushstring(v, "set_anchor_offset", -1); - sq_newclosure(v, &TextObject_set_anchor_offset_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_anchor_offset'"); - } - - sq_pushstring(v, "get_wrap_width", -1); - sq_newclosure(v, &TextObject_get_wrap_width_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_wrap_width'"); - } - - sq_pushstring(v, "set_wrap_width", -1); - sq_newclosure(v, &TextObject_set_wrap_width_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_wrap_width'"); - } - - sq_pushstring(v, "set_front_fill_color", -1); - sq_newclosure(v, &TextObject_set_front_fill_color_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_front_fill_color'"); - } - - sq_pushstring(v, "set_back_fill_color", -1); - sq_newclosure(v, &TextObject_set_back_fill_color_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_back_fill_color'"); - } - - sq_pushstring(v, "set_text_color", -1); - sq_newclosure(v, &TextObject_set_text_color_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_text_color'"); - } - - sq_pushstring(v, "set_roundness", -1); - sq_newclosure(v, &TextObject_set_roundness_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_roundness'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'TextObject'"); - } - - // Register class TextArrayObject - sq_pushstring(v, "TextArrayObject", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'TextArrayObject'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "constructor", -1); - sq_newclosure(v, &TextArrayObject_constructor_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'constructor'"); - } - - sq_pushstring(v, "clear", -1); - sq_newclosure(v, &TextArrayObject_clear_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'clear'"); - } - - sq_pushstring(v, "add_text", -1); - sq_newclosure(v, &TextArrayObject_add_text_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'add_text'"); - } - - sq_pushstring(v, "add_text_duration", -1); - sq_newclosure(v, &TextArrayObject_add_text_duration_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".sb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'add_text_duration'"); - } - - sq_pushstring(v, "set_text_index", -1); - sq_newclosure(v, &TextArrayObject_set_text_index_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_text_index'"); - } - - sq_pushstring(v, "set_keep_visible", -1); - sq_newclosure(v, &TextArrayObject_set_keep_visible_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_keep_visible'"); - } - - sq_pushstring(v, "set_fade_transition", -1); - sq_newclosure(v, &TextArrayObject_set_fade_transition_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_fade_transition'"); - } - - sq_pushstring(v, "set_fade_time", -1); - sq_newclosure(v, &TextArrayObject_set_fade_time_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_fade_time'"); - } - - sq_pushstring(v, "set_done", -1); - sq_newclosure(v, &TextArrayObject_set_done_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_done'"); - } - - sq_pushstring(v, "set_auto", -1); - sq_newclosure(v, &TextArrayObject_set_auto_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_auto'"); - } - - sq_pushstring(v, "next_text", -1); - sq_newclosure(v, &TextArrayObject_next_text_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'next_text'"); - } - - sq_pushstring(v, "prev_text", -1); - sq_newclosure(v, &TextArrayObject_prev_text_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'prev_text'"); - } - - sq_pushstring(v, "set_text", -1); - sq_newclosure(v, &TextArrayObject_set_text_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_text'"); - } - - sq_pushstring(v, "set_font", -1); - sq_newclosure(v, &TextArrayObject_set_font_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".s"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_font'"); - } - - sq_pushstring(v, "fade_in", -1); - sq_newclosure(v, &TextArrayObject_fade_in_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_in'"); - } - - sq_pushstring(v, "fade_out", -1); - sq_newclosure(v, &TextArrayObject_fade_out_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade_out'"); - } - - sq_pushstring(v, "grow_in", -1); - sq_newclosure(v, &TextArrayObject_grow_in_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'grow_in'"); - } - - sq_pushstring(v, "grow_out", -1); - sq_newclosure(v, &TextArrayObject_grow_out_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'grow_out'"); - } - - sq_pushstring(v, "set_visible", -1); - sq_newclosure(v, &TextArrayObject_set_visible_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_visible'"); - } - - sq_pushstring(v, "set_centered", -1); - sq_newclosure(v, &TextArrayObject_set_centered_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_centered'"); - } - - sq_pushstring(v, "set_pos", -1); - sq_newclosure(v, &TextArrayObject_set_pos_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_pos'"); - } - - sq_pushstring(v, "get_pos_x", -1); - sq_newclosure(v, &TextArrayObject_get_pos_x_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_pos_x'"); - } - - sq_pushstring(v, "get_pos_y", -1); - sq_newclosure(v, &TextArrayObject_get_pos_y_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_pos_y'"); - } - - sq_pushstring(v, "set_anchor_point", -1); - sq_newclosure(v, &TextArrayObject_set_anchor_point_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_anchor_point'"); - } - - sq_pushstring(v, "get_anchor_point", -1); - sq_newclosure(v, &TextArrayObject_get_anchor_point_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_anchor_point'"); - } - - sq_pushstring(v, "set_anchor_offset", -1); - sq_newclosure(v, &TextArrayObject_set_anchor_offset_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_anchor_offset'"); - } - - sq_pushstring(v, "get_wrap_width", -1); - sq_newclosure(v, &TextArrayObject_get_wrap_width_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_wrap_width'"); - } - - sq_pushstring(v, "set_wrap_width", -1); - sq_newclosure(v, &TextArrayObject_set_wrap_width_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_wrap_width'"); - } - - sq_pushstring(v, "set_front_fill_color", -1); - sq_newclosure(v, &TextArrayObject_set_front_fill_color_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_front_fill_color'"); - } - - sq_pushstring(v, "set_back_fill_color", -1); - sq_newclosure(v, &TextArrayObject_set_back_fill_color_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_back_fill_color'"); - } - - sq_pushstring(v, "set_text_color", -1); - sq_newclosure(v, &TextArrayObject_set_text_color_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_text_color'"); - } - - sq_pushstring(v, "set_roundness", -1); - sq_newclosure(v, &TextArrayObject_set_roundness_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_roundness'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'TextArrayObject'"); - } - - // Register class Thunderstorm - sq_pushstring(v, "Thunderstorm", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'Thunderstorm'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "start", -1); - sq_newclosure(v, &Thunderstorm_start_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'start'"); - } - - sq_pushstring(v, "stop", -1); - sq_newclosure(v, &Thunderstorm_stop_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'stop'"); - } - - sq_pushstring(v, "thunder", -1); - sq_newclosure(v, &Thunderstorm_thunder_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'thunder'"); - } - - sq_pushstring(v, "lightning", -1); - sq_newclosure(v, &Thunderstorm_lightning_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'lightning'"); - } - - sq_pushstring(v, "flash", -1); - sq_newclosure(v, &Thunderstorm_flash_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'flash'"); - } - - sq_pushstring(v, "electrify", -1); - sq_newclosure(v, &Thunderstorm_electrify_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'electrify'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'Thunderstorm'"); - } - - // Register class TileMap - sq_pushstring(v, "TileMap", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'TileMap'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "goto_node", -1); - sq_newclosure(v, &TileMap_goto_node_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'goto_node'"); - } - - sq_pushstring(v, "set_node", -1); - sq_newclosure(v, &TileMap_set_node_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_node'"); - } - - sq_pushstring(v, "start_moving", -1); - sq_newclosure(v, &TileMap_start_moving_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'start_moving'"); - } - - sq_pushstring(v, "stop_moving", -1); - sq_newclosure(v, &TileMap_stop_moving_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'stop_moving'"); - } - - sq_pushstring(v, "get_tile_id", -1); - sq_newclosure(v, &TileMap_get_tile_id_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_tile_id'"); - } - - sq_pushstring(v, "get_tile_id_at", -1); - sq_newclosure(v, &TileMap_get_tile_id_at_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_tile_id_at'"); - } - - sq_pushstring(v, "change", -1); - sq_newclosure(v, &TileMap_change_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'change'"); - } - - sq_pushstring(v, "change_at", -1); - sq_newclosure(v, &TileMap_change_at_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'change_at'"); - } - - sq_pushstring(v, "fade", -1); - sq_newclosure(v, &TileMap_fade_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'fade'"); - } - - sq_pushstring(v, "tint_fade", -1); - sq_newclosure(v, &TileMap_tint_fade_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|nb|nb|nb|nb|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'tint_fade'"); - } - - sq_pushstring(v, "set_alpha", -1); - sq_newclosure(v, &TileMap_set_alpha_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_alpha'"); - } - - sq_pushstring(v, "get_alpha", -1); - sq_newclosure(v, &TileMap_get_alpha_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_alpha'"); - } - - sq_pushstring(v, "set_solid", -1); - sq_newclosure(v, &TileMap_set_solid_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_solid'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'TileMap'"); - } - - // Register class Torch - sq_pushstring(v, "Torch", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'Torch'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "get_burning", -1); - sq_newclosure(v, &Torch_get_burning_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'get_burning'"); - } - - sq_pushstring(v, "set_burning", -1); - sq_newclosure(v, &Torch_set_burning_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".b|n"); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'set_burning'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'Torch'"); - } - - // Register class Wind - sq_pushstring(v, "Wind", -1); - if(sq_newclass(v, SQFalse) < 0) { - std::ostringstream msg; - msg << "Couldn't create new class 'Wind'"; - throw SquirrelError(v, msg.str()); - } - sq_pushstring(v, "start", -1); - sq_newclosure(v, &Wind_start_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'start'"); - } - - sq_pushstring(v, "stop", -1); - sq_newclosure(v, &Wind_stop_wrapper, 0); - sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "."); - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register function 'stop'"); - } - - if(SQ_FAILED(sq_createslot(v, -3))) { - throw SquirrelError(v, "Couldn't register class 'Wind'"); - } - -} - -} // namespace scripting - -/* EOF */ diff --git a/src/scripting/wrapper.hpp b/src/scripting/wrapper.hpp deleted file mode 100644 index bb8a329977a..00000000000 --- a/src/scripting/wrapper.hpp +++ /dev/null @@ -1,86 +0,0 @@ -/** - * WARNING: This file is automatically generated from: - * 'src/scripting/wrapper.interface.hpp' - * DO NOT CHANGE - */ -#ifndef HEADER_SUPERTUX_SCRIPTING_WRAPPER_HPP -#define HEADER_SUPERTUX_SCRIPTING_WRAPPER_HPP - -#include - -namespace scripting { - -void register_supertux_wrapper(HSQUIRRELVM v); - -class AmbientSound; -void create_squirrel_instance(HSQUIRRELVM v, scripting::AmbientSound* object, bool setup_releasehook = false); -class Background; -void create_squirrel_instance(HSQUIRRELVM v, scripting::Background* object, bool setup_releasehook = false); -class BadGuy; -void create_squirrel_instance(HSQUIRRELVM v, scripting::BadGuy* object, bool setup_releasehook = false); -class Camera; -void create_squirrel_instance(HSQUIRRELVM v, scripting::Camera* object, bool setup_releasehook = false); -class Candle; -void create_squirrel_instance(HSQUIRRELVM v, scripting::Candle* object, bool setup_releasehook = false); -class Clouds; -void create_squirrel_instance(HSQUIRRELVM v, scripting::Clouds* object, bool setup_releasehook = false); -class ConveyorBelt; -void create_squirrel_instance(HSQUIRRELVM v, scripting::ConveyorBelt* object, bool setup_releasehook = false); -class CustomParticles; -void create_squirrel_instance(HSQUIRRELVM v, scripting::CustomParticles* object, bool setup_releasehook = false); -class Decal; -void create_squirrel_instance(HSQUIRRELVM v, scripting::Decal* object, bool setup_releasehook = false); -class Dispenser; -void create_squirrel_instance(HSQUIRRELVM v, scripting::Dispenser* object, bool setup_releasehook = false); -class DisplayEffect; -void create_squirrel_instance(HSQUIRRELVM v, scripting::DisplayEffect* object, bool setup_releasehook = false); -class FloatingImage; -void create_squirrel_instance(HSQUIRRELVM v, scripting::FloatingImage* object, bool setup_releasehook = false); -class GameObjectManager; -void create_squirrel_instance(HSQUIRRELVM v, scripting::GameObjectManager* object, bool setup_releasehook = false); -class Gradient; -void create_squirrel_instance(HSQUIRRELVM v, scripting::Gradient* object, bool setup_releasehook = false); -class LevelTime; -void create_squirrel_instance(HSQUIRRELVM v, scripting::LevelTime* object, bool setup_releasehook = false); -class LitObject; -void create_squirrel_instance(HSQUIRRELVM v, scripting::LitObject* object, bool setup_releasehook = false); -class ParticleSystem; -void create_squirrel_instance(HSQUIRRELVM v, scripting::ParticleSystem* object, bool setup_releasehook = false); -class Platform; -void create_squirrel_instance(HSQUIRRELVM v, scripting::Platform* object, bool setup_releasehook = false); -class Player; -void create_squirrel_instance(HSQUIRRELVM v, scripting::Player* object, bool setup_releasehook = false); -class Rain; -void create_squirrel_instance(HSQUIRRELVM v, scripting::Rain* object, bool setup_releasehook = false); -class Rock; -void create_squirrel_instance(HSQUIRRELVM v, scripting::Rock* object, bool setup_releasehook = false); -class ScriptedObject; -void create_squirrel_instance(HSQUIRRELVM v, scripting::ScriptedObject* object, bool setup_releasehook = false); -class Sector; -void create_squirrel_instance(HSQUIRRELVM v, scripting::Sector* object, bool setup_releasehook = false); -class SoundObject; -void create_squirrel_instance(HSQUIRRELVM v, scripting::SoundObject* object, bool setup_releasehook = false); -class Spotlight; -void create_squirrel_instance(HSQUIRRELVM v, scripting::Spotlight* object, bool setup_releasehook = false); -class TextObject; -void create_squirrel_instance(HSQUIRRELVM v, scripting::TextObject* object, bool setup_releasehook = false); -class TextArrayObject; -void create_squirrel_instance(HSQUIRRELVM v, scripting::TextArrayObject* object, bool setup_releasehook = false); -class Thunderstorm; -void create_squirrel_instance(HSQUIRRELVM v, scripting::Thunderstorm* object, bool setup_releasehook = false); -class TileMap; -void create_squirrel_instance(HSQUIRRELVM v, scripting::TileMap* object, bool setup_releasehook = false); -class Torch; -void create_squirrel_instance(HSQUIRRELVM v, scripting::Torch* object, bool setup_releasehook = false); -class WillOWisp; -void create_squirrel_instance(HSQUIRRELVM v, scripting::WillOWisp* object, bool setup_releasehook = false); -class Wind; -void create_squirrel_instance(HSQUIRRELVM v, scripting::Wind* object, bool setup_releasehook = false); -class WorldMapSector; -void create_squirrel_instance(HSQUIRRELVM v, scripting::WorldMapSector* object, bool setup_releasehook = false); - -} - -#endif - -/* EOF */ diff --git a/src/scripting/wrapper.interface.hpp b/src/scripting/wrapper.interface.hpp deleted file mode 100644 index 4d73317027e..00000000000 --- a/src/scripting/wrapper.interface.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/* This file is processed by miniswig to produce the scripting API */ -#include "scripting/ambient_sound.hpp" -#include "scripting/anchor_points.hpp" -#include "scripting/background.hpp" -#include "scripting/badguy.hpp" -#include "scripting/camera.hpp" -#include "scripting/candle.hpp" -#include "scripting/clouds.hpp" -#include "scripting/conveyor_belt.hpp" -#include "scripting/custom_particles.hpp" -#include "scripting/decal.hpp" -#include "scripting/dispenser.hpp" -#include "scripting/display_effect.hpp" -#include "scripting/floating_image.hpp" -#include "scripting/functions.hpp" -#include "scripting/game_object_manager.hpp" -#include "scripting/gradient.hpp" -#include "scripting/level.hpp" -#include "scripting/level_time.hpp" -#include "scripting/lit_object.hpp" -#include "scripting/particlesystem.hpp" -#include "scripting/platform.hpp" -#include "scripting/player.hpp" -#include "scripting/rain.hpp" -#include "scripting/rock.hpp" -#include "scripting/scripted_object.hpp" -#include "scripting/sector.hpp" -#include "scripting/sound_object.hpp" -#include "scripting/spotlight.hpp" -#include "scripting/text_object.hpp" -#include "scripting/text_array_object.hpp" -#include "scripting/thunderstorm.hpp" -#include "scripting/tilemap.hpp" -#include "scripting/torch.hpp" -#include "scripting/willowisp.hpp" -#include "scripting/wind.hpp" -#include "scripting/worldmap_sector.hpp" - -/* EOF */ diff --git a/src/squirrel/script_interface.hpp b/src/squirrel/exposable_class.hpp similarity index 55% rename from src/squirrel/script_interface.hpp rename to src/squirrel/exposable_class.hpp index 9569e03a5ac..9d572e18680 100644 --- a/src/squirrel/script_interface.hpp +++ b/src/squirrel/exposable_class.hpp @@ -1,5 +1,5 @@ // SuperTux -// Copyright (C) 2006 Matthias Braun +// Copyright (C) 2024 Vankata453 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -14,23 +14,25 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#ifndef HEADER_SUPERTUX_SQUIRREL_SCRIPT_INTERFACE_HPP -#define HEADER_SUPERTUX_SQUIRREL_SCRIPT_INTERFACE_HPP +#ifndef HEADER_SUPERTUX_SQUIRREL_EXPOSABLE_CLASS_HPP +#define HEADER_SUPERTUX_SQUIRREL_EXPOSABLE_CLASS_HPP -#include +#include -/** - * Objects that want to expose themself to the scripting environment - * should implement this interface - */ -class ScriptInterface +#include + +/** Represents a class, which can be exposed to scripting. */ +class ExposableClass : public ssq::ExposableClass { public: - virtual ~ScriptInterface() - {} + ExposableClass() {} + virtual ~ExposableClass() override {} + + virtual std::string get_exposed_class_name() const = 0; - virtual void expose(HSQUIRRELVM vm, SQInteger table_idx) = 0; - virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx) = 0; +private: + ExposableClass(const ExposableClass&) = delete; + ExposableClass& operator=(const ExposableClass&) = delete; }; #endif diff --git a/src/squirrel/exposed_object.hpp b/src/squirrel/exposed_object.hpp deleted file mode 100644 index ad28bb8fd28..00000000000 --- a/src/squirrel/exposed_object.hpp +++ /dev/null @@ -1,107 +0,0 @@ -// SuperTux -- ExposedObject class -// Copyright (C) 2016 Tobias Markus -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SQUIRREL_EXPOSED_OBJECT_HPP -#define HEADER_SUPERTUX_SQUIRREL_EXPOSED_OBJECT_HPP - -#include - -#include "squirrel/squirrel_virtual_machine.hpp" -#include "squirrel/squirrel_util.hpp" -#include "squirrel/script_interface.hpp" -#include "util/log.hpp" - -/** - * @class ExposedObject - * This class binds a certain GameObject class to a scripting class. - * To bind a game object class to a scripting class, extend the GameObject - * class as shown in the following example: - * \code{.cpp} - * public ExposedObject - * \endcode - * - * and instantiate it in each constructor with the this pointer, like this: - * \code{.cpp} - * Gradient::Gradient(const ReaderMapping& reader) : - * ExposedObject(this) - * \endcode - * @param class S: GameObject class (e.g. Gradient) - * @param class T: Scripting class (e.g. scripting::Gradient) - */ -template -class ExposedObject : virtual public ScriptInterface -{ -private: - /** - * The parent object that is exposed to the script interface - */ - S* m_parent; - -public: - /** - * Constructor - * @param parent GameObject - */ - ExposedObject(S* parent) : - m_parent(parent) - { - } - - /** - * Exposes the parent GameObject to the script Interface - * @param vm The squirrel virtual machine to expose the object on - * @param table_idx Index of the table to expose the object on - */ - virtual void expose(HSQUIRRELVM vm, SQInteger table_idx) override - { - auto name = m_parent->get_name(); - if (name.empty()) - { - return; - } - - log_debug << "Exposing " << m_parent->get_class_name() << " object " << name << std::endl; - - auto object = std::make_unique(*m_parent); - expose_object(vm, table_idx, std::move(object), name); - } - - /** - * Un-exposes the parent GameObject to the script Interface - * @param vm The squirrel virtual machine to un-expose the object on - * @param table_idx Index of the table to un-expose the object on - */ - virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx) override - { - auto name = m_parent->get_name(); - if (name.empty()) - { - return; - } - - log_debug << "Unexposing object " << name << std::endl; - - unexpose_object(vm, table_idx, name); - } - -private: - ExposedObject(const ExposedObject&) = delete; - ExposedObject& operator=(const ExposedObject&) = delete; -}; - -#endif - -/* EOF */ diff --git a/src/squirrel/serialize.cpp b/src/squirrel/serialize.cpp index 1c58c4da724..17ab2733801 100644 --- a/src/squirrel/serialize.cpp +++ b/src/squirrel/serialize.cpp @@ -16,24 +16,20 @@ #include "squirrel/serialize.hpp" -#include #include #include +#include -#include "squirrel/squirrel_error.hpp" #include "util/log.hpp" #include "util/reader_mapping.hpp" #include "util/writer.hpp" -void load_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, const ReaderMapping& mapping) +void load_squirrel_table(ssq::Table& table, const ReaderMapping& mapping) { - if (table_idx < 0) - table_idx -= 2; - auto const& arr = mapping.get_sexp().as_array(); for (size_t i = 1; i < arr.size(); ++i) { - auto const& pair = arr[i].as_array(); + const auto& pair = arr[i].as_array(); // Ignore key value pairs with invalid length if (pair.size() < 2) @@ -42,8 +38,8 @@ void load_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, const ReaderMappin continue; } - const std::string& key = pair[0].as_string(); - auto const& value = pair[1]; + const char* key = pair[0].as_string().c_str(); + const auto& value = pair[1]; // ignore empty / null values if (value.is_nil()) @@ -51,100 +47,72 @@ void load_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, const ReaderMappin log_debug << "Found null value for key " << key << ". Ignoring." << std::endl; continue; } - // push the key - sq_pushstring(vm, key.c_str(), key.size()); // push the value - switch (value.get_type()) { + switch (value.get_type()) + { case sexp::Value::Type::ARRAY: - sq_newtable(vm); - load_squirrel_table(vm, sq_gettop(vm), ReaderMapping(mapping.get_doc(), arr[i])); + { + ssq::Table new_table = table.addTable(key); + load_squirrel_table(new_table, ReaderMapping(mapping.get_doc(), arr[i])); break; + } case sexp::Value::Type::INTEGER: - sq_pushinteger(vm, value.as_int()); + table.set(key, value.as_int()); break; case sexp::Value::Type::REAL: - sq_pushfloat(vm, value.as_float()); + table.set(key, value.as_float()); break; case sexp::Value::Type::STRING: - sq_pushstring(vm, value.as_string().c_str(), -1); + table.set(key, value.as_string()); break; case sexp::Value::Type::BOOLEAN: - sq_pushbool(vm, value.as_bool() ? SQTrue : SQFalse); + table.set(key, value.as_bool()); break; case sexp::Value::Type::SYMBOL: - log_fatal << "Unexpected symbol in file: " << value.as_string() << std::endl; - sq_pushnull(vm); + log_warning << "Unexpected symbol in file: " << value.as_string() << std::endl; + table.set(key, nullptr); break; default: assert(false); break; } - - if (SQ_FAILED(sq_createslot(vm, table_idx))) - throw SquirrelError(vm, "Couldn't create new index"); } } -void save_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, Writer& writer) +void save_squirrel_table(const ssq::Table& table, Writer& writer) { - // offset because of sq_pushnull - if (table_idx < 0) - table_idx -= 1; - - //iterator table - sq_pushnull(vm); - while (SQ_SUCCEEDED(sq_next(vm, table_idx))) { - if (sq_gettype(vm, -2) != OT_STRING) { - get_logging_instance(false) << "Table contains non-string key\n"; - continue; - } - const SQChar* key; - sq_getstring(vm, -2, &key); - - switch (sq_gettype(vm, -1)) { - case OT_INTEGER: { - SQInteger val; - sq_getinteger(vm, -1, &val); - writer.write(key, static_cast (val)); + for (const auto& [key, value] : table.convertRaw()) + { + switch (value.getType()) + { + case ssq::Type::INTEGER: + writer.write(key, value.to()); break; - } - case OT_FLOAT: { - SQFloat val; - sq_getfloat(vm, -1, &val); - writer.write(key, static_cast (val)); + case ssq::Type::FLOAT: + writer.write(key, value.toFloat()); break; - } - case OT_BOOL: { - SQBool val; - if (SQ_SUCCEEDED(sq_getbool(vm, -1, &val))) - writer.write(key, val == SQTrue); + case ssq::Type::BOOL: + writer.write(key, value.toBool()); break; - } - case OT_STRING: { - const SQChar* str; - sq_getstring(vm, -1, &str); - writer.write(key, reinterpret_cast (str)); + case ssq::Type::STRING: + writer.write(key, value.toString()); break; - } - case OT_TABLE: { + case ssq::Type::TABLE: writer.start_list(key, true); - save_squirrel_table(vm, -1, writer); + save_squirrel_table(value.toTable(), writer); writer.end_list(key); break; - } - case OT_CLOSURE: - break; // ignore - case OT_NATIVECLOSURE: - break; + + case ssq::Type::CLOSURE: + case ssq::Type::NATIVECLOSURE: + break; // Ignore + default: - get_logging_instance(false) << "Can't serialize key '" << key - << "' in table.\n"; + log_warning << "Can't serialize key '" << key << "' in Squirrel table." << std::endl; break; } - sq_pop(vm, 2); } - sq_pop(vm, 1); } /* EOF */ diff --git a/src/squirrel/serialize.hpp b/src/squirrel/serialize.hpp index f3741acd4f2..beb1b816f90 100644 --- a/src/squirrel/serialize.hpp +++ b/src/squirrel/serialize.hpp @@ -17,13 +17,15 @@ #ifndef HEADER_SUPERTUX_SQUIRREL_SERIALIZE_HPP #define HEADER_SUPERTUX_SQUIRREL_SERIALIZE_HPP -#include - class ReaderMapping; class Writer; -void save_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, Writer& writer); -void load_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, const ReaderMapping& mapping); +namespace ssq { +class Table; +} // namespace ssq + +void load_squirrel_table(ssq::Table& table, const ReaderMapping& mapping); +void save_squirrel_table(const ssq::Table& table, Writer& writer); #endif diff --git a/src/squirrel/squirrel_environment.cpp b/src/squirrel/squirrel_environment.cpp index 86018eef32e..631ffebe7be 100644 --- a/src/squirrel/squirrel_environment.cpp +++ b/src/squirrel/squirrel_environment.cpp @@ -18,105 +18,81 @@ #include -#include "squirrel/script_interface.hpp" -#include "squirrel/squirrel_error.hpp" -#include "squirrel/squirrel_scheduler.hpp" +#include +#include +#include + #include "squirrel/squirrel_util.hpp" #include "squirrel/squirrel_virtual_machine.hpp" -#include "supertux/game_object.hpp" #include "supertux/globals.hpp" #include "util/log.hpp" -SquirrelEnvironment::SquirrelEnvironment(SquirrelVM& vm, const std::string& name) : +SquirrelEnvironment::SquirrelEnvironment(ssq::VM& vm, const std::string& name) : m_vm(vm), - m_table(), + m_table(m_vm.newTable()), m_name(name), m_scripts(), m_scheduler(std::make_unique(m_vm)) { - // garbage collector has to be invoked manually - sq_collectgarbage(m_vm.get_vm()); - - sq_newtable(m_vm.get_vm()); - sq_pushroottable(m_vm.get_vm()); - if (SQ_FAILED(sq_setdelegate(m_vm.get_vm(), -2))) - throw SquirrelError(m_vm.get_vm(), "Couldn't set table delegate"); - - sq_resetobject(&m_table); - if (SQ_FAILED(sq_getstackobj(m_vm.get_vm(), -1, &m_table))) { - throw SquirrelError(m_vm.get_vm(), "Couldn't get table"); - } + // Garbage collector has to be invoked manually! + sq_collectgarbage(m_vm.getHandle()); - sq_addref(m_vm.get_vm(), &m_table); - sq_pop(m_vm.get_vm(), 1); + // Set the root table as delegate. + m_table.setDelegate(m_vm); } SquirrelEnvironment::~SquirrelEnvironment() { - for (auto& script: m_scripts) - { - sq_release(m_vm.get_vm(), &script); - } m_scripts.clear(); - sq_release(m_vm.get_vm(), &m_table); + m_table.reset(); - sq_collectgarbage(m_vm.get_vm()); + sq_collectgarbage(m_vm.getHandle()); } void SquirrelEnvironment::expose_self() { - sq_pushroottable(m_vm.get_vm()); - m_vm.store_object(m_name.c_str(), m_table); - sq_pop(m_vm.get_vm(), 1); + m_vm.set(m_name.c_str(), m_table); } void SquirrelEnvironment::unexpose_self() { - sq_pushroottable(m_vm.get_vm()); - m_vm.delete_table_entry(m_name.c_str()); - sq_pop(m_vm.get_vm(), 1); + m_vm.remove(m_name.c_str()); } void -SquirrelEnvironment::try_expose(GameObject& object) +SquirrelEnvironment::expose(ExposableClass& object, const std::string& name) { - auto script_object = dynamic_cast(&object); - if (script_object != nullptr) { - sq_pushobject(m_vm.get_vm(), m_table); - script_object->expose(m_vm.get_vm(), -1); - sq_pop(m_vm.get_vm(), 1); - } -} + if (name.empty()) return; -void -SquirrelEnvironment::try_unexpose(GameObject& object) -{ - auto script_object = dynamic_cast(&object); - if (script_object != nullptr) { - SQInteger oldtop = sq_gettop(m_vm.get_vm()); - sq_pushobject(m_vm.get_vm(), m_table); - try { - script_object->unexpose(m_vm.get_vm(), -1); - } catch(std::exception& e) { - log_warning << "Couldn't unregister object: " << e.what() << std::endl; - } - sq_settop(m_vm.get_vm(), oldtop); + const std::string class_name = object.get_exposed_class_name(); + assert(!class_name.empty()); + + try + { + ssq::Class sq_class = m_vm.findClass(class_name.c_str()); + m_vm.newInstancePtr(m_table, sq_class, name.c_str(), &object); + } + catch (const std::exception& err) + { + log_warning << "Couldn't expose object of class '" << class_name << "': " << err.what() << std::endl; } } void SquirrelEnvironment::unexpose(const std::string& name) { - SQInteger oldtop = sq_gettop(m_vm.get_vm()); - sq_pushobject(m_vm.get_vm(), m_table); - try { - unexpose_object(m_vm.get_vm(), -1, name); - } catch(std::exception& e) { - log_warning << "Couldn't unregister object: " << e.what() << std::endl; + if (name.empty()) return; + + try + { + m_table.remove(name.c_str()); + } + catch (const std::exception& err) + { + log_warning << "Couldn't unregister object: " << err.what() << std::endl; } - sq_settop(m_vm.get_vm(), oldtop); } void @@ -133,15 +109,8 @@ SquirrelEnvironment::garbage_collect() { m_scripts.erase( std::remove_if(m_scripts.begin(), m_scripts.end(), - [this](HSQOBJECT& object){ - HSQUIRRELVM vm = object_to_vm(object); - - if (sq_getvmstate(vm) != SQ_VMSTATE_SUSPENDED) { - sq_release(m_vm.get_vm(), &object); - return true; - } else { - return false; - } + [](ssq::VM& thread) { + return thread.getState() != SQ_VMSTATE_SUSPENDED; }), m_scripts.end()); } @@ -153,35 +122,37 @@ SquirrelEnvironment::run_script(std::istream& in, const std::string& sourcename) try { - HSQOBJECT object = m_vm.create_thread(); - m_scripts.push_back(object); - - HSQUIRRELVM vm = object_to_vm(object); + ssq::VM thread = m_vm.newThread(64); + thread.setForeignPtr(this); + thread.setRootTable(m_table); - sq_setforeignptr(vm, this); + thread.run(thread.compileSource(in, sourcename.c_str())); - // set root table - sq_pushobject(vm, m_table); - sq_setroottable(vm); + m_scripts.push_back(std::move(thread)); + } + catch (const ssq::Exception& e) + { + if (e.vm) + sqstd_printcallstack(e.vm); - compile_and_run(vm, in, sourcename); + log_warning << e.what() << std::endl; } - catch(const std::exception& e) + catch (const std::exception& e) { - log_warning << "Error running script: " << e.what() << std::endl; + log_warning << e.what() << std::endl; } } -void +SQInteger SquirrelEnvironment::wait_for_seconds(HSQUIRRELVM vm, float seconds) { - m_scheduler->schedule_thread(vm, g_game_time + seconds, false); + return m_scheduler->schedule_thread(vm, g_game_time + seconds, false); } -void +SQInteger SquirrelEnvironment::skippable_wait_for_seconds(HSQUIRRELVM vm, float seconds) { - m_scheduler->schedule_thread(vm, g_game_time + seconds, true); + return m_scheduler->schedule_thread(vm, g_game_time + seconds, true); } void diff --git a/src/squirrel/squirrel_environment.hpp b/src/squirrel/squirrel_environment.hpp index ddb4cc70a92..338350b1584 100644 --- a/src/squirrel/squirrel_environment.hpp +++ b/src/squirrel/squirrel_environment.hpp @@ -21,44 +21,31 @@ #include #include -#include +#include +#include "squirrel/exposable_class.hpp" +#include "squirrel/squirrel_scheduler.hpp" #include "squirrel/squirrel_util.hpp" - -class GameObject; -class ScriptInterface; -class SquirrelVM; +#include "util/log.hpp" /** The SquirrelEnvironment contains the environment in which a script is executed, meaning a root table containing objects and variables. */ -class SquirrelEnvironment +class SquirrelEnvironment final { public: - SquirrelEnvironment(SquirrelVM& vm, const std::string& name); + SquirrelEnvironment(ssq::VM& vm, const std::string& name); virtual ~SquirrelEnvironment(); public: - SquirrelVM& get_vm() const { return m_vm; } + ssq::VM& get_vm() const { return m_vm; } /** Expose this engine under 'name' */ void expose_self(); void unexpose_self(); - /** Expose the GameObject if it has a ScriptInterface, otherwise do - nothing. */ - void try_expose(GameObject& object); - void try_unexpose(GameObject& object); - - /** Generic expose function, T must be a type that has a - create_squirrel_instance() associated with it. */ - template - void expose(const std::string& name, std::unique_ptr script_object) - { - sq_pushobject(m_vm.get_vm(), m_table); - expose_object(m_vm.get_vm(), -1, std::move(script_object), name); - sq_pop(m_vm.get_vm(), 1); - } + /** Expose and unexpose objects */ + void expose(ExposableClass& object, const std::string& name); void unexpose(const std::string& name); /** Convenience function that takes an std::string instead of an @@ -72,17 +59,17 @@ class SquirrelEnvironment void run_script(std::istream& in, const std::string& sourcename); void update(float dt_sec); - void wait_for_seconds(HSQUIRRELVM vm, float seconds); - void skippable_wait_for_seconds(HSQUIRRELVM vm, float seconds); + SQInteger wait_for_seconds(HSQUIRRELVM vm, float seconds); + SQInteger skippable_wait_for_seconds(HSQUIRRELVM vm, float seconds); private: void garbage_collect(); private: - SquirrelVM& m_vm; - HSQOBJECT m_table; + ssq::VM& m_vm; + ssq::Table m_table; std::string m_name; - SquirrelObjectList m_scripts; + std::vector m_scripts; std::unique_ptr m_scheduler; private: diff --git a/src/squirrel/squirrel_error.cpp b/src/squirrel/squirrel_error.cpp deleted file mode 100644 index a09a72e6a06..00000000000 --- a/src/squirrel/squirrel_error.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "squirrel/squirrel_error.hpp" - -#include - -SquirrelError::SquirrelError(HSQUIRRELVM v, const std::string& message_) throw() : - message() -{ - std::ostringstream msg; - msg << "Squirrel error: " << message_ << " ("; - const char* lasterr; - sq_getlasterror(v); - if (sq_gettype(v, -1) != OT_STRING) - { - lasterr = "no error info"; - } - else - { - sq_getstring(v, -1, &lasterr); - } - msg << lasterr << ")"; - sq_pop(v, 1); - message = msg.str(); -} - -SquirrelError::~SquirrelError() throw() -{} - -const char* -SquirrelError::what() const throw() -{ - return message.c_str(); -} - -/* EOF */ diff --git a/src/squirrel/squirrel_error.hpp b/src/squirrel/squirrel_error.hpp deleted file mode 100644 index 1e709714d8e..00000000000 --- a/src/squirrel/squirrel_error.hpp +++ /dev/null @@ -1,44 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SQUIRREL_SQUIRREL_ERROR_HPP -#define HEADER_SUPERTUX_SQUIRREL_SQUIRREL_ERROR_HPP - -#include -#include -#include - -/** Exception class for squirrel errors, it takes a squirrelvm and uses - * sq_geterror() to retrieve additional information about the last error that - * occurred and creates a readable message from that. - */ -class SquirrelError final : public std::exception -{ -public: - SquirrelError(HSQUIRRELVM v, const std::string& message) throw(); - SquirrelError(const SquirrelError&) = default; - SquirrelError& operator=(const SquirrelError&) = default; - ~SquirrelError() throw() override; - - virtual const char* what() const throw() override; - -private: - std::string message; -}; - -#endif - -/* EOF */ diff --git a/src/squirrel/squirrel_scheduler.cpp b/src/squirrel/squirrel_scheduler.cpp index 5396b2c97de..5c700a142c6 100644 --- a/src/squirrel/squirrel_scheduler.cpp +++ b/src/squirrel/squirrel_scheduler.cpp @@ -18,12 +18,14 @@ #include -#include "squirrel/squirrel_virtual_machine.hpp" +#include + #include "squirrel/squirrel_util.hpp" +#include "squirrel/squirrel_virtual_machine.hpp" #include "supertux/level.hpp" #include "util/log.hpp" -SquirrelScheduler::SquirrelScheduler(SquirrelVM& vm) : +SquirrelScheduler::SquirrelScheduler(ssq::VM& vm) : m_vm(vm), schedule() { @@ -32,19 +34,19 @@ SquirrelScheduler::SquirrelScheduler(SquirrelVM& vm) : void SquirrelScheduler::update(float time) { - while (!schedule.empty() && (schedule.front().wakeup_time < time || - (schedule.front().skippable && - Level::current() != nullptr && - Level::current()->m_skip_cutscene) - )) { + while (!schedule.empty() && + (schedule.front().wakeup_time < time || + (schedule.front().skippable && Level::current() && + Level::current()->m_skip_cutscene))) + { HSQOBJECT thread_ref = schedule.front().thread_ref; - sq_pushobject(m_vm.get_vm(), thread_ref); - sq_getweakrefval(m_vm.get_vm(), -1); + sq_pushobject(m_vm.getHandle(), thread_ref); + sq_getweakrefval(m_vm.getHandle(), -1); HSQUIRRELVM scheduled_vm; - if (sq_gettype(m_vm.get_vm(), -1) == OT_THREAD && - SQ_SUCCEEDED(sq_getthread(m_vm.get_vm(), -1, &scheduled_vm))) { + if (sq_gettype(m_vm.getHandle(), -1) == OT_THREAD && + SQ_SUCCEEDED(sq_getthread(m_vm.getHandle(), -1, &scheduled_vm))) { if (SQ_FAILED(sq_wakeupvm(scheduled_vm, SQFalse, SQFalse, SQTrue, SQFalse))) { std::ostringstream msg; msg << "Error waking VM: "; @@ -61,34 +63,36 @@ SquirrelScheduler::update(float time) } } - sq_release(m_vm.get_vm(), &thread_ref); - sq_pop(m_vm.get_vm(), 2); + sq_release(m_vm.getHandle(), &thread_ref); + sq_pop(m_vm.getHandle(), 2); std::pop_heap(schedule.begin(), schedule.end()); schedule.pop_back(); } } -void +SQInteger SquirrelScheduler::schedule_thread(HSQUIRRELVM scheduled_vm, float time, bool skippable) { // create a weakref to the VM - sq_pushthread(m_vm.get_vm(), scheduled_vm); - sq_weakref(m_vm.get_vm(), -1); + sq_pushthread(m_vm.getHandle(), scheduled_vm); + sq_weakref(m_vm.getHandle(), -1); ScheduleEntry entry; - if (SQ_FAILED(sq_getstackobj(m_vm.get_vm(), -1, & entry.thread_ref))) { - sq_pop(m_vm.get_vm(), 2); - throw SquirrelError(m_vm.get_vm(), "Couldn't get thread weakref from vm"); + if (SQ_FAILED(sq_getstackobj(m_vm.getHandle(), -1, & entry.thread_ref))) { + sq_pop(m_vm.getHandle(), 2); + throw ssq::Exception(m_vm.getHandle(), "Couldn't get thread weakref from vm"); } entry.wakeup_time = time; entry.skippable = skippable; - sq_addref(m_vm.get_vm(), & entry.thread_ref); - sq_pop(m_vm.get_vm(), 2); + sq_addref(m_vm.getHandle(), & entry.thread_ref); + sq_pop(m_vm.getHandle(), 2); schedule.push_back(entry); std::push_heap(schedule.begin(), schedule.end()); + + return sq_suspendvm(scheduled_vm); } /* EOF */ diff --git a/src/squirrel/squirrel_scheduler.hpp b/src/squirrel/squirrel_scheduler.hpp index 548584ac56e..728f3d11854 100644 --- a/src/squirrel/squirrel_scheduler.hpp +++ b/src/squirrel/squirrel_scheduler.hpp @@ -19,23 +19,23 @@ #include -#include - -class SquirrelVM; +#include /** This class keeps a list of squirrel threads that are scheduled for a certain time. (the typical result of a wait() command in a squirrel script) */ class SquirrelScheduler final { public: - SquirrelScheduler(SquirrelVM& vm); + SquirrelScheduler(ssq::VM& vm); /** time must be absolute time, not relative updates, i.e. g_game_time */ void update(float time); - void schedule_thread(HSQUIRRELVM vm, float time, bool skippable); + + SQInteger schedule_thread(HSQUIRRELVM vm, float time, bool skippable); private: - struct ScheduleEntry { + struct ScheduleEntry final + { /// weak reference to the squirrel vm object HSQOBJECT thread_ref; /// time when the thread should be woken up @@ -51,7 +51,7 @@ class SquirrelScheduler final }; private: - SquirrelVM& m_vm; + ssq::VM& m_vm; typedef std::vector ScheduleHeap; ScheduleHeap schedule; diff --git a/src/squirrel/squirrel_thread_queue.cpp b/src/squirrel/squirrel_thread_queue.cpp index a06ae9936a3..a06dbaf8800 100644 --- a/src/squirrel/squirrel_thread_queue.cpp +++ b/src/squirrel/squirrel_thread_queue.cpp @@ -16,32 +16,36 @@ #include "squirrel/squirrel_thread_queue.hpp" -#include "squirrel/squirrel_virtual_machine.hpp" +#include + #include "squirrel/squirrel_util.hpp" +#include "squirrel/squirrel_virtual_machine.hpp" #include "util/log.hpp" -SquirrelThreadQueue::SquirrelThreadQueue(SquirrelVM& vm) : +SquirrelThreadQueue::SquirrelThreadQueue(ssq::VM& vm) : m_vm(vm), m_threads() { } -void +SQInteger SquirrelThreadQueue::add(HSQUIRRELVM vm) { // create a weakref to the VM - sq_pushthread(m_vm.get_vm(), vm); - sq_weakref(m_vm.get_vm(), -1); + sq_pushthread(m_vm.getHandle(), vm); + sq_weakref(m_vm.getHandle(), -1); HSQOBJECT object; - if (SQ_FAILED(sq_getstackobj(m_vm.get_vm(), -1, &object))) { - sq_pop(m_vm.get_vm(), 2); - throw SquirrelError(m_vm.get_vm(), "Couldn't get thread weakref from vm"); + if (SQ_FAILED(sq_getstackobj(m_vm.getHandle(), -1, &object))) + { + sq_pop(m_vm.getHandle(), 2); + throw ssq::RuntimeException(m_vm.getHandle(), "Couldn't get thread weakref from VM!"); } - sq_addref(m_vm.get_vm(), &object); + sq_addref(m_vm.getHandle(), &object); m_threads.push_back(object); - sq_pop(m_vm.get_vm(), 2); + sq_pop(m_vm.getHandle(), 2); + return sq_suspendvm(vm); } void @@ -52,20 +56,20 @@ SquirrelThreadQueue::wakeup() for (HSQOBJECT& object : threads) { - sq_pushobject(m_vm.get_vm(), object); - sq_getweakrefval(m_vm.get_vm(), -1); + sq_pushobject(m_vm.getHandle(), object); + sq_getweakrefval(m_vm.getHandle(), -1); HSQUIRRELVM scheduled_vm; - if (sq_gettype(m_vm.get_vm(), -1) == OT_THREAD && - SQ_SUCCEEDED(sq_getthread(m_vm.get_vm(), -1, &scheduled_vm))) + if (sq_gettype(m_vm.getHandle(), -1) == OT_THREAD && + SQ_SUCCEEDED(sq_getthread(m_vm.getHandle(), -1, &scheduled_vm))) { if (SQ_FAILED(sq_wakeupvm(scheduled_vm, SQFalse, SQFalse, SQTrue, SQFalse))) { log_warning << "Couldn't wakeup scheduled squirrel VM" << std::endl; } } - sq_release(m_vm.get_vm(), &object); - sq_pop(m_vm.get_vm(), 1); + sq_release(m_vm.getHandle(), &object); + sq_pop(m_vm.getHandle(), 1); } } diff --git a/src/squirrel/squirrel_thread_queue.hpp b/src/squirrel/squirrel_thread_queue.hpp index 275418d01cf..7793712f380 100644 --- a/src/squirrel/squirrel_thread_queue.hpp +++ b/src/squirrel/squirrel_thread_queue.hpp @@ -17,27 +17,26 @@ #ifndef HEADER_SUPERTUX_SQUIRREL_SQUIRREL_THREAD_QUEUE_HPP #define HEADER_SUPERTUX_SQUIRREL_SQUIRREL_THREAD_QUEUE_HPP -#include #include -#include "squirrel/squirrel_util.hpp" +#include -class SquirrelVM; +#include "squirrel/squirrel_util.hpp" /** Keeps a list of SquirrelThreads that wait for a wakeup event */ class SquirrelThreadQueue final { public: - SquirrelThreadQueue(SquirrelVM& vm); + SquirrelThreadQueue(ssq::VM& vm); /** adds a thread (actually a weakref to the thread) */ - void add(HSQUIRRELVM vm); + SQInteger add(HSQUIRRELVM vm); /** wakes up threads in the list */ void wakeup(); private: - SquirrelVM& m_vm; + ssq::VM& m_vm; SquirrelObjectList m_threads; private: diff --git a/src/squirrel/squirrel_util.cpp b/src/squirrel/squirrel_util.cpp index 084c1a5b7a3..70b760fe6ac 100644 --- a/src/squirrel/squirrel_util.cpp +++ b/src/squirrel/squirrel_util.cpp @@ -16,122 +16,88 @@ #include "squirrel/squirrel_util.hpp" -#include +#include +#include -#include -#include -#include -#include -#include -#include - -#include "squirrel/script_interface.hpp" -#include "supertux/game_object.hpp" -#include "util/log.hpp" - -std::string squirrel2string(HSQUIRRELVM v, SQInteger i) +std::string squirrel_to_string(const ssq::Object& object) { std::ostringstream os; - switch (sq_gettype(v, i)) + switch (object.getType()) { - case OT_NULL: + case ssq::Type::NULLPTR: os << ""; break; - case OT_BOOL: { - SQBool p; - if (SQ_SUCCEEDED(sq_getbool(v, i, &p))) { - if (p) - os << "true"; - else - os << "false"; - } + case ssq::Type::BOOL: + os << object.toBool(); break; - } - case OT_INTEGER: { - SQInteger val; - sq_getinteger(v, i, &val); - os << val; + case ssq::Type::INTEGER: + os << object.to(); break; - } - case OT_FLOAT: { - SQFloat val; - sq_getfloat(v, i, &val); - os << val; + case ssq::Type::FLOAT: + os << object.toFloat(); break; - } - case OT_STRING: { - const SQChar* val; - sq_getstring(v, i, &val); - os << "\"" << val << "\""; + case ssq::Type::STRING: + os << "\"" << object.toString() << "\""; break; - } - case OT_TABLE: { + case ssq::Type::TABLE: + { + const std::map table = object.toTable().convertRaw(); + bool first = true; os << "{"; - sq_pushnull(v); //null iterator - while (SQ_SUCCEEDED(sq_next(v,i-1))) + for (const auto& [key, value] : table) { - if (!first) { + if (!first) os << ", "; - } first = false; - //here -1 is the value and -2 is the key - os << squirrel2string(v, -2) << " => " - << squirrel2string(v, -1); - - sq_pop(v,2); //pops key and val before the nex iteration + os << key << " => " << squirrel_to_string(value); } - sq_pop(v, 1); os << "}"; break; } - case OT_ARRAY: { + case ssq::Type::ARRAY: + { + const std::vector array = object.toArray().convertRaw(); + bool first = true; os << "["; - sq_pushnull(v); //null iterator - while (SQ_SUCCEEDED(sq_next(v,i-1))) + for (const ssq::Object& value : array) { - if (!first) { + if (!first) os << ", "; - } first = false; - //here -1 is the value and -2 is the key - // we ignore the key, since that is just the index in an array - os << squirrel2string(v, -1); - - sq_pop(v,2); //pops key and val before the nex iteration + os << squirrel_to_string(value); } - sq_pop(v, 1); os << "]"; break; } - case OT_USERDATA: + case ssq::Type::USERDATA: os << ""; break; - case OT_CLOSURE: + case ssq::Type::CLOSURE: os << ""; break; - case OT_NATIVECLOSURE: + case ssq::Type::NATIVECLOSURE: os << ""; break; - case OT_GENERATOR: + case ssq::Type::GENERATOR: os << ""; break; - case OT_USERPOINTER: + case ssq::Type::USERPOINTER: os << "userpointer"; break; - case OT_THREAD: + case ssq::Type::THREAD: os << ""; break; - case OT_CLASS: + case ssq::Type::CLASS: os << ""; break; - case OT_INSTANCE: + case ssq::Type::INSTANCE: os << ""; break; - case OT_WEAKREF: + case ssq::Type::WEAKREF: os << ""; break; default: @@ -141,120 +107,4 @@ std::string squirrel2string(HSQUIRRELVM v, SQInteger i) return os.str(); } -void print_squirrel_stack(HSQUIRRELVM v) -{ - printf("--------------------------------------------------------------\n"); - SQInteger count = sq_gettop(v); - for (int i = 1; i <= count; ++i) { - printf("%d: ",i); - switch (sq_gettype(v, i)) - { - case OT_NULL: - printf("null"); - break; - case OT_INTEGER: { - SQInteger val; - sq_getinteger(v, i, &val); - printf("integer (%d)", static_cast(val)); - break; - } - case OT_FLOAT: { - SQFloat val; - sq_getfloat(v, i, &val); - printf("float (%f)", static_cast(val)); - break; - } - case OT_STRING: { - const SQChar* val; - sq_getstring(v, i, &val); - printf("string (%s)", val); - break; - } - case OT_TABLE: - printf("table"); - break; - case OT_ARRAY: - printf("array"); - break; - case OT_USERDATA: - printf("userdata"); - break; - case OT_CLOSURE: - printf("closure(function)"); - break; - case OT_NATIVECLOSURE: - printf("native closure(C function)"); - break; - case OT_GENERATOR: - printf("generator"); - break; - case OT_USERPOINTER: - printf("userpointer"); - break; - case OT_THREAD: - printf("thread"); - break; - case OT_CLASS: - printf("class"); - break; - case OT_INSTANCE: - printf("instance"); - break; - case OT_WEAKREF: - printf("weakref"); - break; - default: - printf("unknown?!?"); - break; - } - printf("\n"); - } - printf("--------------------------------------------------------------\n"); -} - -SQInteger squirrel_read_char(SQUserPointer file) -{ - std::istream* in = reinterpret_cast (file); - int c = in->get(); - if (in->eof()) - return 0; - return c; -} - -void compile_script(HSQUIRRELVM vm, std::istream& in, const std::string& sourcename) -{ - if (SQ_FAILED(sq_compile(vm, squirrel_read_char, &in, sourcename.c_str(), true))) - throw SquirrelError(vm, "Couldn't parse script"); -} - -void compile_and_run(HSQUIRRELVM vm, std::istream& in, - const std::string& sourcename) -{ - compile_script(vm, in, sourcename); - - SQInteger oldtop = sq_gettop(vm); - - try { - sq_pushroottable(vm); - if (SQ_FAILED(sq_call(vm, 1, SQFalse, SQTrue))) - throw SquirrelError(vm, "Couldn't start script"); - } catch(...) { - sq_settop(vm, oldtop); - throw; - } - - // we can remove the closure in case the script was not suspended - if (sq_getvmstate(vm) != SQ_VMSTATE_SUSPENDED) { - sq_settop(vm, oldtop-1); - } -} - -HSQUIRRELVM object_to_vm(const HSQOBJECT& object) -{ - if (object._type != OT_THREAD) - return nullptr; - - return object._unVal.pThread; -} - /* EOF */ diff --git a/src/squirrel/squirrel_util.hpp b/src/squirrel/squirrel_util.hpp index f2daf53d6dd..b6e4e5cd7ba 100644 --- a/src/squirrel/squirrel_util.hpp +++ b/src/squirrel/squirrel_util.hpp @@ -17,63 +17,18 @@ #ifndef HEADER_SUPERTUX_SQUIRREL_SQUIRREL_UTIL_HPP #define HEADER_SUPERTUX_SQUIRREL_SQUIRREL_UTIL_HPP -#include -#include -#include -#include +#include #include -#include "squirrel/squirrel_virtual_machine.hpp" -#include "squirrel/squirrel_error.hpp" -#include "scripting/wrapper.hpp" +#include -typedef std::vector SquirrelObjectList; - -std::string squirrel2string(HSQUIRRELVM vm, SQInteger i); -void print_squirrel_stack(HSQUIRRELVM vm); - -SQInteger squirrel_read_char(SQUserPointer file); - -HSQUIRRELVM object_to_vm(const HSQOBJECT& object); - -void compile_script(HSQUIRRELVM vm, std::istream& in, - const std::string& sourcename); -void compile_and_run(HSQUIRRELVM vm, std::istream& in, - const std::string& sourcename); +namespace ssq { +class Object; +} // namespace ssq -template -void expose_object(HSQUIRRELVM vm, SQInteger table_idx, - std::unique_ptr object, const std::string& name) -{ - sq_pushstring(vm, name.c_str(), -1); - scripting::create_squirrel_instance(vm, object.release(), true); - - if (table_idx < 0) - table_idx -= 2; - - // register instance in root table - if (SQ_FAILED(sq_createslot(vm, table_idx))) { - std::ostringstream msg; - msg << "Couldn't register object '" << name << "' in squirrel table"; - throw SquirrelError(vm, msg.str()); - } -} - -static inline void unexpose_object(HSQUIRRELVM vm, SQInteger table_idx, - const std::string& name) -{ - assert(name.length() < static_cast(std::numeric_limits::max())); - sq_pushstring(vm, name.c_str(), static_cast(name.length())); - - if (table_idx < 0) - table_idx -= 1; +typedef std::vector SquirrelObjectList; - if (SQ_FAILED(sq_deleteslot(vm, table_idx, SQFalse))) { - std::ostringstream msg; - msg << "Couldn't unregister object '" << name << "' in squirrel root table"; - throw SquirrelError(vm, msg.str()); - } -} +std::string squirrel_to_string(const ssq::Object& object); #endif diff --git a/src/squirrel/squirrel_virtual_machine.cpp b/src/squirrel/squirrel_virtual_machine.cpp index bbc25980135..f2d5ac25941 100644 --- a/src/squirrel/squirrel_virtual_machine.cpp +++ b/src/squirrel/squirrel_virtual_machine.cpp @@ -16,20 +16,15 @@ #include "squirrel/squirrel_virtual_machine.hpp" -#include -#include -#include -#include #include #include #include #include "physfs/ifile_stream.hpp" -#include "scripting/wrapper.hpp" -#include "squirrel/squirrel_error.hpp" -#include "squirrel/squirrel_thread_queue.hpp" #include "squirrel/squirrel_scheduler.hpp" -#include "squirrel_util.hpp" +#include "squirrel/squirrel_thread_queue.hpp" +#include "squirrel/squirrel_util.hpp" +#include "squirrel/supertux_api.hpp" #include "supertux/console.hpp" #include "supertux/globals.hpp" #include "util/log.hpp" @@ -41,12 +36,10 @@ HSQREMOTEDBG debugger = nullptr; } // namespace #endif -namespace { - #ifdef __clang__ __attribute__((__format__ (__printf__, 2, 0))) #endif -void printfunc(HSQUIRRELVM, const char* fmt, ...) +static void printFunc(HSQUIRRELVM, const char* fmt, ...) { char buf[4096]; const char separator[] = "\n"; @@ -62,69 +55,60 @@ void printfunc(HSQUIRRELVM, const char* fmt, ...) va_end(arglist); } -} // namespace +static const char* DEFAULT_SCRIPT_FILE = "scripts/default.nut"; SquirrelVirtualMachine::SquirrelVirtualMachine(bool enable_debugger) : - m_vm(), + m_vm(64, ssq::Libs::BLOB | ssq::Libs::MATH | ssq::Libs::STRING), m_screenswitch_queue(), m_scheduler() { - sq_setsharedforeignptr(m_vm.get_vm(), this); + m_vm.setForeignPtr(this); m_screenswitch_queue = std::make_unique(m_vm); m_scheduler = std::make_unique(m_vm); if (enable_debugger) { #ifdef ENABLE_SQDBG - sq_enabledebuginfo(m_vm.get_vm(), SQTrue); - debugger = sq_rdbg_init(m_vm.get_vm(), 1234, SQFalse); + sq_enabledebuginfo(m_vm.getHandle(), SQTrue); + debugger = sq_rdbg_init(m_vm.getHandle(), 1234, SQFalse); if (debugger == nullptr) - throw SquirrelError(m_vm.get_vm(), "Couldn't initialize squirrel debugger"); + throw ssq::Exception(m_vm.getHandle(), "Couldn't initialize squirrel debugger"); - sq_enabledebuginfo(m_vm.get_vm(), SQTrue); + sq_enabledebuginfo(m_vm.getHandle(), SQTrue); log_info << "Waiting for debug client..." << std::endl; if (SQ_FAILED(sq_rdbg_waitforconnections(debugger))) - throw SquirrelError(m_vm.get_vm(), "Waiting for debug clients failed"); + throw ssq::Exception(m_vm.getHandle(), "Waiting for debug clients failed"); log_info << "debug client connected." << std::endl; #endif } - sq_pushroottable(m_vm.get_vm()); - if (SQ_FAILED(sqstd_register_bloblib(m_vm.get_vm()))) - throw SquirrelError(m_vm.get_vm(), "Couldn't register blob lib"); - if (SQ_FAILED(sqstd_register_mathlib(m_vm.get_vm()))) - throw SquirrelError(m_vm.get_vm(), "Couldn't register math lib"); - if (SQ_FAILED(sqstd_register_stringlib(m_vm.get_vm()))) - throw SquirrelError(m_vm.get_vm(), "Couldn't register string lib"); - - // remove rand and srand calls from sqstdmath, we'll provide our own - m_vm.delete_table_entry("srand"); - m_vm.delete_table_entry("rand"); - - // register supertux API - scripting::register_supertux_wrapper(m_vm.get_vm()); - - sq_pop(m_vm.get_vm(), 1); - - // register print function - sq_setprintfunc(m_vm.get_vm(), printfunc, printfunc); - // register default error handlers - sqstd_seterrorhandlers(m_vm.get_vm()); - - // try to load default script - try { - std::string filename = "scripts/default.nut"; - IFileStream stream(filename); - compile_and_run(m_vm.get_vm(), stream, filename); - } catch(std::exception& e) { - log_warning << "Couldn't load default.nut: " << e.what() << std::endl; + // Set print function. + m_vm.setPrintFunc(&printFunc, &printFunc); + + // Remove rand and srand calls from sqstdmath, we'll provide our own. + m_vm.remove("srand"); + m_vm.remove("rand"); + + // Register SuperTux API. + register_supertux_scripting_api(m_vm); + + // Try to load the default script. + try + { + IFileStream stream(DEFAULT_SCRIPT_FILE); + m_vm.run(m_vm.compileSource(stream, DEFAULT_SCRIPT_FILE)); + } + catch (const std::exception& err) + { + log_warning << "Couldn't load 'default.nut': " << err.what() << std::endl; } } SquirrelVirtualMachine::~SquirrelVirtualMachine() { #ifdef ENABLE_SQDBG - if (debugger != nullptr) { + if (debugger) + { sq_rdbg_shutdown(debugger); debugger = nullptr; } @@ -142,27 +126,27 @@ void SquirrelVirtualMachine::update_debugger() { #ifdef ENABLE_SQDBG - if (debugger != nullptr) + if (debugger) sq_rdbg_update(debugger); #endif } -void +SQInteger SquirrelVirtualMachine::wait_for_seconds(HSQUIRRELVM vm, float seconds) { - m_scheduler->schedule_thread(vm, g_game_time + seconds, false); + return m_scheduler->schedule_thread(vm, g_game_time + seconds, false); } -void +SQInteger SquirrelVirtualMachine::skippable_wait_for_seconds(HSQUIRRELVM vm, float seconds) { - m_scheduler->schedule_thread(vm, g_game_time + seconds, true); + return m_scheduler->schedule_thread(vm, g_game_time + seconds, true); } -void +SQInteger SquirrelVirtualMachine::wait_for_screenswitch(HSQUIRRELVM vm) { - m_screenswitch_queue->add(vm); + return m_screenswitch_queue->add(vm); } void diff --git a/src/squirrel/squirrel_virtual_machine.hpp b/src/squirrel/squirrel_virtual_machine.hpp index 3e7406aeae2..01e67cd0a33 100644 --- a/src/squirrel/squirrel_virtual_machine.hpp +++ b/src/squirrel/squirrel_virtual_machine.hpp @@ -19,9 +19,8 @@ #include -#include +#include -#include "squirrel/squirrel_vm.hpp" #include "util/currenton.hpp" class SquirrelThreadQueue; @@ -33,23 +32,23 @@ class SquirrelVirtualMachine final : public Currenton SquirrelVirtualMachine(bool enable_debugger); ~SquirrelVirtualMachine() override; - SquirrelVM& get_vm() { return m_vm; } + ssq::VM& get_vm() { return m_vm; } - void wait_for_seconds(HSQUIRRELVM vm, float seconds); - void skippable_wait_for_seconds(HSQUIRRELVM vm, float seconds); + SQInteger wait_for_seconds(HSQUIRRELVM vm, float seconds); + SQInteger skippable_wait_for_seconds(HSQUIRRELVM vm, float seconds); void update(float dt_sec); /** adds thread waiting for a screen switch event */ - void wait_for_screenswitch(HSQUIRRELVM vm); + SQInteger wait_for_screenswitch(HSQUIRRELVM vm); /** wakes up threads waiting for a screen switch event */ void wakeup_screenswitch(); private: - void update_debugger(); + void update_debugger(); private: - SquirrelVM m_vm; + ssq::VM m_vm; std::unique_ptr m_screenswitch_queue; std::unique_ptr m_scheduler; diff --git a/src/squirrel/squirrel_vm.cpp b/src/squirrel/squirrel_vm.cpp deleted file mode 100644 index 3be4bf85d5d..00000000000 --- a/src/squirrel/squirrel_vm.cpp +++ /dev/null @@ -1,324 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// 2018 Ingo Ruhnke -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "squirrel/squirrel_vm.hpp" - -#include - -#include "squirrel/squirrel_error.hpp" -#include "squirrel/squirrel_util.hpp" - -SquirrelVM::SquirrelVM() : - m_vm(sq_open(64)) -{ - if (m_vm == nullptr) - throw std::runtime_error("Couldn't initialize squirrel vm"); -} - -SquirrelVM::~SquirrelVM() -{ -#ifdef ENABLE_SQDBG - if (debugger != nullptr) { - sq_rdbg_shutdown(debugger); - debugger = nullptr; - } -#endif - - sq_close(m_vm); -} - -void -SquirrelVM::begin_table(const char* name) -{ - sq_pushstring(m_vm, name, -1); - sq_newtable(m_vm); -} - -void -SquirrelVM::end_table(const char* name) -{ - if (SQ_FAILED(sq_createslot(m_vm, -3))) - throw SquirrelError(m_vm, "Failed to create '" + std::string(name) + "' table entry"); -} - -void -SquirrelVM::create_empty_table(const char* name) -{ - begin_table(name); - end_table(name); -} - -bool -SquirrelVM::has_property(const char* name) -{ - sq_pushstring(m_vm, name, -1); - if (SQ_FAILED(sq_get(m_vm, -2))) return false; - sq_pop(m_vm, 1); - return true; -} - -void -SquirrelVM::store_bool(const char* name, bool val) -{ - sq_pushstring(m_vm, name, -1); - sq_pushbool(m_vm, val ? SQTrue : SQFalse); - if (SQ_FAILED(sq_createslot(m_vm, -3))) - throw SquirrelError(m_vm, "Couldn't add float value to table"); -} - -void -SquirrelVM::store_int(const char* name, int val) -{ - sq_pushstring(m_vm, name, -1); - sq_pushinteger(m_vm, val); - if (SQ_FAILED(sq_createslot(m_vm, -3))) - throw SquirrelError(m_vm, "Couldn't add int value to table"); -} - -void -SquirrelVM::store_float(const char* name, float val) -{ - sq_pushstring(m_vm, name, -1); - sq_pushfloat(m_vm, val); - if (SQ_FAILED(sq_createslot(m_vm, -3))) - throw SquirrelError(m_vm, "Couldn't add float value to table"); -} - -void -SquirrelVM::store_string(const char* name, const std::string& val) -{ - sq_pushstring(m_vm, name, -1); - sq_pushstring(m_vm, val.c_str(), val.length()); - if (SQ_FAILED(sq_createslot(m_vm, -3))) - throw SquirrelError(m_vm, "Couldn't add float value to table"); -} - -void -SquirrelVM::store_object(const char* name, const HSQOBJECT& val) -{ - sq_pushstring(m_vm, name, -1); - sq_pushobject(m_vm, val); - if (SQ_FAILED(sq_createslot(m_vm, -3))) - throw SquirrelError(m_vm, "Couldn't add object value to table"); -} - -bool -SquirrelVM::get_bool(const char* name, bool& val) -{ - if (!has_property(name)) return false; - val = read_bool(name); - return true; -} - -bool -SquirrelVM::get_int(const char* name, int& val) -{ - if (!has_property(name)) return false; - val = read_int(name); - return true; -} - -bool -SquirrelVM::get_float(const char* name, float& val) -{ - if (!has_property(name)) return false; - val = read_float(name); - return true; -} - -bool -SquirrelVM::get_string(const char* name, std::string& val) -{ - if (!has_property(name)) return false; - val = read_string(name); - return true; -} - -bool -SquirrelVM::read_bool(const char* name) -{ - get_table_entry(name); - - SQBool result; - if (SQ_FAILED(sq_getbool(m_vm, -1, &result))) { - std::ostringstream msg; - msg << "Couldn't get bool value for '" << name << "' from table"; - throw SquirrelError(m_vm, msg.str()); - } - sq_pop(m_vm, 1); - - return result == SQTrue; -} - -int -SquirrelVM::read_int(const char* name) -{ - get_table_entry(name); - - SQInteger result; - if (SQ_FAILED(sq_getinteger(m_vm, -1, &result))) { - std::ostringstream msg; - msg << "Couldn't get int value for '" << name << "' from table"; - throw SquirrelError(m_vm, msg.str()); - } - sq_pop(m_vm, 1); - - return static_cast(result); -} - -float -SquirrelVM::read_float(const char* name) -{ - get_table_entry(name); - - float result; - if (SQ_FAILED(sq_getfloat(m_vm, -1, &result))) { - std::ostringstream msg; - msg << "Couldn't get float value for '" << name << "' from table"; - throw SquirrelError(m_vm, msg.str()); - } - sq_pop(m_vm, 1); - - return result; -} - -std::string -SquirrelVM::read_string(const char* name) -{ - get_table_entry(name); - - const char* result; - if (SQ_FAILED(sq_getstring(m_vm, -1, &result))) { - std::ostringstream msg; - msg << "Couldn't get string value for '" << name << "' from table"; - throw SquirrelError(m_vm, msg.str()); - } - sq_pop(m_vm, 1); - - return std::string(result); -} - -void -SquirrelVM::get_table_entry(const std::string& name) -{ - sq_pushstring(m_vm, name.c_str(), -1); - if (SQ_FAILED(sq_get(m_vm, -2))) - { - std::ostringstream msg; - msg << "failed to get '" << name << "' table entry"; - throw SquirrelError(m_vm, msg.str()); - } - else - { - // successfully placed result on stack - } -} - -void -SquirrelVM::get_or_create_table_entry(const std::string& name) -{ - try - { - get_table_entry(name); - } - catch(std::exception&) - { - create_empty_table(name.c_str()); - get_table_entry(name); - } -} - -void -SquirrelVM::delete_table_entry(const char* name) -{ - sq_pushstring(m_vm, name, -1); - if (SQ_FAILED(sq_deleteslot(m_vm, -2, false))) - { - // Something failed while deleting the table entry. - // Key doesn't exist? - } -} - -void -SquirrelVM::rename_table_entry(const char* oldname, const char* newname) -{ - SQInteger oldtop = sq_gettop(m_vm); - - // push key - sq_pushstring(m_vm, newname, -1); - - // push value and delete old oldname - sq_pushstring(m_vm, oldname, -1); - if (SQ_FAILED(sq_deleteslot(m_vm, oldtop, SQTrue))) { - sq_settop(m_vm, oldtop); - throw SquirrelError(m_vm, "Couldn't find 'oldname' entry in table"); - } - - // create new entry - sq_createslot(m_vm, -3); - - sq_settop(m_vm, oldtop); -} - -std::vector -SquirrelVM::get_table_keys() -{ - auto old_top = sq_gettop(m_vm); - std::vector keys; - - sq_pushnull(m_vm); - while (SQ_SUCCEEDED(sq_next(m_vm, -2))) - { - //here -1 is the value and -2 is the key - const char* result; - if (SQ_FAILED(sq_getstring(m_vm, -2, &result))) - { - throw SquirrelError(m_vm, "Couldn't get string value for key"); - } - else - { - keys.push_back(result); - } - - // pops key and val before the next iteration - sq_pop(m_vm, 2); - } - - sq_settop(m_vm, old_top); - - return keys; -} - -HSQOBJECT -SquirrelVM::create_thread() -{ - HSQUIRRELVM new_vm = sq_newthread(m_vm, 64); - if (new_vm == nullptr) - throw SquirrelError(m_vm, "Couldn't create new VM"); - - HSQOBJECT vm_object; - sq_resetobject(&vm_object); - if (SQ_FAILED(sq_getstackobj(m_vm, -1, &vm_object))) - throw SquirrelError(m_vm, "Couldn't get squirrel thread from stack"); - sq_addref(m_vm, &vm_object); - - sq_pop(m_vm, 1); - - return vm_object; -} - -/* EOF */ diff --git a/src/squirrel/squirrel_vm.hpp b/src/squirrel/squirrel_vm.hpp deleted file mode 100644 index 58718bd2623..00000000000 --- a/src/squirrel/squirrel_vm.hpp +++ /dev/null @@ -1,81 +0,0 @@ -// SuperTux -// Copyright (C) 2006 Matthias Braun -// 2018 Ingo Ruhnke -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_SQUIRREL_SQUIRREL_VM_HPP -#define HEADER_SUPERTUX_SQUIRREL_SQUIRREL_VM_HPP - -#include -#include - -#include - -/** Basic wrapper around HSQUIRRELVM with some utility functions, not - to be confused with SquirrelVirtualMachine. The classes might be - merged in the future. */ -class SquirrelVM -{ -public: - SquirrelVM(); - ~SquirrelVM(); - - HSQUIRRELVM get_vm() const { return m_vm; } - - void begin_table(const char* name); - void end_table(const char* name); - - /** Creates an empty table with given name - @param vm VM to create table on - @param name Name of the table to create */ - void create_empty_table(const char* name); - - bool has_property(const char* name); - - void store_bool(const char* name, bool val); - void store_int(const char* name, int val); - void store_float(const char* name, float val); - void store_string(const char* name, const std::string& val); - void store_object(const char* name, const HSQOBJECT& val); - - bool get_bool(const char* name, bool& val); - bool get_int(const char* name, int& val); - bool get_float(const char* name, float& val); - bool get_string(const char* name, std::string& val); - - bool read_bool(const char* name); - int read_int(const char* name); - float read_float(const char* name); - std::string read_string(const char* name); - - void get_table_entry(const std::string& name); - void get_or_create_table_entry(const std::string& name); - void delete_table_entry(const char* name); - void rename_table_entry(const char* oldname, const char* newname); - std::vector get_table_keys(); - - HSQOBJECT create_thread(); - -private: - HSQUIRRELVM m_vm; - -private: - SquirrelVM(const SquirrelVM&) = delete; - SquirrelVM& operator=(const SquirrelVM&) = delete; -}; - -#endif - -/* EOF */ diff --git a/src/squirrel/supertux_api.cpp b/src/squirrel/supertux_api.cpp new file mode 100644 index 00000000000..13379b92d17 --- /dev/null +++ b/src/squirrel/supertux_api.cpp @@ -0,0 +1,877 @@ +// SuperTux +// Copyright (C) 2024 Vankata453 +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include "squirrel/supertux_api.hpp" + +#include +#include +#include + +#include "audio/sound_manager.hpp" +#include "math/anchor_point.hpp" +#include "math/random.hpp" +#include "object/camera.hpp" +#include "object/player.hpp" +#include "physfs/ifile_stream.hpp" +#include "squirrel/squirrel_virtual_machine.hpp" +#include "supertux/console.hpp" +#include "supertux/debug.hpp" +#include "supertux/d_scope.hpp" +#include "supertux/flip_level_transformer.hpp" +#include "supertux/game_manager.hpp" +#include "supertux/game_object_factory.hpp" +#include "supertux/game_session.hpp" +#include "supertux/gameconfig.hpp" +#include "supertux/globals.hpp" +#include "supertux/level.hpp" +#include "supertux/screen_manager.hpp" +#include "supertux/sector.hpp" +#include "supertux/textscroller_screen.hpp" +#include "supertux/title_screen.hpp" +#include "worldmap/worldmap.hpp" + +namespace scripting { + +/** + * @scripting + * @summary This module contains global methods. + */ +namespace Globals { + +/** + * @scripting + * @description Displays the value of an argument. This is useful for inspecting tables. + * @param ANY $object + */ +static void display(const ssq::Object& object) +{ + ConsoleBuffer::output << squirrel_to_string(object) << std::endl; +} +/** + * @scripting + * @description Displays the contents of the current stack. + */ +static void print_stacktrace(HSQUIRRELVM vm) +{ + sqstd_printcallstack(vm); +} +/** + * @scripting + * @description Returns the currently running thread. + * @returns Thread + */ +static SQInteger get_current_thread(HSQUIRRELVM vm) +{ + sq_pushthread(vm, vm); + return 1; +} + +/** + * @scripting + * @description Returns whether the game is in christmas mode. + */ +static bool is_christmas() +{ + return g_config->christmas_mode; +} + +/** + * @scripting + * @description Starts a skippable cutscene. + */ +static void start_cutscene() +{ + auto session = GameSession::current(); + if (session == nullptr) + { + log_info << "No game session" << std::endl; + return; + } + + if (session->get_current_level().m_is_in_cutscene) + { + log_warning << "start_cutscene(): starting a new cutscene above another one, ending preceding cutscene (use end_cutscene() in scripts!)" << std::endl; + + // Remove all sounds that started playing while skipping. + if (session->get_current_level().m_skip_cutscene) + SoundManager::current()->stop_sounds(); + } + + session->get_current_level().m_is_in_cutscene = true; + session->get_current_level().m_skip_cutscene = false; +} +/** + * @scripting + * @description Ends a skippable cutscene. + */ +static void end_cutscene() +{ + auto session = GameSession::current(); + if (session == nullptr) + { + log_info << "No game session." << std::endl; + return; + } + + if (!session->get_current_level().m_is_in_cutscene) + { + log_warning << "end_cutscene(): no cutscene to end, resetting status anyways." << std::endl; + } + + // Remove all sounds that started playing while skipping. + if (session->get_current_level().m_skip_cutscene) + SoundManager::current()->stop_sounds(); + + session->get_current_level().m_is_in_cutscene = false; + session->get_current_level().m_skip_cutscene = false; +} +/** + * @scripting + * @description Checks if a skippable cutscene is currently running. + */ +static bool check_cutscene() +{ + auto session = GameSession::current(); + if (session == nullptr) + { + log_info << "No game session" << std::endl; + return false; + } + + return session->get_current_level().m_is_in_cutscene; +} + +/** + * @scripting + * @description Suspends the script execution for a specified number of seconds. + * @param float $seconds + * @returns void + */ +static SQInteger wait(HSQUIRRELVM vm, float seconds) +{ + ssq::VM* ssq_vm = ssq::VM::get(vm); + if (ssq_vm && !ssq_vm->isThread()) return 0; + + auto session = GameSession::current(); + if (session && session->get_current_level().m_skip_cutscene) + { + if (ssq_vm && ssq_vm->getForeignPtr()) + { + auto squirrelenv = ssq_vm->getForeignPtr(); + // Wait anyways, to prevent scripts like `while (true) {wait(0.1); ...}`. + return squirrelenv->wait_for_seconds(vm, 0); + } + else + { + auto squirrelvm = ssq::VM::getMain(vm).getForeignPtr(); + return squirrelvm->wait_for_seconds(vm, 0); + } + } + else if (session && session->get_current_level().m_is_in_cutscene) + { + if (ssq_vm && ssq_vm->getForeignPtr()) + { + auto squirrelenv = ssq_vm->getForeignPtr(); + // Wait anyways, to prevent scripts like `while (true) {wait(0.1); ...}` from freezing the game. + return squirrelenv->skippable_wait_for_seconds(vm, seconds); + } + else + { + auto squirrelvm = ssq::VM::getMain(vm).getForeignPtr(); + return squirrelvm->skippable_wait_for_seconds(vm, seconds); + } + } + else + { + if (ssq_vm && ssq_vm->getForeignPtr()) + { + auto squirrelenv = ssq_vm->getForeignPtr(); + return squirrelenv->wait_for_seconds(vm, seconds); + } + else + { + auto squirrelvm = ssq::VM::getMain(vm).getForeignPtr(); + return squirrelvm->wait_for_seconds(vm, seconds); + } + } +} + +/** + * @scripting + * @description Suspends the script execution until the current screen has been changed. + * @returns void + */ +static SQInteger wait_for_screenswitch(HSQUIRRELVM vm) +{ + auto squirrelvm = ssq::VM::getMain(vm).getForeignPtr(); + return squirrelvm->wait_for_screenswitch(vm); +} +/** + * @scripting + * @description Exits the currently running screen (for example, force exits from worldmap or scrolling text). + */ +static void exit_screen() +{ + ScreenManager::current()->pop_screen(); +} + +/** + * @scripting + * @description Translates a text into the user's language (by looking in the "".po"" files). + * @param string $text + */ +static std::string translate(const std::string& text) +{ + return g_dictionary_manager->get_dictionary().translate(text); +} +#ifdef DOXYGEN_SCRIPTING +/** + * @scripting + * @description Same function as ""translate()"". + * @param string $text + */ +static std::string _(const std::string& text) +{ +} +#endif +/** + * @scripting + * @description Translates a text into the user's language (by looking in the "".po"" files). + Returns ""text"" or ""text_plural"", depending on ""num"" and the locale. + * @param string $text + * @param string $text_plural + * @param int $num + */ +static std::string translate_plural(const std::string& text, const std::string& text_plural, int num) +{ + return g_dictionary_manager->get_dictionary().translate_plural(text, text_plural, num); +} +#ifdef DOXYGEN_SCRIPTING +/** + * @scripting + * @description Same function as ""translate_plural()"". + * @param string $text + * @param string $text_plural + * @param int $num + */ +static std::string __(const std::string& text, const std::string& text_plural, int num) +{ +} +#endif + +/** + * @scripting + * @description Displays a text file and scrolls it over the screen (on next screenswitch). + * @param string $filename + */ +static void display_text_file(const std::string& filename) +{ + ScreenManager::current()->push_screen(std::make_unique(filename)); +} + +/** + * @scripting + * @description Loads and displays a worldmap (on next screenswitch), using the savegame of the current worldmap. + * @param string $filename + * @param string $sector Forced sector to spawn in the worldmap on. Leave empty to use last sector from savegame. + * @param string $spawnpoint Forced spawnpoint to spawn in the worldmap on. Leave empty to use last position from savegame. + */ +static void load_worldmap(const std::string& filename, const std::string& sector, const std::string& spawnpoint) +{ + using namespace worldmap; + + if (!WorldMap::current()) + { + throw std::runtime_error("Can't start Worldmap without active WorldMap"); + } + else + { + WorldMap::current()->change(filename, sector, spawnpoint); + } +} +/** + * @scripting + * @description Switches to a different worldmap after unloading the current one, after ""exit_screen()"" is called. + * @param string $dirname The world directory, where the "worldmap.stwm" file is located. + * @param string $sector Forced sector to spawn in the worldmap on. Leave empty to use last sector from savegame. + * @param string $spawnpoint Forced spawnpoint to spawn in the worldmap on. Leave empty to use last position from savegame. + */ +static void set_next_worldmap(const std::string& dirname, const std::string& sector, const std::string& spawnpoint) +{ + GameManager::current()->set_next_worldmap(dirname, sector, spawnpoint); +} +/** + * @scripting + * @description Loads and displays a level (on next screenswitch), using the savegame of the current level. + * @param string $filename + */ +static void load_level(const std::string& filename) +{ + if (!GameSession::current()) + { + throw std::runtime_error("Can't start level without active level."); + } + else + { + ScreenManager::current()->push_screen(std::make_unique(filename, GameSession::current()->get_savegame())); + } +} + +/** + * @scripting + * @description Loads a script file and executes it. This is typically used to import functions from external files. + * @param string $filename + */ +static void import(HSQUIRRELVM vm, const std::string& filename) +{ + ssq::VM ssq_vm(vm); + + IFileStream in(filename); + ssq_vm.run(ssq_vm.compileSource(in, filename.c_str())); +} + +/** + * @scripting + * @description Enables/disables drawing of collision rectangles. + * @param bool $enable + */ +static void debug_collrects(bool enable) +{ + g_debug.show_collision_rects = enable; +} +/** + * @scripting + * @description Enables/disables drawing of FPS. + * @param bool $enable + */ +static void debug_show_fps(bool enable) +{ + g_config->show_fps = enable; +} +/** + * @scripting + * @description Enables/disables drawing of non-solid layers. + * @param bool $enable + */ +static void debug_draw_solids_only(bool enable) +{ + ::Sector::s_draw_solids_only = enable; +} +/** + * @scripting + * @description Enables/disables drawing of editor images. + * @param bool $enable + */ +static void debug_draw_editor_images(bool enable) +{ + Tile::draw_editor_images = enable; +} +/** + * @scripting + * @description Enables/disables worldmap ghost mode. + * @param bool $enable + */ +static void debug_worldmap_ghost(bool enable) +{ + auto worldmap_sector = worldmap::WorldMapSector::current(); + + if (worldmap_sector == nullptr) + throw std::runtime_error("Can't change ghost mode without active WorldMapSector."); + + auto& tux = worldmap_sector->get_singleton_by_type(); + tux.set_ghost_mode(enable); +} +/** + * @scripting + * @description Sets the game speed to ""speed"". + * @param float $speed + */ +static void set_game_speed(float speed) +{ + if (speed < 0.05f) + { + // Always put a minimum speed above 0 - if the user enabled transitions, + // executing transitions would take an unreaonably long time if we allow + // game speeds like 0.00001. + log_warning << "Cannot set game speed to less than 0.05" << std::endl; + throw std::runtime_error("Cannot set game speed to less than 0.05"); + } + + ::g_debug.set_game_speed_multiplier(speed); +} + +/** + * @scripting + * @description Saves world state to scripting table. + */ +static void save_state() +{ + auto worldmap = worldmap::WorldMap::current(); + + if (!worldmap) + { + throw std::runtime_error("Can't save state without active Worldmap."); + } + else + { + worldmap->save_state(); + } +} +/** + * @scripting + * @description Loads world state from scripting table. + */ +static void load_state() +{ + auto worldmap = worldmap::WorldMap::current(); + + if (!worldmap) + { + throw std::runtime_error("Can't save state without active Worldmap."); + } + else + { + worldmap->load_state(); + } +} + +/** + * @scripting + * @description Changes the music to ""musicfile"". + * @param string $musicfile + */ +static void play_music(const std::string& filename) +{ + SoundManager::current()->play_music(filename); +} +/** + * @scripting + * @description Fades in the music from ""musicfile"" for ""fadetime"" seconds. + * @param string $musicfile + * @param float $fadetime + */ +static void fade_in_music(const std::string& filename, float fadetime) +{ + SoundManager::current()->play_music(filename, fadetime); +} +/** + * @scripting + * @description Fades out the music for ""fadetime"" seconds. + * @param float $fadetime Set to "0" for no fade-out. + */ +static void stop_music(float fadetime) +{ + SoundManager::current()->stop_music(fadetime); +} +/** + * @scripting + * @description Resumes and fades in the music for ""fadetime"" seconds. + * @param float $fadetime Set to "0" for no fade-in. + */ +static void resume_music(float fadetime) +{ + SoundManager::current()->resume_music(fadetime); +} +/** + * @scripting + * @description Pauses the music with a fade-out for ""fadetime"" seconds. + * @param float $fadetime Set to "0" for no fade-out. + */ +static void pause_music(float fadetime) +{ + SoundManager::current()->pause_music(fadetime); +} +/** + * @scripting + * @description Plays ""soundfile"" as a sound. + * @param string $soundfile + */ +static void play_sound(const std::string& filename) +{ + SoundManager::current()->play(filename); +} + +/** + * @scripting + * @description Speeds Tux up. + */ +static void grease() +{ + if (!Sector::current()) return; + // FIXME: This only has effect on the first player. + ::Player& tux = *(::Sector::get().get_players()[0]); // scripting::Player != ::Player + tux.get_physic().set_velocity_x(tux.get_physic().get_velocity_x()*3); +} +/** + * @scripting + * @description Makes Tux invincible for 10000 units of time. + */ +static void invincible() +{ + if (!Sector::current()) return; + // FIXME: This only has effect on the first player. + ::Player& tux = *(::Sector::get().get_players()[0]); + tux.m_invincible_timer.start(10000); +} +/** + * @scripting + * @description Makes Tux a ghost, i.e. lets him float around and through solid objects. + */ +static void ghost() +{ + if (!Sector::current()) return; + // FIXME: This only has effect on the first player. + ::Player& tux = *(::Sector::get().get_players()[0]); + tux.set_ghost_mode(true); +} +/** + * @scripting + * @description Recalls Tux's invincibility and ghost status. + */ +static void mortal() +{ + if (!Sector::current()) return; + // FIXME: This only has effect on the first player. + ::Player& tux = *(::Sector::get().get_players()[0]); + tux.m_invincible_timer.stop(); + tux.set_ghost_mode(false); +} +/** + * @scripting + * @description Re-initializes and respawns Tux at the beginning of the current level. + */ +static void restart() +{ + auto session = GameSession::current(); + if (session == nullptr) + { + log_info << "No game session." << std::endl; + return; + } + session->reset_button = true; +} +/** + * @scripting + * @description Moves Tux near the end of the current level. + */ +static void gotoend() +{ + if (!Sector::current()) return; + // FIXME: This only has effect on the first player. + ::Player& tux = *(::Sector::get().get_players()[0]); + tux.set_pos(Vector((::Sector::get().get_width()) - (static_cast(SCREEN_WIDTH) * 2.0f), 0)); + ::Sector::get().get_camera().reset( + Vector(tux.get_pos().x, tux.get_pos().y)); +} +/** + * @scripting + * @description Moves Tux to the X and Y blocks, relative to his position. + * @param float $offset_x + * @param float $offset_y + */ +static void warp(float offset_x, float offset_y) +{ + if (!Sector::current()) return; + // FIXME: This only has effect on the first player. + ::Player& tux = *(::Sector::get().get_players()[0]); + tux.set_pos(Vector(tux.get_pos().x + (offset_x*32), tux.get_pos().y - (offset_y*32))); + ::Sector::get().get_camera().reset( + Vector(tux.get_pos().x, tux.get_pos().y)); +} + +/** + * @scripting + * @description Adjusts the gamma. + * @param float $gamma + */ +static void set_gamma(float gamma) +{ + VideoSystem::current()->set_gamma(gamma); +} + +/** + * @scripting + * @description Returns a random integer. + */ +static int rand() +{ + return gameRandom.rand(); +} + +/** + * @scripting + * @description Sets the frame, displayed on the title screen. + * @param string $image + */ +static void set_title_frame(const std::string& image) +{ + auto title_screen = TitleScreen::current(); + if (!title_screen) + { + log_info << "No title screen loaded." << std::endl; + return; + } + title_screen->set_frame(image); +} + +} // namespace Globals + + +/** + * @scripting + * @summary The ""Level"" table provides basic controlling functions for the current level. + * @scope global + */ +namespace Level { + +/** + * @scripting + * @description Ends the current level. + * @param bool $win If ""true"", the level is marked as completed if launched from a worldmap. + */ +static void finish(bool win) +{ + if (!GameSession::current()) return; + GameSession::current()->finish(win); +} +/** + * @scripting + * @description Returns whether an end sequence has started. (AKA when the stats at the end are visible) + */ +static bool has_active_sequence() +{ + if (!GameSession::current()) return false; + return GameSession::current()->has_active_sequence(); +} + +/** + * @scripting + * @description Respawns Tux in sector named ""sector"" at spawnpoint named ""spawnpoint"".${SRG_TABLENEWPARAGRAPH} + Exceptions: If ""sector"" or ""spawnpoint"" are empty, or the specified sector does not exist, the function will bail out the first chance it gets. + If the specified spawnpoint doesn't exist, Tux will be spawned at the spawnpoint named “main”. + If that spawnpoint doesn't exist either, Tux will simply end up at the origin (top-left 0, 0). + * @param string $sector + * @param string $spawnpoint + */ +static void spawn(const std::string& sector, const std::string& spawnpoint) +{ + if (!GameSession::current()) return; + GameSession::current()->respawn(sector, spawnpoint); +} + +/** + * @scripting + * @description Respawns Tux in sector named ""sector"" at spawnpoint named ""spawnpoint"" with the given transition ""transition"".${SRG_TABLENEWPARAGRAPH} + Exceptions: If ""sector"" or ""spawnpoint"" are empty, or the specified sector does not exist, the function will bail out the first chance it gets. + If the specified spawnpoint doesn't exist, Tux will be spawned at the spawnpoint named “main”. + If that spawnpoint doesn't exist either, Tux will simply end up at the origin (top-left 0, 0). + * @param string $sector + * @param string $spawnpoint + * @param string $transition Valid transitions are ""circle"" and ""fade"". If any other value is specified, no transition effect is drawn. + */ +static void spawn_transition(const std::string& sector, const std::string& spawnpoint, const std::string& transition) +{ + if (!GameSession::current()) return; + + ScreenFade::FadeType fade_type = ScreenFade::FadeType::NONE; + + if (transition == "fade") + fade_type = ScreenFade::FadeType::FADE; + else if (transition == "circle") + fade_type = ScreenFade::FadeType::CIRCLE; + else + log_warning << "Invalid transition type '" << transition << "'." << std::endl; + + GameSession::current()->respawn_with_fade(sector, spawnpoint, fade_type, {0.0f, 0.0f}, true); +} + +/** + * @scripting + * @description Sets the default start spawnpoint of the level. + * @param string $sector + * @param string $spawnpoint + */ +static void set_start_point(const std::string& sector, const std::string& spawnpoint) +{ + if (!GameSession::current()) return; + GameSession::current()->set_start_point(sector, spawnpoint); +} +/** + * @scripting + * @description Sets the default start spawn position of the level. + * @param string $sector + * @param float $x + * @param float $y + */ +static void set_start_pos(const std::string& sector, float x, float y) +{ + if (!GameSession::current()) return; + GameSession::current()->set_start_pos(sector, Vector(x, y)); +} +/** + * @scripting + * @description Sets the default respawn spawnpoint of the level. + * @param string $sector + * @param string $spawnpoint + */ +static void set_respawn_point(const std::string& sector, const std::string& spawnpoint) +{ + if (!GameSession::current()) return; + GameSession::current()->set_respawn_point(sector, spawnpoint); +} +/** + * @scripting + * @description Sets the default respawn position of the level. + * @param string $sector + * @param float $x + * @param float $y + */ +static void set_respawn_pos(const std::string& sector, float x, float y) +{ + if (!GameSession::current()) return; + GameSession::current()->set_respawn_pos(sector, Vector(x, y)); +} + +/** + * @scripting + * @description Flips the level vertically (i.e. top is now bottom and vice versa). + Call again to revert the effect. Make sure the player can land on something after the level is flipped! + */ +static void flip_vertically() +{ + if (!GameSession::current()) return; + BIND_SECTOR(::Sector::get()); + FlipLevelTransformer flip_transformer; + flip_transformer.transform(GameSession::current()->get_current_level()); +} + +/** + * @scripting + * @description Toggles pause. + */ +static void toggle_pause() +{ + if (!GameSession::current()) return; + GameSession::current()->toggle_pause(); +} + +/** + * @scripting + * @description Pauses the target timer. + */ +static void pause_target_timer() +{ + if (!GameSession::current()) return; + GameSession::current()->set_target_timer_paused(true); +} +/** + * @scripting + * @description Resumes the target timer. + */ +static void resume_target_timer() +{ + if (!GameSession::current()) return; + GameSession::current()->set_target_timer_paused(false); +} + +} // namespace Level + +} // namespace scripting + + +void register_supertux_scripting_api(ssq::VM& vm) +{ + /* GameObject-s */ + GameObjectFactory::register_objects(vm); + + /* Other classes */ + GameObjectManager::register_class(vm); + Sector::register_class(vm); + worldmap::WorldMapSector::register_class(vm); + + /* Global constants */ + vm.setConst("ANCHOR_TOP_LEFT", AnchorPoint::ANCHOR_TOP_LEFT); + vm.setConst("ANCHOR_TOP", AnchorPoint::ANCHOR_TOP); + vm.setConst("ANCHOR_TOP_RIGHT", AnchorPoint::ANCHOR_TOP_RIGHT); + vm.setConst("ANCHOR_LEFT", AnchorPoint::ANCHOR_LEFT); + vm.setConst("ANCHOR_MIDDLE", AnchorPoint::ANCHOR_MIDDLE); + vm.setConst("ANCHOR_RIGHT", AnchorPoint::ANCHOR_RIGHT); + vm.setConst("ANCHOR_BOTTOM_LEFT", AnchorPoint::ANCHOR_BOTTOM_LEFT); + vm.setConst("ANCHOR_BOTTOM", AnchorPoint::ANCHOR_BOTTOM); + vm.setConst("ANCHOR_BOTTOM_RIGHT", AnchorPoint::ANCHOR_BOTTOM_RIGHT); + + /* Global functions */ + vm.addFunc("display", &scripting::Globals::display); + vm.addFunc("print_stacktrace", &scripting::Globals::print_stacktrace); + vm.addFunc("get_current_thread", &scripting::Globals::get_current_thread); + vm.addFunc("is_christmas", &scripting::Globals::is_christmas); + vm.addFunc("start_cutscene", &scripting::Globals::start_cutscene); + vm.addFunc("end_cutscene", &scripting::Globals::end_cutscene); + vm.addFunc("check_cutscene", &scripting::Globals::check_cutscene); + vm.addFunc("wait", &scripting::Globals::wait); + vm.addFunc("wait_for_screenswitch", &scripting::Globals::wait_for_screenswitch); + vm.addFunc("exit_screen", &scripting::Globals::exit_screen); + vm.addFunc("translate", &scripting::Globals::translate); + vm.addFunc("_", &scripting::Globals::translate); + vm.addFunc("translate_plural", &scripting::Globals::translate_plural); + vm.addFunc("__", &scripting::Globals::translate_plural); + vm.addFunc("display_text_file", &scripting::Globals::display_text_file); + vm.addFunc("load_worldmap", &scripting::Globals::load_worldmap); + vm.addFunc("set_next_worldmap", &scripting::Globals::set_next_worldmap); + vm.addFunc("load_level", &scripting::Globals::load_level); + vm.addFunc("import", &scripting::Globals::import); + vm.addFunc("debug_collrects", &scripting::Globals::debug_collrects); + vm.addFunc("debug_show_fps", &scripting::Globals::debug_show_fps); + vm.addFunc("debug_draw_solids_only", &scripting::Globals::debug_draw_solids_only); + vm.addFunc("debug_draw_editor_images", &scripting::Globals::debug_draw_editor_images); + vm.addFunc("debug_worldmap_ghost", &scripting::Globals::debug_worldmap_ghost); + vm.addFunc("set_game_speed", &scripting::Globals::set_game_speed); + vm.addFunc("save_state", &scripting::Globals::save_state); + vm.addFunc("load_state", &scripting::Globals::load_state); + vm.addFunc("play_music", &scripting::Globals::play_music); + vm.addFunc("fade_in_music", &scripting::Globals::fade_in_music); + vm.addFunc("stop_music", &scripting::Globals::stop_music); + vm.addFunc("resume_music", &scripting::Globals::resume_music); + vm.addFunc("pause_music", &scripting::Globals::pause_music); + vm.addFunc("play_sound", &scripting::Globals::play_sound); + vm.addFunc("grease", &scripting::Globals::grease); + vm.addFunc("invincible", &scripting::Globals::invincible); + vm.addFunc("ghost", &scripting::Globals::ghost); + vm.addFunc("mortal", &scripting::Globals::mortal); + vm.addFunc("restart", &scripting::Globals::restart); + vm.addFunc("gotoend", &scripting::Globals::gotoend); + vm.addFunc("warp", &scripting::Globals::warp); + vm.addFunc("set_gamma", &scripting::Globals::set_gamma); + vm.addFunc("rand", &scripting::Globals::rand); + vm.addFunc("set_title_frame", &scripting::Globals::set_title_frame); + + /* "Level" global functions */ + ssq::Table level = vm.addTable("Level"); + level.addFunc("finish", &scripting::Level::finish); + level.addFunc("has_active_sequence", &scripting::Level::has_active_sequence); + level.addFunc("spawn", &scripting::Level::spawn); + level.addFunc("spawn_transition", &scripting::Level::spawn_transition); + level.addFunc("set_start_point", &scripting::Level::set_start_point); + level.addFunc("set_start_pos", &scripting::Level::set_start_pos); + level.addFunc("set_respawn_point", &scripting::Level::set_respawn_point); + level.addFunc("set_respawn_pos", &scripting::Level::set_respawn_pos); + level.addFunc("flip_vertically", &scripting::Level::flip_vertically); + level.addFunc("toggle_pause", &scripting::Level::toggle_pause); + level.addFunc("pause_target_timer", &scripting::Level::pause_target_timer); + level.addFunc("resume_target_timer", &scripting::Level::resume_target_timer); +} + +/* EOF */ diff --git a/src/scripting/wind.cpp b/src/squirrel/supertux_api.hpp similarity index 70% rename from src/scripting/wind.cpp rename to src/squirrel/supertux_api.hpp index 929017f3d4f..74a87f9df15 100644 --- a/src/scripting/wind.cpp +++ b/src/squirrel/supertux_api.hpp @@ -1,5 +1,5 @@ // SuperTux -// Copyright (C) 2006 Matthias Braun +// Copyright (C) 2024 Vankata453 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -14,23 +14,15 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#include "object/wind.hpp" -#include "scripting/wind.hpp" +#ifndef HEADER_SUPERTUX_SQUIRREL_SUPERTUX_API_HPP +#define HEADER_SUPERTUX_SQUIRREL_SUPERTUX_API_HPP -namespace scripting { +namespace ssq { +class VM; +} // namespace ssq -void Wind::start() -{ - SCRIPT_GUARD_VOID; - object.start(); -} +void register_supertux_scripting_api(ssq::VM& vm); -void Wind::stop() -{ - SCRIPT_GUARD_VOID; - object.stop(); -} - -} // namespace scripting +#endif /* EOF */ diff --git a/src/supertux/console.cpp b/src/supertux/console.cpp index 488b2179aa8..5c0f1dac4f7 100644 --- a/src/supertux/console.cpp +++ b/src/supertux/console.cpp @@ -18,8 +18,8 @@ #include "math/sizef.hpp" #include "physfs/ifile_stream.hpp" -#include "squirrel/squirrel_virtual_machine.hpp" #include "squirrel/squirrel_util.hpp" +#include "squirrel/squirrel_virtual_machine.hpp" #include "supertux/gameconfig.hpp" #include "supertux/globals.hpp" #include "supertux/resources.hpp" @@ -111,8 +111,7 @@ Console::Console(ConsoleBuffer& buffer) : m_history_position(m_history.end()), m_background(Surface::from_file("images/engine/console.png")), m_background2(Surface::from_file("images/engine/console2.png")), - m_vm(nullptr), - m_vm_object(), + m_vm(), m_backgroundOffset(0), m_height(0), m_alpha(1.0), @@ -126,10 +125,7 @@ Console::Console(ConsoleBuffer& buffer) : Console::~Console() { - if (m_vm != nullptr && SquirrelVirtualMachine::current() != nullptr) - { - sq_release(SquirrelVirtualMachine::current()->get_vm().get_vm(), &m_vm_object); - } + m_vm.reset(); m_buffer.set_console(nullptr); } @@ -153,36 +149,23 @@ Console::on_buffer_change(int line_count) void Console::ready_vm() { - if (m_vm == nullptr) { - m_vm = SquirrelVirtualMachine::current()->get_vm().get_vm(); - HSQUIRRELVM new_vm = sq_newthread(m_vm, 16); - if (new_vm == nullptr) - throw SquirrelError(m_vm, "Couldn't create new VM thread for console"); - - // Store reference to thread. - sq_resetobject(&m_vm_object); - if (SQ_FAILED(sq_getstackobj(m_vm, -1, &m_vm_object))) - throw SquirrelError(m_vm, "Couldn't get vm object for console"); - sq_addref(m_vm, &m_vm_object); - sq_pop(m_vm, 1); - - // Create new roottable for thread. - sq_newtable(new_vm); - sq_pushroottable(new_vm); - if (SQ_FAILED(sq_setdelegate(new_vm, -2))) - throw SquirrelError(new_vm, "Couldn't set console_table delegate"); - - sq_setroottable(new_vm); - - m_vm = new_vm; - - try { - std::string filename = "scripts/console.nut"; - IFileStream stream(filename); - compile_and_run(m_vm, stream, filename); - } catch(std::exception& e) { - log_warning << "Couldn't load console.nut: " << e.what() << std::endl; - } + if (!m_vm.isEmpty()) return; + + m_vm = SquirrelVirtualMachine::current()->get_vm().newThread(16); + + // Create new root table for the thread. + ssq::Table root = m_vm.newTable(); + root.setDelegate(m_vm); // Set the root table as delegate. + m_vm.setRootTable(root); + + try + { + IFileStream stream("scripts/console.nut"); + m_vm.run(m_vm.compileSource(stream, "scripts/console.nut")); + } + catch (const std::exception& e) + { + log_warning << "Couldn't load 'console.nut': " << e.what() << std::endl; } } @@ -191,26 +174,26 @@ Console::execute_script(const std::string& command) { ready_vm(); - SQInteger oldtop = sq_gettop(m_vm); - try { - if (SQ_FAILED(sq_compilebuffer(m_vm, command.c_str(), command.length(), - "", SQTrue))) - throw SquirrelError(m_vm, "Couldn't compile command"); - - sq_pushroottable(m_vm); - if (SQ_FAILED(sq_call(m_vm, 1, SQTrue, SQTrue))) - throw SquirrelError(m_vm, "Problem while executing command"); + const SQInteger old_top = m_vm.getTop(); + try + { + ssq::Object ret = m_vm.runAndReturn(m_vm.compileSource(command.c_str())); - if (sq_gettype(m_vm, -1) != OT_NULL) - m_buffer.addLines(squirrel2string(m_vm, -1)); - } catch(std::exception& e) { + if (ret.getType() != ssq::Type::NULLPTR) + m_buffer.addLines(squirrel_to_string(ret)); + } + catch (const std::exception& e) + { m_buffer.addLines(e.what()); } - SQInteger newtop = sq_gettop(m_vm); - if (newtop < oldtop) { - log_fatal << "Script destroyed squirrel stack..." << std::endl; - } else { - sq_settop(m_vm, oldtop); + + if (m_vm.getTop() < old_top) + { + log_fatal << "Script destroyed Squirrel stack..." << std::endl; + } + else + { + sq_settop(m_vm.getHandle(), old_top); } } @@ -367,19 +350,20 @@ Console::autocomplete() ready_vm(); // Append all keys of the current root table to list. - sq_pushroottable(m_vm); // push root table. - while (true) { + sq_pushroottable(m_vm.getHandle()); // push root table. + while (true) + { // Check all keys (and their children) for matches. - sq_insert_commands(cmds, m_vm, "", prefix); + sq_insert_commands(cmds, m_vm.getHandle(), "", prefix); // Cycle through parent(delegate) table. - SQInteger oldtop = sq_gettop(m_vm); - if (SQ_FAILED(sq_getdelegate(m_vm, -1)) || oldtop == sq_gettop(m_vm)) { + const SQInteger old_top = m_vm.getTop(); + if (SQ_FAILED(sq_getdelegate(m_vm.getHandle(), -1)) || old_top == m_vm.getTop()) break; - } - sq_remove(m_vm, -2); // Remove old table. + + sq_remove(m_vm.getHandle(), -2); // Remove old table. } - sq_pop(m_vm, 1); // Remove table. + sq_pop(m_vm.getHandle(), 1); // Remove table. // Depending on number of hits, show matches or autocomplete. if (cmds.empty()) diff --git a/src/supertux/console.hpp b/src/supertux/console.hpp index 46841dcef11..dffb5585b28 100644 --- a/src/supertux/console.hpp +++ b/src/supertux/console.hpp @@ -18,10 +18,11 @@ #define HEADER_SUPERTUX_SUPERTUX_CONSOLE_HPP #include -#include #include #include +#include + #include "util/currenton.hpp" #include "video/font_ptr.hpp" #include "video/surface_ptr.hpp" @@ -94,8 +95,7 @@ class Console final : public Currenton SurfacePtr m_background; /**< console background image */ SurfacePtr m_background2; /**< second, moving console background image */ - HSQUIRRELVM m_vm; /**< squirrel thread for the console (with custom roottable) */ - HSQOBJECT m_vm_object; + ssq::VM m_vm; /**< squirrel thread for the console (with custom roottable) */ int m_backgroundOffset; /**< current offset of scrolling background image */ float m_height; /**< height of the console in px */ diff --git a/src/supertux/game_object.cpp b/src/supertux/game_object.cpp index 325b839b48f..187ba06b4d2 100644 --- a/src/supertux/game_object.cpp +++ b/src/supertux/game_object.cpp @@ -18,6 +18,9 @@ #include +#include +#include + #include "editor/editor.hpp" #include "supertux/object_remove_listener.hpp" #include "util/reader_mapping.hpp" @@ -132,12 +135,30 @@ GameObject::get_settings() return result; } +std::string +GameObject::get_name() const +{ + return m_name; +} + +int +GameObject::get_type() const +{ + return m_type; +} + std::vector GameObject::get_patches() const { return {}; } +int +GameObject::get_version() const +{ + return m_version; +} + int GameObject::get_latest_version() const { @@ -147,7 +168,9 @@ GameObject::get_latest_version() const bool GameObject::is_up_to_date() const { - return m_version >= get_latest_version(); + const int latest = get_latest_version(); + assert(m_version <= latest); + return m_version == latest; } void @@ -275,4 +298,18 @@ GameObject::update(float dt_sec) m_fade_helpers.erase(new_end, m_fade_helpers.end()); } + +void +GameObject::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("GameObject"); + + cls.addFunc("get_version", &GameObject::get_version); + cls.addFunc("get_latest_version", &GameObject::get_latest_version); + cls.addFunc("is_up_to_date", &GameObject::is_up_to_date); + cls.addFunc("get_name", &GameObject::get_name); + cls.addFunc("get_display_name", &GameObject::get_display_name); + cls.addFunc("get_type", &GameObject::get_type); +} + /* EOF */ diff --git a/src/supertux/game_object.hpp b/src/supertux/game_object.hpp index c24feebc222..c8202d6f1a8 100644 --- a/src/supertux/game_object.hpp +++ b/src/supertux/game_object.hpp @@ -17,6 +17,8 @@ #ifndef HEADER_SUPERTUX_SUPERTUX_GAME_OBJECT_HPP #define HEADER_SUPERTUX_SUPERTUX_GAME_OBJECT_HPP +#include "squirrel/exposable_class.hpp" + #include #include #include @@ -34,6 +36,10 @@ class ObjectRemoveListener; class ReaderMapping; class Writer; +namespace ssq { +class VM; +} // namespace ssq + struct GameObjectType { const std::string id; @@ -42,26 +48,31 @@ struct GameObjectType typedef std::vector GameObjectTypes; /** - Base class for all the things that make up Levels' Sectors. - - Each sector of a level will hold a list of active GameObject while the - game is played. - - This class is responsible for: - - Updating and Drawing the object. This should happen in the update() and + This class is responsible for: + * Updating and drawing the object. This should happen in the update() and draw() functions. Both are called once per frame. - - Providing a safe way to remove the object by calling the remove_me + * Providing a safe way to remove the object by calling the remove_me functions. + */ +/** + * @scripting + * @summary Base class for all the things that make up Levels' Sectors.${SRG_NEWPARAGRAPH} + + Each sector of a level holds a list of active ""GameObject""s, while the + game is played.${SRG_NEWPARAGRAPH} */ -class GameObject +class GameObject : public ExposableClass { friend class GameObjectManager; +public: + static void register_class(ssq::VM& vm); + public: GameObject(); GameObject(const std::string& name); GameObject(const ReaderMapping& reader); - virtual ~GameObject(); + virtual ~GameObject() override; /** Called after all objects have been added to the Sector and the Sector is fully constructed. If objects refer to other objects @@ -85,14 +96,31 @@ class GameObject virtual void save(Writer& writer); std::string save(); virtual std::string get_class_name() const { return "game-object"; } + virtual std::string get_exposed_class_name() const override { return "GameObject"; } + /** + * @scripting + * @description Returns the display name of the object, translated to the user's locale. + */ virtual std::string get_display_name() const { return _("Unknown object"); } /** Version checking/updating, patch information */ virtual std::vector get_patches() const; - int get_version() const { return m_version; } + virtual void update_version(); + /** + * @scripting + * @description Returns the current version of the object. + */ + int get_version() const; + /** + * @scripting + * @description Returns the latest version of the object. + */ int get_latest_version() const; + /** + * @scripting + * @description Checks whether the object's current version is equal to its latest one. + */ bool is_up_to_date() const; - virtual void update_version(); /** If true only a single object of this type is allowed in a given GameObjectManager */ @@ -120,7 +148,11 @@ class GameObject /** Get all types of the object, if available. **/ virtual GameObjectTypes get_types() const; - int get_type() const { return m_type; } + /** + * @scripting + * @description Returns the type index of the object. + */ + int get_type() const; virtual void after_editor_set(); @@ -142,7 +174,11 @@ class GameObject void del_remove_listener(ObjectRemoveListener* listener); void set_name(const std::string& name) { m_name = name; } - const std::string& get_name() const { return m_name; } + /** + * @scripting + * @description Returns the name of the object. + */ + std::string get_name() const; virtual const std::string get_icon_path() const { return "images/tiles/auxiliary/notile.png"; diff --git a/src/supertux/game_object_factory.cpp b/src/supertux/game_object_factory.cpp index 9e49789709b..ff14c62f316 100644 --- a/src/supertux/game_object_factory.cpp +++ b/src/supertux/game_object_factory.cpp @@ -16,6 +16,8 @@ #include "supertux/game_object_factory.hpp" +#include + #include "audio/sound_source.hpp" #include "badguy/angrystone.hpp" #include "badguy/bouncing_snowball.hpp" @@ -94,9 +96,11 @@ #include "object/coin.hpp" #include "object/conveyor_belt.hpp" #include "object/decal.hpp" +#include "object/display_effect.hpp" #include "object/explosion.hpp" #include "object/fallblock.hpp" #include "object/firefly.hpp" +#include "object/floating_image.hpp" #include "object/ghost_particle_system.hpp" #include "object/gradient.hpp" #include "object/hurting_platform.hpp" @@ -125,6 +129,7 @@ #include "object/sound_object.hpp" #include "object/spawnpoint.hpp" #include "object/spotlight.hpp" +#include "object/text_array_object.hpp" #include "object/textscroller.hpp" #include "object/thunderstorm.hpp" #include "object/tilemap.hpp" @@ -327,6 +332,48 @@ GameObjectFactory::init_factories() }); } +/** Register all scriptable objects to a Squirrel VM. */ +void +GameObjectFactory::register_objects(ssq::VM& vm) +{ + /* Base classes */ + GameObject::register_class(vm); + MovingObject::register_class(vm); + MovingSprite::register_class(vm); + BadGuy::register_class(vm); + ParticleSystem::register_class(vm); + + AmbientSound::register_class(vm); + Background::register_class(vm); + Camera::register_class(vm); + Candle::register_class(vm); + CloudParticleSystem::register_class(vm); + ConveyorBelt::register_class(vm); + CustomParticleSystem::register_class(vm); + Decal::register_class(vm); + Dispenser::register_class(vm); + DisplayEffect::register_class(vm); + FloatingImage::register_class(vm); + Gradient::register_class(vm); + LevelTime::register_class(vm); + LitObject::register_class(vm); + Platform::register_class(vm); + Player::register_class(vm); + RainParticleSystem::register_class(vm); + ScriptedObject::register_class(vm); + SoundObject::register_class(vm); + Spotlight::register_class(vm); + TextArrayObject::register_class(vm); + TextObject::register_class(vm); + Thunderstorm::register_class(vm); + TileMap::register_class(vm); + Torch::register_class(vm); + WillOWisp::register_class(vm); + Wind::register_class(vm); + Granito::register_class(vm); + GranitoBig::register_class(vm); +} + std::unique_ptr GameObjectFactory::create(const std::string& name, const std::string& data) const { diff --git a/src/supertux/game_object_factory.hpp b/src/supertux/game_object_factory.hpp index f3398f47b3a..87efebbab55 100644 --- a/src/supertux/game_object_factory.hpp +++ b/src/supertux/game_object_factory.hpp @@ -23,11 +23,18 @@ #include "math/vector.hpp" +namespace ssq { +class VM; +} // namespace ssq + class GameObjectFactory final : public ObjectFactory { public: static GameObjectFactory& instance(); + /** Register all scriptable objects to a Squirrel VM. */ + static void register_objects(ssq::VM& vm); + public: using ObjectFactory::create; std::unique_ptr create(const std::string& name, const std::string& data) const; diff --git a/src/supertux/game_object_manager.cpp b/src/supertux/game_object_manager.cpp index 4a92cb2d1d9..f272a9f75a7 100644 --- a/src/supertux/game_object_manager.cpp +++ b/src/supertux/game_object_manager.cpp @@ -20,7 +20,12 @@ #include +#include +#include + #include "editor/editor.hpp" +#include "object/ambient_light.hpp" +#include "object/music_object.hpp" #include "object/tilemap.hpp" #include "supertux/game_object_factory.hpp" #include "supertux/moving_object.hpp" @@ -155,6 +160,14 @@ GameObjectManager::add_object(std::unique_ptr object) return tmp; } +void +GameObjectManager::add_object(const std::string& class_name, const std::string& name, + float pos_x, float pos_y, const std::string& direction, + const std::string& data) +{ + add_object_scripting(class_name, name, Vector(pos_x, pos_y), direction, data); +} + MovingObject& GameObjectManager::add_object_scripting(const std::string& class_name, const std::string& name, const Vector& pos, const std::string& direction, @@ -501,6 +514,42 @@ GameObjectManager::this_before_object_remove(GameObject& object) } } +void +GameObjectManager::fade_to_ambient_light(float red, float green, float blue, float fadetime) +{ + get_singleton_by_type().fade_to_ambient_light(red, green, blue, fadetime); +} + +void +GameObjectManager::set_ambient_light(float red, float green, float blue) +{ + get_singleton_by_type().set_ambient_light(Color(red, green, blue)); +} + +float +GameObjectManager::get_ambient_red() const +{ + return get_singleton_by_type().get_ambient_light().red; +} + +float +GameObjectManager::get_ambient_green() const +{ + return get_singleton_by_type().get_ambient_light().green; +} + +float +GameObjectManager::get_ambient_blue() const +{ + return get_singleton_by_type().get_ambient_light().blue; +} + +void +GameObjectManager::set_music(const std::string& filename) +{ + get_singleton_by_type().set_music(filename); +} + float GameObjectManager::get_width() const { @@ -565,4 +614,20 @@ GameObjectManager::get_tiles_height() const return height; } + +void +GameObjectManager::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("GameObjectManager"); + + cls.addFunc("set_ambient_light", &GameObjectManager::set_ambient_light); + cls.addFunc("fade_to_ambient_light", &GameObjectManager::fade_to_ambient_light); + cls.addFunc("get_ambient_red", &GameObjectManager::get_ambient_red); + cls.addFunc("get_ambient_green", &GameObjectManager::get_ambient_green); + cls.addFunc("get_ambient_blue", &GameObjectManager::get_ambient_blue); + cls.addFunc("set_music", &GameObjectManager::set_music); + cls.addFunc("add_object", &GameObjectManager::add_object); +} + /* EOF */ diff --git a/src/supertux/game_object_manager.hpp b/src/supertux/game_object_manager.hpp index 4fcd6f775a4..601918b85fc 100644 --- a/src/supertux/game_object_manager.hpp +++ b/src/supertux/game_object_manager.hpp @@ -19,6 +19,8 @@ #ifndef HEADER_SUPERTUX_SUPERTUX_GAME_OBJECT_MANAGER_HPP #define HEADER_SUPERTUX_SUPERTUX_GAME_OBJECT_MANAGER_HPP +#include "squirrel/exposable_class.hpp" + #include #include #include @@ -34,11 +36,20 @@ class TileMap; template class GameObjectRange; -class GameObjectManager +/** + * @scripting + * @summary This class provides basic controlling functions for a sector. Applies for both worldmap and in-level sectors. + * @instances For in-level sectors, an instance under ""sector.settings"" is available from scripts and the console.${SRG_NEWPARAGRAPH} + For worldmap sectors, such instance is available under ""worldmap.settings"". + */ +class GameObjectManager : public ExposableClass { public: static bool s_draw_solids_only; +public: + static void register_class(ssq::VM& vm); + private: struct NameResolveRequest { @@ -48,7 +59,9 @@ class GameObjectManager public: GameObjectManager(bool undo_tracking = false); - virtual ~GameObjectManager(); + virtual ~GameObjectManager() override; + + virtual std::string get_exposed_class_name() const override { return "GameObjectManager"; } /** Queue an object up to be added to the object list */ GameObject& add_object(std::unique_ptr object); @@ -64,11 +77,6 @@ class GameObjectManager return obj_ref; } - /** Add a MovingObject from scripting. */ - virtual MovingObject& add_object_scripting(const std::string& class_name, const std::string& name, - const Vector& pos, const std::string& direction, - const std::string& data); - void update(float dt_sec); void draw(DrawingContext& context); @@ -77,6 +85,61 @@ class GameObjectManager /** Commit the queued up additions and deletions to the object list */ void flush_game_objects(); + /** + * @scripting + * @description Sets the sector's ambient light to the specified color. + * @param float $red + * @param float $green + * @param float $blue + */ + void set_ambient_light(float red, float green, float blue); + /** + * @scripting + * @description Fades to a specified ambient light color in ""fadetime"" seconds. + * @param float $red + * @param float $green + * @param float $blue + * @param float $fadetime + */ + void fade_to_ambient_light(float red, float green, float blue, float fadetime); + /** + * @scripting + * @description Returns the red channel of the ambient light color. + */ + float get_ambient_red() const; + /** + * @scripting + * @description Returns the green channel of the ambient light color. + */ + float get_ambient_green() const; + /** + * @scripting + * @description Returns the blue channel of the ambient light color. + */ + float get_ambient_blue() const; + + /** + * @scripting + * @description Sets the sector's music. + * @param string $music Full filename, relative to the "music" folder. + */ + void set_music(const std::string& music); + + /** + * @scripting + * @description Adds a ""MovingObject"" to the manager. + Note: If adding objects to a worldmap sector, ""posX"" and ""posY"" have to be tile positions (sector position / 32). + * @param string $class_name GameObject's class. + * @param string $name Name of the created object. + * @param float $pos_x X position inside the current sector. + * @param float $pos_y Y position inside the current sector. + * @param string $direction Direction. + * @param string $data Additional data in S-Expression format (check object definitions in level files). + */ + void add_object(const std::string& class_name, const std::string& name, + float pos_x, float pos_y, const std::string& direction, + const std::string& data); + float get_width() const; float get_height() const; float get_editor_width() const; @@ -224,6 +287,11 @@ class GameObjectManager void on_editor_save(); protected: + /** Add a MovingObject from scripting. */ + virtual MovingObject& add_object_scripting(const std::string& class_name, const std::string& name, + const Vector& pos, const std::string& direction, + const std::string& data); + void update_tilemaps(); void process_resolve_requests(); diff --git a/src/supertux/game_session.cpp b/src/supertux/game_session.cpp index ca88bc9f3f9..ce9ff0d6285 100644 --- a/src/supertux/game_session.cpp +++ b/src/supertux/game_session.cpp @@ -31,6 +31,7 @@ #include "object/player.hpp" #include "object/spawnpoint.hpp" #include "sdk/integration.hpp" +#include "squirrel/squirrel_virtual_machine.hpp" #include "supertux/constants.hpp" #include "supertux/fadetoblack.hpp" #include "supertux/gameconfig.hpp" @@ -61,7 +62,7 @@ GameSession::GameSession(const std::string& levelfile_, Savegame& savegame, Stat m_prevent_death(false), m_level(), m_statistics_backdrop(Surface::from_file("images/engine/menu/score-backdrop.png")), - m_scripts(), + m_data_table(SquirrelVirtualMachine::current()->get_vm().findTable("Level").getOrCreateTable("data")), m_currentsector(nullptr), m_end_sequence(nullptr), m_game_pause(false), @@ -94,6 +95,8 @@ GameSession::GameSession(const std::string& levelfile_, Savegame& savegame, Stat m_max_fire_bullets_at_start.resize(InputManager::current()->get_num_users(), 0); m_max_ice_bullets_at_start.resize(InputManager::current()->get_num_users(), 0); + m_data_table.clear(); + if (restart_level(false, preserve_music) != 0) throw std::runtime_error ("Initializing the level failed."); } @@ -122,6 +125,8 @@ GameSession::reset_level() m_activated_checkpoint = nullptr; m_pause_target_timer = false; m_spawn_with_invincibility = false; + + m_data_table.clear(); } int @@ -201,6 +206,7 @@ GameSession::restart_level(bool after_death, bool preserve_music) spawnpoint = &m_spawnpoints.front(); m_play_time = 0; // Reset play time. + m_data_table.clear(); } /* Perform the respawn from the chosen spawnpoint. */ @@ -483,6 +489,7 @@ GameSession::setup() void GameSession::leave() { + m_data_table.clear(); } void diff --git a/src/supertux/game_session.hpp b/src/supertux/game_session.hpp index bc0e4ddfe93..5623714d030 100644 --- a/src/supertux/game_session.hpp +++ b/src/supertux/game_session.hpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include "math/vector.hpp" #include "squirrel/squirrel_scheduler.hpp" @@ -154,8 +154,7 @@ class GameSession final : public Screen, std::unique_ptr m_level; SurfacePtr m_statistics_backdrop; - // scripts - SquirrelObjectList m_scripts; + ssq::Table m_data_table; Sector* m_currentsector; diff --git a/src/supertux/menu/cheat_apply_menu.cpp b/src/supertux/menu/cheat_apply_menu.cpp index 3d4c77a26ae..242612ab071 100644 --- a/src/supertux/menu/cheat_apply_menu.cpp +++ b/src/supertux/menu/cheat_apply_menu.cpp @@ -21,7 +21,6 @@ #include "gui/menu_item.hpp" #include "gui/menu_manager.hpp" #include "object/player.hpp" -#include "scripting/functions.hpp" #include "supertux/game_session.hpp" #include "supertux/sector.hpp" diff --git a/src/supertux/menu/cheat_menu.cpp b/src/supertux/menu/cheat_menu.cpp index 4100e94b290..871efec94e4 100644 --- a/src/supertux/menu/cheat_menu.cpp +++ b/src/supertux/menu/cheat_menu.cpp @@ -19,7 +19,6 @@ #include "gui/menu_item.hpp" #include "gui/menu_manager.hpp" #include "object/player.hpp" -#include "scripting/functions.hpp" #include "supertux/game_session.hpp" #include "supertux/menu/cheat_apply_menu.hpp" #include "supertux/sector.hpp" diff --git a/src/supertux/menu/worldmap_cheat_apply_menu.cpp b/src/supertux/menu/worldmap_cheat_apply_menu.cpp index d0498eae1a8..4a5c80040cb 100644 --- a/src/supertux/menu/worldmap_cheat_apply_menu.cpp +++ b/src/supertux/menu/worldmap_cheat_apply_menu.cpp @@ -21,7 +21,6 @@ #include "gui/menu_item.hpp" #include "gui/menu_manager.hpp" #include "object/player.hpp" -#include "scripting/functions.hpp" #include "supertux/game_session.hpp" #include "supertux/sector.hpp" diff --git a/src/supertux/moving_object.cpp b/src/supertux/moving_object.cpp index f042fd57285..7a391677446 100644 --- a/src/supertux/moving_object.cpp +++ b/src/supertux/moving_object.cpp @@ -16,6 +16,9 @@ #include "supertux/moving_object.hpp" +#include +#include + #include "editor/resize_marker.hpp" #include "supertux/sector.hpp" #include "util/reader_mapping.hpp" @@ -78,6 +81,42 @@ MovingObject::set_parent_dispenser(Dispenser* dispenser) } } +float +MovingObject::get_x() const +{ + return m_col.m_bbox.get_left(); +} + +float +MovingObject::get_y() const +{ + return m_col.m_bbox.get_top(); +} + +void +MovingObject::set_pos(float x, float y) +{ + set_pos(Vector(x, y)); +} + +void +MovingObject::move(float x, float y) +{ + move(Vector(x, y)); +} + +float +MovingObject::get_width() const +{ + return m_col.m_bbox.get_width(); +} + +float +MovingObject::get_height() const +{ + return m_col.m_bbox.get_height(); +} + void MovingObject::editor_select() { @@ -99,4 +138,18 @@ MovingObject::on_flip(float height) set_pos(pos); } + +void +MovingObject::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("MovingObject", vm.findClass("GameObject")); + + cls.addFunc("get_x", &MovingObject::get_x); + cls.addFunc("get_y", &MovingObject::get_y); + cls.addFunc("set_pos", &MovingObject::set_pos); + cls.addFunc("move", &MovingObject::move); + cls.addFunc("get_width", &MovingObject::get_width); + cls.addFunc("get_height", &MovingObject::get_height); +} + /* EOF */ diff --git a/src/supertux/moving_object.hpp b/src/supertux/moving_object.hpp index e883e959009..bc5e8a1cbe5 100644 --- a/src/supertux/moving_object.hpp +++ b/src/supertux/moving_object.hpp @@ -26,9 +26,12 @@ class Dispenser; class Sector; -/** Base class for all dynamic/moving game objects. This class - contains things for handling the bounding boxes and collision - feedback. */ +/** + * @scripting + * @summary Base class for all dynamic/moving game objects. This class + contains things for handling the bounding boxes and collision + feedback. + */ class MovingObject : public GameObject, public CollisionListener { @@ -36,6 +39,9 @@ class MovingObject : public GameObject, friend class Sector; friend class CollisionSystem; +public: + static void register_class(ssq::VM& vm); + public: MovingObject(); MovingObject(const ReaderMapping& reader); @@ -63,6 +69,10 @@ class MovingObject : public GameObject, { m_col.move_to(pos); } + virtual void move(const Vector& dist) + { + m_col.m_bbox.move(dist); + } virtual bool listener_is_valid() const override { return is_valid(); } @@ -99,6 +109,7 @@ class MovingObject : public GameObject, static std::string class_name() { return "moving-object"; } virtual std::string get_class_name() const override { return class_name(); } + virtual std::string get_exposed_class_name() const override { return "MovingObject"; } virtual ObjectSettings get_settings() override; virtual void editor_select() override; @@ -107,6 +118,42 @@ class MovingObject : public GameObject, virtual int get_layer() const = 0; + /** + * @scripting + * @description Returns the object's X coordinate. + */ + float get_x() const; + /** + * @scripting + * @description Returns the object's Y coordinate. + */ + float get_y() const; + /** + * @scripting + * @description Sets the position of the object. + * @param float $x + * @param float $y + */ + void set_pos(float x, float y); + /** + * @scripting + * @description Moves the object by ""x"" units to the right and ""y"" down, relative to its current position. + * @param float $x + * @param float $y + */ + void move(float x, float y); + + /** + * @scripting + * @description Returns the object's hitbox width. + */ + float get_width() const; + /** + * @scripting + * @description Returns the object's hitbox height. + */ + float get_height() const; + protected: void set_group(CollisionGroup group) { diff --git a/src/supertux/savegame.cpp b/src/supertux/savegame.cpp index 2ea286d8fd8..a3e76bf73b2 100644 --- a/src/supertux/savegame.cpp +++ b/src/supertux/savegame.cpp @@ -24,7 +24,6 @@ #include "physfs/physfs_file_system.hpp" #include "physfs/util.hpp" #include "squirrel/serialize.hpp" -#include "squirrel/squirrel_util.hpp" #include "squirrel/squirrel_virtual_machine.hpp" #include "supertux/player_status.hpp" #include "supertux/profile_manager.hpp" @@ -37,33 +36,26 @@ namespace { -std::vector get_level_states(SquirrelVM& vm) +std::vector get_level_states(ssq::Table& levels) { std::vector results; - - sq_pushnull(vm.get_vm()); - while (SQ_SUCCEEDED(sq_next(vm.get_vm(), -2))) + for (const auto& [key, value] : levels.convertRaw()) { - //here -1 is the value and -2 is the key - const char* result; - if (SQ_FAILED(sq_getstring(vm.get_vm(), -2, &result))) - { - std::ostringstream msg; - msg << "Couldn't get string value"; - throw SquirrelError(vm.get_vm(), msg.str()); - } - else + try { + ssq::Table table = value.toTable(); + LevelState level_state; - level_state.filename = result; - vm.get_bool("solved", level_state.solved); - vm.get_bool("perfect", level_state.perfect); + level_state.filename = key; + table.get("solved", level_state.solved); + table.get("perfect", level_state.perfect); - results.push_back(level_state); + results.push_back(std::move(level_state)); + } + catch (const ssq::TypeException&) + { + // Ignore non-table entries } - - // pops key and val before the next iteration - sq_pop(vm.get_vm(), 2); } return results; @@ -131,7 +123,8 @@ Savegame::from_current_profile(const std::string& world_name, bool base_data) Savegame::Savegame(Profile& profile, const std::string& world_name) : m_profile(profile), m_world_name(world_name), - m_player_status(new PlayerStatus(InputManager::current()->get_num_users())) + m_player_status(new PlayerStatus(InputManager::current()->get_num_users())), + m_state_table() { } @@ -176,8 +169,6 @@ Savegame::load(bool base_data) try { - SquirrelVM& vm = SquirrelVirtualMachine::current()->get_vm(); - auto doc = ReaderDocument::from_file(filename); auto root = doc.get_root(); @@ -213,16 +204,9 @@ Savegame::load(bool base_data) /** Load "state" table */ std::optional state; if (!mapping.get("state", state)) - { throw std::runtime_error("No state section in savegame"); - } else - { - sq_pushroottable(vm.get_vm()); - vm.get_table_entry("state"); - load_squirrel_table(vm.get_vm(), -1, *state); - sq_pop(vm.get_vm(), 2); - } + load_squirrel_table(m_state_table, *state); } } } @@ -236,15 +220,10 @@ Savegame::load(bool base_data) void Savegame::clear_state_table() { - SquirrelVM& vm = SquirrelVirtualMachine::current()->get_vm(); + ssq::VM& vm = SquirrelVirtualMachine::current()->get_vm(); - // delete existing state table, if it exists - sq_pushroottable(vm.get_vm()); - { - // create a new empty state table - vm.create_empty_table("state"); - } - sq_pop(vm.get_vm(), 1); + vm.remove("state"); + m_state_table = vm.addTable("state"); } void @@ -261,8 +240,6 @@ Savegame::save() m_profile.save(); // Make sure profile directory exists, save profile info - SquirrelVM& vm = SquirrelVirtualMachine::current()->get_vm(); - Writer writer(filename); writer.start_list("supertux-savegame"); @@ -283,18 +260,13 @@ Savegame::save() writer.end_list("tux"); writer.start_list("state"); - - sq_pushroottable(vm.get_vm()); try { - vm.get_table_entry("state"); // Push "state" - save_squirrel_table(vm.get_vm(), -1, writer); - sq_pop(vm.get_vm(), 1); // Pop "state" + save_squirrel_table(m_state_table, writer); } catch(const std::exception&) { } - sq_pop(vm.get_vm(), 1); // Pop root table writer.end_list("state"); writer.end_list("supertux-savegame"); @@ -305,23 +277,16 @@ Savegame::get_worldmaps() { std::vector worlds; - SquirrelVM& vm = SquirrelVirtualMachine::current()->get_vm(); - SQInteger oldtop = sq_gettop(vm.get_vm()); - try { - sq_pushroottable(vm.get_vm()); - vm.get_table_entry("state"); - vm.get_or_create_table_entry("worlds"); - worlds = vm.get_table_keys(); + ssq::Table worlds_table = m_state_table.getOrCreateTable("worlds"); + worlds = worlds_table.getKeys(); } catch(const std::exception& err) { log_warning << err.what() << std::endl; } - sq_settop(vm.get_vm(), oldtop); - // ensure that the loaded worldmap names have their canonical form std::transform(worlds.begin(), worlds.end(), worlds.begin(), physfsutil::realpath); @@ -333,35 +298,26 @@ Savegame::get_worldmap_state(const std::string& name) { WorldmapState result; - SquirrelVM& vm = SquirrelVirtualMachine::current()->get_vm(); - SQInteger oldtop = sq_gettop(vm.get_vm()); - try { - sq_pushroottable(vm.get_vm()); - vm.get_table_entry("state"); - vm.get_or_create_table_entry("worlds"); + ssq::Table worlds = m_state_table.getOrCreateTable("worlds"); // if a non-canonical entry is present, replace them with a canonical one - if (name != "/levels/world2/worldmap.stwm") { + if (name != "/levels/world2/worldmap.stwm") + { std::string old_map_filename = name.substr(1); - if (vm.has_property(old_map_filename.c_str())) { - vm.rename_table_entry(old_map_filename.c_str(), name.c_str()); - } + if (worlds.hasEntry(old_map_filename.c_str())) + worlds.rename(old_map_filename.c_str(), name.c_str()); } - vm.get_or_create_table_entry(name); - vm.get_or_create_table_entry("levels"); - - result.level_states = get_level_states(vm); + ssq::Table levels = worlds.getOrCreateTable(name.c_str()).getOrCreateTable("levels"); + result.level_states = get_level_states(levels); } catch(const std::exception& err) { log_warning << err.what() << std::endl; } - sq_settop(vm.get_vm(), oldtop); - return result; } @@ -370,23 +326,16 @@ Savegame::get_levelsets() { std::vector results; - SquirrelVM& vm = SquirrelVirtualMachine::current()->get_vm(); - SQInteger oldtop = sq_gettop(vm.get_vm()); - try { - sq_pushroottable(vm.get_vm()); - vm.get_table_entry("state"); - vm.get_or_create_table_entry("levelsets"); - results = vm.get_table_keys(); + ssq::Table levelsets = m_state_table.getOrCreateTable("levelsets"); + results = levelsets.getKeys(); } catch(const std::exception& err) { log_warning << err.what() << std::endl; } - sq_settop(vm.get_vm(), oldtop); - return results; } @@ -395,26 +344,17 @@ Savegame::get_levelset_state(const std::string& basedir) { LevelsetState result; - SquirrelVM& vm = SquirrelVirtualMachine::current()->get_vm(); - SQInteger oldtop = sq_gettop(vm.get_vm()); - try { - sq_pushroottable(vm.get_vm()); - vm.get_table_entry("state"); - vm.get_or_create_table_entry("levelsets"); - vm.get_or_create_table_entry(basedir); - vm.get_or_create_table_entry("levels"); - - result.level_states = get_level_states(vm); + ssq::Table levelsets = m_state_table.getOrCreateTable("levelsets"); + ssq::Table levels = levelsets.getOrCreateTable(basedir.c_str()).getOrCreateTable("levels"); + result.level_states = get_level_states(levels); } catch(const std::exception& err) { log_warning << err.what() << std::endl; } - sq_settop(vm.get_vm(), oldtop); - return result; } @@ -425,28 +365,20 @@ Savegame::set_levelset_state(const std::string& basedir, { LevelsetState state = get_levelset_state(basedir); - SquirrelVM& vm = SquirrelVirtualMachine::current()->get_vm(); - SQInteger oldtop = sq_gettop(vm.get_vm()); - try { - sq_pushroottable(vm.get_vm()); - vm.get_table_entry("state"); - vm.get_or_create_table_entry("levelsets"); - vm.get_or_create_table_entry(basedir); - vm.get_or_create_table_entry("levels"); - vm.get_or_create_table_entry(level_filename); + ssq::Table levelsets = m_state_table.getOrCreateTable("levelsets"); + ssq::Table levels = levelsets.getOrCreateTable(basedir.c_str()).getOrCreateTable("levels"); + ssq::Table level = levels.getOrCreateTable(level_filename.c_str()); bool old_solved = false; - vm.get_bool("solved", old_solved); - vm.store_bool("solved", solved || old_solved); + level.get("solved", old_solved); + level.set("solved", solved || old_solved); } catch(const std::exception& err) { log_warning << err.what() << std::endl; } - - sq_settop(vm.get_vm(), oldtop); } /* EOF */ diff --git a/src/supertux/savegame.hpp b/src/supertux/savegame.hpp index d200ce67212..a36b64623b9 100644 --- a/src/supertux/savegame.hpp +++ b/src/supertux/savegame.hpp @@ -22,6 +22,8 @@ #include #include +#include + class PlayerStatus; class Profile; @@ -102,6 +104,7 @@ class Savegame final Profile& m_profile; std::string m_world_name; std::unique_ptr m_player_status; + ssq::Table m_state_table; private: Savegame(const Savegame&) = delete; diff --git a/src/supertux/sector.cpp b/src/supertux/sector.cpp index a9d841ba91f..592b769d6bd 100644 --- a/src/supertux/sector.cpp +++ b/src/supertux/sector.cpp @@ -16,9 +16,12 @@ #include "supertux/sector.hpp" -#include #include +#include +#include +#include + #include "audio/sound_manager.hpp" #include "badguy/badguy.hpp" #include "collision/collision.hpp" @@ -42,7 +45,6 @@ #include "object/tilemap.hpp" #include "object/vertical_stripes.hpp" #include "physfs/ifile_stream.hpp" -#include "scripting/sector.hpp" #include "squirrel/squirrel_environment.hpp" #include "supertux/colorscheme.hpp" #include "supertux/constants.hpp" @@ -227,12 +229,12 @@ Sector::activate(const Vector& player_pos) m_squirrel_environment->expose_self(); for (const auto& object : get_objects()) { - m_squirrel_environment->try_expose(*object); + m_squirrel_environment->expose(*object, object->get_name()); } } // The Sector object is called 'settings' as it is accessed as 'sector.settings' - m_squirrel_environment->expose("settings", std::make_unique(this)); + m_squirrel_environment->expose(*this, "settings"); if (Editor::is_active()) return; @@ -243,9 +245,9 @@ Sector::activate(const Vector& player_pos) Player& player = *static_cast(player_ptr); // spawn smalltux below spawnpoint if (!player.is_big()) { - player.move(player_pos + Vector(0,32)); + player.set_pos(player_pos + Vector(0,32)); } else { - player.move(player_pos); + player.set_pos(player_pos); } // spawning tux in the ground would kill him @@ -254,7 +256,7 @@ Sector::activate(const Vector& player_pos) log_warning << current_level << "Tried spawning Tux in solid matter. Compensating." << std::endl; Vector npos = player.get_bbox().p1(); npos.y-=32; - player.move(npos); + player.set_pos(npos); } } @@ -263,10 +265,10 @@ Sector::activate(const Vector& player_pos) { Player& player = *(get_players()[0]); Camera& camera = get_camera(); - player.move(player.get_pos()+Vector(-32, 0)); + player.set_pos(player.get_pos()+Vector(-32, 0)); camera.reset(player.get_pos()); camera.update(1); - player.move(player.get_pos()+(Vector(32, 0))); + player.set_pos(player.get_pos()+(Vector(32, 0))); camera.update(1); } @@ -303,9 +305,8 @@ Sector::deactivate() m_squirrel_environment->unexpose_self(); - for (const auto& object: get_objects()) { - m_squirrel_environment->try_unexpose(*object); - } + for (const auto& object : get_objects()) + m_squirrel_environment->unexpose(object->get_name()); m_squirrel_environment->unexpose("settings"); @@ -414,7 +415,7 @@ Sector::before_object_add(GameObject& object) } if (s_current == this) { - m_squirrel_environment->try_expose(object); + m_squirrel_environment->expose(object, object.get_name()); } if (m_fully_constructed) { @@ -434,7 +435,7 @@ Sector::before_object_remove(GameObject& object) } if (s_current == this) - m_squirrel_environment->try_unexpose(object); + m_squirrel_environment->unexpose(object.get_name()); } void @@ -540,6 +541,14 @@ Sector::is_free_of_tiles(const Rectf& rect, const bool ignoreUnisolid, uint32_t return m_collision_system->is_free_of_tiles(rect, ignoreUnisolid, tiletype); } +bool +Sector::is_free_of_solid_tiles(float left, float top, float right, float bottom, + bool ignore_unisolid) const +{ + return m_collision_system->is_free_of_tiles(Rectf(Vector(left, top), Vector(right, bottom)), + ignore_unisolid, Tile::SOLID); +} + bool Sector::is_free_of_statics(const Rectf& rect, const MovingObject* ignore_object, const bool ignoreUnisolid) const { @@ -548,6 +557,14 @@ Sector::is_free_of_statics(const Rectf& rect, const MovingObject* ignore_object, ignoreUnisolid); } +bool +Sector::is_free_of_statics(float left, float top, float right, float bottom, + bool ignore_unisolid) const +{ + return m_collision_system->is_free_of_statics(Rectf(Vector(left, top), Vector(right, bottom)), + nullptr, ignore_unisolid); +} + bool Sector::is_free_of_movingstatics(const Rectf& rect, const MovingObject* ignore_object) const { @@ -555,6 +572,12 @@ Sector::is_free_of_movingstatics(const Rectf& rect, const MovingObject* ignore_o ignore_object ? ignore_object->get_collision_object() : nullptr); } +bool +Sector::is_free_of_movingstatics(float left, float top, float right, float bottom) const +{ + return m_collision_system->is_free_of_movingstatics(Rectf(Vector(left, top), Vector(right, bottom)), nullptr); +} + bool Sector::is_free_of_specifically_movingstatics(const Rectf& rect, const MovingObject* ignore_object) const { @@ -562,6 +585,12 @@ Sector::is_free_of_specifically_movingstatics(const Rectf& rect, const MovingObj ignore_object ? ignore_object->get_collision_object() : nullptr); } +bool +Sector::is_free_of_specifically_movingstatics(float left, float top, float right, float bottom) const +{ + return m_collision_system->is_free_of_specifically_movingstatics(Rectf(Vector(left, top), Vector(right, bottom)), nullptr); +} + CollisionSystem::RaycastResult Sector::get_first_line_intersection(const Vector& line_start, const Vector& line_end, @@ -684,6 +713,12 @@ Sector::set_gravity(float gravity) m_gravity = gravity; } +float +Sector::get_gravity() const +{ + return m_gravity; +} + Player* Sector::get_nearest_player (const Vector& pos) const { @@ -864,4 +899,20 @@ Sector::get_effect() const return get_singleton_by_type(); } + +void +Sector::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("Sector", vm.findClass("GameObjectManager")); + + cls.addFunc("set_gravity", &Sector::set_gravity); + cls.addFunc("get_gravity", &Sector::get_gravity); + cls.addFunc("is_free_of_solid_tiles", &Sector::is_free_of_solid_tiles); + cls.addFunc("is_free_of_statics", &Sector::is_free_of_statics); + cls.addFunc("is_free_of_movingstatics", &Sector::is_free_of_movingstatics); + cls.addFunc("is_free_of_specifically_movingstatics", &Sector::is_free_of_specifically_movingstatics); + + cls.addVar("gravity", &Sector::m_gravity); +} + /* EOF */ diff --git a/src/supertux/sector.hpp b/src/supertux/sector.hpp index a4d342d6c31..bcc603f07c3 100644 --- a/src/supertux/sector.hpp +++ b/src/supertux/sector.hpp @@ -49,14 +49,23 @@ class TextObject; class TileMap; class Writer; -/** Represents one of (potentially) multiple, separate parts of a Level. - Sectors contain GameObjects, e.g. Badguys and Players. */ +/** + * Represents one of (potentially) multiple, separate parts of a Level. + Sectors contain GameObjects, e.g. Badguys and Players. + */ +/** + * @scripting + * @summary This class provides additional controlling functions for a sector, other than the ones listed at ${SRG_REF_GameObjectManager}. + * @instances An instance under ""sector.settings"" is available from scripts and the console. + */ class Sector final : public Base::Sector { -public: friend class CollisionSystem; friend class EditorSectorMenu; +public: + static void register_class(ssq::VM& vm); + private: static Sector* s_current; @@ -71,6 +80,8 @@ class Sector final : public Base::Sector void finish_construction(bool editable) override; + std::string get_exposed_class_name() const override { return "Sector"; } + Level& get_level() const { return m_level; } TileSet* get_tileset() const override; bool in_worldmap() const override; @@ -101,22 +112,69 @@ class Sector final : public Base::Sector /** Checks if the specified rectangle is free of (solid) tiles. Note that this does not include static objects, e.g. bonus blocks. */ bool is_free_of_tiles(const Rectf& rect, const bool ignoreUnisolid = false, uint32_t tiletype = Tile::SOLID) const; + /** + * @scripting + * @description Checks if the specified sector-relative rectangle is free of solid tiles. + * @param float $left + * @param float $top + * @param float $right + * @param float $bottom + * @param bool $ignore_unisolid If ""true"", unisolid tiles will be ignored. + */ + bool is_free_of_solid_tiles(float left, float top, float right, float bottom, + bool ignore_unisolid) const; /** Checks if the specified rectangle is free of both 1.) solid tiles and 2.) MovingObjects in COLGROUP_STATIC. Note that this does not include badguys or players. */ bool is_free_of_statics(const Rectf& rect, const MovingObject* ignore_object = nullptr, const bool ignoreUnisolid = false) const; + /** + * @scripting + * @description Checks if the specified sector-relative rectangle is free of both: + 1) Solid tiles. + 2) ""MovingObject""s in ""COLGROUP_STATIC"". + Note: This does not include badguys or players. + * @param float $left + * @param float $top + * @param float $right + * @param float $bottom + * @param bool $ignore_unisolid If ""true"", unisolid tiles will be ignored. + */ + bool is_free_of_statics(float left, float top, float right, float bottom, + bool ignore_unisolid) const; /** Checks if the specified rectangle is free of both 1.) solid tiles and 2.) MovingObjects in COLGROUP_STATIC, COLGROUP_MOVINGSTATIC or COLGROUP_MOVING. This includes badguys and players. */ bool is_free_of_movingstatics(const Rectf& rect, const MovingObject* ignore_object = nullptr) const; + /** + * @scripting + * @description Checks if the specified sector-relative rectangle is free of both: + 1) Solid tiles. + 2) ""MovingObject""s in ""COLGROUP_STATIC"", ""COLGROUP_MOVINGSTATIC"" or ""COLGROUP_MOVING"". + This includes badguys and players. + * @param float $left + * @param float $top + * @param float $right + * @param float $bottom + */ + bool is_free_of_movingstatics(float left, float top, float right, float bottom) const; /** Checks if the specified rectangle is free of MovingObjects in COLGROUP_MOVINGSTATIC. Note that this does not include moving badguys, or players */ bool is_free_of_specifically_movingstatics(const Rectf& rect, const MovingObject* ignore_object = nullptr) const; + /** + * @scripting + * @description Checks if the specified sector-relative rectangle is free of ""MovingObject""s in ""COLGROUP_MOVINGSTATIC"". + Note: This does not include moving badguys or players. + * @param float $left + * @param float $top + * @param float $right + * @param float $bottom + */ + bool is_free_of_specifically_movingstatics(float left, float top, float right, float bottom) const; CollisionSystem::RaycastResult get_first_line_intersection(const Vector& line_start, const Vector& line_end, @@ -146,9 +204,20 @@ class Sector final : public Base::Sector /** globally changes solid tilemaps' tile ids */ void change_solid_tiles(uint32_t old_tile_id, uint32_t new_tile_id); - /** set gravity throughout sector */ + /** + * @scripting + * @deprecated Use the ""gravity"" property instead! + * Sets the sector's gravity. + * @param float $gravity + */ void set_gravity(float gravity); - float get_gravity() const { return m_gravity; } + /** + * @scripting + * @deprecated Use the ""gravity"" property instead! + * Returns the sector's gravity. + * @param float $gravity + */ + float get_gravity() const; Camera& get_camera() const; std::vector get_players() const; @@ -178,6 +247,10 @@ class Sector final : public Base::Sector int m_foremost_layer; int m_foremost_opaque_layer; + /** + * @scripting + * @description The sector's gravity. + */ float m_gravity; std::unique_ptr m_collision_system; diff --git a/src/supertux/sector_base.cpp b/src/supertux/sector_base.cpp index aad09d6106e..24acd9b0898 100644 --- a/src/supertux/sector_base.cpp +++ b/src/supertux/sector_base.cpp @@ -16,6 +16,7 @@ #include "supertux/sector_base.hpp" +#include "squirrel/squirrel_virtual_machine.hpp" #include "util/log.hpp" namespace Base { @@ -43,14 +44,14 @@ Sector::run_script(const std::string& script, const std::string& sourcename) bool Sector::before_object_add(GameObject& object) { - m_squirrel_environment->try_expose(object); + m_squirrel_environment->expose(object, object.get_name()); return true; } void Sector::before_object_remove(GameObject& object) { - m_squirrel_environment->try_unexpose(object); + m_squirrel_environment->unexpose(object.get_name()); } } // namespace Base diff --git a/src/supertux/statistics.cpp b/src/supertux/statistics.cpp index 091d84ed2a4..e5bafd36a15 100644 --- a/src/supertux/statistics.cpp +++ b/src/supertux/statistics.cpp @@ -22,9 +22,10 @@ #include #include +#include + #include "audio/sound_manager.hpp" #include "math/util.hpp" -#include "squirrel/squirrel_util.hpp" #include "supertux/globals.hpp" #include "supertux/level.hpp" #include "supertux/resources.hpp" @@ -93,39 +94,37 @@ Statistics::calculate_max_caption_length() } void -Statistics::serialize_to_squirrel(SquirrelVM& vm) const +Statistics::serialize_to_squirrel(ssq::Table& table) const { if (m_status != FINAL) return; - vm.begin_table("statistics"); - vm.store_int("coins-collected", m_coins); - vm.store_int("badguys-killed", m_badguys); - vm.store_int("secrets-found", m_secrets); - vm.store_float("time-needed", m_time); - vm.store_int("coins-collected-total", m_total_coins); - vm.store_int("badguys-killed-total", m_total_badguys); - vm.store_int("secrets-found-total", m_total_secrets); - vm.end_table("statistics"); + ssq::Table statistics = table.addTable("statistics"); + statistics.set("coins-collected", m_coins); + statistics.set("badguys-killed", m_badguys); + statistics.set("secrets-found", m_secrets); + statistics.set("time-needed", m_time); + statistics.set("coins-collected-total", m_total_coins); + statistics.set("badguys-killed-total", m_total_badguys); + statistics.set("secrets-found-total", m_total_secrets); } void -Statistics::unserialize_from_squirrel(SquirrelVM& vm) +Statistics::unserialize_from_squirrel(const ssq::Table& table) { try { - vm.get_table_entry("statistics"); - vm.get_int("coins-collected", m_coins); - vm.get_int("badguys-killed", m_badguys); - vm.get_int("secrets-found", m_secrets); - vm.get_float("time-needed", m_time); - vm.get_int("coins-collected-total", m_total_coins); - vm.get_int("badguys-killed-total", m_total_badguys); - vm.get_int("secrets-found-total", m_total_secrets); - sq_pop(vm.get_vm(), 1); + const ssq::Table statistics = table.findTable("statistics"); + statistics.get("coins-collected", m_coins); + statistics.get("badguys-killed", m_badguys); + statistics.get("secrets-found", m_secrets); + statistics.get("time-needed", m_time); + statistics.get("coins-collected-total", m_total_coins); + statistics.get("badguys-killed-total", m_total_badguys); + statistics.get("secrets-found-total", m_total_secrets); m_status = FINAL; } - catch(const std::exception&) + catch(const ssq::NotFoundException&) { // ignore non-existing or malformed statistics table } diff --git a/src/supertux/statistics.hpp b/src/supertux/statistics.hpp index b2d1206ac5b..3a61934919b 100644 --- a/src/supertux/statistics.hpp +++ b/src/supertux/statistics.hpp @@ -25,7 +25,10 @@ class DrawingContext; class Level; -class SquirrelVM; + +namespace ssq { +class Table; +} // namespace ssq /** This class is a layer between level and worldmap to keep track of stuff like scores, and minor, but funny things, like @@ -50,10 +53,10 @@ class Statistics final Statistics(); /**< Creates new statistics, call reset() before counting */ /** serialize statistics object as squirrel table "statistics" */ - void serialize_to_squirrel(SquirrelVM& vm) const; + void serialize_to_squirrel(ssq::Table& table) const; /** unserialize statistics object from squirrel table "statistics" */ - void unserialize_from_squirrel(SquirrelVM& vm); + void unserialize_from_squirrel(const ssq::Table& table); void draw_worldmap_info(DrawingContext& context, float target_time); /**< draw worldmap stat HUD */ void draw_endseq_panel(DrawingContext& context, Statistics* best_stats, const SurfacePtr& backdrop, float target_time); /**< draw panel shown during level's end sequence */ diff --git a/src/supertux/title_screen.cpp b/src/supertux/title_screen.cpp index ae2667cd533..275913e9bd2 100644 --- a/src/supertux/title_screen.cpp +++ b/src/supertux/title_screen.cpp @@ -72,6 +72,7 @@ void TitleScreen::leave() { m_titlesession->get_current_sector().deactivate(); + m_titlesession->leave(); MenuManager::instance().clear_menu_stack(); } diff --git a/src/worldmap/world_select.cpp b/src/worldmap/world_select.cpp index 0e2220ee8c4..4d9aac46136 100644 --- a/src/worldmap/world_select.cpp +++ b/src/worldmap/world_select.cpp @@ -20,6 +20,7 @@ #include "control/controller.hpp" #include "math/util.hpp" +#include "squirrel/squirrel_virtual_machine.hpp" #include "supertux/constants.hpp" #include "supertux/fadetoblack.hpp" #include "supertux/resources.hpp" @@ -44,93 +45,91 @@ WorldSelect::WorldSelect(const std::string& current_world_filename) : m_angle(), m_bkg() { - std::vector worlds; - auto& vm = SquirrelVirtualMachine::current()->get_vm(); - SQInteger oldtop = sq_gettop(vm.get_vm()); - - sq_pushroottable(vm.get_vm()); - try { - vm.get_table_entry("state"); - vm.get_table_entry("world_select"); - worlds = vm.get_table_keys(); - } catch(const std::exception&) {} - - if (worlds.size() > 0) - std::reverse(worlds.begin(), worlds.end()); - - // Only worlds with a set prefix, which also are numbered starting with 1, will be ordered properly. - // This is a probably a poor solution, but I can't think of any other. - Daniel - std::string prefix = ""; - vm.get_string("prefix", prefix); - if (!prefix.empty()) - { - for (int i = 0; unsigned(i) < worlds.size(); i++) - { - worlds[i] = prefix + std::to_string(i+1) + "/worldmap.stwm"; - } - } int i = 0; - for (const auto& world : worlds) { - sq_pushroottable(vm.get_vm()); - try { - vm.get_table_entry("state"); - vm.get_table_entry("world_select"); - vm.get_table_entry(world); - - bool unlocked = false; - vm.get_bool("unlocked", unlocked); - - WMdata wm; - wm.filename = world; - wm.unlocked = unlocked; - - ReaderDocument doc = ReaderDocument::from_file(world); - if (!doc.get_root().get_mapping().get("name", wm.name)) - { - log_warning << "No name for worldmap " << world << std::endl; - continue; - } + try + { + ssq::Table world_select = vm.findTable("state").findTable("world_select"); + std::vector worlds = world_select.getKeys(); - std::string icon_path = ""; - if (!doc.get_root().get_mapping().get(unlocked ? "icon" : "icon-locked", icon_path)) - { - log_warning << "No icon (" << (unlocked ? "unlocked" : "locked") << ") for worldmap " << world << std::endl; - continue; - } + if (!worlds.empty()) + std::reverse(worlds.begin(), worlds.end()); - wm.icon = Surface::from_file(icon_path); - if (!wm.icon) + // Only worlds with a set prefix, which also are numbered starting with 1, will be ordered properly. + // This is a probably a poor solution, but I can't think of any other. - Daniel + std::string prefix; + world_select.get("prefix", prefix); + if (!prefix.empty()) + { + for (size_t y = 0; y < worlds.size(); y++) { - log_warning << "Icon not found for worldmap " << world << ": " - << icon_path << std::endl; - continue; + worlds[y] = prefix + std::to_string(y + 1) + "/worldmap.stwm"; } + } - m_worlds.push_back(wm); - if (current_world_filename == world) + for (const std::string& world : worlds) + { + try { - m_current_world = i; + ssq::Table world_table = world_select.findTable(world.c_str()); + + bool unlocked = false; + world_table.get("unlocked", unlocked); - std::string bkg_path = ""; - if (doc.get_root().get_mapping().get("bkg", bkg_path)) + WMdata wm; + wm.filename = world; + wm.unlocked = unlocked; + + ReaderDocument doc = ReaderDocument::from_file(world); + if (!doc.get_root().get_mapping().get("name", wm.name)) { - m_bkg = Surface::from_file(bkg_path); + log_warning << "No name for worldmap " << world << std::endl; + continue; } - else + + std::string icon_path = ""; + if (!doc.get_root().get_mapping().get(unlocked ? "icon" : "icon-locked", icon_path)) { - m_bkg = Surface::from_file("/images/worlds/background/default.png"); + log_warning << "No icon (" << (unlocked ? "unlocked" : "locked") << ") for worldmap " << world << std::endl; + continue; } - } - i++; - } catch(const std::exception& e) { - log_info << "Exception thrown while generating world state: " << e.what() << std::endl; + wm.icon = Surface::from_file(icon_path); + if (!wm.icon) + { + log_warning << "Icon not found for worldmap " << world << ": " + << icon_path << std::endl; + continue; + } + + m_worlds.push_back(wm); + if (current_world_filename == world) + { + m_current_world = i; + + std::string bkg_path = ""; + if (doc.get_root().get_mapping().get("bkg", bkg_path)) + { + m_bkg = Surface::from_file(bkg_path); + } + else + { + m_bkg = Surface::from_file("/images/worlds/background/default.png"); + } + } + i++; + } + catch(const std::exception& e) + { + log_info << "Exception thrown while generating world state: " << e.what() << std::endl; + } } } - - sq_settop(vm.get_vm(), oldtop); + catch (const std::exception& err) + { + log_warning << "Couldn't load world select data: " << err.what() << std::endl; + } m_selected_world = m_current_world; m_angle = static_cast(m_current_world) / static_cast(i) * math::PI * 2; diff --git a/src/worldmap/worldmap_sector.cpp b/src/worldmap/worldmap_sector.cpp index 4244d155ade..c7d4ada2ca4 100644 --- a/src/worldmap/worldmap_sector.cpp +++ b/src/worldmap/worldmap_sector.cpp @@ -18,13 +18,15 @@ #include "worldmap/worldmap_sector.hpp" +#include +#include + #include "audio/sound_manager.hpp" #include "object/ambient_light.hpp" #include "object/display_effect.hpp" #include "object/music_object.hpp" #include "object/tilemap.hpp" #include "physfs/ifile_stream.hpp" -#include "scripting/worldmap_sector.hpp" #include "squirrel/squirrel_environment.hpp" #include "supertux/constants.hpp" #include "supertux/d_scope.hpp" @@ -130,7 +132,7 @@ WorldMapSector::setup() // register worldmap_table as "worldmap" in scripting m_squirrel_environment->expose_self(); - m_squirrel_environment->expose("settings", std::make_unique(this)); + m_squirrel_environment->expose(*this, "settings"); /** Perform scripting related actions. **/ // Run default.nut just before init script @@ -568,6 +570,24 @@ WorldMapSector::path_ok(const Direction& direction, const Vector& old_pos, Vecto } } +void +WorldMapSector::set_sector(const std::string& sector) +{ + m_parent.set_sector(sector); +} + +void +WorldMapSector::spawn(const std::string& sector, const std::string& spawnpoint) +{ + m_parent.set_sector(sector, spawnpoint); +} + +void +WorldMapSector::move_to_spawnpoint(const std::string& spawnpoint) +{ + move_to_spawnpoint(spawnpoint, false); +} + void WorldMapSector::move_to_spawnpoint(const std::string& spawnpoint, bool pan) { @@ -608,6 +628,45 @@ WorldMapSector::get_tux_pos() const return m_tux->get_pos(); } +float +WorldMapSector::get_tux_x() const +{ + return m_tux->get_pos().x; +} + +float +WorldMapSector::get_tux_y() const +{ + return m_tux->get_pos().y; +} + +std::string +WorldMapSector::get_filename() const +{ + return m_parent.get_filename(); +} + +void +WorldMapSector::set_title_level(const std::string& filename) +{ + m_parent.get_savegame().get_player_status().title_level = filename; +} + + +void +WorldMapSector::register_class(ssq::VM& vm) +{ + ssq::Class cls = vm.addAbstractClass("WorldMapSector", vm.findClass("GameObjectManager")); + + cls.addFunc("get_tux_x", &WorldMapSector::get_tux_x); + cls.addFunc("get_tux_y", &WorldMapSector::get_tux_y); + cls.addFunc("set_sector", &WorldMapSector::set_sector); + cls.addFunc("spawn", &WorldMapSector::spawn); + cls.addFunc("move_to_spawnpoint", &WorldMapSector::move_to_spawnpoint); + cls.addFunc("get_filename", &WorldMapSector::get_filename); + cls.addFunc("set_title_level", &WorldMapSector::set_title_level); +} + } // namespace worldmap /* EOF */ diff --git a/src/worldmap/worldmap_sector.hpp b/src/worldmap/worldmap_sector.hpp index 262b2f48e39..69134751877 100644 --- a/src/worldmap/worldmap_sector.hpp +++ b/src/worldmap/worldmap_sector.hpp @@ -36,6 +36,9 @@ class WorldMapSector final : public Base::Sector friend class WorldMapSectorParser; friend class WorldMapState; +public: + static void register_class(ssq::VM& vm); + public: static WorldMapSector* current(); @@ -45,16 +48,14 @@ class WorldMapSector final : public Base::Sector void finish_construction(bool editable) override; + std::string get_exposed_class_name() const override { return "WorldMapSector"; } + void setup(); void leave(); void draw(DrawingContext& context) override; void update(float dt_sec) override; - MovingObject& add_object_scripting(const std::string& class_name, const std::string& name, - const Vector& pos, const std::string& direction, - const std::string& data) override; - Vector get_next_tile(const Vector& pos, const Direction& direction) const; /** gets a bitfield of Tile::WORLDMAP_NORTH | Tile::WORLDMAP_WEST | @@ -97,16 +98,50 @@ class WorldMapSector final : public Base::Sector if possible, write the new position to \a new_pos */ bool path_ok(const Direction& direction, const Vector& old_pos, Vector* new_pos) const; - /** Moves Tux to the given spawnpoint - @param spawnpoint Name of the spawnpoint to move to - @param pan Pan the camera during to new spawnpoint */ - void move_to_spawnpoint(const std::string& spawnpoint, bool pan = false); - /** Sets the name of the tilemap that should fade when worldmap is set up. */ void set_initial_fade_tilemap(const std::string& tilemap_name, int direction); bool in_worldmap() const override { return true; } + /** + * Returns Tux's X position on the worldmap. + */ + float get_tux_x() const; + /** + * Returns Tux's Y position on the worldmap. + */ + float get_tux_y() const; + + /** + * Changes the current sector of the worldmap to a specified new sector. + * @param string $sector + */ + void set_sector(const std::string& sector); + /** + * Changes the current sector of the worldmap to a specified new sector, + moving Tux to the specified spawnpoint. + * @param string $sector + * @param string $spawnpoint + */ + void spawn(const std::string& sector, const std::string& spawnpoint); + /** + * Moves Tux to the specified spawnpoint. + * @param string $spawnpoint + */ + void move_to_spawnpoint(const std::string& spawnpoint); + void move_to_spawnpoint(const std::string& spawnpoint, bool pan); + + /** + * Gets the path to the worldmap file. Useful for saving worldmap-specific data. + */ + std::string get_filename() const; + /** + * Overrides the "Title Screen Level" property for the world with ""filename"". + The newly set level will be used for the title screen, after exiting the world. + * @param string $filename + */ + void set_title_level(const std::string& filename); + TileSet* get_tileset() const override; WorldMap& get_worldmap() const { return m_parent; } Camera& get_camera() const { return *m_camera; } @@ -114,6 +149,10 @@ class WorldMapSector final : public Base::Sector Vector get_tux_pos() const; protected: + MovingObject& add_object_scripting(const std::string& class_name, const std::string& name, + const Vector& pos, const std::string& direction, + const std::string& data) override; + void draw_status(DrawingContext& context); private: diff --git a/src/worldmap/worldmap_state.cpp b/src/worldmap/worldmap_state.cpp index 4961d21c78b..423bd21c79d 100644 --- a/src/worldmap/worldmap_state.cpp +++ b/src/worldmap/worldmap_state.cpp @@ -21,6 +21,7 @@ #include "math/vector.hpp" #include "object/music_object.hpp" #include "object/tilemap.hpp" +#include "squirrel/squirrel_virtual_machine.hpp" #include "squirrel/squirrel_util.hpp" #include "supertux/constants.hpp" #include "supertux/savegame.hpp" @@ -46,64 +47,63 @@ WorldMapState::load_state() { log_debug << "loading worldmap state" << std::endl; - WORLDMAP_STATE_SQUIRREL_VM_GUARD; - SQInteger oldtop = sq_gettop(vm.get_vm()); - - try { - /** Get state table. **/ - sq_pushroottable(vm.get_vm()); - vm.get_table_entry("state"); - + ssq::VM& vm = SquirrelVirtualMachine::current()->get_vm(); + try + { /** Get state table for all worldmaps. **/ - vm.get_table_entry("worlds"); + ssq::Table worlds_table = vm.findTable("state").findTable("worlds"); // If a non-canonical entry is present, replace it with a canonical one. const std::string old_map_filename = m_worldmap.m_map_filename.substr(1); - if (vm.has_property(old_map_filename.c_str())) - { - vm.rename_table_entry(old_map_filename.c_str(), m_worldmap.m_map_filename.c_str()); - } + if (worlds_table.hasEntry(old_map_filename.c_str())) + worlds_table.rename(old_map_filename.c_str(), m_worldmap.m_map_filename.c_str()); /** Get state table for the current worldmap. **/ - vm.get_table_entry(m_worldmap.m_map_filename); + ssq::Table worldmap_table = worlds_table.findTable(m_worldmap.m_map_filename.c_str()); // Load the current sector. - if (vm.has_property("sector")) // Load the current sector, only if a "sector" property exists. + ssq::Table sector_table; + if (worldmap_table.hasEntry("sector")) // Load the current sector only if a "sector" property exists. { - const std::string sector_name = vm.read_string("sector"); + const std::string sector_name = worldmap_table.get("sector"); if (!m_worldmap.m_sector) // If the worldmap doesn't have a current sector, try setting the new sector. m_worldmap.set_sector(sector_name, "", false); - WORLDMAP_STATE_SECTOR_GUARD; - /** Get state table for the current sector. **/ - vm.get_table_entry(sector.get_name().c_str()); + sector_table = worldmap_table.findTable(m_worldmap.get_sector().get_name().c_str()); } else // Sector property does not exist, which may indicate outdated save file. { if (!m_worldmap.m_sector) // If the worldmap doesn't have a current sector, try setting the main one. m_worldmap.set_sector(DEFAULT_SECTOR_NAME, "", false); + + sector_table = worldmap_table; } + if (!m_worldmap.m_sector) { // Quit loading worldmap state, if there is still no current sector loaded. throw std::runtime_error("No sector set."); } - - if (vm.has_property("music")) + + try { - const std::string music = vm.read_string("music"); + ssq::Object music = sector_table.find("music"); auto& music_object = m_worldmap.get_sector().get_singleton_by_type(); - music_object.set_music(music); + music_object.set_music(music.toString()); + } + catch (const ssq::NotFoundException&) + { + log_debug << "Could not find \"music\" in the worldmap sector state table." << std::endl; } /** Load objects. **/ - load_tux(); - load_levels(); - load_tilemap_visibility(); - load_sprite_change_objects(); + load_tux(sector_table); + load_levels(sector_table); + load_tilemap_visibility(sector_table); + load_sprite_change_objects(sector_table); } - catch (std::exception& err) + catch (const std::exception& err) { log_warning << "Not loading worldmap state: " << err.what() << std::endl; @@ -114,7 +114,6 @@ WorldMapState::load_state() // Create a new initial save. save_state(); } - sq_settop(vm.get_vm(), oldtop); m_worldmap.m_in_level = false; } @@ -122,109 +121,94 @@ WorldMapState::load_state() /** Load Tux **/ void -WorldMapState::load_tux() +WorldMapState::load_tux(const ssq::Table& table) { - WORLDMAP_STATE_SQUIRREL_VM_GUARD; - WORLDMAP_STATE_SECTOR_GUARD; + WorldMapSector& sector = m_worldmap.get_sector(); - vm.get_table_entry("tux"); + const ssq::Table tux = table.findTable("tux"); Vector p(0.0f, 0.0f); - if (!vm.get_float("x", p.x) || !vm.get_float("y", p.y)) + if (!tux.get("x", p.x) || !tux.get("y", p.y)) { log_warning << "Player position not set, respawning." << std::endl; sector.move_to_spawnpoint(DEFAULT_SPAWNPOINT_NAME); m_position_was_reset = true; } - std::string back_str = vm.read_string("back"); + + std::string back_str; + tux.get("back", back_str); sector.m_tux->m_back_direction = string_to_direction(back_str); sector.m_tux->set_tile_pos(p); int tile_data = sector.tile_data_at(p); - if (!( tile_data & ( Tile::WORLDMAP_NORTH | Tile::WORLDMAP_SOUTH | Tile::WORLDMAP_WEST | Tile::WORLDMAP_EAST ))) { + if (!(tile_data & (Tile::WORLDMAP_NORTH | Tile::WORLDMAP_SOUTH | Tile::WORLDMAP_WEST | Tile::WORLDMAP_EAST))) + { log_warning << "Player at illegal position " << p.x << ", " << p.y << " respawning." << std::endl; sector.move_to_spawnpoint(DEFAULT_SPAWNPOINT_NAME); m_position_was_reset = true; } - sq_pop(vm.get_vm(), 1); } /** Load levels **/ void -WorldMapState::load_levels() +WorldMapState::load_levels(const ssq::Table& table) { - WORLDMAP_STATE_SQUIRREL_VM_GUARD; - WORLDMAP_STATE_SECTOR_GUARD; + try + { + const ssq::Table levels_table = table.findTable("levels"); - vm.get_or_create_table_entry("levels"); - for (auto& level : sector.get_objects_by_type()) { - sq_pushstring(vm.get_vm(), level.get_level_filename().c_str(), -1); - if (SQ_SUCCEEDED(sq_get(vm.get_vm(), -2))) + for (auto& level_tile : m_worldmap.get_sector().get_objects_by_type()) { - bool solved = false; - vm.get_bool("solved", solved); - level.set_solved(solved); + try + { + const ssq::Table level = levels_table.findTable(level_tile.get_level_filename().c_str()); + + bool solved = false; + level.get("solved", solved); + level_tile.set_solved(solved); - bool perfect = false; - vm.get_bool("perfect", perfect); - level.set_perfect(perfect); + bool perfect = false; + level.get("perfect", perfect); + level_tile.set_perfect(perfect); - level.update_sprite_action(); - level.get_statistics().unserialize_from_squirrel(vm); - sq_pop(vm.get_vm(), 1); + level_tile.update_sprite_action(); + level_tile.get_statistics().unserialize_from_squirrel(level); + } + catch (const ssq::NotFoundException&) + { + // Level not saved. + } } } - sq_pop(vm.get_vm(), 1); + catch (const ssq::NotFoundException&) + { + // Level table not saved. + } } /** Load tilemap visibility **/ void -WorldMapState::load_tilemap_visibility() +WorldMapState::load_tilemap_visibility(const ssq::Table& table) { - WORLDMAP_STATE_SQUIRREL_VM_GUARD; - WORLDMAP_STATE_SECTOR_GUARD; + if (m_position_was_reset) return; + WorldMapSector& sector = m_worldmap.get_sector(); try { - if (!m_position_was_reset) + const std::map tilemaps = table.findTable("tilemaps").convertRaw(); + for (const auto& [key, value] : tilemaps) { - vm.get_table_entry("tilemaps"); - sq_pushnull(vm.get_vm()); // Null-iterator - while (SQ_SUCCEEDED(sq_next(vm.get_vm(), -2))) + TileMap* tilemap = sector.get_object_by_name(key); + if (tilemap) { - const char* key; // Name of specific tilemap table - if (SQ_SUCCEEDED(sq_getstring(vm.get_vm(), -2, &key))) - { - auto tilemap = sector.get_object_by_name(key); - if (tilemap != nullptr) - { - sq_pushnull(vm.get_vm()); // null iterator (inner); - while (SQ_SUCCEEDED(sq_next(vm.get_vm(), -2))) - { - const char* property_key; - if (SQ_SUCCEEDED(sq_getstring(vm.get_vm(), -2, &property_key))) - { - auto propKey = std::string(property_key); - if (propKey == "alpha") - { - float alpha_value = 1.0; - if (SQ_SUCCEEDED(sq_getfloat(vm.get_vm(), -1, &alpha_value))) - { - tilemap->set_alpha(alpha_value); - } - } - } - sq_pop(vm.get_vm(), 2); // Pop key/value from the stack - } - sq_pop(vm.get_vm(), 1); // Pop null iterator - } - } - sq_pop(vm.get_vm(), 2); // Pop key value pair from stack + const ssq::Table tilemap_table = value.toTable(); + + float alpha = 1.f; + tilemap_table.get("alpha", alpha); + tilemap->set_alpha(alpha); } - sq_pop(vm.get_vm(), 1); // Pop null - sq_pop(vm.get_vm(), 1); // leave tilemaps table } } - catch(const SquirrelError&) + catch (const ssq::Exception&) { // Failed to get tilemap entry. This could indicate // that no savable tilemaps have been found. In any @@ -234,40 +218,31 @@ WorldMapState::load_tilemap_visibility() /** Load sprite change objects **/ void -WorldMapState::load_sprite_change_objects() +WorldMapState::load_sprite_change_objects(const ssq::Table& table) { - WORLDMAP_STATE_SQUIRREL_VM_GUARD; - WORLDMAP_STATE_SECTOR_GUARD; + if (m_worldmap.get_sector().get_object_count() <= 0) return; - if (sector.get_object_count() > 0) + const ssq::Table sprite_changes = table.findTable("sprite-changes"); + for (auto& sc : m_worldmap.get_sector().get_objects_by_type()) { - vm.get_table_entry("sprite-changes"); - for (auto& sc : sector.get_objects_by_type()) + const std::string key = std::to_string(static_cast(sc.get_pos().x)) + "_" + + std::to_string(static_cast(sc.get_pos().y)); + + try { - auto key = std::to_string(int(sc.get_pos().x)) + "_" + - std::to_string(int(sc.get_pos().y)); - sq_pushstring(vm.get_vm(), key.c_str(), -1); - if (SQ_SUCCEEDED(sq_get(vm.get_vm(), -2))) { - bool show_stay_action = false; - if (!vm.get_bool("show-stay-action", show_stay_action)) - { - sc.clear_stay_action(/* propagate = */ false); - } - else - { - if (show_stay_action) - { - sc.set_stay_action(); - } - else - { - sc.clear_stay_action(/* propagate = */ false); - } - } - sq_pop(vm.get_vm(), 1); - } + const ssq::Table sprite_change = sprite_changes.findTable(key.c_str()); + + bool show_stay_action = false; + sprite_change.get("show-stay-action", show_stay_action); + if (show_stay_action) + sc.set_stay_action(); + else + sc.clear_stay_action(/* propagate = */ false); + } + catch (const ssq::NotFoundException&) + { + // Sprite change not saved. } - sq_pop(vm.get_vm(), 1); // Leave sprite change objects table. } } @@ -277,135 +252,72 @@ WorldMapState::save_state() const { WorldMapSector& sector = m_worldmap.get_sector(); - SquirrelVM& vm = SquirrelVirtualMachine::current()->get_vm(); - SQInteger oldtop = sq_gettop(vm.get_vm()); - - try { - /** Get state table. **/ - sq_pushroottable(vm.get_vm()); - vm.get_table_entry("state"); - + ssq::VM& vm = SquirrelVirtualMachine::current()->get_vm(); + try + { /** Get or create state table for all worldmaps. **/ - vm.get_or_create_table_entry("worlds"); + ssq::Table worlds_table = vm.findTable("state").getOrCreateTable("worlds"); /** Get or create state table for the current worldmap. **/ - vm.get_or_create_table_entry(m_worldmap.m_map_filename); + ssq::Table worldmap_table = worlds_table.getOrCreateTable(m_worldmap.m_map_filename.c_str()); // Save the current sector. - vm.store_string("sector", sector.get_name()); + worldmap_table.set("sector", sector.get_name()); /** Delete the table entry for the current sector and construct a new one. **/ - vm.delete_table_entry(sector.get_name().c_str()); - vm.begin_table(sector.get_name().c_str()); + worldmap_table.remove(sector.get_name().c_str()); + ssq::Table sector_table = worldmap_table.addTable(sector.get_name().c_str()); + /** Save Music **/ auto& music_object = m_worldmap.get_sector().get_singleton_by_type(); - vm.store_string("music", music_object.get_music()); - - /** Save objects. **/ - save_tux(); - save_levels(); - save_tilemap_visibility(); - save_sprite_change_objects(); - - /** Push the current sector into the current worldmap table. **/ - vm.end_table(sector.get_name().c_str()); - } - catch (std::exception& err) - { - log_warning << "Failed to save worldmap state: " << err.what() << std::endl; - - sq_settop(vm.get_vm(), oldtop); - } - - sq_settop(vm.get_vm(), oldtop); - - m_worldmap.m_savegame.save(); -} + sector_table.set("music", music_object.get_music()); + /** Save Tux **/ + ssq::Table tux = sector_table.addTable("tux"); + tux.set("x", sector.m_tux->get_tile_pos().x); + tux.set("y", sector.m_tux->get_tile_pos().y); + tux.set("back", direction_to_string(sector.m_tux->m_back_direction)); -/** Save Tux **/ -void -WorldMapState::save_tux() const -{ - WORLDMAP_STATE_SQUIRREL_VM_GUARD; - WORLDMAP_STATE_SECTOR_GUARD; - - vm.begin_table("tux"); - vm.store_float("x", sector.m_tux->get_tile_pos().x); - vm.store_float("y", sector.m_tux->get_tile_pos().y); - vm.store_string("back", direction_to_string(sector.m_tux->m_back_direction)); - vm.end_table("tux"); -} - -/** Save levels **/ -void -WorldMapState::save_levels() const -{ - WORLDMAP_STATE_SQUIRREL_VM_GUARD; - WORLDMAP_STATE_SECTOR_GUARD; - - vm.begin_table("levels"); - for (const auto& level : sector.get_objects_by_type()) - { - vm.begin_table(level.get_level_filename().c_str()); - - vm.store_bool("solved", level.is_solved()); - vm.store_bool("perfect", level.is_perfect()); - - level.get_statistics().serialize_to_squirrel(vm); - vm.end_table(level.get_level_filename().c_str()); - } - vm.end_table("levels"); -} + /** Save levels **/ + ssq::Table levels = sector_table.addTable("levels"); + for (const auto& level_tile : m_worldmap.get_sector().get_objects_by_type()) + { + ssq::Table level = levels.addTable(level_tile.get_level_filename().c_str()); + level.set("solved", level_tile.is_solved()); + level.set("perfect", level_tile.is_perfect()); + level_tile.get_statistics().serialize_to_squirrel(level); + } -/** Save tilemap visibility **/ -void -WorldMapState::save_tilemap_visibility() const -{ - WORLDMAP_STATE_SQUIRREL_VM_GUARD; - WORLDMAP_STATE_SECTOR_GUARD; + /** Save tilemap visibility **/ + ssq::Table tilemaps = sector_table.addTable("tilemaps"); + for (auto& tilemap : m_worldmap.get_sector().get_objects_by_type<::TileMap>()) + { + if (!tilemap.get_name().empty()) + { + ssq::Table tilemap_table = tilemaps.addTable(tilemap.get_name().c_str()); + tilemap_table.set("alpha", tilemap.get_target_alpha()); + } + } - sq_pushstring(vm.get_vm(), "tilemaps", -1); - sq_newtable(vm.get_vm()); - for (auto& tilemap : sector.get_objects_by_type<::TileMap>()) - { - if (!tilemap.get_name().empty()) + /** Save sprite change objects **/ + if (m_worldmap.get_sector().get_object_count() > 0) { - sq_pushstring(vm.get_vm(), tilemap.get_name().c_str(), -1); - sq_newtable(vm.get_vm()); - vm.store_float("alpha", tilemap.get_target_alpha()); - if (SQ_FAILED(sq_createslot(vm.get_vm(), -3))) + ssq::Table sprite_changes = sector_table.addTable("sprite-changes"); + for (const auto& sc : m_worldmap.get_sector().get_objects_by_type()) { - throw std::runtime_error("failed to create '" + m_worldmap.m_name + "' table entry"); + const std::string key = std::to_string(static_cast(sc.get_pos().x)) + "_" + + std::to_string(static_cast(sc.get_pos().y)); + ssq::Table sprite_change = sprite_changes.addTable(key.c_str()); + sprite_change.set("show-stay-action", sc.show_stay_action()); } } } - if (SQ_FAILED(sq_createslot(vm.get_vm(), -3))) + catch (const std::exception& err) { - throw std::runtime_error("failed to create '" + m_worldmap.m_name + "' table entry"); + log_warning << "Failed to save worldmap state: " << err.what() << std::endl; } -} -/** Save sprite change objects **/ -void -WorldMapState::save_sprite_change_objects() const -{ - WORLDMAP_STATE_SQUIRREL_VM_GUARD; - WORLDMAP_STATE_SECTOR_GUARD; - - if (sector.get_object_count() > 0) - { - vm.begin_table("sprite-changes"); - for (const auto& sc : sector.get_objects_by_type()) - { - auto key = std::to_string(int(sc.get_pos().x)) + "_" + - std::to_string(int(sc.get_pos().y)); - vm.begin_table(key.c_str()); - vm.store_bool("show-stay-action", sc.show_stay_action()); - vm.end_table(key.c_str()); - } - vm.end_table("sprite-changes"); - } + m_worldmap.m_savegame.save(); } } // namespace worldmap diff --git a/src/worldmap/worldmap_state.hpp b/src/worldmap/worldmap_state.hpp index edaaac205ca..c0257d39a53 100644 --- a/src/worldmap/worldmap_state.hpp +++ b/src/worldmap/worldmap_state.hpp @@ -19,16 +19,11 @@ #ifndef HEADER_SUPERTUX_WORLDMAP_WORLDMAP_STATE_HPP #define HEADER_SUPERTUX_WORLDMAP_WORLDMAP_STATE_HPP -namespace worldmap { - -/** Macro to allow quick and easy access to the current Squirrel VM. **/ -#define WORLDMAP_STATE_SQUIRREL_VM_GUARD \ - SquirrelVM& vm = SquirrelVirtualMachine::current()->get_vm() - -/** Macro to allow quick and easy access to the current WorldMapSector. **/ -#define WORLDMAP_STATE_SECTOR_GUARD \ - WorldMapSector& sector = m_worldmap.get_sector() +namespace ssq { +class Table; +} // namespace ssq +namespace worldmap { class WorldMap; @@ -41,15 +36,10 @@ class WorldMapState final void save_state() const; private: - void load_tux(); - void load_levels(); - void load_tilemap_visibility(); - void load_sprite_change_objects(); - - void save_tux() const; - void save_levels() const; - void save_tilemap_visibility() const; - void save_sprite_change_objects() const; + void load_tux(const ssq::Table& table); + void load_levels(const ssq::Table& table); + void load_tilemap_visibility(const ssq::Table& table); + void load_sprite_change_objects(const ssq::Table& table); private: WorldMap& m_worldmap; diff --git a/tools/miniswig b/tools/miniswig deleted file mode 160000 index 2ea03004661..00000000000 --- a/tools/miniswig +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2ea030046610d3ee156e6c9c546f5b9c02fc24ef diff --git a/tools/scripting_docs_gen/class.hpp b/tools/scripting_docs_gen/class.hpp index 38b1a763bee..a19c353e327 100644 --- a/tools/scripting_docs_gen/class.hpp +++ b/tools/scripting_docs_gen/class.hpp @@ -17,38 +17,55 @@ #ifndef CLASS_HEADER #define CLASS_HEADER +#include #include #include struct Constant { - std::string type; - std::string name; - std::string description; + std::string type {}; + std::string name {}; + std::string initializer {}; + std::string description {}; +}; + +struct Variable +{ + std::string type {}; + std::string name {}; + std::string description {}; }; struct Parameter { - std::string type; - std::string name; - std::string description; + std::string type {}; + std::string name {}; + std::string description {}; }; struct Function { - std::string type; - std::string name; - std::string description; - std::vector parameters; + std::string type {}; + std::string name {}; + std::string description {}; + std::vector parameters {}; + + bool deprecated {}; + std::string deprecation_msg {}; }; struct Class { - std::string name; - std::string summary; - std::string instances; - std::vector constants; - std::vector functions; + std::string name {}; + std::string summary {}; + std::string instances {}; + std::vector constants {}; + std::vector variables {}; + std::vector functions {}; + + typedef std::map BaseClasses; + BaseClasses base_classes {}; + std::vector derived_classes {}; }; #endif diff --git a/tools/scripting_docs_gen/main.cpp b/tools/scripting_docs_gen/main.cpp index 8d806c7e170..04dd02e445a 100644 --- a/tools/scripting_docs_gen/main.cpp +++ b/tools/scripting_docs_gen/main.cpp @@ -72,20 +72,37 @@ int main(int argc, char** argv) const std::string filename = fspath.filename(); if (!(std::filesystem::is_regular_file(dir_entry) && - starts_with(filename, "classscripting_1_1"))) continue; // Make sure the current file is about "scripting" namespace member class + (starts_with(filename, "class") || starts_with(filename, "namespace")))) continue; // Make sure the current file is about a class or a namespace /** Read data from current XML class data file **/ tinyxml2::XMLDocument doc; doc.LoadFile(fspath.c_str()); - /** Parse the class and its functions **/ + /** Parse the class and its members **/ Class cl; // Store class data Parser::parse_compounddef(doc.RootElement(), cl); - if (cl.constants.empty() && cl.functions.empty()) continue; // If there are no constants or functions, do not create a file + if (cl.constants.empty() && cl.variables.empty() && cl.functions.empty()) continue; // If the class has no content, do not save it - // Save class, so it gets included in the home page - classes.push_back(cl); + // Save the class + classes.push_back(std::move(cl)); + } + + // Sort classes by their names (A-Z) + std::sort(classes.begin(), classes.end(), + [](const Class& lhs, const Class& rhs) { return lhs.name < rhs.name; }); + + /** Loop through all classes and write their data to files **/ + for (Class& cl : classes) + { + // Remove a few internal base classes + for (auto it = cl.base_classes.begin(); it != cl.base_classes.end();) + { + if (it->second == "ssq::ExposableClass" || it->second == "ExposableClass") + cl.base_classes.erase(it++); + else + ++it; + } /** Fill in the data in the provided page template file and save as new file. File entries to be replaced: @@ -107,7 +124,9 @@ int main(int argc, char** argv) // Entries replace(target_data, "${SRG_CLASSSUMMARY}", cl.summary, "None."); replace(target_data, "${SRG_CLASSINSTANCES}", cl.instances, "None."); + replace(target_data, "${SRG_CLASSINHERITANCE}", Writer::write_inheritance_list(classes, cl.base_classes, cl.derived_classes), "None."); replace(target_data, "${SRG_CLASSCONSTANTS}", Writer::write_constants_table(cl.constants), "None."); + replace(target_data, "${SRG_CLASSVARIABLES}", Writer::write_variables_table(cl.variables), "None."); replace(target_data, "${SRG_CLASSFUNCTIONS}", Writer::write_function_table(cl.functions), "None."); replace(target_data, "${SRG_CLASSNAME}", "`" + cl.name + "`"); regex_replace(target_data, std::regex("\\$\\{SRG_REF_(.+?)\\}"), Writer::write_class_ref("$1")); @@ -115,16 +134,14 @@ int main(int argc, char** argv) replace(target_data, "${SRG_NEWPARAGRAPH} ", "\r\n\r\n"); replace(target_data, "${SRG_TABLENEWPARAGRAPH}", "

"); replace(target_data, "\"\"", "`"); + replace(target_data, "NOTE:", "

**NOTE:**"); + replace(target_data, "Note:", "

**NOTE:**"); // Write to target file write_file(output_dir_path / std::filesystem::path("Scripting" + cl.name + ".md"), target_data); std::cout << "Generated reference for class \"" << cl.name << "\"." << std::endl; } - // Sort classes by their names (A-Z) - std::sort(classes.begin(), classes.end(), - [](const Class& lhs, const Class& rhs) { return lhs.name < rhs.name; }); - /** Fill in the data in the provided home page template file and save as new file. File entries to be replaced: "${SRG_CLASSLIST}": Insert a list with all classes which have been parsed. diff --git a/tools/scripting_docs_gen/parser.cpp b/tools/scripting_docs_gen/parser.cpp index d0beb8ae0cc..547fc2cedac 100644 --- a/tools/scripting_docs_gen/parser.cpp +++ b/tools/scripting_docs_gen/parser.cpp @@ -18,12 +18,47 @@ #include #include +#include #include "util.hpp" namespace Parser { -Class* cl = nullptr; +// Simplified versions of various C++ types for easier understanding +static const std::unordered_map s_simplified_types = { + { "SQInteger", "ANY" }, // SQInteger is used internally with Squirrel, so we don't know the exact return type + { "char", "int" }, + { "signed char", "int" }, + { "short", "int" }, + { "long", "int" }, + { "unsigned char", "int" }, + { "unsigned short", "int" }, + { "unsigned int", "int" }, + { "unsigned long", "int" }, + { "uint8_t", "int" }, + { "uint16_t", "int" }, + { "uint32_t", "int" }, + { "long long", "int" }, + { "unsigned long long", "int" }, + { "double", "float" }, + { "std::string", "string" }, + { "std::wstring", "string" } +}; + +static void parse_base_classes(tinyxml2::XMLElement* p_inheritancenode, tinyxml2::XMLElement* p_inheritancegraph, Class::BaseClasses& list) +{ + list[std::stoi(p_inheritancenode->FindAttribute("id")->Value())] = p_inheritancenode->FirstChildElement("label")->GetText(); + + tinyxml2::XMLElement* p_childnode = p_inheritancenode->FirstChildElement("childnode"); + while (p_childnode) + { + tinyxml2::XMLElement* p_childinheritancenode = first_child_with_attribute(p_inheritancegraph, "node", "id", p_childnode->FindAttribute("refid")->Value()); + if (p_childinheritancenode) + parse_base_classes(p_childinheritancenode, p_inheritancegraph, list); + + p_childnode = p_childnode->NextSiblingElement("childnode"); + } +} void parse_compounddef(tinyxml2::XMLElement* p_root, Class& cls) @@ -31,15 +66,35 @@ void parse_compounddef(tinyxml2::XMLElement* p_root, Class& cls) tinyxml2::XMLElement* p_compounddef = p_root->FirstChildElement("compounddef"); // Get general class info - cls.name = p_compounddef->FirstChildElement("compoundname")->GetText(); - replace(cls.name, "scripting::", ""); // Leave only the class name + const char* name = p_compounddef->FirstChildElement("compoundname")->GetText(); + if (!name) return; // Some namespaces may not have a name. Don't include those. + cls.name = name; + + // Leave only the class name + const size_t pos = cls.name.find_last_of("::"); + if (pos != std::string::npos) + cls.name.erase(0, pos + 1); // Get additional info tinyxml2::XMLElement* p_detaileddescpara = p_compounddef->FirstChildElement("detaileddescription")->FirstChildElement("para"); if (p_detaileddescpara) // Detailed description (possibly containing additional info) is available { + // Check whether the class is marked with "@scripting". Otherwise, do not include. + bool include = false; tinyxml2::XMLElement* p_xrefsect = p_detaileddescpara->FirstChildElement("xrefsect"); while (p_xrefsect) + { + if (el_equal(p_xrefsect, "xreftitle", "Scripting")) + { + include = true; + break; + } + p_xrefsect = p_xrefsect->NextSiblingElement("xrefsect"); + } + if (!include) return; + + p_xrefsect = p_detaileddescpara->FirstChildElement("xrefsect"); + while (p_xrefsect) { // Check if the "xrefsect" title matches any of the additional info titles const std::string title = p_xrefsect->FirstChildElement("xreftitle")->GetText(); @@ -52,94 +107,271 @@ void parse_compounddef(tinyxml2::XMLElement* p_root, Class& cls) } } - cl = &cls; - parse_sectiondef(p_compounddef); - cl = nullptr; + parse_sectiondef(p_compounddef, cls); + + tinyxml2::XMLElement* p_inheritancegraph = p_compounddef->FirstChildElement("inheritancegraph"); + if (p_inheritancegraph) + { + // Get base classes + tinyxml2::XMLElement* p_inheritancenode = first_child_with_attribute(p_inheritancegraph, "node", "id", "1"); + if (p_inheritancenode) + parse_base_classes(p_inheritancenode, p_inheritancegraph, cls.base_classes); + + cls.base_classes.erase(1); // The node with an ID of "1" is this class + + // Get derived (child) classes + p_inheritancenode = p_inheritancegraph->FirstChildElement("node"); + while (p_inheritancenode) + { + const int id = std::stoi(p_inheritancenode->FindAttribute("id")->Value()); + if (id != 1 && cls.base_classes.find(id) == cls.base_classes.end()) // Make sure this is not this class, or a base class + { + std::string name = p_inheritancenode->FirstChildElement("label")->GetText(); + + // Leave only the class name + const size_t pos = name.find_last_of("::"); + if (pos != std::string::npos) + name.erase(0, pos + 1); + + cls.derived_classes.push_back(name); + } + + p_inheritancenode = p_inheritancenode->NextSiblingElement("node"); + } + std::sort(cls.derived_classes.begin(), cls.derived_classes.end()); // Sort A-Z + cls.derived_classes.erase(std::unique(cls.derived_classes.begin(), cls.derived_classes.end()), cls.derived_classes.end()); // Remove duplicates + } } -void parse_sectiondef(tinyxml2::XMLElement* p_compounddef) +void parse_sectiondef(tinyxml2::XMLElement* p_compounddef, Class& cls) { - if (!cl) return; - tinyxml2::XMLElement* p_sectiondef = p_compounddef->FirstChildElement("sectiondef"); while (p_sectiondef) { - if (attr_equal(p_sectiondef, "kind", "public-func") || - attr_equal(p_sectiondef, "kind", "public-static-attrib")) // Is public, contains public class functions or static attributes - { - parse_memberdef(p_sectiondef); - } + parse_memberdef(p_sectiondef, cls); + p_sectiondef = p_sectiondef->NextSiblingElement("sectiondef"); } } -void parse_memberdef(tinyxml2::XMLElement* p_sectiondef) +void parse_memberdef(tinyxml2::XMLElement* p_sectiondef, Class& cls) { - if (!cl) return; - tinyxml2::XMLElement* p_memberdef = p_sectiondef->FirstChildElement("memberdef"); while (p_memberdef) { if (attr_equal(p_memberdef, "kind", "function") && - attr_equal(p_memberdef, "static", "no") && - !el_equal(p_memberdef, "type", "")) // Try searching for non-static, typed functions + //!el_equal(p_memberdef, "type", "") && + !p_memberdef->FirstChildElement("reimplements")) // Look for non-derived typed functions + { + parse_function(p_memberdef, cls); + } + else if (attr_equal(p_memberdef, "kind", "enum")) // Look for enumerators { - /** Parse the function **/ - Function func; - - // Get general info - func.type = p_memberdef->FirstChildElement("type")->GetText(); - func.name = p_memberdef->FirstChildElement("name")->GetText(); - if (starts_with(func.name, cl->name + "_")) // If function name starts with the string "{CLASS}_", remove it - func.name.erase(0, cl->name.size() + 1); - tinyxml2::XMLElement* p_descpara = p_memberdef->FirstChildElement("briefdescription")->FirstChildElement("para"); tinyxml2::XMLElement* p_detaileddescpara = p_memberdef->FirstChildElement("detaileddescription")->FirstChildElement("para"); - if (p_descpara) // Brief description has been provided + if (p_detaileddescpara) { - XMLTextReader read(func.description); - p_descpara->Accept(&read); + bool include = false; + std::string prefix; + + tinyxml2::XMLElement* p_xrefsect = p_detaileddescpara->FirstChildElement("xrefsect"); + while (p_xrefsect) + { + if (el_equal(p_xrefsect, "xreftitle", "Scripting")) // Make sure the enum is marked with "@scripting". Otherwise, do not include. + include = true; + else if (el_equal(p_xrefsect, "xreftitle", "Prefix")) + parse_xrefsect_desc(p_xrefsect, prefix); + + p_xrefsect = p_xrefsect->NextSiblingElement("xrefsect"); + } + if (include) + { + tinyxml2::XMLElement* p_enumvalue = p_memberdef->FirstChildElement("enumvalue"); + while (p_enumvalue) + { + parse_constant(p_enumvalue, cls, true, prefix); // Parse enumerators as constants + + p_enumvalue = p_enumvalue->NextSiblingElement("enumvalue"); + } + } } - if (p_detaileddescpara && p_detaileddescpara->GetText()) // The description may also continue in the detailed description. Check if more text is available. - func.description += p_detaileddescpara->GetText(); + } + else if (attr_equal(p_memberdef, "kind", "variable") && + !el_equal(p_memberdef, "type", "")) // Look for variables + { + if (starts_with(p_memberdef->FirstChildElement("type")->GetText(), "const ")) // Constant variable + parse_constant(p_memberdef, cls); + else // Non-constant variable + parse_variable(p_memberdef, cls); + } + p_memberdef = p_memberdef->NextSiblingElement("memberdef"); + } +} - /** Parse function parameters **/ - parse_parameterlist(p_memberdef, func); - // Add to function list - cl->functions.push_back(func); +void parse_constant(tinyxml2::XMLElement* p_memberdef, Class& cls, bool include, const std::string& prefix) +{ + /** Parse the constant **/ + Constant con; + + // Get general info + tinyxml2::XMLElement* p_type = p_memberdef->FirstChildElement("type"); + if (p_type) + { + con.type = p_type->GetText(); + con.type.erase(0, 6); // Remove the "const " part from the type string + } + else // Would indicate this is an enumerator + { + con.type = "int"; + } + con.name = p_memberdef->FirstChildElement("name")->GetText(); + if (starts_with(con.name, "s_")) + con.name.erase(0, 2); // Remove the "s_" prefix + con.name = prefix + con.name; + tinyxml2::XMLElement* p_initializer = p_memberdef->FirstChildElement("initializer"); + if (p_initializer) + con.initializer = p_initializer->GetText(); + tinyxml2::XMLElement* p_descpara = p_memberdef->FirstChildElement("briefdescription")->FirstChildElement("para"); + tinyxml2::XMLElement* p_detaileddescpara = p_memberdef->FirstChildElement("detaileddescription")->FirstChildElement("para"); + + if (p_detaileddescpara) + { + tinyxml2::XMLElement* p_xrefsect = p_detaileddescpara->FirstChildElement("xrefsect"); + while (p_xrefsect) + { + if (el_equal(p_xrefsect, "xreftitle", "Scripting")) // Make sure the constant is marked with "@scripting". Otherwise, do not include. + include = true; + else if (el_equal(p_xrefsect, "xreftitle", "Description")) + parse_xrefsect_desc(p_xrefsect, con.description); + + p_xrefsect = p_xrefsect->NextSiblingElement("xrefsect"); } - else if (attr_equal(p_memberdef, "kind", "variable") && - !el_equal(p_memberdef, "type", "") && - starts_with(p_memberdef->FirstChildElement("type")->GetText(), "const ")) // Otherwise, try searching for constant variables + if (!include) return; + + if (p_descpara) // Brief description has been provided { - /** Parse the constant **/ - Constant con; - - // Get general info - con.type = p_memberdef->FirstChildElement("type")->GetText(); - con.type.erase(0, 6); // Remove the "const " part from the type string - con.name = p_memberdef->FirstChildElement("name")->GetText(); - tinyxml2::XMLElement* p_descpara = p_memberdef->FirstChildElement("briefdescription")->FirstChildElement("para"); - tinyxml2::XMLElement* p_detaileddescpara = p_memberdef->FirstChildElement("detaileddescription")->FirstChildElement("para"); + XMLTextReader read(con.description); + p_descpara->Accept(&read); + } + + // Add to constants list + cls.constants.push_back(std::move(con)); + } +} + +void parse_variable(tinyxml2::XMLElement* p_memberdef, Class& cls) +{ + /** Parse the variable **/ + Variable var; + + // Get general info + var.type = p_memberdef->FirstChildElement("type")->GetText(); + var.name = p_memberdef->FirstChildElement("name")->GetText(); + if (starts_with(var.name, "m_")) + var.name.erase(0, 2); // Remove the "m_" prefix + tinyxml2::XMLElement* p_descpara = p_memberdef->FirstChildElement("briefdescription")->FirstChildElement("para"); + tinyxml2::XMLElement* p_detaileddescpara = p_memberdef->FirstChildElement("detaileddescription")->FirstChildElement("para"); + + if (p_detaileddescpara) + { + bool include = false; + tinyxml2::XMLElement* p_xrefsect = p_detaileddescpara->FirstChildElement("xrefsect"); + while (p_xrefsect) + { + if (el_equal(p_xrefsect, "xreftitle", "Scripting")) // Make sure the variable is marked with "@scripting". Otherwise, do not include. + include = true; + else if (el_equal(p_xrefsect, "xreftitle", "Description")) + parse_xrefsect_desc(p_xrefsect, var.description); + + p_xrefsect = p_xrefsect->NextSiblingElement("xrefsect"); + } + if (!include) return; + + if (p_descpara) // Brief description has been provided + { + XMLTextReader read(var.description); + p_descpara->Accept(&read); + } + + // Add to variables list + cls.variables.push_back(std::move(var)); + } +} + +void parse_function(tinyxml2::XMLElement* p_memberdef, Class& cls) +{ + /** Parse the function **/ + Function func; + + // Get general info + const char* type = p_memberdef->FirstChildElement("type")->GetText(); + if (type) + { + func.type = type; + + // Replace type with simplified version, if available + const auto it = s_simplified_types.find(func.type); + if (it != s_simplified_types.end()) + func.type = it->second; + } + else + { + func.type = "void"; + } + func.name = p_memberdef->FirstChildElement("name")->GetText(); + + tinyxml2::XMLElement* p_descpara = p_memberdef->FirstChildElement("briefdescription")->FirstChildElement("para"); + tinyxml2::XMLElement* p_detaileddescpara = p_memberdef->FirstChildElement("detaileddescription")->FirstChildElement("para"); + + if (p_detaileddescpara) + { + bool include = false; + tinyxml2::XMLElement* p_xrefsect = p_detaileddescpara->FirstChildElement("xrefsect"); + while (p_xrefsect) + { + if (el_equal(p_xrefsect, "xreftitle", "Scripting")) // Make sure the function is marked with "@scripting". Otherwise, do not include. + include = true; + else if (el_equal(p_xrefsect, "xreftitle", "Deprecated")) + { + func.deprecated = true; + parse_xrefsect_desc(p_xrefsect, func.deprecation_msg); + } + else if (el_equal(p_xrefsect, "xreftitle", "Description")) + parse_xrefsect_desc(p_xrefsect, func.description); + + p_xrefsect = p_xrefsect->NextSiblingElement("xrefsect"); + } + if (include) + { + tinyxml2::XMLElement* p_simplesect = p_detaileddescpara->FirstChildElement("simplesect"); + while (p_simplesect) + { + if (attr_equal(p_simplesect, "kind", "return")) // Custom return type specified + { + func.type = p_simplesect->FirstChildElement("para")->GetText(); + func.type.pop_back(); // Remove space at the end + break; + } + p_simplesect = p_simplesect->NextSiblingElement("simplesect"); + } + if (p_descpara) // Brief description has been provided { - XMLTextReader read(con.description); + XMLTextReader read(func.description); p_descpara->Accept(&read); } - if (p_detaileddescpara && p_detaileddescpara->GetText()) // The description may also continue in the detailed description. Check if more text is available. - con.description += p_detaileddescpara->GetText(); - // Add to constants list - cl->constants.push_back(con); + /** Parse function parameters **/ + parse_parameterlist(p_memberdef, func); + + // Add to function list + cls.functions.push_back(std::move(func)); } - p_memberdef = p_memberdef->NextSiblingElement("memberdef"); } } void parse_parameterlist(tinyxml2::XMLElement* p_memberdef, Function& func) { - if (!cl) return; - tinyxml2::XMLElement* p_detaileddescpara = p_memberdef->FirstChildElement("detaileddescription")->FirstChildElement("para"); if (!p_detaileddescpara) return; // There is no detailed description, hence no parameter list @@ -171,7 +403,7 @@ void parse_parameterlist(tinyxml2::XMLElement* p_memberdef, Function& func) } // Add to parameter list - func.parameters.push_back(param); + func.parameters.push_back(std::move(param)); p_parameteritem = p_parameteritem->NextSiblingElement("parameteritem"); } @@ -186,6 +418,8 @@ void parse_xrefsect_desc(tinyxml2::XMLElement* p_xrefsect, std::string& dest) XMLTextReader read(dest); p_xrefsectdescpara->Accept(&read); } + + if (!dest.empty()) dest.pop_back(); // Remove space, added at the end } } // namespace Parser diff --git a/tools/scripting_docs_gen/parser.hpp b/tools/scripting_docs_gen/parser.hpp index 52c67cccba0..3fd1970863a 100644 --- a/tools/scripting_docs_gen/parser.hpp +++ b/tools/scripting_docs_gen/parser.hpp @@ -25,11 +25,13 @@ namespace Parser { - extern Class* cl; // Set by "parse_compounddef()" so it can be accessed by the other functions. - void parse_compounddef(tinyxml2::XMLElement* p_root, Class& cls); - void parse_sectiondef(tinyxml2::XMLElement* p_compounddef); - void parse_memberdef(tinyxml2::XMLElement* p_sectiondef); + void parse_sectiondef(tinyxml2::XMLElement* p_compounddef, Class& cls); + void parse_memberdef(tinyxml2::XMLElement* p_sectiondef, Class& cls); + + void parse_constant(tinyxml2::XMLElement* p_memberdef, Class& cls, bool include = false, const std::string& prefix = {}); + void parse_variable(tinyxml2::XMLElement* p_memberdef, Class& cls); + void parse_function(tinyxml2::XMLElement* p_memberdef, Class& cls); void parse_parameterlist(tinyxml2::XMLElement* p_memberdef, Function& func); void parse_xrefsect_desc(tinyxml2::XMLElement* p_xrefsect, std::string& dest); diff --git a/tools/scripting_docs_gen/util.cpp b/tools/scripting_docs_gen/util.cpp index af7db7c8723..3f6a3110141 100644 --- a/tools/scripting_docs_gen/util.cpp +++ b/tools/scripting_docs_gen/util.cpp @@ -34,13 +34,15 @@ bool starts_with(const std::string& str, const std::string& prefix) } void replace(std::string& str, const std::string& from, - const std::string to, const std::string to_if_empty) + const std::string& to, const std::string& to_if_empty) { + const std::string& to_str = to.empty() ? to_if_empty : to; + size_t start_pos = str.find(from); while (start_pos != std::string::npos) { - str.replace(start_pos, from.length(), to.empty() ? to_if_empty : to); - start_pos = str.find(from); + str.replace(start_pos, from.length(), to_str); + start_pos = str.find(from, start_pos + to_str.length()); } } @@ -70,12 +72,35 @@ void write_file(const std::string& path, const std::string& content) bool attr_equal(tinyxml2::XMLElement* el, const char* attr, const std::string& rhs) { - const char* val = el->FindAttribute(attr)->Value(); + const tinyxml2::XMLAttribute* attr_obj = el->FindAttribute(attr); + if (!attr_obj) return false; + + const char* val = attr_obj->Value(); return val == NULL ? rhs.empty() : std::string(val) == rhs; } bool el_equal(tinyxml2::XMLElement* el, const char* child_el, const std::string& rhs) { - const char* text = el->FirstChildElement(child_el)->GetText(); + const tinyxml2::XMLElement* child_el_obj = el->FirstChildElement(child_el); + if (!child_el_obj) return false; + + const char* text = child_el_obj->GetText(); return text == NULL ? rhs.empty() : std::string(text) == rhs; } + + +tinyxml2::XMLElement* first_child_with_attribute(tinyxml2::XMLElement* el, + const char* child_name, + const char* child_attr, + const std::string& child_attr_val) +{ + tinyxml2::XMLElement* child_el = el->FirstChildElement(child_name); + while (child_el) + { + if (attr_equal(child_el, child_attr, child_attr_val)) + return child_el; + + child_el = child_el->NextSiblingElement(child_name); + } + return nullptr; +} diff --git a/tools/scripting_docs_gen/util.hpp b/tools/scripting_docs_gen/util.hpp index 470a5822cc4..92dc786be8d 100644 --- a/tools/scripting_docs_gen/util.hpp +++ b/tools/scripting_docs_gen/util.hpp @@ -28,7 +28,7 @@ bool param_matches(int argc, char** argv, int i, bool starts_with(const std::string& str, const std::string& prefix); void replace(std::string& str, const std::string& from, - const std::string to, const std::string to_if_empty = ""); + const std::string& to, const std::string& to_if_empty = ""); void regex_replace(std::string& str, const std::regex from, const std::string& to); @@ -38,6 +38,10 @@ void write_file(const std::string& path, const std::string& content); bool attr_equal(tinyxml2::XMLElement* el, const char* attr, const std::string& rhs); bool el_equal(tinyxml2::XMLElement* el, const char* child_el, const std::string& rhs); +tinyxml2::XMLElement* first_child_with_attribute(tinyxml2::XMLElement* el, + const char* child_name, + const char* child_attr, + const std::string& child_attr_val); // XML text reader, which is able to read text from all child nodes. class XMLTextReader : public tinyxml2::XMLVisitor diff --git a/tools/scripting_docs_gen/writer.cpp b/tools/scripting_docs_gen/writer.cpp index 2ed2658119d..daa5a06b118 100644 --- a/tools/scripting_docs_gen/writer.cpp +++ b/tools/scripting_docs_gen/writer.cpp @@ -26,7 +26,7 @@ std::string write_file_notice(const std::string& template_file) { std::stringstream notice; - notice << "> Note: This file is auto-generated from the [SuperTux scripting interface source code](https://github.com/SuperTux/supertux/tree/master/src/scripting), " + notice << "> This file is auto-generated from the [SuperTux source code](https://github.com/SuperTux/supertux/tree/master/src), " << "using the template [" << template_file << "](https://github.com/SuperTux/wiki/tree/master/templates/" << template_file << ")." << std::endl << std::endl; @@ -34,6 +34,42 @@ std::string write_file_notice(const std::string& template_file) } +std::string write_inheritance_list(const std::vector& classes, + const Class::BaseClasses& base_classes, + const std::vector& derived_classes) +{ + std::stringstream list; + + if (!base_classes.empty()) + { + list << "This class inherits functions and variables from the following base classes:" << std::endl; + // List of all base classes + for (const auto& [_, base_class] : base_classes) + { + // Check whether the current class is documented + const bool documented = std::any_of(classes.begin(), classes.end(), [base_class](const Class& cl) { return cl.name == base_class; }); + + list << "* " << (documented ? write_class_ref(base_class) : base_class) << std::endl; + } + if (!derived_classes.empty()) + list << std::endl; + } + if (!derived_classes.empty()) + { + list << "The following classes inherit functions and variables from this class:" << std::endl; + // List of all derived classes + for (const std::string& derived_class : derived_classes) + { + // Check whether the current class is documented + const bool documented = std::any_of(classes.begin(), classes.end(), [derived_class](const Class& cl) { return cl.name == derived_class; }); + + list << "* " << (documented ? write_class_ref(derived_class) : derived_class) << std::endl; + } + } + + return list.str(); +} + std::string write_constants_table(const std::vector& constants) { if (constants.empty()) return ""; @@ -45,9 +81,29 @@ std::string write_constants_table(const std::vector& constants) table << "---------|---------" << std::endl; // Table contents (constants) for (const Constant& con : constants) + { + // Print out type, name, initializer (if available) and description + table << "`" << con.type << " " << con.name << (con.initializer.empty() ? "" : " " + con.initializer) + << "` | " << con.description << std::endl; + } + + return table.str(); +} + +std::string write_variables_table(const std::vector& variables) +{ + if (variables.empty()) return ""; + + std::stringstream table; + + // Table beginning + table << "Variable | Explanation" << std::endl; + table << "---------|---------" << std::endl; + // Table contents (variables) + for (const Variable& var : variables) { // Print out type, name and description - table << "`" << con.type << " " << con.name << "` | " << con.description << std::endl; + table << "`" << var.type << " " << var.name << "` | " << var.description << std::endl; } return table.str(); @@ -66,7 +122,7 @@ std::string write_function_table(const std::vector& functions) for (const Function& func : functions) { // Print out function - table << "`" << func.name << "("; + table << "`" << func.type << " " << func.name << "("; for (size_t i = 0; i < func.parameters.size(); i++) { if (i != 0) table << ", "; @@ -75,15 +131,33 @@ std::string write_function_table(const std::vector& functions) table << ")`"; // Print out description of function - table << " | " << func.description; + table << " | "; + if (func.deprecated) + { + table << "**Deprecated!**"; + if (!func.deprecation_msg.empty()) + table << " " << func.deprecation_msg; + + // Add line breaks only if a description is available + if (!func.description.empty()) + table << "

"; + } + table << func.description; // Print out descriptions of parameters - bool has_printed_param_desc = false; - for (const Parameter& param : func.parameters) + if (std::any_of(func.parameters.begin(), func.parameters.end(), [](const Parameter& param) { return !param.description.empty(); })) { - if (param.description.empty()) continue; - table << (has_printed_param_desc ? "" : "
") << "
`" << param.name << "` - " << param.description; - has_printed_param_desc = true; + if (!func.deprecation_msg.empty() || !func.description.empty()) + table << "

"; + + bool has_printed_param_desc = false; + for (const Parameter& param : func.parameters) + { + if (param.description.empty()) continue; + + table << (has_printed_param_desc ? "
" : "") << " `" << param.name << "` - " << param.description; + has_printed_param_desc = true; + } } // End table entry diff --git a/tools/scripting_docs_gen/writer.hpp b/tools/scripting_docs_gen/writer.hpp index df8bea8a73b..a1e69fa4096 100644 --- a/tools/scripting_docs_gen/writer.hpp +++ b/tools/scripting_docs_gen/writer.hpp @@ -26,7 +26,11 @@ namespace Writer { std::string write_file_notice(const std::string& template_file); + std::string write_inheritance_list(const std::vector& classes, + const Class::BaseClasses& base_classes, + const std::vector& derived_classes); std::string write_constants_table(const std::vector& constants); + std::string write_variables_table(const std::vector& variables); std::string write_function_table(const std::vector& functions); std::string write_class_list(const std::vector& classes); From 17503c478bfd00484bcee691f72a2db09b73398f Mon Sep 17 00:00:00 2001 From: Vankata453 <78196474+Vankata453@users.noreply.github.com> Date: Sat, 6 Jul 2024 21:40:53 +0300 Subject: [PATCH 06/33] Fix "Scripting" workflow not triggering on "src/*" pushes [ci skip] --- .github/workflows/scripting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scripting.yml b/.github/workflows/scripting.yml index dbec6463912..9a89199a9ca 100644 --- a/.github/workflows/scripting.yml +++ b/.github/workflows/scripting.yml @@ -20,7 +20,7 @@ on: push: branches: [ "master" ] paths: - - src/ + - src/* workflow_dispatch: jobs: From df670e40169d118ba35735aacfea4313056dcf32 Mon Sep 17 00:00:00 2001 From: mstoeckl Date: Sat, 6 Jul 2024 20:53:47 -0400 Subject: [PATCH 07/33] Index by base classes in GameObjectManager::m_objects_by_type_index (#2991) * Index intermediate classes of GameObjects This allows for much more efficient implementations of GameObjectManager's get_object_count and get_objects_by_type. Now, for example, counting all BadGuy objects does not require scanning through all the unrelated objects. * Simplify GameObjectIterator Now it is only used on vectors containing only objects with T as a base class. --- src/badguy/angrystone.hpp | 1 + src/badguy/badguy.hpp | 1 + src/badguy/bomb.hpp | 1 + src/badguy/bouncing_snowball.hpp | 1 + src/badguy/captainsnowball.hpp | 1 + src/badguy/corrupted_granito.hpp | 1 + src/badguy/corrupted_granito_big.hpp | 1 + src/badguy/crusher.hpp | 2 + src/badguy/crystallo.hpp | 1 + src/badguy/dart.hpp | 1 + src/badguy/darttrap.hpp | 1 + src/badguy/dispenser.hpp | 1 + src/badguy/dive_mine.hpp | 1 + src/badguy/fish_chasing.hpp | 1 + src/badguy/fish_harmless.hpp | 1 + src/badguy/fish_jumping.hpp | 1 + src/badguy/fish_swimming.hpp | 1 + src/badguy/flame.hpp | 1 + src/badguy/flyingsnowball.hpp | 1 + src/badguy/ghosttree.hpp | 1 + src/badguy/ghoul.hpp | 1 + src/badguy/goldbomb.hpp | 1 + src/badguy/granito.hpp | 1 + src/badguy/granito_big.hpp | 1 + src/badguy/granito_giant.hpp | 1 + src/badguy/haywire.hpp | 1 + src/badguy/igel.hpp | 1 + src/badguy/jumpy.hpp | 1 + src/badguy/kamikazesnowball.hpp | 2 + src/badguy/kugelblitz.hpp | 1 + src/badguy/livefire.hpp | 3 ++ src/badguy/mole.hpp | 1 + src/badguy/mole_rock.hpp | 1 + src/badguy/mrbomb.hpp | 1 + src/badguy/mriceblock.hpp | 1 + src/badguy/mrtree.hpp | 1 + src/badguy/owl.hpp | 1 + src/badguy/plant.hpp | 1 + src/badguy/rcrystallo.hpp | 1 + src/badguy/root.hpp | 1 + src/badguy/root_sapling.hpp | 1 + src/badguy/scrystallo.hpp | 1 + src/badguy/short_fuse.hpp | 1 + src/badguy/skydive.hpp | 1 + src/badguy/smartball.hpp | 1 + src/badguy/smartblock.hpp | 1 + src/badguy/snail.hpp | 1 + src/badguy/snowball.hpp | 1 + src/badguy/snowman.hpp | 1 + src/badguy/spiky.hpp | 1 + src/badguy/sspiky.hpp | 1 + src/badguy/stalactite.hpp | 1 + src/badguy/stumpy.hpp | 1 + src/badguy/tarantula.hpp | 1 + src/badguy/toad.hpp | 1 + src/badguy/totem.hpp | 1 + src/badguy/treewillowisp.hpp | 1 + src/badguy/viciousivy.hpp | 1 + src/badguy/walking_badguy.hpp | 1 + src/badguy/walking_candle.hpp | 1 + src/badguy/walkingleaf.hpp | 1 + src/badguy/willowisp.hpp | 1 + src/badguy/yeti.hpp | 1 + src/badguy/yeti_stalactite.hpp | 1 + src/badguy/zeekling.hpp | 1 + src/editor/bezier_marker.hpp | 1 + src/editor/marker_object.hpp | 1 + src/editor/node_marker.hpp | 1 + src/editor/resize_marker.hpp | 1 + src/object/ambient_light.hpp | 1 + src/object/ambient_sound.hpp | 1 + src/object/background.hpp | 1 + src/object/bicycle_platform.hpp | 2 + src/object/block.hpp | 2 + src/object/bonus_block.hpp | 1 + src/object/bouncy_coin.hpp | 1 + src/object/brick.hpp | 2 + src/object/bullet.hpp | 2 + src/object/bumper.hpp | 1 + src/object/camera.hpp | 1 + src/object/candle.hpp | 1 + src/object/circleplatform.hpp | 1 + src/object/cloud_particle_system.hpp | 1 + src/object/coin.hpp | 2 + src/object/coin_explode.hpp | 1 + src/object/coin_rain.hpp | 1 + src/object/conveyor_belt.hpp | 1 + src/object/custom_particle_system.hpp | 1 + src/object/custom_particle_system_file.hpp | 1 + src/object/decal.hpp | 1 + src/object/display_effect.hpp | 1 + src/object/electrifier.hpp | 1 + src/object/endsequence.hpp | 1 + src/object/endsequence_fireworks.hpp | 1 + src/object/endsequence_walk.hpp | 1 + src/object/explosion.hpp | 1 + src/object/fallblock.hpp | 1 + src/object/falling_coin.hpp | 1 + src/object/firefly.hpp | 1 + src/object/fireworks.hpp | 1 + src/object/floating_image.hpp | 1 + src/object/floating_text.hpp | 2 + src/object/flower.hpp | 1 + src/object/ghost_particle_system.hpp | 1 + src/object/gradient.hpp | 1 + src/object/growup.hpp | 1 + src/object/hurting_platform.hpp | 1 + src/object/infoblock.hpp | 1 + src/object/invisible_block.hpp | 1 + src/object/invisible_wall.hpp | 1 + src/object/ispy.hpp | 1 + src/object/key.hpp | 1 + src/object/lantern.hpp | 1 + src/object/level_time.hpp | 1 + src/object/light.hpp | 2 + src/object/lit_object.hpp | 1 + src/object/magicblock.hpp | 1 + src/object/moving_sprite.hpp | 1 + src/object/music_object.hpp | 1 + src/object/oneup.hpp | 1 + src/object/particle_zone.hpp | 1 + src/object/particles.hpp | 1 + src/object/particlesystem.hpp | 1 + src/object/particlesystem_interactive.hpp | 1 + src/object/path_gameobject.hpp | 1 + src/object/platform.hpp | 1 + src/object/player.hpp | 1 + src/object/pneumatic_platform.hpp | 2 + src/object/powerup.hpp | 1 + src/object/pulsing_light.hpp | 1 + src/object/pushbutton.hpp | 1 + src/object/rain_particle_system.hpp | 1 + src/object/rainsplash.hpp | 1 + src/object/rock.hpp | 1 + src/object/rublight.hpp | 1 + src/object/rusty_trampoline.hpp | 1 + src/object/scripted_object.hpp | 1 + src/object/shard.hpp | 1 + src/object/smoke_cloud.hpp | 1 + src/object/snow_particle_system.hpp | 1 + src/object/sound_object.hpp | 1 + src/object/spawnpoint.hpp | 1 + src/object/specialriser.hpp | 1 + src/object/spotlight.hpp | 1 + src/object/sprite_particle.hpp | 1 + src/object/star.hpp | 1 + src/object/sticky_object.hpp | 2 + src/object/text_array_object.hpp | 1 + src/object/text_object.hpp | 1 + src/object/textscroller.hpp | 1 + src/object/thunderstorm.hpp | 1 + src/object/tilemap.hpp | 1 + src/object/torch.hpp | 1 + src/object/trampoline.hpp | 1 + src/object/unstable_tile.hpp | 1 + src/object/vertical_stripes.hpp | 2 + src/object/water_drop.hpp | 2 + src/object/weak_block.hpp | 1 + src/object/wind.hpp | 1 + src/supertux/game_object.cpp | 8 ++++ src/supertux/game_object.hpp | 21 +++++++++++ src/supertux/game_object_iterator.hpp | 44 ++++++++-------------- src/supertux/game_object_manager.cpp | 14 ++++--- src/supertux/game_object_manager.hpp | 4 +- src/supertux/moving_object.hpp | 1 + src/supertux/player_status_hud.hpp | 1 + src/trigger/climbable.hpp | 1 + src/trigger/door.hpp | 1 + src/trigger/scripttrigger.hpp | 1 + src/trigger/secretarea_trigger.hpp | 1 + src/trigger/sequence_trigger.hpp | 1 + src/trigger/switch.hpp | 1 + src/trigger/text_area.hpp | 1 + src/trigger/trigger_base.hpp | 3 ++ src/worldmap/level_tile.hpp | 1 + src/worldmap/spawn_point.hpp | 1 + src/worldmap/special_tile.hpp | 1 + src/worldmap/sprite_change.hpp | 1 + src/worldmap/teleporter.hpp | 1 + src/worldmap/tux.hpp | 1 + src/worldmap/worldmap_object.hpp | 1 + 181 files changed, 249 insertions(+), 35 deletions(-) diff --git a/src/badguy/angrystone.hpp b/src/badguy/angrystone.hpp index f5470e0aab1..fec61367164 100644 --- a/src/badguy/angrystone.hpp +++ b/src/badguy/angrystone.hpp @@ -38,6 +38,7 @@ class AngryStone final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Angry Stone"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(AngryStone)); } protected: virtual std::vector get_allowed_directions() const override; diff --git a/src/badguy/badguy.hpp b/src/badguy/badguy.hpp index 861998b81ae..56382e33bb5 100644 --- a/src/badguy/badguy.hpp +++ b/src/badguy/badguy.hpp @@ -68,6 +68,7 @@ class BadGuy : public MovingSprite, virtual std::string get_exposed_class_name() const override { return "BadGuy"; } static std::string display_name() { return _("Badguy"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Portable)).add(typeid(BadGuy)); } virtual std::string get_overlay_size() const { return "1x1"; } diff --git a/src/badguy/bomb.hpp b/src/badguy/bomb.hpp index 5b4b9e24e91..642914d57f7 100644 --- a/src/badguy/bomb.hpp +++ b/src/badguy/bomb.hpp @@ -25,6 +25,7 @@ class Bomb final : public BadGuy { public: Bomb(const Vector& pos, Direction dir, const std::string& custom_sprite = "images/creatures/mr_bomb/bomb.sprite" ); + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Bomb)); } virtual bool is_saveable() const override { return false; } diff --git a/src/badguy/bouncing_snowball.hpp b/src/badguy/bouncing_snowball.hpp index 3b65c5319a2..45fd2f81700 100644 --- a/src/badguy/bouncing_snowball.hpp +++ b/src/badguy/bouncing_snowball.hpp @@ -38,6 +38,7 @@ class BouncingSnowball final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Bouncing Snowball"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(BouncingSnowball)); } virtual GameObjectTypes get_types() const override; virtual std::string get_default_sprite_name() const override; diff --git a/src/badguy/captainsnowball.hpp b/src/badguy/captainsnowball.hpp index 9a295ef56aa..70cde6961e5 100644 --- a/src/badguy/captainsnowball.hpp +++ b/src/badguy/captainsnowball.hpp @@ -31,6 +31,7 @@ class CaptainSnowball final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Captain Snowball"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(CaptainSnowball)); } virtual bool is_snipable() const override { return true; } bool might_climb(int width, int height) const; diff --git a/src/badguy/corrupted_granito.hpp b/src/badguy/corrupted_granito.hpp index fcd266f901b..977caa7848a 100644 --- a/src/badguy/corrupted_granito.hpp +++ b/src/badguy/corrupted_granito.hpp @@ -43,6 +43,7 @@ class CorruptedGranito final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Corrupted Granito"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(CorruptedGranito)); } virtual bool is_snipable() const override { return true; } virtual bool is_flammable() const override { return m_type != GRANITO; } diff --git a/src/badguy/corrupted_granito_big.hpp b/src/badguy/corrupted_granito_big.hpp index e007e35d8a4..c1723a54fd4 100644 --- a/src/badguy/corrupted_granito_big.hpp +++ b/src/badguy/corrupted_granito_big.hpp @@ -34,6 +34,7 @@ class CorruptedGranitoBig final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Corrupted Big Granito"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(CorruptedGranitoBig)); } virtual bool is_snipable() const override { return false; } virtual bool is_freezable() const override { return false; } diff --git a/src/badguy/crusher.hpp b/src/badguy/crusher.hpp index ad186509d29..a0dd52a3c91 100644 --- a/src/badguy/crusher.hpp +++ b/src/badguy/crusher.hpp @@ -70,6 +70,7 @@ class Crusher final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Crusher"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Crusher)); } virtual ObjectSettings get_settings() override; GameObjectTypes get_types() const override; @@ -115,6 +116,7 @@ class CrusherRoot : public MovingSprite { public: CrusherRoot(Vector position, Crusher::Direction direction, float delay, int layer); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(CrusherRoot)); } virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; virtual void update(float dt_sec) override; diff --git a/src/badguy/crystallo.hpp b/src/badguy/crystallo.hpp index 7389f646060..00913e7362e 100644 --- a/src/badguy/crystallo.hpp +++ b/src/badguy/crystallo.hpp @@ -32,6 +32,7 @@ class Crystallo final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Crystallo"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Crystallo)); } virtual void active_update(float dt_sec) override; virtual bool is_flammable() const override; diff --git a/src/badguy/dart.hpp b/src/badguy/dart.hpp index ae3ba35d909..e5cfc99bb58 100644 --- a/src/badguy/dart.hpp +++ b/src/badguy/dart.hpp @@ -43,6 +43,7 @@ class Dart final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Dart"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Dart)); } virtual bool is_flammable() const override; diff --git a/src/badguy/darttrap.hpp b/src/badguy/darttrap.hpp index 42bab088aa4..69ffb1aaca9 100644 --- a/src/badguy/darttrap.hpp +++ b/src/badguy/darttrap.hpp @@ -34,6 +34,7 @@ class DartTrap final : public StickyBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Dart Trap"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return StickyBadguy::get_class_types().add(typeid(DartTrap)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; diff --git a/src/badguy/dispenser.hpp b/src/badguy/dispenser.hpp index 48ea925313e..a68e45d68f8 100644 --- a/src/badguy/dispenser.hpp +++ b/src/badguy/dispenser.hpp @@ -66,6 +66,7 @@ class Dispenser final : public BadGuy virtual std::string get_exposed_class_name() const override { return "Dispenser"; } static std::string display_name() { return _("Dispenser"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Dispenser)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; diff --git a/src/badguy/dive_mine.hpp b/src/badguy/dive_mine.hpp index 7e71dec6cb1..bb4c122d583 100644 --- a/src/badguy/dive_mine.hpp +++ b/src/badguy/dive_mine.hpp @@ -49,6 +49,7 @@ class DiveMine final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Dive Mine"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(DiveMine)); } protected: virtual std::vector get_allowed_directions() const override; diff --git a/src/badguy/fish_chasing.hpp b/src/badguy/fish_chasing.hpp index a7ce8661e9c..0dcfbe7d310 100644 --- a/src/badguy/fish_chasing.hpp +++ b/src/badguy/fish_chasing.hpp @@ -33,6 +33,7 @@ class FishChasing final : public FishSwimming static std::string display_name() { return _("Chasing Fish"); } virtual std::string get_display_name() const override { return display_name(); } virtual std::string get_overlay_size() const override { return "2x2"; } + virtual GameObjectClasses get_class_types() const override { return FishSwimming::get_class_types().add(typeid(FishChasing)); } virtual ObjectSettings get_settings() override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/fish_harmless.hpp b/src/badguy/fish_harmless.hpp index 58895c3954e..fd1f777cede 100644 --- a/src/badguy/fish_harmless.hpp +++ b/src/badguy/fish_harmless.hpp @@ -29,6 +29,7 @@ class FishHarmless final : public FishSwimming virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Harmless Fish"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return FishSwimming::get_class_types().add(typeid(FishHarmless)); } virtual std::string get_overlay_size() const override { return "1x1"; } GameObjectTypes get_types() const override { return {}; } diff --git a/src/badguy/fish_jumping.hpp b/src/badguy/fish_jumping.hpp index ed97fe28182..99cf62ea851 100644 --- a/src/badguy/fish_jumping.hpp +++ b/src/badguy/fish_jumping.hpp @@ -40,6 +40,7 @@ class FishJumping final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Jumping Fish"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(FishJumping)); } protected: virtual std::vector get_allowed_directions() const override; diff --git a/src/badguy/fish_swimming.hpp b/src/badguy/fish_swimming.hpp index 5b9efe76c41..cecce233060 100644 --- a/src/badguy/fish_swimming.hpp +++ b/src/badguy/fish_swimming.hpp @@ -40,6 +40,7 @@ class FishSwimming : public BadGuy static std::string display_name() { return _("Swimming Fish"); } virtual std::string get_display_name() const override { return display_name(); } virtual std::string get_overlay_size() const override { return "2x1"; } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(FishSwimming)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; diff --git a/src/badguy/flame.hpp b/src/badguy/flame.hpp index f1dcce809c0..0b4f10aab0e 100644 --- a/src/badguy/flame.hpp +++ b/src/badguy/flame.hpp @@ -46,6 +46,7 @@ class Flame final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Flame"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Flame)); } virtual void stop_looping_sounds() override; virtual void play_looping_sounds() override; diff --git a/src/badguy/flyingsnowball.hpp b/src/badguy/flyingsnowball.hpp index 6665ce29ab6..206b9084f73 100644 --- a/src/badguy/flyingsnowball.hpp +++ b/src/badguy/flyingsnowball.hpp @@ -32,6 +32,7 @@ class FlyingSnowBall final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Flying Snowball"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(FlyingSnowBall)); } virtual bool is_snipable() const override { return true; } protected: diff --git a/src/badguy/ghosttree.hpp b/src/badguy/ghosttree.hpp index caad21d9ca9..b30e371cbab 100644 --- a/src/badguy/ghosttree.hpp +++ b/src/badguy/ghosttree.hpp @@ -42,6 +42,7 @@ class GhostTree final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Ghost Tree"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(GhostTree)); } virtual void on_flip(float height) override; diff --git a/src/badguy/ghoul.hpp b/src/badguy/ghoul.hpp index 4227a902d57..a580538bc9b 100644 --- a/src/badguy/ghoul.hpp +++ b/src/badguy/ghoul.hpp @@ -30,6 +30,7 @@ class Ghoul final : public BadGuy, static std::string display_name() { return _("Ghoul"); } std::string get_class_name() const override { return class_name(); } std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Ghoul)); } bool is_freezable() const override; bool is_flammable() const override; virtual bool is_snipable() const override { return true; } diff --git a/src/badguy/goldbomb.hpp b/src/badguy/goldbomb.hpp index c9e56f0d2a2..f33ef1bfa29 100644 --- a/src/badguy/goldbomb.hpp +++ b/src/badguy/goldbomb.hpp @@ -49,6 +49,7 @@ class GoldBomb final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Gold Bomb"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(GoldBomb)); } virtual bool is_snipable() const override { return true; } virtual void stop_looping_sounds() override; diff --git a/src/badguy/granito.hpp b/src/badguy/granito.hpp index ae4b360249b..a009a959ad8 100644 --- a/src/badguy/granito.hpp +++ b/src/badguy/granito.hpp @@ -51,6 +51,7 @@ class Granito : public WalkingBadguy virtual std::string get_exposed_class_name() const override { return "Granito"; } static std::string display_name() { return _("Granito"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Granito)); } virtual bool is_snipable() const override { return false; } virtual bool is_freezable() const override { return false; } diff --git a/src/badguy/granito_big.hpp b/src/badguy/granito_big.hpp index 44e8749b86a..7d6f6467e16 100644 --- a/src/badguy/granito_big.hpp +++ b/src/badguy/granito_big.hpp @@ -43,6 +43,7 @@ class GranitoBig final : public Granito virtual std::string get_exposed_class_name() const override { return "GranitoBig"; } static std::string display_name() { return _("Big Granito"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Granito::get_class_types().add(typeid(GranitoBig)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; diff --git a/src/badguy/granito_giant.hpp b/src/badguy/granito_giant.hpp index a3df651eab2..aebe7c34658 100644 --- a/src/badguy/granito_giant.hpp +++ b/src/badguy/granito_giant.hpp @@ -31,6 +31,7 @@ class GranitoGiant final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Giant Granito"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(GranitoGiant)); } virtual void kill_fall() override; diff --git a/src/badguy/haywire.hpp b/src/badguy/haywire.hpp index bca973206a4..e0280b8db7a 100644 --- a/src/badguy/haywire.hpp +++ b/src/badguy/haywire.hpp @@ -45,6 +45,7 @@ class Haywire final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Haywire"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Haywire)); } virtual bool is_snipable() const override { return true; } inline bool is_exploding() const { return m_is_exploding; } diff --git a/src/badguy/igel.hpp b/src/badguy/igel.hpp index 0aef788a590..70039c4f4d8 100644 --- a/src/badguy/igel.hpp +++ b/src/badguy/igel.hpp @@ -38,6 +38,7 @@ class Igel final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Igel"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Igel)); } virtual bool is_freezable() const override { return true; } virtual void unfreeze(bool melt = true) override; diff --git a/src/badguy/jumpy.hpp b/src/badguy/jumpy.hpp index 07bf84a9771..f8378833679 100644 --- a/src/badguy/jumpy.hpp +++ b/src/badguy/jumpy.hpp @@ -39,6 +39,7 @@ class Jumpy final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Jumpy"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Jumpy)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/kamikazesnowball.hpp b/src/badguy/kamikazesnowball.hpp index fdcb5da4149..1c279813740 100644 --- a/src/badguy/kamikazesnowball.hpp +++ b/src/badguy/kamikazesnowball.hpp @@ -33,6 +33,7 @@ class KamikazeSnowball : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Kamikaze Snowball"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(KamikazeSnowball)); } virtual bool is_snipable() const override { return true; } protected: @@ -63,6 +64,7 @@ class LeafShot final : public KamikazeSnowball virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Leafshot"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return KamikazeSnowball::get_class_types().add(typeid(LeafShot)); } virtual bool is_snipable() const override { return true; } diff --git a/src/badguy/kugelblitz.hpp b/src/badguy/kugelblitz.hpp index a3fee55dc97..6dea704955d 100644 --- a/src/badguy/kugelblitz.hpp +++ b/src/badguy/kugelblitz.hpp @@ -39,6 +39,7 @@ class Kugelblitz final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Kugelblitz"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Kugelblitz)); } void explode(); diff --git a/src/badguy/livefire.hpp b/src/badguy/livefire.hpp index 3eae46303c5..29331628c1f 100644 --- a/src/badguy/livefire.hpp +++ b/src/badguy/livefire.hpp @@ -37,6 +37,7 @@ class LiveFire : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Walking Flame"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(LiveFire)); } private: std::string death_sound; @@ -70,6 +71,7 @@ class LiveFireAsleep final : public LiveFire virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Sleeping Flame"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return LiveFire::get_class_types().add(typeid(LiveFireAsleep)); } private: LiveFireAsleep(const LiveFireAsleep&) = delete; @@ -88,6 +90,7 @@ class LiveFireDormant final : public LiveFire virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Dormant Flame"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return LiveFire::get_class_types().add(typeid(LiveFireDormant)); } private: LiveFireDormant(const LiveFireDormant&) = delete; diff --git a/src/badguy/mole.hpp b/src/badguy/mole.hpp index 30a8de7c5d8..07d808cf692 100644 --- a/src/badguy/mole.hpp +++ b/src/badguy/mole.hpp @@ -37,6 +37,7 @@ class Mole final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mole"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Mole)); } virtual bool is_snipable() const override { return true; } diff --git a/src/badguy/mole_rock.hpp b/src/badguy/mole_rock.hpp index b472e05bd4e..e9c378aa700 100644 --- a/src/badguy/mole_rock.hpp +++ b/src/badguy/mole_rock.hpp @@ -43,6 +43,7 @@ class MoleRock final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mole's rock"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(MoleRock)); } protected: const BadGuy* parent; /**< collisions with this BadGuy will be ignored */ diff --git a/src/badguy/mrbomb.hpp b/src/badguy/mrbomb.hpp index b4f6c221cdd..914251e92f9 100644 --- a/src/badguy/mrbomb.hpp +++ b/src/badguy/mrbomb.hpp @@ -39,6 +39,7 @@ class MrBomb final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mr. Bomb"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(MrBomb)); } virtual bool is_snipable() const override { return true; } GameObjectTypes get_types() const override; diff --git a/src/badguy/mriceblock.hpp b/src/badguy/mriceblock.hpp index b8f5ce8ee43..7b84e4ba1b5 100644 --- a/src/badguy/mriceblock.hpp +++ b/src/badguy/mriceblock.hpp @@ -48,6 +48,7 @@ class MrIceBlock : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mr. Iceblock"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(MrIceBlock)); } virtual bool is_snipable() const override { return ice_state != ICESTATE_KICKED; } virtual bool is_freezable() const override; diff --git a/src/badguy/mrtree.hpp b/src/badguy/mrtree.hpp index 24250aa09fc..21856013658 100644 --- a/src/badguy/mrtree.hpp +++ b/src/badguy/mrtree.hpp @@ -31,6 +31,7 @@ class MrTree final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mr. Tree"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(MrTree)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/owl.hpp b/src/badguy/owl.hpp index 3571d6248fd..4ec6e31584e 100644 --- a/src/badguy/owl.hpp +++ b/src/badguy/owl.hpp @@ -44,6 +44,7 @@ class Owl final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Owl"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Owl)); } virtual ObjectSettings get_settings() override; virtual bool is_snipable() const override { return true; } diff --git a/src/badguy/plant.hpp b/src/badguy/plant.hpp index 8f8136d474d..2478a12b30b 100644 --- a/src/badguy/plant.hpp +++ b/src/badguy/plant.hpp @@ -33,6 +33,7 @@ class Plant final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Plant"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Plant)); } protected: enum PlantState { diff --git a/src/badguy/rcrystallo.hpp b/src/badguy/rcrystallo.hpp index 0c6f2faedc8..b47ea645463 100644 --- a/src/badguy/rcrystallo.hpp +++ b/src/badguy/rcrystallo.hpp @@ -32,6 +32,7 @@ class RCrystallo final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Roof Crystallo"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(RCrystallo)); } virtual void active_update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/badguy/root.hpp b/src/badguy/root.hpp index c2a8903480a..ec727246773 100644 --- a/src/badguy/root.hpp +++ b/src/badguy/root.hpp @@ -38,6 +38,7 @@ class Root final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Root"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Root)); } virtual bool is_flammable() const override { return false; } virtual bool is_freezable() const override { return false; } diff --git a/src/badguy/root_sapling.hpp b/src/badguy/root_sapling.hpp index 6d30bea8c66..2de801170f8 100644 --- a/src/badguy/root_sapling.hpp +++ b/src/badguy/root_sapling.hpp @@ -40,6 +40,7 @@ class RootSapling final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Root Sapling"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(RootSapling)); } virtual void on_flip(float height) override; diff --git a/src/badguy/scrystallo.hpp b/src/badguy/scrystallo.hpp index 5761bc35667..2ac8a59cc95 100644 --- a/src/badguy/scrystallo.hpp +++ b/src/badguy/scrystallo.hpp @@ -30,6 +30,7 @@ class SCrystallo final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Sleeping Crystallo"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(SCrystallo)); } virtual void collision_solid(const CollisionHit& hit) override; virtual HitResponse collision_badguy(BadGuy& badguy, const CollisionHit& hit) override; diff --git a/src/badguy/short_fuse.hpp b/src/badguy/short_fuse.hpp index 74c80754eac..bac740e5b1c 100644 --- a/src/badguy/short_fuse.hpp +++ b/src/badguy/short_fuse.hpp @@ -29,6 +29,7 @@ class ShortFuse final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Short Fuse"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(ShortFuse)); } protected: virtual HitResponse collision_player (Player& player, const CollisionHit& hit) override; diff --git a/src/badguy/skydive.hpp b/src/badguy/skydive.hpp index dfb2b37efb9..88b1c1f441a 100644 --- a/src/badguy/skydive.hpp +++ b/src/badguy/skydive.hpp @@ -42,6 +42,7 @@ class SkyDive final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Skydive"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(SkyDive)); } virtual bool is_snipable() const override { return true; } protected: diff --git a/src/badguy/smartball.hpp b/src/badguy/smartball.hpp index 044b8564eb6..a4b5ed8ecef 100644 --- a/src/badguy/smartball.hpp +++ b/src/badguy/smartball.hpp @@ -31,6 +31,7 @@ class SmartBall final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mrs. Snowball"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(SmartBall)); } virtual bool is_snipable() const override { return true; } virtual bool is_freezable() const override; diff --git a/src/badguy/smartblock.hpp b/src/badguy/smartblock.hpp index 0b060b27e5b..6564227c8aa 100644 --- a/src/badguy/smartblock.hpp +++ b/src/badguy/smartblock.hpp @@ -29,6 +29,7 @@ class SmartBlock final : public MrIceBlock virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mrs. Iceblock"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MrIceBlock::get_class_types().add(typeid(SmartBlock)); } GameObjectTypes get_types() const override { return {}; } diff --git a/src/badguy/snail.hpp b/src/badguy/snail.hpp index a08a6040103..e77b41b2d31 100644 --- a/src/badguy/snail.hpp +++ b/src/badguy/snail.hpp @@ -42,6 +42,7 @@ class Snail final : virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Snail"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Snail)); } virtual GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/snowball.hpp b/src/badguy/snowball.hpp index 65e1a06dc29..ed0fe2433c3 100644 --- a/src/badguy/snowball.hpp +++ b/src/badguy/snowball.hpp @@ -29,6 +29,7 @@ class SnowBall final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mr. Snowball"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(SnowBall)); } virtual bool is_snipable() const override { return true; } virtual bool is_freezable() const override; diff --git a/src/badguy/snowman.hpp b/src/badguy/snowman.hpp index 82b8b2060e9..f241643f23c 100644 --- a/src/badguy/snowman.hpp +++ b/src/badguy/snowman.hpp @@ -28,6 +28,7 @@ class Snowman final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Snowman"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Snowman)); } protected: void loose_head(); diff --git a/src/badguy/spiky.hpp b/src/badguy/spiky.hpp index 8a48a26209e..c3f95eb9e27 100644 --- a/src/badguy/spiky.hpp +++ b/src/badguy/spiky.hpp @@ -30,6 +30,7 @@ class Spiky final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Spiky"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Spiky)); } private: Spiky(const Spiky&) = delete; diff --git a/src/badguy/sspiky.hpp b/src/badguy/sspiky.hpp index 551e1b12fd8..c09f713941c 100644 --- a/src/badguy/sspiky.hpp +++ b/src/badguy/sspiky.hpp @@ -36,6 +36,7 @@ class SSpiky final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Sleeping Spiky"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(SSpiky)); } virtual void after_editor_set() override; protected: diff --git a/src/badguy/stalactite.hpp b/src/badguy/stalactite.hpp index 10f928325ed..39ad7ebb60c 100644 --- a/src/badguy/stalactite.hpp +++ b/src/badguy/stalactite.hpp @@ -41,6 +41,7 @@ class Stalactite : public StickyBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Stalactite"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return StickyBadguy::get_class_types().add(typeid(Stalactite)); } virtual ObjectSettings get_settings() override; diff --git a/src/badguy/stumpy.hpp b/src/badguy/stumpy.hpp index bfee886a51b..a46c7ff4eb2 100644 --- a/src/badguy/stumpy.hpp +++ b/src/badguy/stumpy.hpp @@ -37,6 +37,7 @@ class Stumpy final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Stumpy"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Stumpy)); } protected: enum MyState { diff --git a/src/badguy/tarantula.hpp b/src/badguy/tarantula.hpp index 5c454ab5862..52b25d40af7 100644 --- a/src/badguy/tarantula.hpp +++ b/src/badguy/tarantula.hpp @@ -38,6 +38,7 @@ class Tarantula final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Tarantula"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Tarantula)); } virtual bool is_snipable() const override; virtual GameObjectTypes get_types() const override; diff --git a/src/badguy/toad.hpp b/src/badguy/toad.hpp index e2ff16d447d..330b2c6d1b1 100644 --- a/src/badguy/toad.hpp +++ b/src/badguy/toad.hpp @@ -37,6 +37,7 @@ class Toad final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Toad"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Toad)); } virtual bool is_snipable() const override { return true; } protected: diff --git a/src/badguy/totem.hpp b/src/badguy/totem.hpp index a4fb02769cc..d7188fba479 100644 --- a/src/badguy/totem.hpp +++ b/src/badguy/totem.hpp @@ -36,6 +36,7 @@ class Totem final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Totem"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Totem)); } virtual bool is_snipable() const override { return true; } protected: diff --git a/src/badguy/treewillowisp.hpp b/src/badguy/treewillowisp.hpp index c69ab63c705..a03c9a8dc93 100644 --- a/src/badguy/treewillowisp.hpp +++ b/src/badguy/treewillowisp.hpp @@ -27,6 +27,7 @@ class TreeWillOWisp final : public BadGuy public: TreeWillOWisp(GhostTree* tree, const Vector& pos, float radius, float speed); ~TreeWillOWisp() override; + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(TreeWillOWisp)); } virtual void activate() override; virtual void active_update(float dt_sec) override; diff --git a/src/badguy/viciousivy.hpp b/src/badguy/viciousivy.hpp index 99d566eb770..b9fa837d434 100644 --- a/src/badguy/viciousivy.hpp +++ b/src/badguy/viciousivy.hpp @@ -32,6 +32,7 @@ class ViciousIvy final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Vicious Ivy"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(ViciousIvy)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/walking_badguy.hpp b/src/badguy/walking_badguy.hpp index b65537f2e0a..4e43ed62235 100644 --- a/src/badguy/walking_badguy.hpp +++ b/src/badguy/walking_badguy.hpp @@ -52,6 +52,7 @@ class WalkingBadguy : public BadGuy const std::string& walk_right_action, int layer = LAYER_OBJECTS, const std::string& light_sprite_name = "images/objects/lightmap_light/lightmap_light-medium.sprite"); + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(WalkingBadguy)); } virtual void initialize() override; virtual void active_update(float dt_sec) override; diff --git a/src/badguy/walking_candle.hpp b/src/badguy/walking_candle.hpp index d621c46b833..3dd92d626ed 100644 --- a/src/badguy/walking_candle.hpp +++ b/src/badguy/walking_candle.hpp @@ -40,6 +40,7 @@ class WalkingCandle final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Walking Candle"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(WalkingCandle)); } private: Color lightcolor; diff --git a/src/badguy/walkingleaf.hpp b/src/badguy/walkingleaf.hpp index d2204841f00..7b4cdb15958 100644 --- a/src/badguy/walkingleaf.hpp +++ b/src/badguy/walkingleaf.hpp @@ -32,6 +32,7 @@ class WalkingLeaf final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Walking Leaf"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(WalkingLeaf)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/willowisp.hpp b/src/badguy/willowisp.hpp index cac9ae4e368..9fb5247135b 100644 --- a/src/badguy/willowisp.hpp +++ b/src/badguy/willowisp.hpp @@ -68,6 +68,7 @@ class WillOWisp final : public BadGuy, virtual std::string get_exposed_class_name() const override { return "WillOWisp"; } static std::string display_name() { return _("Will o' Wisp"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(WillOWisp)); } virtual ObjectSettings get_settings() override; virtual void move_to(const Vector& pos) override; diff --git a/src/badguy/yeti.hpp b/src/badguy/yeti.hpp index 68aea592bb5..9015aba7bb2 100644 --- a/src/badguy/yeti.hpp +++ b/src/badguy/yeti.hpp @@ -37,6 +37,7 @@ class Yeti final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Yeti"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Yeti)); } virtual ObjectSettings get_settings() override; diff --git a/src/badguy/yeti_stalactite.hpp b/src/badguy/yeti_stalactite.hpp index 70a4bd01460..01904f07b39 100644 --- a/src/badguy/yeti_stalactite.hpp +++ b/src/badguy/yeti_stalactite.hpp @@ -33,6 +33,7 @@ class YetiStalactite final : public Stalactite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Yeti's Stalactite"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Stalactite::get_class_types().add(typeid(YetiStalactite)); } void start_shaking(); bool is_hanging() const; diff --git a/src/badguy/zeekling.hpp b/src/badguy/zeekling.hpp index 73577595821..28efb11f88d 100644 --- a/src/badguy/zeekling.hpp +++ b/src/badguy/zeekling.hpp @@ -38,6 +38,7 @@ class Zeekling final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Zeekling"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Zeekling)); } virtual bool is_snipable() const override { return true; } private: diff --git a/src/editor/bezier_marker.hpp b/src/editor/bezier_marker.hpp index 383416bba6e..daf2e038a57 100644 --- a/src/editor/bezier_marker.hpp +++ b/src/editor/bezier_marker.hpp @@ -26,6 +26,7 @@ class BezierMarker final : public MarkerObject { public: BezierMarker(Path::Node* node, Vector* bezier_pos); + virtual GameObjectClasses get_class_types() const override { return MarkerObject::get_class_types().add(typeid(BezierMarker)); } virtual void move_to(const Vector& pos) override; virtual Vector get_point_vector() const override; diff --git a/src/editor/marker_object.hpp b/src/editor/marker_object.hpp index 03cb561d128..8341d182b79 100644 --- a/src/editor/marker_object.hpp +++ b/src/editor/marker_object.hpp @@ -28,6 +28,7 @@ class MarkerObject : public MovingObject public: MarkerObject(const Vector& pos); MarkerObject(); + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(MarkerObject)); } virtual void update(float dt_sec) override {} virtual void draw(DrawingContext& context) override; diff --git a/src/editor/node_marker.hpp b/src/editor/node_marker.hpp index 1a0f1e964bf..1014a960d35 100644 --- a/src/editor/node_marker.hpp +++ b/src/editor/node_marker.hpp @@ -25,6 +25,7 @@ class NodeMarker final : public MarkerObject { public: NodeMarker(std::vector::iterator node_iterator, size_t id_, UID before, UID after); + virtual GameObjectClasses get_class_types() const override { return MarkerObject::get_class_types().add(typeid(NodeMarker)); } virtual void move_to(const Vector& pos) override; virtual void editor_delete() override; diff --git a/src/editor/resize_marker.hpp b/src/editor/resize_marker.hpp index 5a832ae6269..ba0f16d623b 100644 --- a/src/editor/resize_marker.hpp +++ b/src/editor/resize_marker.hpp @@ -32,6 +32,7 @@ class ResizeMarker final : public MarkerObject public: ResizeMarker(MovingObject* obj, Side vert, Side horz); + virtual GameObjectClasses get_class_types() const override { return MarkerObject::get_class_types().add(typeid(ResizeMarker)); } void move_to(const Vector& pos) override; Vector get_point_vector() const override; diff --git a/src/object/ambient_light.hpp b/src/object/ambient_light.hpp index 34c4cead95e..43311a21ac2 100644 --- a/src/object/ambient_light.hpp +++ b/src/object/ambient_light.hpp @@ -37,6 +37,7 @@ class AmbientLight : public GameObject static std::string display_name() { return _("Ambient Light"); } virtual std::string get_display_name() const override { return display_name(); } virtual const std::string get_icon_path() const override { return "images/engine/editor/ambient_light.png"; } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(AmbientLight)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/ambient_sound.hpp b/src/object/ambient_sound.hpp index 43a868cf6ba..e37403f7f68 100644 --- a/src/object/ambient_sound.hpp +++ b/src/object/ambient_sound.hpp @@ -50,6 +50,7 @@ class AmbientSound final : public MovingObject static std::string display_name() { return _("Ambient Sound"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(AmbientSound)); } virtual void draw(DrawingContext& context) override; diff --git a/src/object/background.hpp b/src/object/background.hpp index d5f15247901..94bbbee5784 100644 --- a/src/object/background.hpp +++ b/src/object/background.hpp @@ -50,6 +50,7 @@ class Background final : public GameObject virtual std::string get_exposed_class_name() const override { return "Background"; } static std::string display_name() { return _("Background"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Background)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/background.png"; diff --git a/src/object/bicycle_platform.hpp b/src/object/bicycle_platform.hpp index 9df28d6c09f..fcec2c931a9 100644 --- a/src/object/bicycle_platform.hpp +++ b/src/object/bicycle_platform.hpp @@ -28,6 +28,7 @@ class BicyclePlatformChild : public MovingSprite public: BicyclePlatformChild(const ReaderMapping& reader, float angle_offset, BicyclePlatform& parent); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(BicyclePlatformChild)); } virtual void update(float dt_sec) override; virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; @@ -66,6 +67,7 @@ class BicyclePlatform final : public GameObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Bicycle Platform"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(BicyclePlatform)); } virtual ObjectSettings get_settings() override; virtual void editor_delete() override; diff --git a/src/object/block.hpp b/src/object/block.hpp index 8e647bf4852..50345044f89 100644 --- a/src/object/block.hpp +++ b/src/object/block.hpp @@ -30,6 +30,8 @@ class Block : public MovingSprite Block(const Vector& pos, const std::string& sprite_file); Block(const ReaderMapping& mapping, const std::string& sprite_file); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Block)); } + virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/bonus_block.hpp b/src/object/bonus_block.hpp index 9b7ec20239d..924f59bc0ad 100644 --- a/src/object/bonus_block.hpp +++ b/src/object/bonus_block.hpp @@ -61,6 +61,7 @@ class BonusBlock final : public Block virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Bonus Block"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Block::get_class_types().add(typeid(BonusBlock)); } virtual ObjectSettings get_settings() override; GameObjectTypes get_types() const override; diff --git a/src/object/bouncy_coin.hpp b/src/object/bouncy_coin.hpp index 79c8099a65d..67f2a8de3c6 100644 --- a/src/object/bouncy_coin.hpp +++ b/src/object/bouncy_coin.hpp @@ -27,6 +27,7 @@ class BouncyCoin final : public GameObject public: BouncyCoin(const Vector& pos, bool emerge = false, const std::string& sprite_path = "images/objects/coin/coin.sprite"); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(BouncyCoin)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; virtual bool is_saveable() const override { diff --git a/src/object/brick.hpp b/src/object/brick.hpp index ffe8f0432c1..21803d4de37 100644 --- a/src/object/brick.hpp +++ b/src/object/brick.hpp @@ -33,6 +33,7 @@ class Brick : public Block virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Brick"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Block::get_class_types().add(typeid(Brick)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; @@ -69,6 +70,7 @@ class HeavyBrick : public Brick virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Heavy Brick"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Brick::get_class_types().add(typeid(HeavyBrick)); } GameObjectTypes get_types() const override { return {}; } diff --git a/src/object/bullet.hpp b/src/object/bullet.hpp index aefdbbbf8c4..601c35b1d0a 100644 --- a/src/object/bullet.hpp +++ b/src/object/bullet.hpp @@ -31,6 +31,8 @@ class Bullet final : public MovingObject public: Bullet(const Vector& pos, const Vector& xm, Direction dir, BonusType type, Player& player); + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Bullet)); } + virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; virtual void collision_solid(const CollisionHit& hit) override; diff --git a/src/object/bumper.hpp b/src/object/bumper.hpp index bc9b40c8700..724059f0cea 100644 --- a/src/object/bumper.hpp +++ b/src/object/bumper.hpp @@ -37,6 +37,7 @@ class Bumper final : public StickyObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Bumper"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return StickyObject::get_class_types().add(typeid(Bumper)); } virtual void after_editor_set() override; virtual void on_flip(float height) override; diff --git a/src/object/camera.hpp b/src/object/camera.hpp index 912f40e4126..c4c6e44dc76 100644 --- a/src/object/camera.hpp +++ b/src/object/camera.hpp @@ -67,6 +67,7 @@ class Camera final : public GameObject, virtual std::string get_exposed_class_name() const override { return "Camera"; } static std::string display_name() { return _("Camera"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Camera)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/candle.hpp b/src/object/candle.hpp index 34be1323caa..cc3a4e0a833 100644 --- a/src/object/candle.hpp +++ b/src/object/candle.hpp @@ -42,6 +42,7 @@ class Candle final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "Candle"; } static std::string display_name() { return _("Candle"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Candle)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/circleplatform.hpp b/src/object/circleplatform.hpp index 11892f4b274..4da7c150726 100644 --- a/src/object/circleplatform.hpp +++ b/src/object/circleplatform.hpp @@ -34,6 +34,7 @@ class CirclePlatform : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Circular Platform"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(CirclePlatform)); } private: virtual void initialize(); diff --git a/src/object/cloud_particle_system.hpp b/src/object/cloud_particle_system.hpp index 20c1cee322d..81b49cc6c46 100644 --- a/src/object/cloud_particle_system.hpp +++ b/src/object/cloud_particle_system.hpp @@ -49,6 +49,7 @@ class CloudParticleSystem final : public ParticleSystem virtual std::string get_exposed_class_name() const override { return "CloudParticleSystem"; } static std::string display_name() { return _("Cloud Particles"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return ParticleSystem::get_class_types().add(typeid(CloudParticleSystem)); } virtual ObjectSettings get_settings() override; virtual const std::string get_icon_path() const override { diff --git a/src/object/coin.hpp b/src/object/coin.hpp index 194be61b99b..9fd3de5db62 100644 --- a/src/object/coin.hpp +++ b/src/object/coin.hpp @@ -43,6 +43,7 @@ class Coin : public MovingSprite, virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Coin"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Coin)); } virtual ObjectSettings get_settings() override; GameObjectTypes get_types() const override; @@ -96,6 +97,7 @@ class HeavyCoin final : public Coin virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Heavy Coin"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Coin::get_class_types().add(typeid(HeavyCoin)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/coin_explode.hpp b/src/object/coin_explode.hpp index b8ec2233e8d..e7a316d4e77 100644 --- a/src/object/coin_explode.hpp +++ b/src/object/coin_explode.hpp @@ -25,6 +25,7 @@ class CoinExplode final : public GameObject public: CoinExplode(const Vector& pos, bool count_stats = true, const std::string& sprite_path = "images/objects/coin/coin.sprite"); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(CoinExplode)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; virtual bool is_saveable() const override { diff --git a/src/object/coin_rain.hpp b/src/object/coin_rain.hpp index 55a8ce5b222..df5c8ea3e5e 100644 --- a/src/object/coin_rain.hpp +++ b/src/object/coin_rain.hpp @@ -27,6 +27,7 @@ class CoinRain final : public GameObject public: CoinRain(const Vector& pos, bool emerge=false, bool count_stats = true, const std::string& sprite_path = "images/objects/coin/coin.sprite"); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(CoinRain)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; virtual bool is_saveable() const override { diff --git a/src/object/conveyor_belt.hpp b/src/object/conveyor_belt.hpp index 80eff3dec91..eb45c47e656 100644 --- a/src/object/conveyor_belt.hpp +++ b/src/object/conveyor_belt.hpp @@ -46,6 +46,7 @@ class ConveyorBelt final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "ConveyorBelt"; } static std::string display_name() { return _("Conveyor Belt"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(ConveyorBelt)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/custom_particle_system.hpp b/src/object/custom_particle_system.hpp index 427970374a6..2076a0b1716 100644 --- a/src/object/custom_particle_system.hpp +++ b/src/object/custom_particle_system.hpp @@ -53,6 +53,7 @@ class CustomParticleSystem : public ParticleSystem_Interactive virtual std::string get_exposed_class_name() const override { return "CustomParticleSystem"; } static std::string display_name() { return _("Custom Particles"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return ParticleSystem_Interactive::get_class_types().add(typeid(CustomParticleSystem)); } virtual void save(Writer& writer) override; virtual ObjectSettings get_settings() override; diff --git a/src/object/custom_particle_system_file.hpp b/src/object/custom_particle_system_file.hpp index b37a4c4cded..728852e5443 100644 --- a/src/object/custom_particle_system_file.hpp +++ b/src/object/custom_particle_system_file.hpp @@ -38,6 +38,7 @@ class CustomParticleSystemFile final : public CustomParticleSystem virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Custom Particles from file"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return CustomParticleSystem::get_class_types().add(typeid(CustomParticleSystemFile)); } virtual ObjectSettings get_settings() override; virtual const std::string get_icon_path() const override { diff --git a/src/object/decal.hpp b/src/object/decal.hpp index c8913305bad..edff1bd404a 100644 --- a/src/object/decal.hpp +++ b/src/object/decal.hpp @@ -48,6 +48,7 @@ class Decal final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "Decal"; } static std::string display_name() { return _("Decal"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Decal)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/display_effect.hpp b/src/object/display_effect.hpp index 33ef9533565..3822438cf94 100644 --- a/src/object/display_effect.hpp +++ b/src/object/display_effect.hpp @@ -34,6 +34,7 @@ class DisplayEffect final : public GameObject public: DisplayEffect(const std::string& name = ""); ~DisplayEffect() override; + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(DisplayEffect)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/electrifier.hpp b/src/object/electrifier.hpp index 9bf3dd26f2f..574e253a70f 100644 --- a/src/object/electrifier.hpp +++ b/src/object/electrifier.hpp @@ -35,6 +35,7 @@ class Electrifier final : public GameObject public: Electrifier(TileChangeMap replacements, float seconds); Electrifier(uint32_t oldtile, uint32_t newtile, float seconds); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Electrifier)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/endsequence.hpp b/src/object/endsequence.hpp index 5ccb154d6c4..2ccfbd99ba4 100644 --- a/src/object/endsequence.hpp +++ b/src/object/endsequence.hpp @@ -27,6 +27,7 @@ class EndSequence : public GameObject public: EndSequence(); ~EndSequence() override; + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(EndSequence)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/endsequence_fireworks.hpp b/src/object/endsequence_fireworks.hpp index c459e791738..7e052277b3e 100644 --- a/src/object/endsequence_fireworks.hpp +++ b/src/object/endsequence_fireworks.hpp @@ -25,6 +25,7 @@ class EndSequenceFireworks final : public EndSequence public: EndSequenceFireworks(); ~EndSequenceFireworks() override; + virtual GameObjectClasses get_class_types() const override { return EndSequence::get_class_types().add(typeid(EndSequenceFireworks)); } virtual void draw(DrawingContext& context) override; protected: diff --git a/src/object/endsequence_walk.hpp b/src/object/endsequence_walk.hpp index 8f4836cbaff..ef22d244e5b 100644 --- a/src/object/endsequence_walk.hpp +++ b/src/object/endsequence_walk.hpp @@ -25,6 +25,7 @@ class EndSequenceWalk final : public EndSequence public: EndSequenceWalk(); ~EndSequenceWalk() override; + virtual GameObjectClasses get_class_types() const override { return EndSequence::get_class_types().add(typeid(EndSequenceWalk)); } virtual void draw(DrawingContext& context) override; protected: diff --git a/src/object/explosion.hpp b/src/object/explosion.hpp index 0b7146fef81..070d3b654c2 100644 --- a/src/object/explosion.hpp +++ b/src/object/explosion.hpp @@ -34,6 +34,7 @@ class Explosion final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Explosion"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Explosion)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/fallblock.hpp b/src/object/fallblock.hpp index e6f627f2c34..202b56e5d1e 100644 --- a/src/object/fallblock.hpp +++ b/src/object/fallblock.hpp @@ -40,6 +40,7 @@ class FallBlock : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Falling Platform"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(FallBlock)); } virtual void on_flip(float height) override; diff --git a/src/object/falling_coin.hpp b/src/object/falling_coin.hpp index 5f942a33ee4..55ef3b3d3b8 100644 --- a/src/object/falling_coin.hpp +++ b/src/object/falling_coin.hpp @@ -26,6 +26,7 @@ class FallingCoin final : public GameObject { public: FallingCoin(const Vector& start_position, float x_vel); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(FallingCoin)); } virtual void draw(DrawingContext& context) override; virtual void update(float dt_sec) override; diff --git a/src/object/firefly.hpp b/src/object/firefly.hpp index 147cdb68195..55c820d6a1e 100644 --- a/src/object/firefly.hpp +++ b/src/object/firefly.hpp @@ -37,6 +37,7 @@ class Firefly final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Checkpoint"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Firefly)); } virtual ObjectSettings get_settings() override; virtual void on_flip(float height) override; diff --git a/src/object/fireworks.hpp b/src/object/fireworks.hpp index 23f45bf4263..e54bacb3ccf 100644 --- a/src/object/fireworks.hpp +++ b/src/object/fireworks.hpp @@ -26,6 +26,7 @@ class Fireworks final : public GameObject { public: Fireworks(); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Fireworks)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/floating_image.hpp b/src/object/floating_image.hpp index 59774cdc45d..a4fbec4a997 100644 --- a/src/object/floating_image.hpp +++ b/src/object/floating_image.hpp @@ -39,6 +39,7 @@ class FloatingImage final : public GameObject ~FloatingImage() override; virtual bool is_saveable() const override { return false; } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(FloatingImage)); } virtual std::string get_exposed_class_name() const override { return "FloatingImage"; } virtual void update(float dt_sec) override; diff --git a/src/object/floating_text.hpp b/src/object/floating_text.hpp index ca3c671a427..7b7d3214b13 100644 --- a/src/object/floating_text.hpp +++ b/src/object/floating_text.hpp @@ -28,6 +28,8 @@ class FloatingText final : public GameObject public: FloatingText(const Vector& pos, const std::string& text_); FloatingText(const Vector& pos, int s); // use this for score, for instance + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(FloatingText)); } + virtual bool is_saveable() const override { return false; } diff --git a/src/object/flower.hpp b/src/object/flower.hpp index 173a8d0c1e8..11427005be7 100644 --- a/src/object/flower.hpp +++ b/src/object/flower.hpp @@ -30,6 +30,7 @@ class Flower final : public MovingObject public: Flower(BonusType type, const std::string& custom_sprite = ""); + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Flower)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/ghost_particle_system.hpp b/src/object/ghost_particle_system.hpp index 8610b5b8e1f..2bedbf2d2ec 100644 --- a/src/object/ghost_particle_system.hpp +++ b/src/object/ghost_particle_system.hpp @@ -36,6 +36,7 @@ class GhostParticleSystem final : public ParticleSystem virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Ghost Particles"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return ParticleSystem::get_class_types().add(typeid(GhostParticleSystem)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/ghostparticles.png"; diff --git a/src/object/gradient.hpp b/src/object/gradient.hpp index 0c57c2a5e95..7259b25ae88 100644 --- a/src/object/gradient.hpp +++ b/src/object/gradient.hpp @@ -48,6 +48,7 @@ class Gradient final : public GameObject virtual std::string get_exposed_class_name() const override { return "Gradient"; } static std::string display_name() { return _("Gradient"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Gradient)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/gradient.png"; diff --git a/src/object/growup.hpp b/src/object/growup.hpp index 8c743cd1cd4..d779a01132f 100644 --- a/src/object/growup.hpp +++ b/src/object/growup.hpp @@ -25,6 +25,7 @@ class GrowUp final : public MovingSprite { public: GrowUp(const Vector& pos, Direction direction = Direction::RIGHT, const std::string& custom_sprite = ""); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(GrowUp)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/hurting_platform.hpp b/src/object/hurting_platform.hpp index db034f4bb66..d1fc19b8db9 100644 --- a/src/object/hurting_platform.hpp +++ b/src/object/hurting_platform.hpp @@ -30,6 +30,7 @@ class HurtingPlatform final : public Platform virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Hurting Platform"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Platform::get_class_types().add(typeid(HurtingPlatform)); } private: HurtingPlatform(const HurtingPlatform&) = delete; diff --git a/src/object/infoblock.hpp b/src/object/infoblock.hpp index a5351bfba72..9df49d85751 100644 --- a/src/object/infoblock.hpp +++ b/src/object/infoblock.hpp @@ -36,6 +36,7 @@ class InfoBlock final : public Block virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Info Block"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Block::get_class_types().add(typeid(InfoBlock)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/invisible_block.hpp b/src/object/invisible_block.hpp index ad2b63a169f..3d3ccb6c8bc 100644 --- a/src/object/invisible_block.hpp +++ b/src/object/invisible_block.hpp @@ -29,6 +29,7 @@ class InvisibleBlock final : public Block virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Invisible Block"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Block::get_class_types().add(typeid(InvisibleBlock)); } virtual void draw(DrawingContext& context) override; virtual bool collides(GameObject& other, const CollisionHit& hit) const override; diff --git a/src/object/invisible_wall.hpp b/src/object/invisible_wall.hpp index 02bddb90440..3b5ba67cec8 100644 --- a/src/object/invisible_wall.hpp +++ b/src/object/invisible_wall.hpp @@ -36,6 +36,7 @@ class InvisibleWall final : public MovingObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Invisible Wall"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(InvisibleWall)); } virtual bool has_variable_size() const override { return true; } diff --git a/src/object/ispy.hpp b/src/object/ispy.hpp index 681b005a14e..dea8674b2ce 100644 --- a/src/object/ispy.hpp +++ b/src/object/ispy.hpp @@ -34,6 +34,7 @@ class Ispy final : public StickyObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Ispy"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return StickyObject::get_class_types().add(typeid(Ispy)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/key.hpp b/src/object/key.hpp index d709020384b..81097fe9999 100644 --- a/src/object/key.hpp +++ b/src/object/key.hpp @@ -37,6 +37,7 @@ class Key final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Key"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Key)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/lantern.hpp b/src/object/lantern.hpp index 68d053cc5d4..435a1feaa02 100644 --- a/src/object/lantern.hpp +++ b/src/object/lantern.hpp @@ -37,6 +37,7 @@ class Lantern final : public Rock virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Lantern"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Rock::get_class_types().add(typeid(Lantern)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override { return {}; } diff --git a/src/object/level_time.hpp b/src/object/level_time.hpp index ee752a1a8a6..f592bdea360 100644 --- a/src/object/level_time.hpp +++ b/src/object/level_time.hpp @@ -74,6 +74,7 @@ class LevelTime final : public GameObject virtual std::string get_exposed_class_name() const override { return "LevelTime"; } static std::string display_name() { return _("Time Limit"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(LevelTime)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/light.hpp b/src/object/light.hpp index ce03309b56a..88ee82425f5 100644 --- a/src/object/light.hpp +++ b/src/object/light.hpp @@ -31,6 +31,8 @@ class Light : public GameObject return false; } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Light)); } + virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/lit_object.hpp b/src/object/lit_object.hpp index 4c326d38d9c..adddfe9d2c3 100644 --- a/src/object/lit_object.hpp +++ b/src/object/lit_object.hpp @@ -45,6 +45,7 @@ class LitObject final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "LitObject"; } static std::string display_name() { return _("Lit object"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(LitObject)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/magicblock.hpp b/src/object/magicblock.hpp index 21b1ef87d8c..91261eec774 100644 --- a/src/object/magicblock.hpp +++ b/src/object/magicblock.hpp @@ -41,6 +41,7 @@ class MagicBlock final: public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Magic Tile"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(MagicBlock)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/moving_sprite.hpp b/src/object/moving_sprite.hpp index 1f1c26323e9..b251e127587 100644 --- a/src/object/moving_sprite.hpp +++ b/src/object/moving_sprite.hpp @@ -57,6 +57,7 @@ class MovingSprite : public MovingObject static std::string class_name() { return "moving-sprite"; } virtual std::string get_class_name() const override { return class_name(); } virtual std::string get_exposed_class_name() const override { return "MovingSprite"; } + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(MovingSprite)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/music_object.hpp b/src/object/music_object.hpp index aecd6ee4305..b9c6e4c0448 100644 --- a/src/object/music_object.hpp +++ b/src/object/music_object.hpp @@ -41,6 +41,7 @@ class MusicObject : public GameObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Music"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(MusicObject)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/music.png"; } virtual ObjectSettings get_settings() override; diff --git a/src/object/oneup.hpp b/src/object/oneup.hpp index 373168fc49c..51efe40a3cc 100644 --- a/src/object/oneup.hpp +++ b/src/object/oneup.hpp @@ -25,6 +25,7 @@ class OneUp final : public MovingSprite { public: OneUp(const Vector& pos, Direction direction = Direction::RIGHT); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(OneUp)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/particle_zone.hpp b/src/object/particle_zone.hpp index dd59e6858e0..7504f30bd1c 100644 --- a/src/object/particle_zone.hpp +++ b/src/object/particle_zone.hpp @@ -37,6 +37,7 @@ class ParticleZone final : public MovingObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Particle zone"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(ParticleZone)); } virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; virtual ObjectSettings get_settings() override; diff --git a/src/object/particles.hpp b/src/object/particles.hpp index c92a2996326..1b090e82ff9 100644 --- a/src/object/particles.hpp +++ b/src/object/particles.hpp @@ -35,6 +35,7 @@ class Particles final : public GameObject const float min_initial_velocity, const float max_initial_velocity, const Vector& acceleration, int number, Color color, int size, float life_time, int drawing_layer); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Particles)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/particlesystem.hpp b/src/object/particlesystem.hpp index 239dd519d69..7f61f42c575 100644 --- a/src/object/particlesystem.hpp +++ b/src/object/particlesystem.hpp @@ -63,6 +63,7 @@ class ParticleSystem : public GameObject virtual std::string get_exposed_class_name() const override { return "ParticleSystem"; } static std::string display_name() { return _("Particle system"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(ParticleSystem)); } virtual ObjectSettings get_settings() override; /** diff --git a/src/object/particlesystem_interactive.hpp b/src/object/particlesystem_interactive.hpp index abf37cfb843..c0233f796cf 100644 --- a/src/object/particlesystem_interactive.hpp +++ b/src/object/particlesystem_interactive.hpp @@ -47,6 +47,7 @@ class ParticleSystem_Interactive : public ParticleSystem virtual std::string get_display_name() const override { return _("Interactive particle system"); } + virtual GameObjectClasses get_class_types() const override { return ParticleSystem::get_class_types().add(typeid(ParticleSystem_Interactive)); } protected: virtual int collision(Particle* particle, const Vector& movement); diff --git a/src/object/path_gameobject.hpp b/src/object/path_gameobject.hpp index 732c6f0d933..cbb7c7984cb 100644 --- a/src/object/path_gameobject.hpp +++ b/src/object/path_gameobject.hpp @@ -44,6 +44,7 @@ class PathGameObject : public GameObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Path"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(PathGameObject)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/path.png"; diff --git a/src/object/platform.hpp b/src/object/platform.hpp index 8308de5c763..1cc837e8349 100644 --- a/src/object/platform.hpp +++ b/src/object/platform.hpp @@ -53,6 +53,7 @@ class Platform : public MovingSprite, virtual std::string get_exposed_class_name() const override { return "Platform"; } static std::string display_name() { return _("Platform"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Platform)); } virtual void editor_update() override; diff --git a/src/object/player.hpp b/src/object/player.hpp index be7532333da..ba8d84c7715 100644 --- a/src/object/player.hpp +++ b/src/object/player.hpp @@ -89,6 +89,7 @@ class Player final : public MovingObject virtual bool has_object_manager_priority() const override { return true; } virtual std::string get_exposed_class_name() const override { return "Player"; } virtual void remove_me() override; + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Player)); } int get_id() const { return m_id; } void set_id(int id); diff --git a/src/object/pneumatic_platform.hpp b/src/object/pneumatic_platform.hpp index e5859ec53e1..6af88c99d83 100644 --- a/src/object/pneumatic_platform.hpp +++ b/src/object/pneumatic_platform.hpp @@ -28,6 +28,7 @@ class PneumaticPlatformChild final : public MovingSprite public: PneumaticPlatformChild(const ReaderMapping& reader, bool left, PneumaticPlatform& parent); ~PneumaticPlatformChild() override; + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(PneumaticPlatformChild)); } virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; virtual void update(float dt_sec) override; @@ -64,6 +65,7 @@ class PneumaticPlatform final : public GameObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Pneumatic Platform"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(PneumaticPlatform)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/powerup.hpp b/src/object/powerup.hpp index b0b9b5f8f12..b9ad6d2fd58 100644 --- a/src/object/powerup.hpp +++ b/src/object/powerup.hpp @@ -39,6 +39,7 @@ class PowerUp final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Powerup"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(PowerUp)); } std::vector get_patches() const override; virtual ObjectSettings get_settings() override; diff --git a/src/object/pulsing_light.hpp b/src/object/pulsing_light.hpp index 8e9d60cf3e3..f453aa94313 100644 --- a/src/object/pulsing_light.hpp +++ b/src/object/pulsing_light.hpp @@ -27,6 +27,7 @@ class PulsingLight final : public Light public: PulsingLight(const Vector& center, float cycle_len = 5.0, float min_alpha = 0.0, float max_alpha = 1.0, const Color& color = Color(1.0, 1.0, 1.0, 1.0)); ~PulsingLight() override; + virtual GameObjectClasses get_class_types() const override { return Light::get_class_types().add(typeid(PulsingLight)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/pushbutton.hpp b/src/object/pushbutton.hpp index dfc49e3d640..253a44a58e5 100644 --- a/src/object/pushbutton.hpp +++ b/src/object/pushbutton.hpp @@ -31,6 +31,7 @@ class PushButton final : public StickyObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Button"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return StickyObject::get_class_types().add(typeid(PushButton)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/rain_particle_system.hpp b/src/object/rain_particle_system.hpp index 5b2acd9cae4..4a6b263858c 100644 --- a/src/object/rain_particle_system.hpp +++ b/src/object/rain_particle_system.hpp @@ -48,6 +48,7 @@ class RainParticleSystem final : public ParticleSystem_Interactive virtual std::string get_exposed_class_name() const override { return "RainParticleSystem"; } static std::string display_name() { return _("Rain Particles"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return ParticleSystem_Interactive::get_class_types().add(typeid(RainParticleSystem)); } virtual ObjectSettings get_settings() override; /** diff --git a/src/object/rainsplash.hpp b/src/object/rainsplash.hpp index 86ca688d3dd..3b06bf4db6a 100644 --- a/src/object/rainsplash.hpp +++ b/src/object/rainsplash.hpp @@ -28,6 +28,7 @@ class RainSplash final : public GameObject public: RainSplash(const Vector& pos, bool vertical); ~RainSplash() override; + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(RainSplash)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/rock.hpp b/src/object/rock.hpp index c50f8ff45fb..f38b9cd7c90 100644 --- a/src/object/rock.hpp +++ b/src/object/rock.hpp @@ -39,6 +39,7 @@ class Rock : public MovingSprite, virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Rock"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Portable)).add(typeid(Rock)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; diff --git a/src/object/rublight.hpp b/src/object/rublight.hpp index 0a218585745..9772dd2eda2 100644 --- a/src/object/rublight.hpp +++ b/src/object/rublight.hpp @@ -33,6 +33,7 @@ class RubLight final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Rublight"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(RubLight)); } virtual ObjectSettings get_settings() override; virtual void on_flip(float height) override; diff --git a/src/object/rusty_trampoline.hpp b/src/object/rusty_trampoline.hpp index 86e4ac4b074..590fc0d6a09 100644 --- a/src/object/rusty_trampoline.hpp +++ b/src/object/rusty_trampoline.hpp @@ -39,6 +39,7 @@ class RustyTrampoline final : public Rock virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Rusty Trampoline"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Rock::get_class_types().add(typeid(RustyTrampoline)); } virtual ObjectSettings get_settings() override; GameObjectTypes get_types() const override { return {}; } diff --git a/src/object/scripted_object.hpp b/src/object/scripted_object.hpp index 5465f78d210..920a09d9874 100644 --- a/src/object/scripted_object.hpp +++ b/src/object/scripted_object.hpp @@ -45,6 +45,7 @@ class ScriptedObject final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "ScriptedObject"; } static std::string display_name() { return _("Scripted Object"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(ScriptedObject)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/shard.hpp b/src/object/shard.hpp index 7d3c89579ff..57c461ae7a5 100644 --- a/src/object/shard.hpp +++ b/src/object/shard.hpp @@ -34,6 +34,7 @@ class Shard final : public StickyObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Shard"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return StickyObject::get_class_types().add(typeid(Shard)); } protected: Physic m_physic; diff --git a/src/object/smoke_cloud.hpp b/src/object/smoke_cloud.hpp index 6c3b1ef47ea..4eedf2a7955 100644 --- a/src/object/smoke_cloud.hpp +++ b/src/object/smoke_cloud.hpp @@ -26,6 +26,7 @@ class SmokeCloud final : public GameObject { public: SmokeCloud(const Vector& pos); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(SmokeCloud)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/snow_particle_system.hpp b/src/object/snow_particle_system.hpp index 6b608ab27fe..854962b8fd2 100644 --- a/src/object/snow_particle_system.hpp +++ b/src/object/snow_particle_system.hpp @@ -36,6 +36,7 @@ class SnowParticleSystem final : public ParticleSystem virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Snow Particles"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return ParticleSystem::get_class_types().add(typeid(SnowParticleSystem)); } virtual ObjectSettings get_settings() override; virtual const std::string get_icon_path() const override diff --git a/src/object/sound_object.hpp b/src/object/sound_object.hpp index c2ef56791ee..b636843a03a 100644 --- a/src/object/sound_object.hpp +++ b/src/object/sound_object.hpp @@ -40,6 +40,7 @@ class SoundObject final : public GameObject virtual std::string get_exposed_class_name() const override { return "SoundObject"; } static std::string display_name() { return _("Sound"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(SoundObject)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/sound.png"; } virtual ObjectSettings get_settings() override; diff --git a/src/object/spawnpoint.hpp b/src/object/spawnpoint.hpp index 6a6c22185d3..a2e12ba57a0 100644 --- a/src/object/spawnpoint.hpp +++ b/src/object/spawnpoint.hpp @@ -47,6 +47,7 @@ class SpawnPointMarker final : public MovingObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Spawnpoint"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(SpawnPointMarker)); } virtual ObjectSettings get_settings() override; virtual int get_layer() const override { return LAYER_FOREGROUND1; } diff --git a/src/object/specialriser.hpp b/src/object/specialriser.hpp index 2e4248708f7..7eb546f66b7 100644 --- a/src/object/specialriser.hpp +++ b/src/object/specialriser.hpp @@ -27,6 +27,7 @@ class SpecialRiser final : public MovingObject { public: SpecialRiser(const Vector& pos, std::unique_ptr child, bool is_solid = false); + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(SpecialRiser)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/spotlight.hpp b/src/object/spotlight.hpp index 1f2c9422542..c214080c4b5 100644 --- a/src/object/spotlight.hpp +++ b/src/object/spotlight.hpp @@ -58,6 +58,7 @@ class Spotlight final : public MovingObject virtual std::string get_exposed_class_name() const override { return "Spotlight"; } static std::string display_name() { return _("Spotlight"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Spotlight)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/sprite_particle.hpp b/src/object/sprite_particle.hpp index 44bd77c841b..ae5dad30dfc 100644 --- a/src/object/sprite_particle.hpp +++ b/src/object/sprite_particle.hpp @@ -37,6 +37,7 @@ class SpriteParticle final : public GameObject const Vector& position, AnchorPoint anchor, const Vector& velocity, const Vector& acceleration, int drawing_layer = LAYER_OBJECTS-1, bool notimeout = false, Color color = Color::WHITE); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(SpriteParticle)); } ~SpriteParticle() override; protected: diff --git a/src/object/star.hpp b/src/object/star.hpp index 808ddf8052a..f019757707b 100644 --- a/src/object/star.hpp +++ b/src/object/star.hpp @@ -26,6 +26,7 @@ class Star final : public MovingSprite { public: Star(const Vector& pos, Direction direction = Direction::RIGHT, const std::string& custom_sprite = ""); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Star)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/sticky_object.hpp b/src/object/sticky_object.hpp index b276dfa5a36..13c7ed61316 100644 --- a/src/object/sticky_object.hpp +++ b/src/object/sticky_object.hpp @@ -31,6 +31,7 @@ class StickyObject : public MovingSprite int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); StickyObject(const ReaderMapping& reader, const std::string& sprite_name, int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(StickyObject)); } virtual void update(float dt_sec) override; @@ -80,6 +81,7 @@ class StickyBadguy : public BadGuy int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); StickyBadguy(const ReaderMapping& reader, const std::string& sprite_name, int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(StickyBadguy)); } virtual void sticky_update(float dt_sec); diff --git a/src/object/text_array_object.hpp b/src/object/text_array_object.hpp index bfbd8320ea6..81f49a68750 100644 --- a/src/object/text_array_object.hpp +++ b/src/object/text_array_object.hpp @@ -56,6 +56,7 @@ class TextArrayObject final : public GameObject virtual std::string get_exposed_class_name() const override { return "TextArrayObject"; } static std::string display_name() { return _("Text array"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(TextArrayObject)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/textarray.png"; diff --git a/src/object/text_object.hpp b/src/object/text_object.hpp index 33396c4cc33..70184ea3a56 100644 --- a/src/object/text_object.hpp +++ b/src/object/text_object.hpp @@ -51,6 +51,7 @@ class TextObject final : public GameObject virtual std::string get_exposed_class_name() const override { return "TextObject"; } static std::string display_name() { return _("Text"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(TextObject)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/textarray.png"; } diff --git a/src/object/textscroller.hpp b/src/object/textscroller.hpp index 1a15e5ae30c..d484c4fe78b 100644 --- a/src/object/textscroller.hpp +++ b/src/object/textscroller.hpp @@ -44,6 +44,7 @@ class TextScroller : public GameObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Text Scroller"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(TextScroller)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/textscroller.png"; } void set_default_speed(float default_speed); diff --git a/src/object/thunderstorm.hpp b/src/object/thunderstorm.hpp index 0c888df48e1..50b71184a71 100644 --- a/src/object/thunderstorm.hpp +++ b/src/object/thunderstorm.hpp @@ -51,6 +51,7 @@ class Thunderstorm final : public GameObject virtual std::string get_exposed_class_name() const override { return "Thunderstorm"; } static std::string display_name() { return _("Thunderstorm"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Thunderstorm)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/tilemap.hpp b/src/object/tilemap.hpp index 332b52c3ec2..e2acdff847e 100644 --- a/src/object/tilemap.hpp +++ b/src/object/tilemap.hpp @@ -65,6 +65,7 @@ class TileMap final : public GameObject, virtual const std::string get_icon_path() const override { return "images/engine/editor/tilemap.png"; } static std::string display_name() { return _("Tilemap"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(TileMap)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/torch.hpp b/src/object/torch.hpp index ea24ad4ac41..377f5ae6d38 100644 --- a/src/object/torch.hpp +++ b/src/object/torch.hpp @@ -46,6 +46,7 @@ class Torch final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "Torch"; } static std::string display_name() { return _("Torch"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Torch)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/trampoline.hpp b/src/object/trampoline.hpp index 910fa118258..29b6cfebfb5 100644 --- a/src/object/trampoline.hpp +++ b/src/object/trampoline.hpp @@ -36,6 +36,7 @@ class Trampoline final : public Rock virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Trampoline"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Rock::get_class_types().add(typeid(Trampoline)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/object/unstable_tile.hpp b/src/object/unstable_tile.hpp index b5af23dd308..313a226ece1 100644 --- a/src/object/unstable_tile.hpp +++ b/src/object/unstable_tile.hpp @@ -41,6 +41,7 @@ class UnstableTile final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Unstable Tile"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(UnstableTile)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/object/vertical_stripes.hpp b/src/object/vertical_stripes.hpp index 79535fda9ac..b789d754af3 100644 --- a/src/object/vertical_stripes.hpp +++ b/src/object/vertical_stripes.hpp @@ -28,6 +28,8 @@ class VerticalStripes final : public GameObject VerticalStripes(); ~VerticalStripes() override; + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(VerticalStripes)); } + virtual bool is_singleton() const override { return true; } virtual bool is_saveable() const override { return false; } virtual void update(float dt_sec) override; diff --git a/src/object/water_drop.hpp b/src/object/water_drop.hpp index 5f7cd70eedd..0949b7f83fd 100644 --- a/src/object/water_drop.hpp +++ b/src/object/water_drop.hpp @@ -27,6 +27,8 @@ class WaterDrop final : public MovingSprite public: WaterDrop(const Vector& pos, const std::string& sprite_path_, const Vector& velocity); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(WaterDrop)); } + virtual void update(float dt_sec) override; virtual void collision_solid(const CollisionHit& hit) override; virtual HitResponse collision(GameObject& other, const CollisionHit& ) override; diff --git a/src/object/weak_block.hpp b/src/object/weak_block.hpp index 865c97e9a99..8c9f5724f54 100644 --- a/src/object/weak_block.hpp +++ b/src/object/weak_block.hpp @@ -35,6 +35,7 @@ class WeakBlock final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Weak Tile"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(WeakBlock)); } std::vector get_patches() const override; void update_version() override; diff --git a/src/object/wind.hpp b/src/object/wind.hpp index bbc5ae21c1f..2eb5562d710 100644 --- a/src/object/wind.hpp +++ b/src/object/wind.hpp @@ -42,6 +42,7 @@ class Wind final : public MovingObject virtual std::string get_exposed_class_name() const override { return "Wind"; } static std::string display_name() { return _("Wind"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Wind)); } virtual ObjectSettings get_settings() override; diff --git a/src/supertux/game_object.cpp b/src/supertux/game_object.cpp index 187ba06b4d2..8f54d5dd4cd 100644 --- a/src/supertux/game_object.cpp +++ b/src/supertux/game_object.cpp @@ -109,6 +109,14 @@ GameObject::save() return save_stream.str(); } +GameObjectClasses +GameObject::get_class_types() const { + GameObjectClasses g{}; + // All class types except GameObject, since everything implements GameObject + // g.add(typeid(GameObject)); + return g; +} + ObjectSettings GameObject::get_settings() { diff --git a/src/supertux/game_object.hpp b/src/supertux/game_object.hpp index c8202d6f1a8..9c427d21e69 100644 --- a/src/supertux/game_object.hpp +++ b/src/supertux/game_object.hpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "editor/object_settings.hpp" #include "supertux/game_object_component.hpp" @@ -47,6 +48,23 @@ struct GameObjectType }; typedef std::vector GameObjectTypes; +/** + A helper structure to list all the type_indexes of the classes in the + type hierarchy of a given class. This makes it easier to register e.g. + a MrIceblock in lists for MrIceBlock, WalkingBadguy, Badguy, Portable, + MovingSprite, MovingObject, and GameObject. + */ +struct GameObjectClasses +{ + std::vector types; + + GameObjectClasses& add(const std::type_info &info) { + std::type_index idx(info); + types.push_back(idx); + return *this; + } +}; + /** This class is responsible for: * Updating and drawing the object. This should happen in the update() and @@ -102,6 +120,9 @@ class GameObject : public ExposableClass * @description Returns the display name of the object, translated to the user's locale. */ virtual std::string get_display_name() const { return _("Unknown object"); } + /** List notable classes in inheritance hierarchy of class. This makes it possible + to efficiently look up all objects deriving from a particular intermediate class */ + virtual GameObjectClasses get_class_types() const; /** Version checking/updating, patch information */ virtual std::vector get_patches() const; diff --git a/src/supertux/game_object_iterator.hpp b/src/supertux/game_object_iterator.hpp index d16757434f0..1bef5e52390 100644 --- a/src/supertux/game_object_iterator.hpp +++ b/src/supertux/game_object_iterator.hpp @@ -25,7 +25,7 @@ template class GameObjectIterator { public: - typedef std::vector >::const_iterator Iterator; + typedef std::vector::const_iterator Iterator; public: GameObjectIterator(Iterator it, Iterator end) : @@ -35,24 +35,28 @@ class GameObjectIterator { if (m_it != m_end) { - m_object = dynamic_cast(m_it->get()); - if (!m_object) - { - skip_to_next(); - } + // A dynamic_cast is needed to perform sidecasts (a.k.a. crosscasts) + // T may be one of multiple base classes of the object and need not inherit GameObject + m_object = dynamic_cast(*m_it); + assert(m_object); } } GameObjectIterator& operator++() { - skip_to_next(); + ++m_it; + if (m_it != m_end) + { + m_object = dynamic_cast(*m_it); + assert(m_object); + } return *this; } GameObjectIterator operator++(int) { GameObjectIterator tmp(*this); - skip_to_next(); + operator++(); return tmp; } @@ -82,24 +86,6 @@ class GameObjectIterator return !(*this == other); } -private: - void skip_to_next() - { - do - { - ++m_it; - if (m_it == m_end) - { - break; - } - else - { - m_object = dynamic_cast(m_it->get()); - } - } - while (!m_object); - } - private: Iterator m_it; Iterator m_end; @@ -115,11 +101,13 @@ class GameObjectRange {} GameObjectIterator begin() const { - return GameObjectIterator(m_manager.get_objects().begin(), m_manager.get_objects().end()); + auto& objects = m_manager.get_objects_by_type_index(typeid(T)); + return GameObjectIterator(objects.begin(), objects.end()); } GameObjectIterator end() const { - return GameObjectIterator(m_manager.get_objects().end(), m_manager.get_objects().end()); + auto& objects = m_manager.get_objects_by_type_index(typeid(T)); + return GameObjectIterator(objects.end(), objects.end()); } private: diff --git a/src/supertux/game_object_manager.cpp b/src/supertux/game_object_manager.cpp index f272a9f75a7..0226a1a60a0 100644 --- a/src/supertux/game_object_manager.cpp +++ b/src/supertux/game_object_manager.cpp @@ -483,7 +483,9 @@ GameObjectManager::this_before_object_add(GameObject& object) } { // By type index: - m_objects_by_type_index[std::type_index(typeid(object))].push_back(&object); + for (const std::type_index& type : object.get_class_types().types) { + m_objects_by_type_index[type].push_back(&object); + } } save_object_change(object, true); @@ -507,10 +509,12 @@ GameObjectManager::this_before_object_remove(GameObject& object) } { // By type index: - auto& vec = m_objects_by_type_index[std::type_index(typeid(object))]; - auto it = std::find(vec.begin(), vec.end(), &object); - assert(it != vec.end()); - vec.erase(it); + for (const std::type_index& type : object.get_class_types().types) { + auto& vec = m_objects_by_type_index[type]; + auto it = std::find(vec.begin(), vec.end(), &object); + assert(it != vec.end()); + vec.erase(it); + } } } diff --git a/src/supertux/game_object_manager.hpp b/src/supertux/game_object_manager.hpp index 601918b85fc..07a79f77dba 100644 --- a/src/supertux/game_object_manager.hpp +++ b/src/supertux/game_object_manager.hpp @@ -243,8 +243,8 @@ class GameObjectManager : public ExposableClass int get_object_count(std::function predicate = nullptr) const { int total = 0; - for (const auto& obj : m_gameobjects) { - auto object = dynamic_cast(obj.get()); + for (const auto& obj : get_objects_by_type_index(typeid(T))) { + auto object = static_cast(obj); if (object && (predicate == nullptr || predicate(*object))) { total += 1; diff --git a/src/supertux/moving_object.hpp b/src/supertux/moving_object.hpp index bc5e8a1cbe5..1872470b228 100644 --- a/src/supertux/moving_object.hpp +++ b/src/supertux/moving_object.hpp @@ -46,6 +46,7 @@ class MovingObject : public GameObject, MovingObject(); MovingObject(const ReaderMapping& reader); ~MovingObject() override; + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(MovingObject)); } virtual void collision_solid(const CollisionHit& /*hit*/) override { diff --git a/src/supertux/player_status_hud.hpp b/src/supertux/player_status_hud.hpp index 0315f532001..3bcc649eef0 100644 --- a/src/supertux/player_status_hud.hpp +++ b/src/supertux/player_status_hud.hpp @@ -34,6 +34,7 @@ class PlayerStatusHUD : public GameObject public: PlayerStatusHUD(PlayerStatus& player_status); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(PlayerStatusHUD)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/trigger/climbable.hpp b/src/trigger/climbable.hpp index c3214b61d4f..6ef3bffcaa9 100644 --- a/src/trigger/climbable.hpp +++ b/src/trigger/climbable.hpp @@ -46,6 +46,7 @@ class Climbable final : public Trigger static std::string display_name() { return _("Climbable"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } + virtual GameObjectClasses get_class_types() const override { return Trigger::get_class_types().add(typeid(Climbable)); } virtual ObjectSettings get_settings() override; diff --git a/src/trigger/door.hpp b/src/trigger/door.hpp index fe363954944..7b095c33157 100644 --- a/src/trigger/door.hpp +++ b/src/trigger/door.hpp @@ -30,6 +30,7 @@ class Door final : public SpritedTrigger virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Door"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return SpritedTrigger::get_class_types().add(typeid(Door)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/trigger/scripttrigger.hpp b/src/trigger/scripttrigger.hpp index 538990e8752..6b3276346b7 100644 --- a/src/trigger/scripttrigger.hpp +++ b/src/trigger/scripttrigger.hpp @@ -29,6 +29,7 @@ class ScriptTrigger final : public Trigger static std::string display_name() { return _("Script Trigger"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } + virtual GameObjectClasses get_class_types() const override { return Trigger::get_class_types().add(typeid(ScriptTrigger)); } virtual ObjectSettings get_settings() override; diff --git a/src/trigger/secretarea_trigger.hpp b/src/trigger/secretarea_trigger.hpp index a32a237b5bb..8473b06da0f 100644 --- a/src/trigger/secretarea_trigger.hpp +++ b/src/trigger/secretarea_trigger.hpp @@ -36,6 +36,7 @@ class SecretAreaTrigger final : public Trigger static std::string display_name() { return _("Secret Area"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } + virtual GameObjectClasses get_class_types() const override { return Trigger::get_class_types().add(typeid(SecretAreaTrigger)); } virtual ObjectSettings get_settings() override; diff --git a/src/trigger/sequence_trigger.hpp b/src/trigger/sequence_trigger.hpp index 4de2fcb446b..fdbd44cb04b 100644 --- a/src/trigger/sequence_trigger.hpp +++ b/src/trigger/sequence_trigger.hpp @@ -31,6 +31,7 @@ class SequenceTrigger final : public Trigger static std::string display_name() { return _("Sequence Trigger"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } + virtual GameObjectClasses get_class_types() const override { return Trigger::get_class_types().add(typeid(SequenceTrigger)); } virtual ObjectSettings get_settings() override; diff --git a/src/trigger/switch.hpp b/src/trigger/switch.hpp index 0a09d06eb73..a83e267d799 100644 --- a/src/trigger/switch.hpp +++ b/src/trigger/switch.hpp @@ -29,6 +29,7 @@ class Switch final : public StickyTrigger virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Switch"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return StickyTrigger::get_class_types().add(typeid(Switch)); } virtual ObjectSettings get_settings() override; diff --git a/src/trigger/text_area.hpp b/src/trigger/text_area.hpp index 0c0b3d9df31..e652afd2bc8 100644 --- a/src/trigger/text_area.hpp +++ b/src/trigger/text_area.hpp @@ -47,6 +47,7 @@ class TextArea final : public Trigger static std::string display_name() { return _("Text Area"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } + virtual GameObjectClasses get_class_types() const override { return Trigger::get_class_types().add(typeid(TextArea)); } private: bool m_once; diff --git a/src/trigger/trigger_base.hpp b/src/trigger/trigger_base.hpp index 211df6fdc28..681458f0cf4 100644 --- a/src/trigger/trigger_base.hpp +++ b/src/trigger/trigger_base.hpp @@ -68,6 +68,7 @@ class Trigger : public MovingObject, { public: Trigger(const ReaderMapping& reader); + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Trigger)); } virtual void update(float) override { @@ -91,6 +92,7 @@ class SpritedTrigger : public MovingSprite, { public: SpritedTrigger(const ReaderMapping& reader, const std::string& sprite_name); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(SpritedTrigger)); } virtual void update(float) override { @@ -112,6 +114,7 @@ class StickyTrigger : public StickyObject, { public: StickyTrigger(const ReaderMapping& reader, const std::string& sprite_name); + virtual GameObjectClasses get_class_types() const override { return StickyObject::get_class_types().add(typeid(StickyTrigger)); } virtual void update(float dt_sec) override { diff --git a/src/worldmap/level_tile.hpp b/src/worldmap/level_tile.hpp index 66e20c1337f..59cc80a7539 100644 --- a/src/worldmap/level_tile.hpp +++ b/src/worldmap/level_tile.hpp @@ -35,6 +35,7 @@ class LevelTile final : public WorldMapObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Level"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(LevelTile)); } virtual ObjectSettings get_settings() override; diff --git a/src/worldmap/spawn_point.hpp b/src/worldmap/spawn_point.hpp index 3a664a1a48a..108eaa915d7 100644 --- a/src/worldmap/spawn_point.hpp +++ b/src/worldmap/spawn_point.hpp @@ -57,6 +57,7 @@ class SpawnPointObject final : public WorldMapObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Spawn point"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(SpawnPointObject)); } virtual ObjectSettings get_settings() override; diff --git a/src/worldmap/special_tile.hpp b/src/worldmap/special_tile.hpp index fab8de59fca..902d37c835c 100644 --- a/src/worldmap/special_tile.hpp +++ b/src/worldmap/special_tile.hpp @@ -35,6 +35,7 @@ class SpecialTile final : public WorldMapObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Special Tile"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(SpecialTile)); } virtual void draw_worldmap(DrawingContext& context) override; diff --git a/src/worldmap/sprite_change.hpp b/src/worldmap/sprite_change.hpp index e889b681066..4fa4fda3292 100644 --- a/src/worldmap/sprite_change.hpp +++ b/src/worldmap/sprite_change.hpp @@ -34,6 +34,7 @@ class SpriteChange final : public WorldMapObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Sprite Change"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(SpriteChange)); } virtual void draw_worldmap(DrawingContext& context) override; diff --git a/src/worldmap/teleporter.hpp b/src/worldmap/teleporter.hpp index b35b43e6aa4..39c7ec8253e 100644 --- a/src/worldmap/teleporter.hpp +++ b/src/worldmap/teleporter.hpp @@ -33,6 +33,7 @@ class Teleporter final : public WorldMapObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Teleporter"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(Teleporter)); } virtual ObjectSettings get_settings() override; diff --git a/src/worldmap/tux.hpp b/src/worldmap/tux.hpp index 60031875974..4347fd3d1ac 100644 --- a/src/worldmap/tux.hpp +++ b/src/worldmap/tux.hpp @@ -39,6 +39,7 @@ class Tux final : public GameObject virtual void draw(DrawingContext& context) override; virtual void update(float dt_sec) override; virtual bool is_singleton() const override { return true; } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Tux)); } void setup(); /**< called prior to first update */ diff --git a/src/worldmap/worldmap_object.hpp b/src/worldmap/worldmap_object.hpp index 7d60963f188..9803e576d0a 100644 --- a/src/worldmap/worldmap_object.hpp +++ b/src/worldmap/worldmap_object.hpp @@ -36,6 +36,7 @@ class WorldMapObject : public MovingSprite WorldMapObject(const ReaderMapping& mapping, const std::string& default_sprite); WorldMapObject(const ReaderMapping& mapping); WorldMapObject(const Vector& pos, const std::string& default_sprite); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(WorldMapObject)); } static std::string class_name() { return "worldmap-object"; } virtual std::string get_class_name() const override { return class_name(); } From 31dc707893b9beb3d9990e470ea3b80f917eafbb Mon Sep 17 00:00:00 2001 From: bruhmoent <69918580+bruhmoent@users.noreply.github.com> Date: Sun, 7 Jul 2024 14:31:31 +0200 Subject: [PATCH 08/33] Add an option to hide wind particles + set fancy as default (#2997) --- src/object/wind.cpp | 23 ++++++++++++----------- src/object/wind.hpp | 1 + 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/object/wind.cpp b/src/object/wind.cpp index b446c005243..f69c71be5fd 100644 --- a/src/object/wind.cpp +++ b/src/object/wind.cpp @@ -42,7 +42,8 @@ Wind::Wind(const ReaderMapping& reader) : affects_badguys(), affects_objects(), affects_player(), - fancy_wind() + fancy_wind(true), + particles_enabled(true) { float w,h; reader.get("x", m_col.m_bbox.get_left(), 0.0f); @@ -62,7 +63,8 @@ Wind::Wind(const ReaderMapping& reader) : reader.get("affects-objects", affects_objects, false); reader.get("affects-player", affects_player, true); - reader.get("fancy-wind", fancy_wind, false); + reader.get("fancy-wind", fancy_wind, true); + reader.get("particles-enabled", particles_enabled, true); set_group(COLGROUP_TOUCHABLE); } @@ -75,8 +77,6 @@ Wind::get_settings() ObjectSettings result = MovingObject::get_settings(); - //result.add_float("width", &new_size.x, "width", OPTION_HIDDEN); - //result.add_float("height", &new_size.y, "height", OPTION_HIDDEN); result.add_float(_("Speed X"), &speed.x, "speed-x"); result.add_float(_("Speed Y"), &speed.y, "speed-y"); result.add_float(_("Acceleration"), &acceleration, "acceleration"); @@ -84,9 +84,10 @@ Wind::get_settings() result.add_bool(_("Affects Badguys"), &affects_badguys, "affects-badguys", false); result.add_bool(_("Affects Objects"), &affects_objects, "affects-objects", false); result.add_bool(_("Affects Player"), &affects_player, "affects-player"); - result.add_bool(_("Fancy Particles"), &fancy_wind, "fancy-wind", false); + result.add_bool(_("Fancy Particles"), &fancy_wind, "fancy-wind", true); + result.add_bool(_("Particles Enabled"), &particles_enabled, "particles-enabled", true); - result.reorder({"blowing", "speed-x", "speed-y", "acceleration", "affects-badguys", "affects-objects", "affects-player", "fancy-wind", "region", "name", "x", "y"}); + result.reorder({ "blowing", "speed-x", "speed-y", "acceleration", "affects-badguys", "affects-objects", "affects-player", "fancy-wind", "particles-enabled", "region", "name", "x", "y" }); return result; } @@ -96,17 +97,17 @@ Wind::update(float dt_sec_) { dt_sec = dt_sec_; - if (!blowing) return; + if (!blowing || !particles_enabled) return; if (m_col.m_bbox.get_width() <= 16 || m_col.m_bbox.get_height() <= 16) return; - Vector ppos = Vector(graphicsRandom.randf(m_col.m_bbox.get_left()+8, m_col.m_bbox.get_right()-8), graphicsRandom.randf(m_col.m_bbox.get_top()+8, m_col.m_bbox.get_bottom()-8)); - Vector pspeed = Vector(graphicsRandom.randf(speed.x-20, speed.x+20), graphicsRandom.randf(speed.y-20, speed.y+20)); + Vector ppos = Vector(graphicsRandom.randf(m_col.m_bbox.get_left() + 8, m_col.m_bbox.get_right() - 8), graphicsRandom.randf(m_col.m_bbox.get_top() + 8, m_col.m_bbox.get_bottom() - 8)); + Vector pspeed = Vector(graphicsRandom.randf(speed.x - 20, speed.x + 20), graphicsRandom.randf(speed.y - 20, speed.y + 20)); // TODO: Rotate sprite rather than just use 2 different actions // Approx. 1 particle per tile if (graphicsRandom.randf(0.f, 100.f) < (m_col.m_bbox.get_width() / 32.f) * (m_col.m_bbox.get_height() / 32.f)) { - // emit a particle + // Emit a particle if (fancy_wind) { Sector::get().add("images/particles/wind.sprite", (std::abs(speed.x) > std::abs(speed.y)) ? "default" : "flip", ppos, ANCHOR_MIDDLE, pspeed, Vector(0, 0), LAYER_BACKGROUNDTILES + 1); @@ -148,7 +149,7 @@ Wind::collision(GameObject& other, const CollisionHit& ) } else { - //When on ground, get blown slightly differently, but the max speed is less than it would be otherwise seen as we take "friction" into account + // When on ground, get blown slightly differently, but the max speed is less than it would be otherwise seen as we take "friction" into account player->add_velocity((Vector(speed.x, 0) * 0.1f) * (acceleration+1), (Vector(speed.x, speed.y) * 0.5f)); } } diff --git a/src/object/wind.hpp b/src/object/wind.hpp index 2eb5562d710..787850a70cb 100644 --- a/src/object/wind.hpp +++ b/src/object/wind.hpp @@ -71,6 +71,7 @@ class Wind final : public MovingObject bool affects_objects; /**< whether the wind can affect objects */ bool affects_player; /**< whether the wind can affect the player: useful for cinematic wind */ bool fancy_wind; + bool particles_enabled; private: Wind(const Wind&) = delete; From 47541beb0c416c62fce8cea20d31d7637ccdb19a Mon Sep 17 00:00:00 2001 From: Vankata453 <78196474+Vankata453@users.noreply.github.com> Date: Mon, 8 Jul 2024 14:38:55 +0300 Subject: [PATCH 09/33] Scripting docs: Do not omit last character of explanation In Doxygen version 1.9.1, used by the `scripting-update` workflow, there is not always an additional space added at the end of an `xrefdescription`. Additionally, the `scripting-update` workflow is now triggered on modifications to the scripting documentation generator. --- .github/workflows/scripting.yml | 1 + tools/scripting_docs_gen/parser.cpp | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/scripting.yml b/.github/workflows/scripting.yml index 9a89199a9ca..64c796115c8 100644 --- a/.github/workflows/scripting.yml +++ b/.github/workflows/scripting.yml @@ -21,6 +21,7 @@ on: branches: [ "master" ] paths: - src/* + - tools/scripting_docs_gen/* workflow_dispatch: jobs: diff --git a/tools/scripting_docs_gen/parser.cpp b/tools/scripting_docs_gen/parser.cpp index 547fc2cedac..460dbf6183f 100644 --- a/tools/scripting_docs_gen/parser.cpp +++ b/tools/scripting_docs_gen/parser.cpp @@ -418,8 +418,6 @@ void parse_xrefsect_desc(tinyxml2::XMLElement* p_xrefsect, std::string& dest) XMLTextReader read(dest); p_xrefsectdescpara->Accept(&read); } - - if (!dest.empty()) dest.pop_back(); // Remove space, added at the end } } // namespace Parser From 15a29c6c566c7918266aeb02708c1730f6473a99 Mon Sep 17 00:00:00 2001 From: Daniel W <39805490+weluvgoatz@users.noreply.github.com> Date: Mon, 8 Jul 2024 10:03:10 -0700 Subject: [PATCH 10/33] Revert "Index by base classes in GameObjectManager::m_objects_by_type_index (#2991)" This reverts commit df670e40169d118ba35735aacfea4313056dcf32. --- src/badguy/angrystone.hpp | 1 - src/badguy/badguy.hpp | 1 - src/badguy/bomb.hpp | 1 - src/badguy/bouncing_snowball.hpp | 1 - src/badguy/captainsnowball.hpp | 1 - src/badguy/corrupted_granito.hpp | 1 - src/badguy/corrupted_granito_big.hpp | 1 - src/badguy/crusher.hpp | 2 - src/badguy/crystallo.hpp | 1 - src/badguy/dart.hpp | 1 - src/badguy/darttrap.hpp | 1 - src/badguy/dispenser.hpp | 1 - src/badguy/dive_mine.hpp | 1 - src/badguy/fish_chasing.hpp | 1 - src/badguy/fish_harmless.hpp | 1 - src/badguy/fish_jumping.hpp | 1 - src/badguy/fish_swimming.hpp | 1 - src/badguy/flame.hpp | 1 - src/badguy/flyingsnowball.hpp | 1 - src/badguy/ghosttree.hpp | 1 - src/badguy/ghoul.hpp | 1 - src/badguy/goldbomb.hpp | 1 - src/badguy/granito.hpp | 1 - src/badguy/granito_big.hpp | 1 - src/badguy/granito_giant.hpp | 1 - src/badguy/haywire.hpp | 1 - src/badguy/igel.hpp | 1 - src/badguy/jumpy.hpp | 1 - src/badguy/kamikazesnowball.hpp | 2 - src/badguy/kugelblitz.hpp | 1 - src/badguy/livefire.hpp | 3 -- src/badguy/mole.hpp | 1 - src/badguy/mole_rock.hpp | 1 - src/badguy/mrbomb.hpp | 1 - src/badguy/mriceblock.hpp | 1 - src/badguy/mrtree.hpp | 1 - src/badguy/owl.hpp | 1 - src/badguy/plant.hpp | 1 - src/badguy/rcrystallo.hpp | 1 - src/badguy/root.hpp | 1 - src/badguy/root_sapling.hpp | 1 - src/badguy/scrystallo.hpp | 1 - src/badguy/short_fuse.hpp | 1 - src/badguy/skydive.hpp | 1 - src/badguy/smartball.hpp | 1 - src/badguy/smartblock.hpp | 1 - src/badguy/snail.hpp | 1 - src/badguy/snowball.hpp | 1 - src/badguy/snowman.hpp | 1 - src/badguy/spiky.hpp | 1 - src/badguy/sspiky.hpp | 1 - src/badguy/stalactite.hpp | 1 - src/badguy/stumpy.hpp | 1 - src/badguy/tarantula.hpp | 1 - src/badguy/toad.hpp | 1 - src/badguy/totem.hpp | 1 - src/badguy/treewillowisp.hpp | 1 - src/badguy/viciousivy.hpp | 1 - src/badguy/walking_badguy.hpp | 1 - src/badguy/walking_candle.hpp | 1 - src/badguy/walkingleaf.hpp | 1 - src/badguy/willowisp.hpp | 1 - src/badguy/yeti.hpp | 1 - src/badguy/yeti_stalactite.hpp | 1 - src/badguy/zeekling.hpp | 1 - src/editor/bezier_marker.hpp | 1 - src/editor/marker_object.hpp | 1 - src/editor/node_marker.hpp | 1 - src/editor/resize_marker.hpp | 1 - src/object/ambient_light.hpp | 1 - src/object/ambient_sound.hpp | 1 - src/object/background.hpp | 1 - src/object/bicycle_platform.hpp | 2 - src/object/block.hpp | 2 - src/object/bonus_block.hpp | 1 - src/object/bouncy_coin.hpp | 1 - src/object/brick.hpp | 2 - src/object/bullet.hpp | 2 - src/object/bumper.hpp | 1 - src/object/camera.hpp | 1 - src/object/candle.hpp | 1 - src/object/circleplatform.hpp | 1 - src/object/cloud_particle_system.hpp | 1 - src/object/coin.hpp | 2 - src/object/coin_explode.hpp | 1 - src/object/coin_rain.hpp | 1 - src/object/conveyor_belt.hpp | 1 - src/object/custom_particle_system.hpp | 1 - src/object/custom_particle_system_file.hpp | 1 - src/object/decal.hpp | 1 - src/object/display_effect.hpp | 1 - src/object/electrifier.hpp | 1 - src/object/endsequence.hpp | 1 - src/object/endsequence_fireworks.hpp | 1 - src/object/endsequence_walk.hpp | 1 - src/object/explosion.hpp | 1 - src/object/fallblock.hpp | 1 - src/object/falling_coin.hpp | 1 - src/object/firefly.hpp | 1 - src/object/fireworks.hpp | 1 - src/object/floating_image.hpp | 1 - src/object/floating_text.hpp | 2 - src/object/flower.hpp | 1 - src/object/ghost_particle_system.hpp | 1 - src/object/gradient.hpp | 1 - src/object/growup.hpp | 1 - src/object/hurting_platform.hpp | 1 - src/object/infoblock.hpp | 1 - src/object/invisible_block.hpp | 1 - src/object/invisible_wall.hpp | 1 - src/object/ispy.hpp | 1 - src/object/key.hpp | 1 - src/object/lantern.hpp | 1 - src/object/level_time.hpp | 1 - src/object/light.hpp | 2 - src/object/lit_object.hpp | 1 - src/object/magicblock.hpp | 1 - src/object/moving_sprite.hpp | 1 - src/object/music_object.hpp | 1 - src/object/oneup.hpp | 1 - src/object/particle_zone.hpp | 1 - src/object/particles.hpp | 1 - src/object/particlesystem.hpp | 1 - src/object/particlesystem_interactive.hpp | 1 - src/object/path_gameobject.hpp | 1 - src/object/platform.hpp | 1 - src/object/player.hpp | 1 - src/object/pneumatic_platform.hpp | 2 - src/object/powerup.hpp | 1 - src/object/pulsing_light.hpp | 1 - src/object/pushbutton.hpp | 1 - src/object/rain_particle_system.hpp | 1 - src/object/rainsplash.hpp | 1 - src/object/rock.hpp | 1 - src/object/rublight.hpp | 1 - src/object/rusty_trampoline.hpp | 1 - src/object/scripted_object.hpp | 1 - src/object/shard.hpp | 1 - src/object/smoke_cloud.hpp | 1 - src/object/snow_particle_system.hpp | 1 - src/object/sound_object.hpp | 1 - src/object/spawnpoint.hpp | 1 - src/object/specialriser.hpp | 1 - src/object/spotlight.hpp | 1 - src/object/sprite_particle.hpp | 1 - src/object/star.hpp | 1 - src/object/sticky_object.hpp | 2 - src/object/text_array_object.hpp | 1 - src/object/text_object.hpp | 1 - src/object/textscroller.hpp | 1 - src/object/thunderstorm.hpp | 1 - src/object/tilemap.hpp | 1 - src/object/torch.hpp | 1 - src/object/trampoline.hpp | 1 - src/object/unstable_tile.hpp | 1 - src/object/vertical_stripes.hpp | 2 - src/object/water_drop.hpp | 2 - src/object/weak_block.hpp | 1 - src/object/wind.hpp | 1 - src/supertux/game_object.cpp | 8 ---- src/supertux/game_object.hpp | 21 ----------- src/supertux/game_object_iterator.hpp | 44 ++++++++++++++-------- src/supertux/game_object_manager.cpp | 14 +++---- src/supertux/game_object_manager.hpp | 4 +- src/supertux/moving_object.hpp | 1 - src/supertux/player_status_hud.hpp | 1 - src/trigger/climbable.hpp | 1 - src/trigger/door.hpp | 1 - src/trigger/scripttrigger.hpp | 1 - src/trigger/secretarea_trigger.hpp | 1 - src/trigger/sequence_trigger.hpp | 1 - src/trigger/switch.hpp | 1 - src/trigger/text_area.hpp | 1 - src/trigger/trigger_base.hpp | 3 -- src/worldmap/level_tile.hpp | 1 - src/worldmap/spawn_point.hpp | 1 - src/worldmap/special_tile.hpp | 1 - src/worldmap/sprite_change.hpp | 1 - src/worldmap/teleporter.hpp | 1 - src/worldmap/tux.hpp | 1 - src/worldmap/worldmap_object.hpp | 1 - 181 files changed, 35 insertions(+), 249 deletions(-) diff --git a/src/badguy/angrystone.hpp b/src/badguy/angrystone.hpp index fec61367164..f5470e0aab1 100644 --- a/src/badguy/angrystone.hpp +++ b/src/badguy/angrystone.hpp @@ -38,7 +38,6 @@ class AngryStone final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Angry Stone"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(AngryStone)); } protected: virtual std::vector get_allowed_directions() const override; diff --git a/src/badguy/badguy.hpp b/src/badguy/badguy.hpp index 56382e33bb5..861998b81ae 100644 --- a/src/badguy/badguy.hpp +++ b/src/badguy/badguy.hpp @@ -68,7 +68,6 @@ class BadGuy : public MovingSprite, virtual std::string get_exposed_class_name() const override { return "BadGuy"; } static std::string display_name() { return _("Badguy"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Portable)).add(typeid(BadGuy)); } virtual std::string get_overlay_size() const { return "1x1"; } diff --git a/src/badguy/bomb.hpp b/src/badguy/bomb.hpp index 642914d57f7..5b4b9e24e91 100644 --- a/src/badguy/bomb.hpp +++ b/src/badguy/bomb.hpp @@ -25,7 +25,6 @@ class Bomb final : public BadGuy { public: Bomb(const Vector& pos, Direction dir, const std::string& custom_sprite = "images/creatures/mr_bomb/bomb.sprite" ); - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Bomb)); } virtual bool is_saveable() const override { return false; } diff --git a/src/badguy/bouncing_snowball.hpp b/src/badguy/bouncing_snowball.hpp index 45fd2f81700..3b65c5319a2 100644 --- a/src/badguy/bouncing_snowball.hpp +++ b/src/badguy/bouncing_snowball.hpp @@ -38,7 +38,6 @@ class BouncingSnowball final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Bouncing Snowball"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(BouncingSnowball)); } virtual GameObjectTypes get_types() const override; virtual std::string get_default_sprite_name() const override; diff --git a/src/badguy/captainsnowball.hpp b/src/badguy/captainsnowball.hpp index 70cde6961e5..9a295ef56aa 100644 --- a/src/badguy/captainsnowball.hpp +++ b/src/badguy/captainsnowball.hpp @@ -31,7 +31,6 @@ class CaptainSnowball final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Captain Snowball"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(CaptainSnowball)); } virtual bool is_snipable() const override { return true; } bool might_climb(int width, int height) const; diff --git a/src/badguy/corrupted_granito.hpp b/src/badguy/corrupted_granito.hpp index 977caa7848a..fcd266f901b 100644 --- a/src/badguy/corrupted_granito.hpp +++ b/src/badguy/corrupted_granito.hpp @@ -43,7 +43,6 @@ class CorruptedGranito final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Corrupted Granito"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(CorruptedGranito)); } virtual bool is_snipable() const override { return true; } virtual bool is_flammable() const override { return m_type != GRANITO; } diff --git a/src/badguy/corrupted_granito_big.hpp b/src/badguy/corrupted_granito_big.hpp index c1723a54fd4..e007e35d8a4 100644 --- a/src/badguy/corrupted_granito_big.hpp +++ b/src/badguy/corrupted_granito_big.hpp @@ -34,7 +34,6 @@ class CorruptedGranitoBig final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Corrupted Big Granito"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(CorruptedGranitoBig)); } virtual bool is_snipable() const override { return false; } virtual bool is_freezable() const override { return false; } diff --git a/src/badguy/crusher.hpp b/src/badguy/crusher.hpp index a0dd52a3c91..ad186509d29 100644 --- a/src/badguy/crusher.hpp +++ b/src/badguy/crusher.hpp @@ -70,7 +70,6 @@ class Crusher final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Crusher"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Crusher)); } virtual ObjectSettings get_settings() override; GameObjectTypes get_types() const override; @@ -116,7 +115,6 @@ class CrusherRoot : public MovingSprite { public: CrusherRoot(Vector position, Crusher::Direction direction, float delay, int layer); - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(CrusherRoot)); } virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; virtual void update(float dt_sec) override; diff --git a/src/badguy/crystallo.hpp b/src/badguy/crystallo.hpp index 00913e7362e..7389f646060 100644 --- a/src/badguy/crystallo.hpp +++ b/src/badguy/crystallo.hpp @@ -32,7 +32,6 @@ class Crystallo final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Crystallo"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Crystallo)); } virtual void active_update(float dt_sec) override; virtual bool is_flammable() const override; diff --git a/src/badguy/dart.hpp b/src/badguy/dart.hpp index e5cfc99bb58..ae3ba35d909 100644 --- a/src/badguy/dart.hpp +++ b/src/badguy/dart.hpp @@ -43,7 +43,6 @@ class Dart final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Dart"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Dart)); } virtual bool is_flammable() const override; diff --git a/src/badguy/darttrap.hpp b/src/badguy/darttrap.hpp index 69ffb1aaca9..42bab088aa4 100644 --- a/src/badguy/darttrap.hpp +++ b/src/badguy/darttrap.hpp @@ -34,7 +34,6 @@ class DartTrap final : public StickyBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Dart Trap"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return StickyBadguy::get_class_types().add(typeid(DartTrap)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; diff --git a/src/badguy/dispenser.hpp b/src/badguy/dispenser.hpp index a68e45d68f8..48ea925313e 100644 --- a/src/badguy/dispenser.hpp +++ b/src/badguy/dispenser.hpp @@ -66,7 +66,6 @@ class Dispenser final : public BadGuy virtual std::string get_exposed_class_name() const override { return "Dispenser"; } static std::string display_name() { return _("Dispenser"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Dispenser)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; diff --git a/src/badguy/dive_mine.hpp b/src/badguy/dive_mine.hpp index bb4c122d583..7e71dec6cb1 100644 --- a/src/badguy/dive_mine.hpp +++ b/src/badguy/dive_mine.hpp @@ -49,7 +49,6 @@ class DiveMine final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Dive Mine"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(DiveMine)); } protected: virtual std::vector get_allowed_directions() const override; diff --git a/src/badguy/fish_chasing.hpp b/src/badguy/fish_chasing.hpp index 0dcfbe7d310..a7ce8661e9c 100644 --- a/src/badguy/fish_chasing.hpp +++ b/src/badguy/fish_chasing.hpp @@ -33,7 +33,6 @@ class FishChasing final : public FishSwimming static std::string display_name() { return _("Chasing Fish"); } virtual std::string get_display_name() const override { return display_name(); } virtual std::string get_overlay_size() const override { return "2x2"; } - virtual GameObjectClasses get_class_types() const override { return FishSwimming::get_class_types().add(typeid(FishChasing)); } virtual ObjectSettings get_settings() override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/fish_harmless.hpp b/src/badguy/fish_harmless.hpp index fd1f777cede..58895c3954e 100644 --- a/src/badguy/fish_harmless.hpp +++ b/src/badguy/fish_harmless.hpp @@ -29,7 +29,6 @@ class FishHarmless final : public FishSwimming virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Harmless Fish"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return FishSwimming::get_class_types().add(typeid(FishHarmless)); } virtual std::string get_overlay_size() const override { return "1x1"; } GameObjectTypes get_types() const override { return {}; } diff --git a/src/badguy/fish_jumping.hpp b/src/badguy/fish_jumping.hpp index 99cf62ea851..ed97fe28182 100644 --- a/src/badguy/fish_jumping.hpp +++ b/src/badguy/fish_jumping.hpp @@ -40,7 +40,6 @@ class FishJumping final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Jumping Fish"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(FishJumping)); } protected: virtual std::vector get_allowed_directions() const override; diff --git a/src/badguy/fish_swimming.hpp b/src/badguy/fish_swimming.hpp index cecce233060..5b9efe76c41 100644 --- a/src/badguy/fish_swimming.hpp +++ b/src/badguy/fish_swimming.hpp @@ -40,7 +40,6 @@ class FishSwimming : public BadGuy static std::string display_name() { return _("Swimming Fish"); } virtual std::string get_display_name() const override { return display_name(); } virtual std::string get_overlay_size() const override { return "2x1"; } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(FishSwimming)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; diff --git a/src/badguy/flame.hpp b/src/badguy/flame.hpp index 0b4f10aab0e..f1dcce809c0 100644 --- a/src/badguy/flame.hpp +++ b/src/badguy/flame.hpp @@ -46,7 +46,6 @@ class Flame final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Flame"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Flame)); } virtual void stop_looping_sounds() override; virtual void play_looping_sounds() override; diff --git a/src/badguy/flyingsnowball.hpp b/src/badguy/flyingsnowball.hpp index 206b9084f73..6665ce29ab6 100644 --- a/src/badguy/flyingsnowball.hpp +++ b/src/badguy/flyingsnowball.hpp @@ -32,7 +32,6 @@ class FlyingSnowBall final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Flying Snowball"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(FlyingSnowBall)); } virtual bool is_snipable() const override { return true; } protected: diff --git a/src/badguy/ghosttree.hpp b/src/badguy/ghosttree.hpp index b30e371cbab..caad21d9ca9 100644 --- a/src/badguy/ghosttree.hpp +++ b/src/badguy/ghosttree.hpp @@ -42,7 +42,6 @@ class GhostTree final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Ghost Tree"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(GhostTree)); } virtual void on_flip(float height) override; diff --git a/src/badguy/ghoul.hpp b/src/badguy/ghoul.hpp index a580538bc9b..4227a902d57 100644 --- a/src/badguy/ghoul.hpp +++ b/src/badguy/ghoul.hpp @@ -30,7 +30,6 @@ class Ghoul final : public BadGuy, static std::string display_name() { return _("Ghoul"); } std::string get_class_name() const override { return class_name(); } std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Ghoul)); } bool is_freezable() const override; bool is_flammable() const override; virtual bool is_snipable() const override { return true; } diff --git a/src/badguy/goldbomb.hpp b/src/badguy/goldbomb.hpp index f33ef1bfa29..c9e56f0d2a2 100644 --- a/src/badguy/goldbomb.hpp +++ b/src/badguy/goldbomb.hpp @@ -49,7 +49,6 @@ class GoldBomb final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Gold Bomb"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(GoldBomb)); } virtual bool is_snipable() const override { return true; } virtual void stop_looping_sounds() override; diff --git a/src/badguy/granito.hpp b/src/badguy/granito.hpp index a009a959ad8..ae4b360249b 100644 --- a/src/badguy/granito.hpp +++ b/src/badguy/granito.hpp @@ -51,7 +51,6 @@ class Granito : public WalkingBadguy virtual std::string get_exposed_class_name() const override { return "Granito"; } static std::string display_name() { return _("Granito"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Granito)); } virtual bool is_snipable() const override { return false; } virtual bool is_freezable() const override { return false; } diff --git a/src/badguy/granito_big.hpp b/src/badguy/granito_big.hpp index 7d6f6467e16..44e8749b86a 100644 --- a/src/badguy/granito_big.hpp +++ b/src/badguy/granito_big.hpp @@ -43,7 +43,6 @@ class GranitoBig final : public Granito virtual std::string get_exposed_class_name() const override { return "GranitoBig"; } static std::string display_name() { return _("Big Granito"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return Granito::get_class_types().add(typeid(GranitoBig)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; diff --git a/src/badguy/granito_giant.hpp b/src/badguy/granito_giant.hpp index aebe7c34658..a3df651eab2 100644 --- a/src/badguy/granito_giant.hpp +++ b/src/badguy/granito_giant.hpp @@ -31,7 +31,6 @@ class GranitoGiant final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Giant Granito"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(GranitoGiant)); } virtual void kill_fall() override; diff --git a/src/badguy/haywire.hpp b/src/badguy/haywire.hpp index e0280b8db7a..bca973206a4 100644 --- a/src/badguy/haywire.hpp +++ b/src/badguy/haywire.hpp @@ -45,7 +45,6 @@ class Haywire final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Haywire"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Haywire)); } virtual bool is_snipable() const override { return true; } inline bool is_exploding() const { return m_is_exploding; } diff --git a/src/badguy/igel.hpp b/src/badguy/igel.hpp index 70039c4f4d8..0aef788a590 100644 --- a/src/badguy/igel.hpp +++ b/src/badguy/igel.hpp @@ -38,7 +38,6 @@ class Igel final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Igel"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Igel)); } virtual bool is_freezable() const override { return true; } virtual void unfreeze(bool melt = true) override; diff --git a/src/badguy/jumpy.hpp b/src/badguy/jumpy.hpp index f8378833679..07bf84a9771 100644 --- a/src/badguy/jumpy.hpp +++ b/src/badguy/jumpy.hpp @@ -39,7 +39,6 @@ class Jumpy final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Jumpy"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Jumpy)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/kamikazesnowball.hpp b/src/badguy/kamikazesnowball.hpp index 1c279813740..fdcb5da4149 100644 --- a/src/badguy/kamikazesnowball.hpp +++ b/src/badguy/kamikazesnowball.hpp @@ -33,7 +33,6 @@ class KamikazeSnowball : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Kamikaze Snowball"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(KamikazeSnowball)); } virtual bool is_snipable() const override { return true; } protected: @@ -64,7 +63,6 @@ class LeafShot final : public KamikazeSnowball virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Leafshot"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return KamikazeSnowball::get_class_types().add(typeid(LeafShot)); } virtual bool is_snipable() const override { return true; } diff --git a/src/badguy/kugelblitz.hpp b/src/badguy/kugelblitz.hpp index 6dea704955d..a3fee55dc97 100644 --- a/src/badguy/kugelblitz.hpp +++ b/src/badguy/kugelblitz.hpp @@ -39,7 +39,6 @@ class Kugelblitz final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Kugelblitz"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Kugelblitz)); } void explode(); diff --git a/src/badguy/livefire.hpp b/src/badguy/livefire.hpp index 29331628c1f..3eae46303c5 100644 --- a/src/badguy/livefire.hpp +++ b/src/badguy/livefire.hpp @@ -37,7 +37,6 @@ class LiveFire : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Walking Flame"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(LiveFire)); } private: std::string death_sound; @@ -71,7 +70,6 @@ class LiveFireAsleep final : public LiveFire virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Sleeping Flame"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return LiveFire::get_class_types().add(typeid(LiveFireAsleep)); } private: LiveFireAsleep(const LiveFireAsleep&) = delete; @@ -90,7 +88,6 @@ class LiveFireDormant final : public LiveFire virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Dormant Flame"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return LiveFire::get_class_types().add(typeid(LiveFireDormant)); } private: LiveFireDormant(const LiveFireDormant&) = delete; diff --git a/src/badguy/mole.hpp b/src/badguy/mole.hpp index 07d808cf692..30a8de7c5d8 100644 --- a/src/badguy/mole.hpp +++ b/src/badguy/mole.hpp @@ -37,7 +37,6 @@ class Mole final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mole"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Mole)); } virtual bool is_snipable() const override { return true; } diff --git a/src/badguy/mole_rock.hpp b/src/badguy/mole_rock.hpp index e9c378aa700..b472e05bd4e 100644 --- a/src/badguy/mole_rock.hpp +++ b/src/badguy/mole_rock.hpp @@ -43,7 +43,6 @@ class MoleRock final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mole's rock"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(MoleRock)); } protected: const BadGuy* parent; /**< collisions with this BadGuy will be ignored */ diff --git a/src/badguy/mrbomb.hpp b/src/badguy/mrbomb.hpp index 914251e92f9..b4f6c221cdd 100644 --- a/src/badguy/mrbomb.hpp +++ b/src/badguy/mrbomb.hpp @@ -39,7 +39,6 @@ class MrBomb final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mr. Bomb"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(MrBomb)); } virtual bool is_snipable() const override { return true; } GameObjectTypes get_types() const override; diff --git a/src/badguy/mriceblock.hpp b/src/badguy/mriceblock.hpp index 7b84e4ba1b5..b8f5ce8ee43 100644 --- a/src/badguy/mriceblock.hpp +++ b/src/badguy/mriceblock.hpp @@ -48,7 +48,6 @@ class MrIceBlock : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mr. Iceblock"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(MrIceBlock)); } virtual bool is_snipable() const override { return ice_state != ICESTATE_KICKED; } virtual bool is_freezable() const override; diff --git a/src/badguy/mrtree.hpp b/src/badguy/mrtree.hpp index 21856013658..24250aa09fc 100644 --- a/src/badguy/mrtree.hpp +++ b/src/badguy/mrtree.hpp @@ -31,7 +31,6 @@ class MrTree final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mr. Tree"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(MrTree)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/owl.hpp b/src/badguy/owl.hpp index 4ec6e31584e..3571d6248fd 100644 --- a/src/badguy/owl.hpp +++ b/src/badguy/owl.hpp @@ -44,7 +44,6 @@ class Owl final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Owl"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Owl)); } virtual ObjectSettings get_settings() override; virtual bool is_snipable() const override { return true; } diff --git a/src/badguy/plant.hpp b/src/badguy/plant.hpp index 2478a12b30b..8f8136d474d 100644 --- a/src/badguy/plant.hpp +++ b/src/badguy/plant.hpp @@ -33,7 +33,6 @@ class Plant final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Plant"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Plant)); } protected: enum PlantState { diff --git a/src/badguy/rcrystallo.hpp b/src/badguy/rcrystallo.hpp index b47ea645463..0c6f2faedc8 100644 --- a/src/badguy/rcrystallo.hpp +++ b/src/badguy/rcrystallo.hpp @@ -32,7 +32,6 @@ class RCrystallo final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Roof Crystallo"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(RCrystallo)); } virtual void active_update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/badguy/root.hpp b/src/badguy/root.hpp index ec727246773..c2a8903480a 100644 --- a/src/badguy/root.hpp +++ b/src/badguy/root.hpp @@ -38,7 +38,6 @@ class Root final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Root"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Root)); } virtual bool is_flammable() const override { return false; } virtual bool is_freezable() const override { return false; } diff --git a/src/badguy/root_sapling.hpp b/src/badguy/root_sapling.hpp index 2de801170f8..6d30bea8c66 100644 --- a/src/badguy/root_sapling.hpp +++ b/src/badguy/root_sapling.hpp @@ -40,7 +40,6 @@ class RootSapling final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Root Sapling"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(RootSapling)); } virtual void on_flip(float height) override; diff --git a/src/badguy/scrystallo.hpp b/src/badguy/scrystallo.hpp index 2ac8a59cc95..5761bc35667 100644 --- a/src/badguy/scrystallo.hpp +++ b/src/badguy/scrystallo.hpp @@ -30,7 +30,6 @@ class SCrystallo final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Sleeping Crystallo"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(SCrystallo)); } virtual void collision_solid(const CollisionHit& hit) override; virtual HitResponse collision_badguy(BadGuy& badguy, const CollisionHit& hit) override; diff --git a/src/badguy/short_fuse.hpp b/src/badguy/short_fuse.hpp index bac740e5b1c..74c80754eac 100644 --- a/src/badguy/short_fuse.hpp +++ b/src/badguy/short_fuse.hpp @@ -29,7 +29,6 @@ class ShortFuse final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Short Fuse"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(ShortFuse)); } protected: virtual HitResponse collision_player (Player& player, const CollisionHit& hit) override; diff --git a/src/badguy/skydive.hpp b/src/badguy/skydive.hpp index 88b1c1f441a..dfb2b37efb9 100644 --- a/src/badguy/skydive.hpp +++ b/src/badguy/skydive.hpp @@ -42,7 +42,6 @@ class SkyDive final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Skydive"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(SkyDive)); } virtual bool is_snipable() const override { return true; } protected: diff --git a/src/badguy/smartball.hpp b/src/badguy/smartball.hpp index a4b5ed8ecef..044b8564eb6 100644 --- a/src/badguy/smartball.hpp +++ b/src/badguy/smartball.hpp @@ -31,7 +31,6 @@ class SmartBall final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mrs. Snowball"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(SmartBall)); } virtual bool is_snipable() const override { return true; } virtual bool is_freezable() const override; diff --git a/src/badguy/smartblock.hpp b/src/badguy/smartblock.hpp index 6564227c8aa..0b060b27e5b 100644 --- a/src/badguy/smartblock.hpp +++ b/src/badguy/smartblock.hpp @@ -29,7 +29,6 @@ class SmartBlock final : public MrIceBlock virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mrs. Iceblock"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MrIceBlock::get_class_types().add(typeid(SmartBlock)); } GameObjectTypes get_types() const override { return {}; } diff --git a/src/badguy/snail.hpp b/src/badguy/snail.hpp index e77b41b2d31..a08a6040103 100644 --- a/src/badguy/snail.hpp +++ b/src/badguy/snail.hpp @@ -42,7 +42,6 @@ class Snail final : virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Snail"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Snail)); } virtual GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/snowball.hpp b/src/badguy/snowball.hpp index ed0fe2433c3..65e1a06dc29 100644 --- a/src/badguy/snowball.hpp +++ b/src/badguy/snowball.hpp @@ -29,7 +29,6 @@ class SnowBall final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mr. Snowball"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(SnowBall)); } virtual bool is_snipable() const override { return true; } virtual bool is_freezable() const override; diff --git a/src/badguy/snowman.hpp b/src/badguy/snowman.hpp index f241643f23c..82b8b2060e9 100644 --- a/src/badguy/snowman.hpp +++ b/src/badguy/snowman.hpp @@ -28,7 +28,6 @@ class Snowman final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Snowman"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Snowman)); } protected: void loose_head(); diff --git a/src/badguy/spiky.hpp b/src/badguy/spiky.hpp index c3f95eb9e27..8a48a26209e 100644 --- a/src/badguy/spiky.hpp +++ b/src/badguy/spiky.hpp @@ -30,7 +30,6 @@ class Spiky final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Spiky"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Spiky)); } private: Spiky(const Spiky&) = delete; diff --git a/src/badguy/sspiky.hpp b/src/badguy/sspiky.hpp index c09f713941c..551e1b12fd8 100644 --- a/src/badguy/sspiky.hpp +++ b/src/badguy/sspiky.hpp @@ -36,7 +36,6 @@ class SSpiky final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Sleeping Spiky"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(SSpiky)); } virtual void after_editor_set() override; protected: diff --git a/src/badguy/stalactite.hpp b/src/badguy/stalactite.hpp index 39ad7ebb60c..10f928325ed 100644 --- a/src/badguy/stalactite.hpp +++ b/src/badguy/stalactite.hpp @@ -41,7 +41,6 @@ class Stalactite : public StickyBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Stalactite"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return StickyBadguy::get_class_types().add(typeid(Stalactite)); } virtual ObjectSettings get_settings() override; diff --git a/src/badguy/stumpy.hpp b/src/badguy/stumpy.hpp index a46c7ff4eb2..bfee886a51b 100644 --- a/src/badguy/stumpy.hpp +++ b/src/badguy/stumpy.hpp @@ -37,7 +37,6 @@ class Stumpy final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Stumpy"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Stumpy)); } protected: enum MyState { diff --git a/src/badguy/tarantula.hpp b/src/badguy/tarantula.hpp index 52b25d40af7..5c454ab5862 100644 --- a/src/badguy/tarantula.hpp +++ b/src/badguy/tarantula.hpp @@ -38,7 +38,6 @@ class Tarantula final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Tarantula"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Tarantula)); } virtual bool is_snipable() const override; virtual GameObjectTypes get_types() const override; diff --git a/src/badguy/toad.hpp b/src/badguy/toad.hpp index 330b2c6d1b1..e2ff16d447d 100644 --- a/src/badguy/toad.hpp +++ b/src/badguy/toad.hpp @@ -37,7 +37,6 @@ class Toad final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Toad"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Toad)); } virtual bool is_snipable() const override { return true; } protected: diff --git a/src/badguy/totem.hpp b/src/badguy/totem.hpp index d7188fba479..a4fb02769cc 100644 --- a/src/badguy/totem.hpp +++ b/src/badguy/totem.hpp @@ -36,7 +36,6 @@ class Totem final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Totem"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Totem)); } virtual bool is_snipable() const override { return true; } protected: diff --git a/src/badguy/treewillowisp.hpp b/src/badguy/treewillowisp.hpp index a03c9a8dc93..c69ab63c705 100644 --- a/src/badguy/treewillowisp.hpp +++ b/src/badguy/treewillowisp.hpp @@ -27,7 +27,6 @@ class TreeWillOWisp final : public BadGuy public: TreeWillOWisp(GhostTree* tree, const Vector& pos, float radius, float speed); ~TreeWillOWisp() override; - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(TreeWillOWisp)); } virtual void activate() override; virtual void active_update(float dt_sec) override; diff --git a/src/badguy/viciousivy.hpp b/src/badguy/viciousivy.hpp index b9fa837d434..99d566eb770 100644 --- a/src/badguy/viciousivy.hpp +++ b/src/badguy/viciousivy.hpp @@ -32,7 +32,6 @@ class ViciousIvy final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Vicious Ivy"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(ViciousIvy)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/walking_badguy.hpp b/src/badguy/walking_badguy.hpp index 4e43ed62235..b65537f2e0a 100644 --- a/src/badguy/walking_badguy.hpp +++ b/src/badguy/walking_badguy.hpp @@ -52,7 +52,6 @@ class WalkingBadguy : public BadGuy const std::string& walk_right_action, int layer = LAYER_OBJECTS, const std::string& light_sprite_name = "images/objects/lightmap_light/lightmap_light-medium.sprite"); - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(WalkingBadguy)); } virtual void initialize() override; virtual void active_update(float dt_sec) override; diff --git a/src/badguy/walking_candle.hpp b/src/badguy/walking_candle.hpp index 3dd92d626ed..d621c46b833 100644 --- a/src/badguy/walking_candle.hpp +++ b/src/badguy/walking_candle.hpp @@ -40,7 +40,6 @@ class WalkingCandle final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Walking Candle"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(WalkingCandle)); } private: Color lightcolor; diff --git a/src/badguy/walkingleaf.hpp b/src/badguy/walkingleaf.hpp index 7b4cdb15958..d2204841f00 100644 --- a/src/badguy/walkingleaf.hpp +++ b/src/badguy/walkingleaf.hpp @@ -32,7 +32,6 @@ class WalkingLeaf final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Walking Leaf"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(WalkingLeaf)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/willowisp.hpp b/src/badguy/willowisp.hpp index 9fb5247135b..cac9ae4e368 100644 --- a/src/badguy/willowisp.hpp +++ b/src/badguy/willowisp.hpp @@ -68,7 +68,6 @@ class WillOWisp final : public BadGuy, virtual std::string get_exposed_class_name() const override { return "WillOWisp"; } static std::string display_name() { return _("Will o' Wisp"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(WillOWisp)); } virtual ObjectSettings get_settings() override; virtual void move_to(const Vector& pos) override; diff --git a/src/badguy/yeti.hpp b/src/badguy/yeti.hpp index 9015aba7bb2..68aea592bb5 100644 --- a/src/badguy/yeti.hpp +++ b/src/badguy/yeti.hpp @@ -37,7 +37,6 @@ class Yeti final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Yeti"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Yeti)); } virtual ObjectSettings get_settings() override; diff --git a/src/badguy/yeti_stalactite.hpp b/src/badguy/yeti_stalactite.hpp index 01904f07b39..70a4bd01460 100644 --- a/src/badguy/yeti_stalactite.hpp +++ b/src/badguy/yeti_stalactite.hpp @@ -33,7 +33,6 @@ class YetiStalactite final : public Stalactite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Yeti's Stalactite"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return Stalactite::get_class_types().add(typeid(YetiStalactite)); } void start_shaking(); bool is_hanging() const; diff --git a/src/badguy/zeekling.hpp b/src/badguy/zeekling.hpp index 28efb11f88d..73577595821 100644 --- a/src/badguy/zeekling.hpp +++ b/src/badguy/zeekling.hpp @@ -38,7 +38,6 @@ class Zeekling final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Zeekling"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Zeekling)); } virtual bool is_snipable() const override { return true; } private: diff --git a/src/editor/bezier_marker.hpp b/src/editor/bezier_marker.hpp index daf2e038a57..383416bba6e 100644 --- a/src/editor/bezier_marker.hpp +++ b/src/editor/bezier_marker.hpp @@ -26,7 +26,6 @@ class BezierMarker final : public MarkerObject { public: BezierMarker(Path::Node* node, Vector* bezier_pos); - virtual GameObjectClasses get_class_types() const override { return MarkerObject::get_class_types().add(typeid(BezierMarker)); } virtual void move_to(const Vector& pos) override; virtual Vector get_point_vector() const override; diff --git a/src/editor/marker_object.hpp b/src/editor/marker_object.hpp index 8341d182b79..03cb561d128 100644 --- a/src/editor/marker_object.hpp +++ b/src/editor/marker_object.hpp @@ -28,7 +28,6 @@ class MarkerObject : public MovingObject public: MarkerObject(const Vector& pos); MarkerObject(); - virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(MarkerObject)); } virtual void update(float dt_sec) override {} virtual void draw(DrawingContext& context) override; diff --git a/src/editor/node_marker.hpp b/src/editor/node_marker.hpp index 1014a960d35..1a0f1e964bf 100644 --- a/src/editor/node_marker.hpp +++ b/src/editor/node_marker.hpp @@ -25,7 +25,6 @@ class NodeMarker final : public MarkerObject { public: NodeMarker(std::vector::iterator node_iterator, size_t id_, UID before, UID after); - virtual GameObjectClasses get_class_types() const override { return MarkerObject::get_class_types().add(typeid(NodeMarker)); } virtual void move_to(const Vector& pos) override; virtual void editor_delete() override; diff --git a/src/editor/resize_marker.hpp b/src/editor/resize_marker.hpp index ba0f16d623b..5a832ae6269 100644 --- a/src/editor/resize_marker.hpp +++ b/src/editor/resize_marker.hpp @@ -32,7 +32,6 @@ class ResizeMarker final : public MarkerObject public: ResizeMarker(MovingObject* obj, Side vert, Side horz); - virtual GameObjectClasses get_class_types() const override { return MarkerObject::get_class_types().add(typeid(ResizeMarker)); } void move_to(const Vector& pos) override; Vector get_point_vector() const override; diff --git a/src/object/ambient_light.hpp b/src/object/ambient_light.hpp index 43311a21ac2..34c4cead95e 100644 --- a/src/object/ambient_light.hpp +++ b/src/object/ambient_light.hpp @@ -37,7 +37,6 @@ class AmbientLight : public GameObject static std::string display_name() { return _("Ambient Light"); } virtual std::string get_display_name() const override { return display_name(); } virtual const std::string get_icon_path() const override { return "images/engine/editor/ambient_light.png"; } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(AmbientLight)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/ambient_sound.hpp b/src/object/ambient_sound.hpp index e37403f7f68..43a868cf6ba 100644 --- a/src/object/ambient_sound.hpp +++ b/src/object/ambient_sound.hpp @@ -50,7 +50,6 @@ class AmbientSound final : public MovingObject static std::string display_name() { return _("Ambient Sound"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } - virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(AmbientSound)); } virtual void draw(DrawingContext& context) override; diff --git a/src/object/background.hpp b/src/object/background.hpp index 94bbbee5784..d5f15247901 100644 --- a/src/object/background.hpp +++ b/src/object/background.hpp @@ -50,7 +50,6 @@ class Background final : public GameObject virtual std::string get_exposed_class_name() const override { return "Background"; } static std::string display_name() { return _("Background"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Background)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/background.png"; diff --git a/src/object/bicycle_platform.hpp b/src/object/bicycle_platform.hpp index fcec2c931a9..9df28d6c09f 100644 --- a/src/object/bicycle_platform.hpp +++ b/src/object/bicycle_platform.hpp @@ -28,7 +28,6 @@ class BicyclePlatformChild : public MovingSprite public: BicyclePlatformChild(const ReaderMapping& reader, float angle_offset, BicyclePlatform& parent); - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(BicyclePlatformChild)); } virtual void update(float dt_sec) override; virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; @@ -67,7 +66,6 @@ class BicyclePlatform final : public GameObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Bicycle Platform"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(BicyclePlatform)); } virtual ObjectSettings get_settings() override; virtual void editor_delete() override; diff --git a/src/object/block.hpp b/src/object/block.hpp index 50345044f89..8e647bf4852 100644 --- a/src/object/block.hpp +++ b/src/object/block.hpp @@ -30,8 +30,6 @@ class Block : public MovingSprite Block(const Vector& pos, const std::string& sprite_file); Block(const ReaderMapping& mapping, const std::string& sprite_file); - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Block)); } - virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/bonus_block.hpp b/src/object/bonus_block.hpp index 924f59bc0ad..9b7ec20239d 100644 --- a/src/object/bonus_block.hpp +++ b/src/object/bonus_block.hpp @@ -61,7 +61,6 @@ class BonusBlock final : public Block virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Bonus Block"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return Block::get_class_types().add(typeid(BonusBlock)); } virtual ObjectSettings get_settings() override; GameObjectTypes get_types() const override; diff --git a/src/object/bouncy_coin.hpp b/src/object/bouncy_coin.hpp index 67f2a8de3c6..79c8099a65d 100644 --- a/src/object/bouncy_coin.hpp +++ b/src/object/bouncy_coin.hpp @@ -27,7 +27,6 @@ class BouncyCoin final : public GameObject public: BouncyCoin(const Vector& pos, bool emerge = false, const std::string& sprite_path = "images/objects/coin/coin.sprite"); - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(BouncyCoin)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; virtual bool is_saveable() const override { diff --git a/src/object/brick.hpp b/src/object/brick.hpp index 21803d4de37..ffe8f0432c1 100644 --- a/src/object/brick.hpp +++ b/src/object/brick.hpp @@ -33,7 +33,6 @@ class Brick : public Block virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Brick"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return Block::get_class_types().add(typeid(Brick)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; @@ -70,7 +69,6 @@ class HeavyBrick : public Brick virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Heavy Brick"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return Brick::get_class_types().add(typeid(HeavyBrick)); } GameObjectTypes get_types() const override { return {}; } diff --git a/src/object/bullet.hpp b/src/object/bullet.hpp index 601c35b1d0a..aefdbbbf8c4 100644 --- a/src/object/bullet.hpp +++ b/src/object/bullet.hpp @@ -31,8 +31,6 @@ class Bullet final : public MovingObject public: Bullet(const Vector& pos, const Vector& xm, Direction dir, BonusType type, Player& player); - virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Bullet)); } - virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; virtual void collision_solid(const CollisionHit& hit) override; diff --git a/src/object/bumper.hpp b/src/object/bumper.hpp index 724059f0cea..bc9b40c8700 100644 --- a/src/object/bumper.hpp +++ b/src/object/bumper.hpp @@ -37,7 +37,6 @@ class Bumper final : public StickyObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Bumper"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return StickyObject::get_class_types().add(typeid(Bumper)); } virtual void after_editor_set() override; virtual void on_flip(float height) override; diff --git a/src/object/camera.hpp b/src/object/camera.hpp index c4c6e44dc76..912f40e4126 100644 --- a/src/object/camera.hpp +++ b/src/object/camera.hpp @@ -67,7 +67,6 @@ class Camera final : public GameObject, virtual std::string get_exposed_class_name() const override { return "Camera"; } static std::string display_name() { return _("Camera"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Camera)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/candle.hpp b/src/object/candle.hpp index cc3a4e0a833..34be1323caa 100644 --- a/src/object/candle.hpp +++ b/src/object/candle.hpp @@ -42,7 +42,6 @@ class Candle final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "Candle"; } static std::string display_name() { return _("Candle"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Candle)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/circleplatform.hpp b/src/object/circleplatform.hpp index 4da7c150726..11892f4b274 100644 --- a/src/object/circleplatform.hpp +++ b/src/object/circleplatform.hpp @@ -34,7 +34,6 @@ class CirclePlatform : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Circular Platform"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(CirclePlatform)); } private: virtual void initialize(); diff --git a/src/object/cloud_particle_system.hpp b/src/object/cloud_particle_system.hpp index 81b49cc6c46..20c1cee322d 100644 --- a/src/object/cloud_particle_system.hpp +++ b/src/object/cloud_particle_system.hpp @@ -49,7 +49,6 @@ class CloudParticleSystem final : public ParticleSystem virtual std::string get_exposed_class_name() const override { return "CloudParticleSystem"; } static std::string display_name() { return _("Cloud Particles"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return ParticleSystem::get_class_types().add(typeid(CloudParticleSystem)); } virtual ObjectSettings get_settings() override; virtual const std::string get_icon_path() const override { diff --git a/src/object/coin.hpp b/src/object/coin.hpp index 9fd3de5db62..194be61b99b 100644 --- a/src/object/coin.hpp +++ b/src/object/coin.hpp @@ -43,7 +43,6 @@ class Coin : public MovingSprite, virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Coin"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Coin)); } virtual ObjectSettings get_settings() override; GameObjectTypes get_types() const override; @@ -97,7 +96,6 @@ class HeavyCoin final : public Coin virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Heavy Coin"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return Coin::get_class_types().add(typeid(HeavyCoin)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/coin_explode.hpp b/src/object/coin_explode.hpp index e7a316d4e77..b8ec2233e8d 100644 --- a/src/object/coin_explode.hpp +++ b/src/object/coin_explode.hpp @@ -25,7 +25,6 @@ class CoinExplode final : public GameObject public: CoinExplode(const Vector& pos, bool count_stats = true, const std::string& sprite_path = "images/objects/coin/coin.sprite"); - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(CoinExplode)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; virtual bool is_saveable() const override { diff --git a/src/object/coin_rain.hpp b/src/object/coin_rain.hpp index df5c8ea3e5e..55a8ce5b222 100644 --- a/src/object/coin_rain.hpp +++ b/src/object/coin_rain.hpp @@ -27,7 +27,6 @@ class CoinRain final : public GameObject public: CoinRain(const Vector& pos, bool emerge=false, bool count_stats = true, const std::string& sprite_path = "images/objects/coin/coin.sprite"); - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(CoinRain)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; virtual bool is_saveable() const override { diff --git a/src/object/conveyor_belt.hpp b/src/object/conveyor_belt.hpp index eb45c47e656..80eff3dec91 100644 --- a/src/object/conveyor_belt.hpp +++ b/src/object/conveyor_belt.hpp @@ -46,7 +46,6 @@ class ConveyorBelt final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "ConveyorBelt"; } static std::string display_name() { return _("Conveyor Belt"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(ConveyorBelt)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/custom_particle_system.hpp b/src/object/custom_particle_system.hpp index 2076a0b1716..427970374a6 100644 --- a/src/object/custom_particle_system.hpp +++ b/src/object/custom_particle_system.hpp @@ -53,7 +53,6 @@ class CustomParticleSystem : public ParticleSystem_Interactive virtual std::string get_exposed_class_name() const override { return "CustomParticleSystem"; } static std::string display_name() { return _("Custom Particles"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return ParticleSystem_Interactive::get_class_types().add(typeid(CustomParticleSystem)); } virtual void save(Writer& writer) override; virtual ObjectSettings get_settings() override; diff --git a/src/object/custom_particle_system_file.hpp b/src/object/custom_particle_system_file.hpp index 728852e5443..b37a4c4cded 100644 --- a/src/object/custom_particle_system_file.hpp +++ b/src/object/custom_particle_system_file.hpp @@ -38,7 +38,6 @@ class CustomParticleSystemFile final : public CustomParticleSystem virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Custom Particles from file"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return CustomParticleSystem::get_class_types().add(typeid(CustomParticleSystemFile)); } virtual ObjectSettings get_settings() override; virtual const std::string get_icon_path() const override { diff --git a/src/object/decal.hpp b/src/object/decal.hpp index edff1bd404a..c8913305bad 100644 --- a/src/object/decal.hpp +++ b/src/object/decal.hpp @@ -48,7 +48,6 @@ class Decal final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "Decal"; } static std::string display_name() { return _("Decal"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Decal)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/display_effect.hpp b/src/object/display_effect.hpp index 3822438cf94..33ef9533565 100644 --- a/src/object/display_effect.hpp +++ b/src/object/display_effect.hpp @@ -34,7 +34,6 @@ class DisplayEffect final : public GameObject public: DisplayEffect(const std::string& name = ""); ~DisplayEffect() override; - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(DisplayEffect)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/electrifier.hpp b/src/object/electrifier.hpp index 574e253a70f..9bf3dd26f2f 100644 --- a/src/object/electrifier.hpp +++ b/src/object/electrifier.hpp @@ -35,7 +35,6 @@ class Electrifier final : public GameObject public: Electrifier(TileChangeMap replacements, float seconds); Electrifier(uint32_t oldtile, uint32_t newtile, float seconds); - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Electrifier)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/endsequence.hpp b/src/object/endsequence.hpp index 2ccfbd99ba4..5ccb154d6c4 100644 --- a/src/object/endsequence.hpp +++ b/src/object/endsequence.hpp @@ -27,7 +27,6 @@ class EndSequence : public GameObject public: EndSequence(); ~EndSequence() override; - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(EndSequence)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/endsequence_fireworks.hpp b/src/object/endsequence_fireworks.hpp index 7e052277b3e..c459e791738 100644 --- a/src/object/endsequence_fireworks.hpp +++ b/src/object/endsequence_fireworks.hpp @@ -25,7 +25,6 @@ class EndSequenceFireworks final : public EndSequence public: EndSequenceFireworks(); ~EndSequenceFireworks() override; - virtual GameObjectClasses get_class_types() const override { return EndSequence::get_class_types().add(typeid(EndSequenceFireworks)); } virtual void draw(DrawingContext& context) override; protected: diff --git a/src/object/endsequence_walk.hpp b/src/object/endsequence_walk.hpp index ef22d244e5b..8f4836cbaff 100644 --- a/src/object/endsequence_walk.hpp +++ b/src/object/endsequence_walk.hpp @@ -25,7 +25,6 @@ class EndSequenceWalk final : public EndSequence public: EndSequenceWalk(); ~EndSequenceWalk() override; - virtual GameObjectClasses get_class_types() const override { return EndSequence::get_class_types().add(typeid(EndSequenceWalk)); } virtual void draw(DrawingContext& context) override; protected: diff --git a/src/object/explosion.hpp b/src/object/explosion.hpp index 070d3b654c2..0b7146fef81 100644 --- a/src/object/explosion.hpp +++ b/src/object/explosion.hpp @@ -34,7 +34,6 @@ class Explosion final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Explosion"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Explosion)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/fallblock.hpp b/src/object/fallblock.hpp index 202b56e5d1e..e6f627f2c34 100644 --- a/src/object/fallblock.hpp +++ b/src/object/fallblock.hpp @@ -40,7 +40,6 @@ class FallBlock : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Falling Platform"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(FallBlock)); } virtual void on_flip(float height) override; diff --git a/src/object/falling_coin.hpp b/src/object/falling_coin.hpp index 55ef3b3d3b8..5f942a33ee4 100644 --- a/src/object/falling_coin.hpp +++ b/src/object/falling_coin.hpp @@ -26,7 +26,6 @@ class FallingCoin final : public GameObject { public: FallingCoin(const Vector& start_position, float x_vel); - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(FallingCoin)); } virtual void draw(DrawingContext& context) override; virtual void update(float dt_sec) override; diff --git a/src/object/firefly.hpp b/src/object/firefly.hpp index 55c820d6a1e..147cdb68195 100644 --- a/src/object/firefly.hpp +++ b/src/object/firefly.hpp @@ -37,7 +37,6 @@ class Firefly final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Checkpoint"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Firefly)); } virtual ObjectSettings get_settings() override; virtual void on_flip(float height) override; diff --git a/src/object/fireworks.hpp b/src/object/fireworks.hpp index e54bacb3ccf..23f45bf4263 100644 --- a/src/object/fireworks.hpp +++ b/src/object/fireworks.hpp @@ -26,7 +26,6 @@ class Fireworks final : public GameObject { public: Fireworks(); - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Fireworks)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/floating_image.hpp b/src/object/floating_image.hpp index a4fbec4a997..59774cdc45d 100644 --- a/src/object/floating_image.hpp +++ b/src/object/floating_image.hpp @@ -39,7 +39,6 @@ class FloatingImage final : public GameObject ~FloatingImage() override; virtual bool is_saveable() const override { return false; } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(FloatingImage)); } virtual std::string get_exposed_class_name() const override { return "FloatingImage"; } virtual void update(float dt_sec) override; diff --git a/src/object/floating_text.hpp b/src/object/floating_text.hpp index 7b7d3214b13..ca3c671a427 100644 --- a/src/object/floating_text.hpp +++ b/src/object/floating_text.hpp @@ -28,8 +28,6 @@ class FloatingText final : public GameObject public: FloatingText(const Vector& pos, const std::string& text_); FloatingText(const Vector& pos, int s); // use this for score, for instance - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(FloatingText)); } - virtual bool is_saveable() const override { return false; } diff --git a/src/object/flower.hpp b/src/object/flower.hpp index 11427005be7..173a8d0c1e8 100644 --- a/src/object/flower.hpp +++ b/src/object/flower.hpp @@ -30,7 +30,6 @@ class Flower final : public MovingObject public: Flower(BonusType type, const std::string& custom_sprite = ""); - virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Flower)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/ghost_particle_system.hpp b/src/object/ghost_particle_system.hpp index 2bedbf2d2ec..8610b5b8e1f 100644 --- a/src/object/ghost_particle_system.hpp +++ b/src/object/ghost_particle_system.hpp @@ -36,7 +36,6 @@ class GhostParticleSystem final : public ParticleSystem virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Ghost Particles"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return ParticleSystem::get_class_types().add(typeid(GhostParticleSystem)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/ghostparticles.png"; diff --git a/src/object/gradient.hpp b/src/object/gradient.hpp index 7259b25ae88..0c57c2a5e95 100644 --- a/src/object/gradient.hpp +++ b/src/object/gradient.hpp @@ -48,7 +48,6 @@ class Gradient final : public GameObject virtual std::string get_exposed_class_name() const override { return "Gradient"; } static std::string display_name() { return _("Gradient"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Gradient)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/gradient.png"; diff --git a/src/object/growup.hpp b/src/object/growup.hpp index d779a01132f..8c743cd1cd4 100644 --- a/src/object/growup.hpp +++ b/src/object/growup.hpp @@ -25,7 +25,6 @@ class GrowUp final : public MovingSprite { public: GrowUp(const Vector& pos, Direction direction = Direction::RIGHT, const std::string& custom_sprite = ""); - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(GrowUp)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/hurting_platform.hpp b/src/object/hurting_platform.hpp index d1fc19b8db9..db034f4bb66 100644 --- a/src/object/hurting_platform.hpp +++ b/src/object/hurting_platform.hpp @@ -30,7 +30,6 @@ class HurtingPlatform final : public Platform virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Hurting Platform"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return Platform::get_class_types().add(typeid(HurtingPlatform)); } private: HurtingPlatform(const HurtingPlatform&) = delete; diff --git a/src/object/infoblock.hpp b/src/object/infoblock.hpp index 9df49d85751..a5351bfba72 100644 --- a/src/object/infoblock.hpp +++ b/src/object/infoblock.hpp @@ -36,7 +36,6 @@ class InfoBlock final : public Block virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Info Block"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return Block::get_class_types().add(typeid(InfoBlock)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/invisible_block.hpp b/src/object/invisible_block.hpp index 3d3ccb6c8bc..ad2b63a169f 100644 --- a/src/object/invisible_block.hpp +++ b/src/object/invisible_block.hpp @@ -29,7 +29,6 @@ class InvisibleBlock final : public Block virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Invisible Block"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return Block::get_class_types().add(typeid(InvisibleBlock)); } virtual void draw(DrawingContext& context) override; virtual bool collides(GameObject& other, const CollisionHit& hit) const override; diff --git a/src/object/invisible_wall.hpp b/src/object/invisible_wall.hpp index 3b5ba67cec8..02bddb90440 100644 --- a/src/object/invisible_wall.hpp +++ b/src/object/invisible_wall.hpp @@ -36,7 +36,6 @@ class InvisibleWall final : public MovingObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Invisible Wall"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(InvisibleWall)); } virtual bool has_variable_size() const override { return true; } diff --git a/src/object/ispy.hpp b/src/object/ispy.hpp index dea8674b2ce..681b005a14e 100644 --- a/src/object/ispy.hpp +++ b/src/object/ispy.hpp @@ -34,7 +34,6 @@ class Ispy final : public StickyObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Ispy"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return StickyObject::get_class_types().add(typeid(Ispy)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/key.hpp b/src/object/key.hpp index 81097fe9999..d709020384b 100644 --- a/src/object/key.hpp +++ b/src/object/key.hpp @@ -37,7 +37,6 @@ class Key final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Key"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Key)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/lantern.hpp b/src/object/lantern.hpp index 435a1feaa02..68d053cc5d4 100644 --- a/src/object/lantern.hpp +++ b/src/object/lantern.hpp @@ -37,7 +37,6 @@ class Lantern final : public Rock virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Lantern"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return Rock::get_class_types().add(typeid(Lantern)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override { return {}; } diff --git a/src/object/level_time.hpp b/src/object/level_time.hpp index f592bdea360..ee752a1a8a6 100644 --- a/src/object/level_time.hpp +++ b/src/object/level_time.hpp @@ -74,7 +74,6 @@ class LevelTime final : public GameObject virtual std::string get_exposed_class_name() const override { return "LevelTime"; } static std::string display_name() { return _("Time Limit"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(LevelTime)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/light.hpp b/src/object/light.hpp index 88ee82425f5..ce03309b56a 100644 --- a/src/object/light.hpp +++ b/src/object/light.hpp @@ -31,8 +31,6 @@ class Light : public GameObject return false; } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Light)); } - virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/lit_object.hpp b/src/object/lit_object.hpp index adddfe9d2c3..4c326d38d9c 100644 --- a/src/object/lit_object.hpp +++ b/src/object/lit_object.hpp @@ -45,7 +45,6 @@ class LitObject final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "LitObject"; } static std::string display_name() { return _("Lit object"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(LitObject)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/magicblock.hpp b/src/object/magicblock.hpp index 91261eec774..21b1ef87d8c 100644 --- a/src/object/magicblock.hpp +++ b/src/object/magicblock.hpp @@ -41,7 +41,6 @@ class MagicBlock final: public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Magic Tile"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(MagicBlock)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/moving_sprite.hpp b/src/object/moving_sprite.hpp index b251e127587..1f1c26323e9 100644 --- a/src/object/moving_sprite.hpp +++ b/src/object/moving_sprite.hpp @@ -57,7 +57,6 @@ class MovingSprite : public MovingObject static std::string class_name() { return "moving-sprite"; } virtual std::string get_class_name() const override { return class_name(); } virtual std::string get_exposed_class_name() const override { return "MovingSprite"; } - virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(MovingSprite)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/music_object.hpp b/src/object/music_object.hpp index b9c6e4c0448..aecd6ee4305 100644 --- a/src/object/music_object.hpp +++ b/src/object/music_object.hpp @@ -41,7 +41,6 @@ class MusicObject : public GameObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Music"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(MusicObject)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/music.png"; } virtual ObjectSettings get_settings() override; diff --git a/src/object/oneup.hpp b/src/object/oneup.hpp index 51efe40a3cc..373168fc49c 100644 --- a/src/object/oneup.hpp +++ b/src/object/oneup.hpp @@ -25,7 +25,6 @@ class OneUp final : public MovingSprite { public: OneUp(const Vector& pos, Direction direction = Direction::RIGHT); - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(OneUp)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/particle_zone.hpp b/src/object/particle_zone.hpp index 7504f30bd1c..dd59e6858e0 100644 --- a/src/object/particle_zone.hpp +++ b/src/object/particle_zone.hpp @@ -37,7 +37,6 @@ class ParticleZone final : public MovingObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Particle zone"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(ParticleZone)); } virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; virtual ObjectSettings get_settings() override; diff --git a/src/object/particles.hpp b/src/object/particles.hpp index 1b090e82ff9..c92a2996326 100644 --- a/src/object/particles.hpp +++ b/src/object/particles.hpp @@ -35,7 +35,6 @@ class Particles final : public GameObject const float min_initial_velocity, const float max_initial_velocity, const Vector& acceleration, int number, Color color, int size, float life_time, int drawing_layer); - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Particles)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/particlesystem.hpp b/src/object/particlesystem.hpp index 7f61f42c575..239dd519d69 100644 --- a/src/object/particlesystem.hpp +++ b/src/object/particlesystem.hpp @@ -63,7 +63,6 @@ class ParticleSystem : public GameObject virtual std::string get_exposed_class_name() const override { return "ParticleSystem"; } static std::string display_name() { return _("Particle system"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(ParticleSystem)); } virtual ObjectSettings get_settings() override; /** diff --git a/src/object/particlesystem_interactive.hpp b/src/object/particlesystem_interactive.hpp index c0233f796cf..abf37cfb843 100644 --- a/src/object/particlesystem_interactive.hpp +++ b/src/object/particlesystem_interactive.hpp @@ -47,7 +47,6 @@ class ParticleSystem_Interactive : public ParticleSystem virtual std::string get_display_name() const override { return _("Interactive particle system"); } - virtual GameObjectClasses get_class_types() const override { return ParticleSystem::get_class_types().add(typeid(ParticleSystem_Interactive)); } protected: virtual int collision(Particle* particle, const Vector& movement); diff --git a/src/object/path_gameobject.hpp b/src/object/path_gameobject.hpp index cbb7c7984cb..732c6f0d933 100644 --- a/src/object/path_gameobject.hpp +++ b/src/object/path_gameobject.hpp @@ -44,7 +44,6 @@ class PathGameObject : public GameObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Path"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(PathGameObject)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/path.png"; diff --git a/src/object/platform.hpp b/src/object/platform.hpp index 1cc837e8349..8308de5c763 100644 --- a/src/object/platform.hpp +++ b/src/object/platform.hpp @@ -53,7 +53,6 @@ class Platform : public MovingSprite, virtual std::string get_exposed_class_name() const override { return "Platform"; } static std::string display_name() { return _("Platform"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Platform)); } virtual void editor_update() override; diff --git a/src/object/player.hpp b/src/object/player.hpp index ba8d84c7715..be7532333da 100644 --- a/src/object/player.hpp +++ b/src/object/player.hpp @@ -89,7 +89,6 @@ class Player final : public MovingObject virtual bool has_object_manager_priority() const override { return true; } virtual std::string get_exposed_class_name() const override { return "Player"; } virtual void remove_me() override; - virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Player)); } int get_id() const { return m_id; } void set_id(int id); diff --git a/src/object/pneumatic_platform.hpp b/src/object/pneumatic_platform.hpp index 6af88c99d83..e5859ec53e1 100644 --- a/src/object/pneumatic_platform.hpp +++ b/src/object/pneumatic_platform.hpp @@ -28,7 +28,6 @@ class PneumaticPlatformChild final : public MovingSprite public: PneumaticPlatformChild(const ReaderMapping& reader, bool left, PneumaticPlatform& parent); ~PneumaticPlatformChild() override; - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(PneumaticPlatformChild)); } virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; virtual void update(float dt_sec) override; @@ -65,7 +64,6 @@ class PneumaticPlatform final : public GameObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Pneumatic Platform"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(PneumaticPlatform)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/powerup.hpp b/src/object/powerup.hpp index b9ad6d2fd58..b0b9b5f8f12 100644 --- a/src/object/powerup.hpp +++ b/src/object/powerup.hpp @@ -39,7 +39,6 @@ class PowerUp final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Powerup"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(PowerUp)); } std::vector get_patches() const override; virtual ObjectSettings get_settings() override; diff --git a/src/object/pulsing_light.hpp b/src/object/pulsing_light.hpp index f453aa94313..8e9d60cf3e3 100644 --- a/src/object/pulsing_light.hpp +++ b/src/object/pulsing_light.hpp @@ -27,7 +27,6 @@ class PulsingLight final : public Light public: PulsingLight(const Vector& center, float cycle_len = 5.0, float min_alpha = 0.0, float max_alpha = 1.0, const Color& color = Color(1.0, 1.0, 1.0, 1.0)); ~PulsingLight() override; - virtual GameObjectClasses get_class_types() const override { return Light::get_class_types().add(typeid(PulsingLight)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/pushbutton.hpp b/src/object/pushbutton.hpp index 253a44a58e5..dfc49e3d640 100644 --- a/src/object/pushbutton.hpp +++ b/src/object/pushbutton.hpp @@ -31,7 +31,6 @@ class PushButton final : public StickyObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Button"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return StickyObject::get_class_types().add(typeid(PushButton)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/rain_particle_system.hpp b/src/object/rain_particle_system.hpp index 4a6b263858c..5b2acd9cae4 100644 --- a/src/object/rain_particle_system.hpp +++ b/src/object/rain_particle_system.hpp @@ -48,7 +48,6 @@ class RainParticleSystem final : public ParticleSystem_Interactive virtual std::string get_exposed_class_name() const override { return "RainParticleSystem"; } static std::string display_name() { return _("Rain Particles"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return ParticleSystem_Interactive::get_class_types().add(typeid(RainParticleSystem)); } virtual ObjectSettings get_settings() override; /** diff --git a/src/object/rainsplash.hpp b/src/object/rainsplash.hpp index 3b06bf4db6a..86ca688d3dd 100644 --- a/src/object/rainsplash.hpp +++ b/src/object/rainsplash.hpp @@ -28,7 +28,6 @@ class RainSplash final : public GameObject public: RainSplash(const Vector& pos, bool vertical); ~RainSplash() override; - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(RainSplash)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/rock.hpp b/src/object/rock.hpp index f38b9cd7c90..c50f8ff45fb 100644 --- a/src/object/rock.hpp +++ b/src/object/rock.hpp @@ -39,7 +39,6 @@ class Rock : public MovingSprite, virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Rock"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Portable)).add(typeid(Rock)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; diff --git a/src/object/rublight.hpp b/src/object/rublight.hpp index 9772dd2eda2..0a218585745 100644 --- a/src/object/rublight.hpp +++ b/src/object/rublight.hpp @@ -33,7 +33,6 @@ class RubLight final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Rublight"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(RubLight)); } virtual ObjectSettings get_settings() override; virtual void on_flip(float height) override; diff --git a/src/object/rusty_trampoline.hpp b/src/object/rusty_trampoline.hpp index 590fc0d6a09..86e4ac4b074 100644 --- a/src/object/rusty_trampoline.hpp +++ b/src/object/rusty_trampoline.hpp @@ -39,7 +39,6 @@ class RustyTrampoline final : public Rock virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Rusty Trampoline"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return Rock::get_class_types().add(typeid(RustyTrampoline)); } virtual ObjectSettings get_settings() override; GameObjectTypes get_types() const override { return {}; } diff --git a/src/object/scripted_object.hpp b/src/object/scripted_object.hpp index 920a09d9874..5465f78d210 100644 --- a/src/object/scripted_object.hpp +++ b/src/object/scripted_object.hpp @@ -45,7 +45,6 @@ class ScriptedObject final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "ScriptedObject"; } static std::string display_name() { return _("Scripted Object"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(ScriptedObject)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/shard.hpp b/src/object/shard.hpp index 57c461ae7a5..7d3c89579ff 100644 --- a/src/object/shard.hpp +++ b/src/object/shard.hpp @@ -34,7 +34,6 @@ class Shard final : public StickyObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Shard"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return StickyObject::get_class_types().add(typeid(Shard)); } protected: Physic m_physic; diff --git a/src/object/smoke_cloud.hpp b/src/object/smoke_cloud.hpp index 4eedf2a7955..6c3b1ef47ea 100644 --- a/src/object/smoke_cloud.hpp +++ b/src/object/smoke_cloud.hpp @@ -26,7 +26,6 @@ class SmokeCloud final : public GameObject { public: SmokeCloud(const Vector& pos); - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(SmokeCloud)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/snow_particle_system.hpp b/src/object/snow_particle_system.hpp index 854962b8fd2..6b608ab27fe 100644 --- a/src/object/snow_particle_system.hpp +++ b/src/object/snow_particle_system.hpp @@ -36,7 +36,6 @@ class SnowParticleSystem final : public ParticleSystem virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Snow Particles"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return ParticleSystem::get_class_types().add(typeid(SnowParticleSystem)); } virtual ObjectSettings get_settings() override; virtual const std::string get_icon_path() const override diff --git a/src/object/sound_object.hpp b/src/object/sound_object.hpp index b636843a03a..c2ef56791ee 100644 --- a/src/object/sound_object.hpp +++ b/src/object/sound_object.hpp @@ -40,7 +40,6 @@ class SoundObject final : public GameObject virtual std::string get_exposed_class_name() const override { return "SoundObject"; } static std::string display_name() { return _("Sound"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(SoundObject)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/sound.png"; } virtual ObjectSettings get_settings() override; diff --git a/src/object/spawnpoint.hpp b/src/object/spawnpoint.hpp index a2e12ba57a0..6a6c22185d3 100644 --- a/src/object/spawnpoint.hpp +++ b/src/object/spawnpoint.hpp @@ -47,7 +47,6 @@ class SpawnPointMarker final : public MovingObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Spawnpoint"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(SpawnPointMarker)); } virtual ObjectSettings get_settings() override; virtual int get_layer() const override { return LAYER_FOREGROUND1; } diff --git a/src/object/specialriser.hpp b/src/object/specialriser.hpp index 7eb546f66b7..2e4248708f7 100644 --- a/src/object/specialriser.hpp +++ b/src/object/specialriser.hpp @@ -27,7 +27,6 @@ class SpecialRiser final : public MovingObject { public: SpecialRiser(const Vector& pos, std::unique_ptr child, bool is_solid = false); - virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(SpecialRiser)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/spotlight.hpp b/src/object/spotlight.hpp index c214080c4b5..1f2c9422542 100644 --- a/src/object/spotlight.hpp +++ b/src/object/spotlight.hpp @@ -58,7 +58,6 @@ class Spotlight final : public MovingObject virtual std::string get_exposed_class_name() const override { return "Spotlight"; } static std::string display_name() { return _("Spotlight"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Spotlight)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/sprite_particle.hpp b/src/object/sprite_particle.hpp index ae5dad30dfc..44bd77c841b 100644 --- a/src/object/sprite_particle.hpp +++ b/src/object/sprite_particle.hpp @@ -37,7 +37,6 @@ class SpriteParticle final : public GameObject const Vector& position, AnchorPoint anchor, const Vector& velocity, const Vector& acceleration, int drawing_layer = LAYER_OBJECTS-1, bool notimeout = false, Color color = Color::WHITE); - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(SpriteParticle)); } ~SpriteParticle() override; protected: diff --git a/src/object/star.hpp b/src/object/star.hpp index f019757707b..808ddf8052a 100644 --- a/src/object/star.hpp +++ b/src/object/star.hpp @@ -26,7 +26,6 @@ class Star final : public MovingSprite { public: Star(const Vector& pos, Direction direction = Direction::RIGHT, const std::string& custom_sprite = ""); - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Star)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/sticky_object.hpp b/src/object/sticky_object.hpp index 13c7ed61316..b276dfa5a36 100644 --- a/src/object/sticky_object.hpp +++ b/src/object/sticky_object.hpp @@ -31,7 +31,6 @@ class StickyObject : public MovingSprite int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); StickyObject(const ReaderMapping& reader, const std::string& sprite_name, int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(StickyObject)); } virtual void update(float dt_sec) override; @@ -81,7 +80,6 @@ class StickyBadguy : public BadGuy int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); StickyBadguy(const ReaderMapping& reader, const std::string& sprite_name, int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); - virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(StickyBadguy)); } virtual void sticky_update(float dt_sec); diff --git a/src/object/text_array_object.hpp b/src/object/text_array_object.hpp index 81f49a68750..bfbd8320ea6 100644 --- a/src/object/text_array_object.hpp +++ b/src/object/text_array_object.hpp @@ -56,7 +56,6 @@ class TextArrayObject final : public GameObject virtual std::string get_exposed_class_name() const override { return "TextArrayObject"; } static std::string display_name() { return _("Text array"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(TextArrayObject)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/textarray.png"; diff --git a/src/object/text_object.hpp b/src/object/text_object.hpp index 70184ea3a56..33396c4cc33 100644 --- a/src/object/text_object.hpp +++ b/src/object/text_object.hpp @@ -51,7 +51,6 @@ class TextObject final : public GameObject virtual std::string get_exposed_class_name() const override { return "TextObject"; } static std::string display_name() { return _("Text"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(TextObject)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/textarray.png"; } diff --git a/src/object/textscroller.hpp b/src/object/textscroller.hpp index d484c4fe78b..1a15e5ae30c 100644 --- a/src/object/textscroller.hpp +++ b/src/object/textscroller.hpp @@ -44,7 +44,6 @@ class TextScroller : public GameObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Text Scroller"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(TextScroller)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/textscroller.png"; } void set_default_speed(float default_speed); diff --git a/src/object/thunderstorm.hpp b/src/object/thunderstorm.hpp index 50b71184a71..0c888df48e1 100644 --- a/src/object/thunderstorm.hpp +++ b/src/object/thunderstorm.hpp @@ -51,7 +51,6 @@ class Thunderstorm final : public GameObject virtual std::string get_exposed_class_name() const override { return "Thunderstorm"; } static std::string display_name() { return _("Thunderstorm"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Thunderstorm)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/tilemap.hpp b/src/object/tilemap.hpp index e2acdff847e..332b52c3ec2 100644 --- a/src/object/tilemap.hpp +++ b/src/object/tilemap.hpp @@ -65,7 +65,6 @@ class TileMap final : public GameObject, virtual const std::string get_icon_path() const override { return "images/engine/editor/tilemap.png"; } static std::string display_name() { return _("Tilemap"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(TileMap)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/torch.hpp b/src/object/torch.hpp index 377f5ae6d38..ea24ad4ac41 100644 --- a/src/object/torch.hpp +++ b/src/object/torch.hpp @@ -46,7 +46,6 @@ class Torch final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "Torch"; } static std::string display_name() { return _("Torch"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Torch)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/trampoline.hpp b/src/object/trampoline.hpp index 29b6cfebfb5..910fa118258 100644 --- a/src/object/trampoline.hpp +++ b/src/object/trampoline.hpp @@ -36,7 +36,6 @@ class Trampoline final : public Rock virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Trampoline"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return Rock::get_class_types().add(typeid(Trampoline)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/object/unstable_tile.hpp b/src/object/unstable_tile.hpp index 313a226ece1..b5af23dd308 100644 --- a/src/object/unstable_tile.hpp +++ b/src/object/unstable_tile.hpp @@ -41,7 +41,6 @@ class UnstableTile final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Unstable Tile"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(UnstableTile)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/object/vertical_stripes.hpp b/src/object/vertical_stripes.hpp index b789d754af3..79535fda9ac 100644 --- a/src/object/vertical_stripes.hpp +++ b/src/object/vertical_stripes.hpp @@ -28,8 +28,6 @@ class VerticalStripes final : public GameObject VerticalStripes(); ~VerticalStripes() override; - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(VerticalStripes)); } - virtual bool is_singleton() const override { return true; } virtual bool is_saveable() const override { return false; } virtual void update(float dt_sec) override; diff --git a/src/object/water_drop.hpp b/src/object/water_drop.hpp index 0949b7f83fd..5f7cd70eedd 100644 --- a/src/object/water_drop.hpp +++ b/src/object/water_drop.hpp @@ -27,8 +27,6 @@ class WaterDrop final : public MovingSprite public: WaterDrop(const Vector& pos, const std::string& sprite_path_, const Vector& velocity); - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(WaterDrop)); } - virtual void update(float dt_sec) override; virtual void collision_solid(const CollisionHit& hit) override; virtual HitResponse collision(GameObject& other, const CollisionHit& ) override; diff --git a/src/object/weak_block.hpp b/src/object/weak_block.hpp index 8c9f5724f54..865c97e9a99 100644 --- a/src/object/weak_block.hpp +++ b/src/object/weak_block.hpp @@ -35,7 +35,6 @@ class WeakBlock final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Weak Tile"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(WeakBlock)); } std::vector get_patches() const override; void update_version() override; diff --git a/src/object/wind.hpp b/src/object/wind.hpp index 787850a70cb..cfc7fe53220 100644 --- a/src/object/wind.hpp +++ b/src/object/wind.hpp @@ -42,7 +42,6 @@ class Wind final : public MovingObject virtual std::string get_exposed_class_name() const override { return "Wind"; } static std::string display_name() { return _("Wind"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Wind)); } virtual ObjectSettings get_settings() override; diff --git a/src/supertux/game_object.cpp b/src/supertux/game_object.cpp index 8f54d5dd4cd..187ba06b4d2 100644 --- a/src/supertux/game_object.cpp +++ b/src/supertux/game_object.cpp @@ -109,14 +109,6 @@ GameObject::save() return save_stream.str(); } -GameObjectClasses -GameObject::get_class_types() const { - GameObjectClasses g{}; - // All class types except GameObject, since everything implements GameObject - // g.add(typeid(GameObject)); - return g; -} - ObjectSettings GameObject::get_settings() { diff --git a/src/supertux/game_object.hpp b/src/supertux/game_object.hpp index 9c427d21e69..c8202d6f1a8 100644 --- a/src/supertux/game_object.hpp +++ b/src/supertux/game_object.hpp @@ -22,7 +22,6 @@ #include #include #include -#include #include "editor/object_settings.hpp" #include "supertux/game_object_component.hpp" @@ -48,23 +47,6 @@ struct GameObjectType }; typedef std::vector GameObjectTypes; -/** - A helper structure to list all the type_indexes of the classes in the - type hierarchy of a given class. This makes it easier to register e.g. - a MrIceblock in lists for MrIceBlock, WalkingBadguy, Badguy, Portable, - MovingSprite, MovingObject, and GameObject. - */ -struct GameObjectClasses -{ - std::vector types; - - GameObjectClasses& add(const std::type_info &info) { - std::type_index idx(info); - types.push_back(idx); - return *this; - } -}; - /** This class is responsible for: * Updating and drawing the object. This should happen in the update() and @@ -120,9 +102,6 @@ class GameObject : public ExposableClass * @description Returns the display name of the object, translated to the user's locale. */ virtual std::string get_display_name() const { return _("Unknown object"); } - /** List notable classes in inheritance hierarchy of class. This makes it possible - to efficiently look up all objects deriving from a particular intermediate class */ - virtual GameObjectClasses get_class_types() const; /** Version checking/updating, patch information */ virtual std::vector get_patches() const; diff --git a/src/supertux/game_object_iterator.hpp b/src/supertux/game_object_iterator.hpp index 1bef5e52390..d16757434f0 100644 --- a/src/supertux/game_object_iterator.hpp +++ b/src/supertux/game_object_iterator.hpp @@ -25,7 +25,7 @@ template class GameObjectIterator { public: - typedef std::vector::const_iterator Iterator; + typedef std::vector >::const_iterator Iterator; public: GameObjectIterator(Iterator it, Iterator end) : @@ -35,28 +35,24 @@ class GameObjectIterator { if (m_it != m_end) { - // A dynamic_cast is needed to perform sidecasts (a.k.a. crosscasts) - // T may be one of multiple base classes of the object and need not inherit GameObject - m_object = dynamic_cast(*m_it); - assert(m_object); + m_object = dynamic_cast(m_it->get()); + if (!m_object) + { + skip_to_next(); + } } } GameObjectIterator& operator++() { - ++m_it; - if (m_it != m_end) - { - m_object = dynamic_cast(*m_it); - assert(m_object); - } + skip_to_next(); return *this; } GameObjectIterator operator++(int) { GameObjectIterator tmp(*this); - operator++(); + skip_to_next(); return tmp; } @@ -86,6 +82,24 @@ class GameObjectIterator return !(*this == other); } +private: + void skip_to_next() + { + do + { + ++m_it; + if (m_it == m_end) + { + break; + } + else + { + m_object = dynamic_cast(m_it->get()); + } + } + while (!m_object); + } + private: Iterator m_it; Iterator m_end; @@ -101,13 +115,11 @@ class GameObjectRange {} GameObjectIterator begin() const { - auto& objects = m_manager.get_objects_by_type_index(typeid(T)); - return GameObjectIterator(objects.begin(), objects.end()); + return GameObjectIterator(m_manager.get_objects().begin(), m_manager.get_objects().end()); } GameObjectIterator end() const { - auto& objects = m_manager.get_objects_by_type_index(typeid(T)); - return GameObjectIterator(objects.end(), objects.end()); + return GameObjectIterator(m_manager.get_objects().end(), m_manager.get_objects().end()); } private: diff --git a/src/supertux/game_object_manager.cpp b/src/supertux/game_object_manager.cpp index 0226a1a60a0..f272a9f75a7 100644 --- a/src/supertux/game_object_manager.cpp +++ b/src/supertux/game_object_manager.cpp @@ -483,9 +483,7 @@ GameObjectManager::this_before_object_add(GameObject& object) } { // By type index: - for (const std::type_index& type : object.get_class_types().types) { - m_objects_by_type_index[type].push_back(&object); - } + m_objects_by_type_index[std::type_index(typeid(object))].push_back(&object); } save_object_change(object, true); @@ -509,12 +507,10 @@ GameObjectManager::this_before_object_remove(GameObject& object) } { // By type index: - for (const std::type_index& type : object.get_class_types().types) { - auto& vec = m_objects_by_type_index[type]; - auto it = std::find(vec.begin(), vec.end(), &object); - assert(it != vec.end()); - vec.erase(it); - } + auto& vec = m_objects_by_type_index[std::type_index(typeid(object))]; + auto it = std::find(vec.begin(), vec.end(), &object); + assert(it != vec.end()); + vec.erase(it); } } diff --git a/src/supertux/game_object_manager.hpp b/src/supertux/game_object_manager.hpp index 07a79f77dba..601918b85fc 100644 --- a/src/supertux/game_object_manager.hpp +++ b/src/supertux/game_object_manager.hpp @@ -243,8 +243,8 @@ class GameObjectManager : public ExposableClass int get_object_count(std::function predicate = nullptr) const { int total = 0; - for (const auto& obj : get_objects_by_type_index(typeid(T))) { - auto object = static_cast(obj); + for (const auto& obj : m_gameobjects) { + auto object = dynamic_cast(obj.get()); if (object && (predicate == nullptr || predicate(*object))) { total += 1; diff --git a/src/supertux/moving_object.hpp b/src/supertux/moving_object.hpp index 1872470b228..bc5e8a1cbe5 100644 --- a/src/supertux/moving_object.hpp +++ b/src/supertux/moving_object.hpp @@ -46,7 +46,6 @@ class MovingObject : public GameObject, MovingObject(); MovingObject(const ReaderMapping& reader); ~MovingObject() override; - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(MovingObject)); } virtual void collision_solid(const CollisionHit& /*hit*/) override { diff --git a/src/supertux/player_status_hud.hpp b/src/supertux/player_status_hud.hpp index 3bcc649eef0..0315f532001 100644 --- a/src/supertux/player_status_hud.hpp +++ b/src/supertux/player_status_hud.hpp @@ -34,7 +34,6 @@ class PlayerStatusHUD : public GameObject public: PlayerStatusHUD(PlayerStatus& player_status); - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(PlayerStatusHUD)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/trigger/climbable.hpp b/src/trigger/climbable.hpp index 6ef3bffcaa9..c3214b61d4f 100644 --- a/src/trigger/climbable.hpp +++ b/src/trigger/climbable.hpp @@ -46,7 +46,6 @@ class Climbable final : public Trigger static std::string display_name() { return _("Climbable"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } - virtual GameObjectClasses get_class_types() const override { return Trigger::get_class_types().add(typeid(Climbable)); } virtual ObjectSettings get_settings() override; diff --git a/src/trigger/door.hpp b/src/trigger/door.hpp index 7b095c33157..fe363954944 100644 --- a/src/trigger/door.hpp +++ b/src/trigger/door.hpp @@ -30,7 +30,6 @@ class Door final : public SpritedTrigger virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Door"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return SpritedTrigger::get_class_types().add(typeid(Door)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/trigger/scripttrigger.hpp b/src/trigger/scripttrigger.hpp index 6b3276346b7..538990e8752 100644 --- a/src/trigger/scripttrigger.hpp +++ b/src/trigger/scripttrigger.hpp @@ -29,7 +29,6 @@ class ScriptTrigger final : public Trigger static std::string display_name() { return _("Script Trigger"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } - virtual GameObjectClasses get_class_types() const override { return Trigger::get_class_types().add(typeid(ScriptTrigger)); } virtual ObjectSettings get_settings() override; diff --git a/src/trigger/secretarea_trigger.hpp b/src/trigger/secretarea_trigger.hpp index 8473b06da0f..a32a237b5bb 100644 --- a/src/trigger/secretarea_trigger.hpp +++ b/src/trigger/secretarea_trigger.hpp @@ -36,7 +36,6 @@ class SecretAreaTrigger final : public Trigger static std::string display_name() { return _("Secret Area"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } - virtual GameObjectClasses get_class_types() const override { return Trigger::get_class_types().add(typeid(SecretAreaTrigger)); } virtual ObjectSettings get_settings() override; diff --git a/src/trigger/sequence_trigger.hpp b/src/trigger/sequence_trigger.hpp index fdbd44cb04b..4de2fcb446b 100644 --- a/src/trigger/sequence_trigger.hpp +++ b/src/trigger/sequence_trigger.hpp @@ -31,7 +31,6 @@ class SequenceTrigger final : public Trigger static std::string display_name() { return _("Sequence Trigger"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } - virtual GameObjectClasses get_class_types() const override { return Trigger::get_class_types().add(typeid(SequenceTrigger)); } virtual ObjectSettings get_settings() override; diff --git a/src/trigger/switch.hpp b/src/trigger/switch.hpp index a83e267d799..0a09d06eb73 100644 --- a/src/trigger/switch.hpp +++ b/src/trigger/switch.hpp @@ -29,7 +29,6 @@ class Switch final : public StickyTrigger virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Switch"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return StickyTrigger::get_class_types().add(typeid(Switch)); } virtual ObjectSettings get_settings() override; diff --git a/src/trigger/text_area.hpp b/src/trigger/text_area.hpp index e652afd2bc8..0c0b3d9df31 100644 --- a/src/trigger/text_area.hpp +++ b/src/trigger/text_area.hpp @@ -47,7 +47,6 @@ class TextArea final : public Trigger static std::string display_name() { return _("Text Area"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } - virtual GameObjectClasses get_class_types() const override { return Trigger::get_class_types().add(typeid(TextArea)); } private: bool m_once; diff --git a/src/trigger/trigger_base.hpp b/src/trigger/trigger_base.hpp index 681458f0cf4..211df6fdc28 100644 --- a/src/trigger/trigger_base.hpp +++ b/src/trigger/trigger_base.hpp @@ -68,7 +68,6 @@ class Trigger : public MovingObject, { public: Trigger(const ReaderMapping& reader); - virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Trigger)); } virtual void update(float) override { @@ -92,7 +91,6 @@ class SpritedTrigger : public MovingSprite, { public: SpritedTrigger(const ReaderMapping& reader, const std::string& sprite_name); - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(SpritedTrigger)); } virtual void update(float) override { @@ -114,7 +112,6 @@ class StickyTrigger : public StickyObject, { public: StickyTrigger(const ReaderMapping& reader, const std::string& sprite_name); - virtual GameObjectClasses get_class_types() const override { return StickyObject::get_class_types().add(typeid(StickyTrigger)); } virtual void update(float dt_sec) override { diff --git a/src/worldmap/level_tile.hpp b/src/worldmap/level_tile.hpp index 59cc80a7539..66e20c1337f 100644 --- a/src/worldmap/level_tile.hpp +++ b/src/worldmap/level_tile.hpp @@ -35,7 +35,6 @@ class LevelTile final : public WorldMapObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Level"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(LevelTile)); } virtual ObjectSettings get_settings() override; diff --git a/src/worldmap/spawn_point.hpp b/src/worldmap/spawn_point.hpp index 108eaa915d7..3a664a1a48a 100644 --- a/src/worldmap/spawn_point.hpp +++ b/src/worldmap/spawn_point.hpp @@ -57,7 +57,6 @@ class SpawnPointObject final : public WorldMapObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Spawn point"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(SpawnPointObject)); } virtual ObjectSettings get_settings() override; diff --git a/src/worldmap/special_tile.hpp b/src/worldmap/special_tile.hpp index 902d37c835c..fab8de59fca 100644 --- a/src/worldmap/special_tile.hpp +++ b/src/worldmap/special_tile.hpp @@ -35,7 +35,6 @@ class SpecialTile final : public WorldMapObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Special Tile"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(SpecialTile)); } virtual void draw_worldmap(DrawingContext& context) override; diff --git a/src/worldmap/sprite_change.hpp b/src/worldmap/sprite_change.hpp index 4fa4fda3292..e889b681066 100644 --- a/src/worldmap/sprite_change.hpp +++ b/src/worldmap/sprite_change.hpp @@ -34,7 +34,6 @@ class SpriteChange final : public WorldMapObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Sprite Change"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(SpriteChange)); } virtual void draw_worldmap(DrawingContext& context) override; diff --git a/src/worldmap/teleporter.hpp b/src/worldmap/teleporter.hpp index 39c7ec8253e..b35b43e6aa4 100644 --- a/src/worldmap/teleporter.hpp +++ b/src/worldmap/teleporter.hpp @@ -33,7 +33,6 @@ class Teleporter final : public WorldMapObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Teleporter"); } virtual std::string get_display_name() const override { return display_name(); } - virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(Teleporter)); } virtual ObjectSettings get_settings() override; diff --git a/src/worldmap/tux.hpp b/src/worldmap/tux.hpp index 4347fd3d1ac..60031875974 100644 --- a/src/worldmap/tux.hpp +++ b/src/worldmap/tux.hpp @@ -39,7 +39,6 @@ class Tux final : public GameObject virtual void draw(DrawingContext& context) override; virtual void update(float dt_sec) override; virtual bool is_singleton() const override { return true; } - virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Tux)); } void setup(); /**< called prior to first update */ diff --git a/src/worldmap/worldmap_object.hpp b/src/worldmap/worldmap_object.hpp index 9803e576d0a..7d60963f188 100644 --- a/src/worldmap/worldmap_object.hpp +++ b/src/worldmap/worldmap_object.hpp @@ -36,7 +36,6 @@ class WorldMapObject : public MovingSprite WorldMapObject(const ReaderMapping& mapping, const std::string& default_sprite); WorldMapObject(const ReaderMapping& mapping); WorldMapObject(const Vector& pos, const std::string& default_sprite); - virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(WorldMapObject)); } static std::string class_name() { return "worldmap-object"; } virtual std::string get_class_name() const override { return class_name(); } From 8c7ab0769b3896446a10300dfb655d702d408239 Mon Sep 17 00:00:00 2001 From: Vankata453 <78196474+Vankata453@users.noreply.github.com> Date: Tue, 9 Jul 2024 00:12:32 +0300 Subject: [PATCH 11/33] Separate `Player::set_pos()` and `Player::move()` This commit reverts the `Player::move()` function as it was before 19e2884f5da5b6951d2a16abb910440ba764fcd3. `Player::set_pos()` is now a separate function, which additionally only updates the position of grabbed objects and keys. This was done, so that setting Tux's position from scripting doesn't change his state or reset his velocity. Fixes #3006. --- src/object/player.cpp | 15 +++++++++++++-- src/object/player.hpp | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/object/player.cpp b/src/object/player.cpp index 911863b88b2..22feb4dab4e 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -2379,7 +2379,7 @@ Player::on_flip(float height) { Vector pos = get_pos(); pos.y = height - pos.y - get_bbox().get_height(); - set_pos(pos); + move(pos); } void @@ -2492,6 +2492,17 @@ Player::set_pos(const Vector& vector) { MovingObject::set_pos(vector); + // Make sure objects following Tux move directly with him + position_grabbed_object(true); + for (Key* key : m_collected_keys) + key->update_pos(); +} + +void +Player::move(const Vector& vector) +{ + m_col.set_pos(vector); + // Reset size to get correct hitbox if Tux was eg. ducked before moving if (is_big()) m_col.set_size(TUX_WIDTH, BIG_TUX_HEIGHT); @@ -3002,7 +3013,7 @@ Player::multiplayer_respawn() set_group(COLGROUP_MOVING); m_physic.reset(); - set_pos(target->get_pos()); + move(target->get_pos()); m_target.reset(); } diff --git a/src/object/player.hpp b/src/object/player.hpp index be7532333da..5780153f896 100644 --- a/src/object/player.hpp +++ b/src/object/player.hpp @@ -145,6 +145,7 @@ class Player final : public MovingObject void kill(bool completely); void set_pos(const Vector& vector) override; + void move(const Vector& vector); /** * @scripting From 00a307005b75c1e8fb91f2cacf892ac2b6ac1077 Mon Sep 17 00:00:00 2001 From: Vankata453 <78196474+Vankata453@users.noreply.github.com> Date: Tue, 9 Jul 2024 00:37:48 +0300 Subject: [PATCH 12/33] Rename `Player::move()` to `Player::set_pos_reset()` Fixes conflicts with `MovingObject::move()`, which the function doesn't override, because of different functionality. --- src/object/player.cpp | 6 +++--- src/object/player.hpp | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/object/player.cpp b/src/object/player.cpp index 22feb4dab4e..5254fb2cf10 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -2379,7 +2379,7 @@ Player::on_flip(float height) { Vector pos = get_pos(); pos.y = height - pos.y - get_bbox().get_height(); - move(pos); + set_pos_reset(pos); } void @@ -2499,7 +2499,7 @@ Player::set_pos(const Vector& vector) } void -Player::move(const Vector& vector) +Player::set_pos_reset(const Vector& vector) { m_col.set_pos(vector); @@ -3013,7 +3013,7 @@ Player::multiplayer_respawn() set_group(COLGROUP_MOVING); m_physic.reset(); - move(target->get_pos()); + set_pos_reset(target->get_pos()); m_target.reset(); } diff --git a/src/object/player.hpp b/src/object/player.hpp index 5780153f896..984dbaa5c4d 100644 --- a/src/object/player.hpp +++ b/src/object/player.hpp @@ -145,7 +145,6 @@ class Player final : public MovingObject void kill(bool completely); void set_pos(const Vector& vector) override; - void move(const Vector& vector); /** * @scripting @@ -427,6 +426,9 @@ class Player final : public MovingObject void handle_horizontal_input(); void handle_vertical_input(); + /** Set Tux's position, reset state and velocity. */ + void set_pos_reset(const Vector& vector); + void do_jump_apex(); void early_jump_apex(); From b4d2c168bd0fddbe60f72d7ffe7f93003589ed98 Mon Sep 17 00:00:00 2001 From: Daniel Ward <39805490+weluvgoatz@users.noreply.github.com> Date: Mon, 8 Jul 2024 22:24:41 -0700 Subject: [PATCH 13/33] Fix dispenser bug (#2990) Original PR description: "Fixes #2837 This PR makes dispensers active in terms of being an active/inactive badguy always. This is beneficial for many reasons: Dispensers don't really function as badguys anyway, moreso as other objects, which are always active. It fixes the bug where dispensers scripting would break if you went away from the dispenser and then came back. I believe it fixes an unreported issue where gravity-obeying dispensers would fall into the void if they were placed on moving platforms because the dispenser would load below/inside/off the moving platform because the platform was moving and the dispenser wasn't. However, I know this could be considered kind of a cheap/non-optimal solution to the bug. So if anyone has any better suggestions feel free to take a look at it." --- src/badguy/badguy.cpp | 2 +- src/badguy/badguy.hpp | 2 ++ src/badguy/dispenser.hpp | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/badguy/badguy.cpp b/src/badguy/badguy.cpp index 34d555c0c1f..a3ee560d57c 100644 --- a/src/badguy/badguy.cpp +++ b/src/badguy/badguy.cpp @@ -221,7 +221,7 @@ BadGuy::update(float dt_sec) } // Deactivate badguy, if off-screen and not falling down. - if (m_is_active_flag && is_offscreen() && m_physic.get_velocity_y() <= 0.f) + if (m_is_active_flag && is_offscreen() && m_physic.get_velocity_y() <= 0.f && !always_active()) { deactivate(); set_state(STATE_INACTIVE); diff --git a/src/badguy/badguy.hpp b/src/badguy/badguy.hpp index 861998b81ae..438a22ee07c 100644 --- a/src/badguy/badguy.hpp +++ b/src/badguy/badguy.hpp @@ -139,6 +139,8 @@ class BadGuy : public MovingSprite, Returns false if enemy is spiky or too large */ virtual bool is_snipable() const { return false; } + virtual bool always_active() const { return false; } + bool is_frozen() const; bool is_in_water() const; diff --git a/src/badguy/dispenser.hpp b/src/badguy/dispenser.hpp index 48ea925313e..f057484e863 100644 --- a/src/badguy/dispenser.hpp +++ b/src/badguy/dispenser.hpp @@ -59,6 +59,7 @@ class Dispenser final : public BadGuy virtual void unfreeze(bool melt = true) override; virtual bool is_freezable() const override; virtual bool is_flammable() const override; + virtual bool always_active() const override { return true; } virtual bool is_portable() const override; static std::string class_name() { return "dispenser"; } From bc06d8cc1835eee771e021cf8a550655bae0ef9e Mon Sep 17 00:00:00 2001 From: bruhmoent <69918580+bruhmoent@users.noreply.github.com> Date: Tue, 9 Jul 2024 16:20:45 +0200 Subject: [PATCH 14/33] Add an option for the thunderstorm flash (#3000) This pr adds a brightness setting for the thunderstorm flash as a percentage value. Fixes #2914 --- src/object/thunderstorm.cpp | 1 + src/supertux/gameconfig.cpp | 5 ++- src/supertux/gameconfig.hpp | 1 + src/supertux/menu/options_menu.cpp | 49 ++++++++++++++++++++++++++++-- src/supertux/menu/options_menu.hpp | 3 ++ 5 files changed, 55 insertions(+), 4 deletions(-) diff --git a/src/object/thunderstorm.cpp b/src/object/thunderstorm.cpp index 359edc3f648..05b1836d76e 100644 --- a/src/object/thunderstorm.cpp +++ b/src/object/thunderstorm.cpp @@ -114,6 +114,7 @@ Thunderstorm::update(float ) return; } + alpha *= static_cast(g_config->flash_intensity) / 100.0f; m_flash_color = Color(alpha, alpha, alpha, 1.0); } diff --git a/src/supertux/gameconfig.cpp b/src/supertux/gameconfig.cpp index 520a6c96da0..810b8ef025f 100644 --- a/src/supertux/gameconfig.cpp +++ b/src/supertux/gameconfig.cpp @@ -62,6 +62,7 @@ Config::Config() : music_enabled(true), sound_volume(100), music_volume(50), + flash_intensity(50), random_seed(0), // Set by time(), by default (unless in config). enable_script_debugger(false), tux_spawn_pos(), @@ -143,6 +144,7 @@ Config::load() auto config_mapping = root.get_mapping(); config_mapping.get("profile", profile); + config_mapping.get("flash_intensity", flash_intensity); config_mapping.get("frame_prediction", frame_prediction); config_mapping.get("show_fps", show_fps); config_mapping.get("show_player_pos", show_player_pos); @@ -441,6 +443,8 @@ Config::save() writer.write("aspect_width", aspect_size.width); writer.write("aspect_height", aspect_size.height); + writer.write("flash_intensity", flash_intensity); + #ifdef __EMSCRIPTEN__ // Forcibly set autofit to true // TODO: Remove the autofit parameter entirely - it should always be true @@ -508,7 +512,6 @@ Config::check_values() camera_peek_multiplier = math::clamp(camera_peek_multiplier, 0.f, 1.f); } - bool Config::is_christmas() const { diff --git a/src/supertux/gameconfig.hpp b/src/supertux/gameconfig.hpp index 5b780ea63e2..97cde1e6491 100644 --- a/src/supertux/gameconfig.hpp +++ b/src/supertux/gameconfig.hpp @@ -73,6 +73,7 @@ class Config final bool music_enabled; int sound_volume; int music_volume; + int flash_intensity; /** initial random seed. 0 ==> set from time() */ int random_seed; diff --git a/src/supertux/menu/options_menu.cpp b/src/supertux/menu/options_menu.cpp index b4c18de77c4..c06f2eeef1c 100644 --- a/src/supertux/menu/options_menu.cpp +++ b/src/supertux/menu/options_menu.cpp @@ -55,7 +55,6 @@ OptionsMenu::less_than_volume(const std::string& lhs, const std::string& rhs) return false; } - OptionsMenu::OptionsMenu(Type type, bool complete) : m_magnifications(), m_aspect_ratios(), @@ -64,6 +63,7 @@ OptionsMenu::OptionsMenu(Type type, bool complete) : m_vsyncs(), m_sound_volumes(), m_music_volumes(), + m_flash_intensity_values(), m_mobile_control_scales() { switch (type) // Insert label and menu items, appropriate for the chosen OptionsMenu type @@ -113,6 +113,8 @@ OptionsMenu::OptionsMenu(Type type, bool complete) : add_toggle(MNID_FRAME_PREDICTION, _("Frame prediction"), &g_config->frame_prediction) .set_help(_("Smooth camera motion, generating intermediate frames. This has a noticeable effect on monitors at >> 60Hz. Moving objects may be blurry.")); + add_flash_intensity(); + #if !defined(HIDE_NONMOBILE_OPTIONS) && !defined(__EMSCRIPTEN__) add_aspect_ratio(); #endif @@ -511,6 +513,42 @@ OptionsMenu::add_music_volume() .set_help(_("Adjust music volume")); } +void +OptionsMenu::add_flash_intensity() +{ + m_flash_intensity_values.list = { "0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%" }; + + std::ostringstream flash_intensity_value_stream; + flash_intensity_value_stream << g_config->flash_intensity << "%"; + std::string flash_intensity_string = flash_intensity_value_stream.str(); + + if (std::find(m_flash_intensity_values.list.begin(), + m_flash_intensity_values.list.end(), flash_intensity_string) == m_flash_intensity_values.list.end()) + { + m_flash_intensity_values.list.push_back(flash_intensity_string); + } + + std::sort(m_flash_intensity_values.list.begin(), m_flash_intensity_values.list.end(), less_than_volume); + + std::ostringstream out; + out << g_config->flash_intensity << "%"; + std::string flash_intensity_value = out.str(); + int count = 0; + for (const auto& value : m_flash_intensity_values.list) + { + if (value == flash_intensity_value) + { + flash_intensity_value.clear(); + m_flash_intensity_values.next = count; + break; + } + ++count; + } + + add_string_select(MNID_FLASH_INTENSITY, _("Flash Intensity"), &m_flash_intensity_values.next, m_flash_intensity_values.list) + .set_help(_("Adjust the intensity of the flash produced by the thunderstorm")); +} + void OptionsMenu::add_mobile_control_scales() { @@ -524,7 +562,6 @@ OptionsMenu::add_mobile_control_scales() add_string_select(MNID_MOBILE_CONTROLS_SCALE, _("On-screen controls scale"), &m_mobile_control_scales.next, m_mobile_control_scales.list); } - void OptionsMenu::on_window_resize() { @@ -532,7 +569,6 @@ OptionsMenu::on_window_resize() static_cast(SCREEN_HEIGHT) / 2.0f + 15.0f); } - void OptionsMenu::menu_action(MenuItem& item) { @@ -709,6 +745,13 @@ OptionsMenu::menu_action(MenuItem& item) } break; + case MNID_FLASH_INTENSITY: + if (sscanf(m_flash_intensity_values.list[m_flash_intensity_values.next].c_str(), "%i", &g_config->flash_intensity) == 1) + { + g_config->save(); + } + break; + case MNID_CUSTOM_TITLE_LEVELS: TitleScreen::current()->refresh_level(); break; diff --git a/src/supertux/menu/options_menu.hpp b/src/supertux/menu/options_menu.hpp index ae66d352866..703f7120236 100644 --- a/src/supertux/menu/options_menu.hpp +++ b/src/supertux/menu/options_menu.hpp @@ -53,6 +53,7 @@ class OptionsMenu final : public Menu void add_vsync(); void add_sound_volume(); void add_music_volume(); + void add_flash_intensity(); void add_mobile_control_scales(); private: @@ -70,6 +71,7 @@ class OptionsMenu final : public Menu MNID_MUSIC, MNID_SOUND_VOLUME, MNID_MUSIC_VOLUME, + MNID_FLASH_INTENSITY, MNID_RUMBLING, MNID_DEVELOPER_MODE, MNID_CHRISTMAS_MODE, @@ -97,6 +99,7 @@ class OptionsMenu final : public Menu StringOption m_vsyncs; StringOption m_sound_volumes; StringOption m_music_volumes; + StringOption m_flash_intensity_values; StringOption m_mobile_control_scales; private: From ee7b044864f3fba028fa460dd73f05961a53f4bf Mon Sep 17 00:00:00 2001 From: SuperTux Bot Date: Wed, 10 Jul 2024 01:37:19 +0000 Subject: [PATCH 15/33] Update translations --- data/locale/gl.po | 4500 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 3404 insertions(+), 1096 deletions(-) diff --git a/data/locale/gl.po b/data/locale/gl.po index a0efd92a44d..2278c70a8b4 100644 --- a/data/locale/gl.po +++ b/data/locale/gl.po @@ -3,163 +3,185 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# xanvieiro , 2019-2020 +# Xan Vieiro , 2019-2021 +# Martin, 2022 +# nin hum , 2024 # Pablo Rodriguez , 2018 +# Xan Vieiro , 2021-2022,2024 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" -"POT-Creation-Date: 2020-04-13 17:25+0200\n" -"PO-Revision-Date: 2020-04-23 06:34+0000\n" -"Last-Translator: xanvieiro \n" -"Language-Team: Galician (http://www.transifex.com/arctic-games/supertux/language/gl/)\n" +"POT-Creation-Date: 2024-05-30 16:19+0200\n" +"PO-Revision-Date: 2013-08-10 22:56+0000\n" +"Last-Translator: nin hum , 2024\n" +"Language-Team: Galician (http://app.transifex.com/arctic-games/supertux/language/gl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: gl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: src/trigger/secretarea_trigger.cpp:53 src/trigger/secretarea_trigger.cpp:61 +#: src/trigger/secretarea_trigger.cpp:47 msgid "You found a secret area!" msgstr "Atopaches unha área secreta!" -#: src/trigger/secretarea_trigger.cpp:77 src/trigger/scripttrigger.cpp:75 -#: src/supertux/game_object.cpp:88 src/supertux/menu/editor_sector_menu.cpp:34 -#: src/supertux/menu/editor_levelset_menu.cpp:58 +#: src/trigger/secretarea_trigger.cpp:55 src/supertux/game_object.cpp:115 +#: src/supertux/menu/editor_sector_menu.cpp:36 +#: src/supertux/menu/editor_levelset_menu.cpp:52 #: src/supertux/menu/editor_new_levelset_menu.cpp:34 +#: src/supertux/menu/profile_name_menu.cpp:39 #: src/supertux/menu/editor_level_menu.cpp:33 msgid "Name" msgstr "Nome" -#: src/trigger/secretarea_trigger.cpp:78 +#: src/trigger/secretarea_trigger.cpp:56 msgid "Fade tilemap" msgstr "Esvaer mapa" -#: src/trigger/secretarea_trigger.cpp:79 src/trigger/climbable.cpp:81 -#: src/object/infoblock.cpp:57 src/editor/worldmap_objects.cpp:174 -#: src/editor/worldmap_objects.cpp:272 +#: src/trigger/secretarea_trigger.cpp:57 src/trigger/climbable.cpp:59 +#: src/object/infoblock.cpp:76 src/worldmap/teleporter.cpp:49 +#: src/worldmap/special_tile.cpp:74 msgid "Message" msgstr "Mensaxe" -#: src/trigger/secretarea_trigger.cpp:80 src/trigger/scripttrigger.cpp:80 -#: src/trigger/door.cpp:73 src/object/ispy.cpp:67 -#: src/object/bonus_block.cpp:203 src/object/bonus_block.cpp:207 -#: src/object/pushbutton.cpp:49 src/object/powerup.cpp:190 -#: src/editor/worldmap_objects.cpp:274 +#: src/trigger/secretarea_trigger.cpp:58 src/trigger/scripttrigger.cpp:51 +#: src/trigger/door.cpp:79 src/object/ispy.cpp:53 +#: src/object/bonus_block.cpp:264 src/object/bonus_block.cpp:268 +#: src/object/pushbutton.cpp:62 src/object/powerup.cpp:301 +#: src/worldmap/special_tile.cpp:76 msgid "Script" msgstr "Guión" -#: src/trigger/scripttrigger.cpp:73 -msgid "Script Trigger" -msgstr "Activador do Script" - -#: src/trigger/scripttrigger.cpp:76 src/object/tilemap.cpp:220 -#: src/supertux/menu/editor_sector_menu.cpp:39 -#: src/editor/object_option.cpp:148 -msgid "Width" -msgstr "Ancho" - -#: src/trigger/scripttrigger.cpp:77 src/object/tilemap.cpp:221 -#: src/supertux/menu/editor_sector_menu.cpp:40 -#: src/editor/object_option.cpp:149 -msgid "Height" -msgstr "Alto" - -#: src/trigger/scripttrigger.cpp:78 src/object/bicycle_platform.cpp:187 -#: src/object/background.cpp:160 src/object/pneumatic_platform.cpp:145 -#: src/supertux/menu/joystick_menu.cpp:170 src/supertux/moving_object.cpp:47 -#: src/editor/worldmap_objects.cpp:73 -msgid "X" -msgstr "X" - -#: src/trigger/scripttrigger.cpp:79 src/object/bicycle_platform.cpp:188 -#: src/object/background.cpp:161 src/object/pneumatic_platform.cpp:146 -#: src/supertux/menu/joystick_menu.cpp:172 src/supertux/moving_object.cpp:48 -#: src/editor/worldmap_objects.cpp:74 -msgid "Y" -msgstr "Y" - -#: src/trigger/scripttrigger.cpp:81 src/object/pushbutton.hpp:31 +#: src/trigger/scripttrigger.cpp:52 src/object/pushbutton.hpp:32 msgid "Button" msgstr "Botón" -#: src/trigger/scripttrigger.cpp:82 +#: src/trigger/scripttrigger.cpp:53 msgid "Oneshot" msgstr "UnTiro" -#: src/trigger/sequence_trigger.hpp:33 +#: src/trigger/sequence_trigger.hpp:31 msgid "Sequence Trigger" msgstr "Activador da Secuencia" -#: src/trigger/door.cpp:74 src/badguy/willowisp.cpp:280 -#: src/supertux/menu/editor_sector_menu.cpp:32 -#: src/editor/layers_widget.cpp:274 -#: data//images/engine/editor/objects.stoi:300 +#: src/trigger/text_area.cpp:141 +msgid "Once" +msgstr "Unha vez" + +#: src/trigger/text_area.cpp:142 +msgid "Text change time" +msgstr "Tempo de cambio de texto" + +#: src/trigger/text_area.cpp:143 +msgid "Fade time" +msgstr "Tempo de desvanecemento" + +#: src/trigger/text_area.cpp:144 src/object/textscroller.cpp:353 +msgid "Anchor" +msgstr "Ancorado" + +#: src/trigger/text_area.cpp:148 +msgid "Anchor offset X" +msgstr "desvío do ancoraxe en X" + +#: src/trigger/text_area.cpp:149 +msgid "Anchor offset Y" +msgstr "desvío do ancoraxe en Y" + +#: src/trigger/text_area.cpp:150 +msgid "Texts" +msgstr "Textos" + +#: src/trigger/door.cpp:80 src/badguy/willowisp.cpp:311 +#: src/worldmap/teleporter.cpp:47 data//images/engine/editor/objects.stoi:342 msgid "Sector" msgstr "Sector" -#: src/trigger/door.cpp:75 src/editor/worldmap_objects.hpp:101 +#: src/trigger/door.cpp:81 src/worldmap/spawn_point.hpp:58 msgid "Spawn point" msgstr "Punto de inicio" -#: src/trigger/switch.cpp:61 src/object/block.cpp:212 src/object/torch.cpp:91 -#: src/object/moving_sprite.cpp:156 src/object/pneumatic_platform.cpp:144 -msgid "Sprite" -msgstr "Fada" +#: src/trigger/door.cpp:82 +msgid "Locked?" +msgstr "Bloqueado?" + +#: src/trigger/door.cpp:83 +msgid "Lock Color" +msgstr "Cor de bloqueo" + +#: src/trigger/switch.cpp:62 src/object/ispy.cpp:54 src/object/bumper.cpp:53 +#: src/object/spotlight.cpp:106 src/object/pushbutton.cpp:61 +#: src/object/gradient.cpp:103 src/object/conveyor_belt.cpp:60 +#: src/badguy/badguy.cpp:1063 src/worldmap/spawn_point.cpp:79 +#: src/worldmap/special_tile.cpp:78 +msgid "Direction" +msgstr "Dirección" -#: src/trigger/switch.cpp:62 +#: src/trigger/switch.cpp:65 msgid "Turn on script" msgstr "Activar guión" -#: src/trigger/switch.cpp:63 +#: src/trigger/switch.cpp:66 msgid "Turn off script" msgstr "Desactivar guión" -#: src/trigger/sequence_trigger.cpp:75 +#: src/trigger/scripttrigger.hpp:29 +msgid "Script Trigger" +msgstr "Activador do Script" + +#: src/trigger/sequence_trigger.cpp:48 msgid "Sequence" msgstr "Secuencia" -#: src/trigger/sequence_trigger.cpp:76 +#: src/trigger/sequence_trigger.cpp:49 msgid "end sequence" msgstr "rematar secuencia" -#: src/trigger/sequence_trigger.cpp:76 +#: src/trigger/sequence_trigger.cpp:49 msgid "stop Tux" msgstr "para Tux" -#: src/trigger/sequence_trigger.cpp:76 +#: src/trigger/sequence_trigger.cpp:49 msgid "fireworks" msgstr "fogos de artificio" -#: src/trigger/sequence_trigger.cpp:80 +#: src/trigger/sequence_trigger.cpp:53 msgid "New worldmap spawnpoint" msgstr "Novo punto de inicio do mapa principal" -#: src/trigger/sequence_trigger.cpp:81 +#: src/trigger/sequence_trigger.cpp:54 msgid "Worldmap fade tilemap" msgstr "Esvaer mosaico do mapa principal" -#: src/trigger/sequence_trigger.cpp:82 +#: src/trigger/sequence_trigger.cpp:55 +#: src/object/custom_particle_system.cpp:430 +#: src/object/custom_particle_system.cpp:465 msgid "Fade" msgstr "Esvaer" -#: src/trigger/sequence_trigger.cpp:83 +#: src/trigger/sequence_trigger.cpp:56 src/editor/particle_editor.cpp:161 msgid "Fade in" msgstr "Aparecer" -#: src/trigger/sequence_trigger.cpp:83 +#: src/trigger/sequence_trigger.cpp:56 src/editor/particle_editor.cpp:167 +#: src/editor/particle_editor.cpp:212 msgid "Fade out" msgstr "Desaparecer" -#: src/trigger/climbable.hpp:37 +#: src/trigger/climbable.hpp:46 msgid "Climbable" msgstr "Agatuñable" -#: src/trigger/door.hpp:34 +#: src/trigger/text_area.hpp:47 +msgid "Text Area" +msgstr "Área do Texto" + +#: src/trigger/door.hpp:31 msgid "Door" msgstr "Porta" -#: src/trigger/switch.hpp:33 +#: src/trigger/switch.hpp:30 msgid "Switch" msgstr "Interruptor" @@ -167,85 +189,194 @@ msgstr "Interruptor" msgid "Secret Area" msgstr "Área Secreta" -#: src/object/thunderstorm.hpp:40 +#: src/math/anchor_point.cpp:33 +msgid "Top Left" +msgstr "Arriba á Esquerda" + +#: src/math/anchor_point.cpp:34 +msgid "Top" +msgstr "Arriba" + +#: src/math/anchor_point.cpp:35 +msgid "Top Right" +msgstr "Arriba á Dereita" + +#: src/math/anchor_point.cpp:36 src/object/textscroller.cpp:354 +#: src/object/textscroller.cpp:358 src/supertux/menu/keyboard_menu.cpp:38 +#: src/supertux/menu/joystick_menu.cpp:73 +msgid "Left" +msgstr "Esquerda" + +#: src/math/anchor_point.cpp:37 +msgid "Middle" +msgstr "Medio" + +#: src/math/anchor_point.cpp:38 src/object/textscroller.cpp:354 +#: src/object/textscroller.cpp:358 src/supertux/menu/keyboard_menu.cpp:39 +#: src/supertux/menu/joystick_menu.cpp:74 +msgid "Right" +msgstr "Dereita" + +#: src/math/anchor_point.cpp:39 +msgid "Bottom Left" +msgstr "Abaixo á Esquerda" + +#: src/math/anchor_point.cpp:40 +msgid "Bottom" +msgstr "Abaixo" + +#: src/math/anchor_point.cpp:41 +msgid "Bottom Right" +msgstr "Abaixo á Dereita" + +#: src/object/thunderstorm.hpp:44 msgid "Thunderstorm" msgstr "Tronada" -#: src/object/ispy.cpp:66 -msgid "Facing Down" -msgstr "Boca Abaixo" +#: src/object/cloud_particle_system.cpp:77 +#: src/object/rain_particle_system.cpp:100 +msgid "Intensity" +msgstr "Intensidade" -#: src/object/ispy.cpp:68 src/object/gradient.cpp:124 -#: src/badguy/willowisp.cpp:279 src/badguy/badguy.cpp:840 -#: src/editor/worldmap_objects.cpp:209 src/editor/worldmap_objects.cpp:276 -msgid "Direction" -msgstr "Dirección" +#: src/object/custom_particle_system.hpp:46 +msgid "Custom Particles" +msgstr "Partículas Personalizadas" + +#: src/object/particle_zone.hpp:41 +msgid "Particle zone" +msgstr "Zona de partículas" -#: src/object/path_gameobject.hpp:44 src/object/coin.cpp:262 -#: src/object/camera.cpp:212 src/object/platform.cpp:65 -#: src/object/path_gameobject.cpp:168 src/object/tilemap.cpp:234 -#: src/badguy/willowisp.cpp:286 +#: src/object/path_gameobject.hpp:45 src/object/coin.cpp:324 +#: src/object/camera.cpp:168 src/object/platform.cpp:76 +#: src/object/path_gameobject.cpp:175 src/object/tilemap.cpp:284 +#: src/badguy/willowisp.cpp:317 msgid "Path" msgstr "Camiño" -#: src/object/decal.cpp:41 src/object/scripted_object.cpp:67 -#: src/object/particlesystem.cpp:62 src/object/background.cpp:164 -#: src/object/thunderstorm.cpp:68 src/object/tilemap.cpp:227 -#: src/object/gradient.cpp:122 -msgid "Z-pos" -msgstr "Posición-Z" - -#: src/object/decal.cpp:42 src/object/scripted_object.cpp:70 -#: src/object/tilemap.cpp:216 +#: src/object/decal.cpp:48 src/object/scripted_object.cpp:70 +#: src/object/tilemap.cpp:266 msgid "Solid" msgstr "Sólido" -#: src/object/decal.cpp:43 src/supertux/menu/keyboard_menu.cpp:37 -#: src/supertux/menu/joystick_menu.cpp:74 +#: src/object/decal.cpp:49 src/supertux/menu/keyboard_menu.cpp:41 +#: src/supertux/menu/joystick_menu.cpp:76 msgid "Action" msgstr "Acción" -#: src/object/weak_block.hpp:35 +#: src/object/weak_block.hpp:36 msgid "Weak Tile" msgstr "Tesela Fráxil" -#: src/object/gradient.hpp:42 +#: src/object/gradient.hpp:43 msgid "Gradient" msgstr "Gradiente" -#: src/object/tilemap.hpp:53 +#: src/object/tilemap.hpp:58 msgid "Tilemap" msgstr "Mosaico" -#: src/object/brick.cpp:133 +#: src/object/sound_object.cpp:69 src/object/ambient_sound.cpp:85 +#: src/object/sound_object.hpp:42 src/supertux/menu/options_menu.cpp:128 +#: data//credits.stxt:367 +msgid "Sound" +msgstr "Son" + +#: src/object/sound_object.cpp:70 src/object/ambient_sound.cpp:87 +msgid "Volume" +msgstr "Volume" + +#: src/object/conveyor_belt.hpp:39 +msgid "Conveyor Belt" +msgstr "Correa transportadora" + +#: src/object/unstable_tile.cpp:70 src/object/weak_block.cpp:97 +#: src/badguy/flame.cpp:86 +msgid "Ice" +msgstr "Xeo" + +#: src/object/unstable_tile.cpp:71 src/object/brick.hpp:34 +msgid "Brick" +msgstr "Ladrillo" + +#: src/object/unstable_tile.cpp:72 +msgid "Delayed" +msgstr "Atrasado" + +#: src/object/circleplatform.hpp:35 +msgid "Circular Platform" +msgstr "Plataforma Circular" + +#: src/object/brick.cpp:59 src/object/coin.cpp:69 +#: src/object/invisible_block.cpp:37 src/object/background.cpp:200 +#: src/object/tilemap.cpp:279 src/object/gradient.cpp:109 +#: src/badguy/viciousivy.cpp:44 src/badguy/snail.cpp:69 +#: src/badguy/smartball.cpp:34 src/badguy/bouncing_snowball.cpp:81 +#: src/badguy/kamikazesnowball.cpp:117 src/badguy/walkingleaf.cpp:35 +#: src/badguy/mrbomb.cpp:47 src/badguy/igel.cpp:188 src/badguy/snowball.cpp:40 +#: src/badguy/mrtree.cpp:50 src/badguy/mriceblock.cpp:62 +msgid "Normal" +msgstr "Normal" + +#: src/object/brick.cpp:60 src/object/bonus_block.cpp:175 +#: src/object/coin.cpp:70 src/object/invisible_block.cpp:38 +msgid "Retro" +msgstr "Retro" + +#: src/object/brick.cpp:166 msgid "Breakable" msgstr "Rompible " -#: src/object/trampoline.cpp:136 src/object/rusty_trampoline.cpp:66 +#: src/object/trampoline.cpp:66 src/object/rusty_trampoline.cpp:66 msgid "Portable" msgstr "Portátil" -#: src/object/spotlight.cpp:62 +#: src/object/trampoline.cpp:67 +msgid "Stationary" +msgstr "Estacionario" + +#: src/object/key.hpp:38 +msgid "Key" +msgstr "Chave" + +#: src/object/spotlight.cpp:102 src/object/particlesystem.cpp:64 +#: src/object/particle_zone.cpp:50 src/badguy/darttrap.cpp:149 +#: src/supertux/menu/addon_preview_menu.cpp:189 +msgid "Enabled" +msgstr "Activado" + +#: src/object/spotlight.cpp:103 src/object/rain_particle_system.cpp:101 msgid "Angle" msgstr "Ángulo" -#: src/object/spotlight.cpp:63 src/object/magicblock.cpp:94 -#: src/object/candle.cpp:77 src/object/lantern.cpp:62 -#: src/object/ambient_light.cpp:131 src/badguy/walking_candle.cpp:82 +#: src/object/spotlight.cpp:104 src/object/magicblock.cpp:95 +#: src/object/candle.cpp:75 src/object/torch.cpp:96 src/object/rublight.cpp:55 +#: src/object/lantern.cpp:62 src/object/ambient_light.cpp:122 +#: src/object/key.cpp:192 src/badguy/willowisp.cpp:319 +#: src/badguy/walking_candle.cpp:91 msgid "Color" msgstr "Cor" -#: src/object/spotlight.cpp:64 src/object/textscroller.cpp:279 -#: src/badguy/flame.cpp:59 +#: src/object/spotlight.cpp:105 src/object/textscroller.cpp:350 +#: src/object/rain_particle_system.cpp:102 src/object/conveyor_belt.cpp:61 +#: src/object/circleplatform.cpp:58 src/badguy/flame.cpp:110 +#: src/editor/node_marker.cpp:125 msgid "Speed" msgstr "Velocidade" -#: src/object/spotlight.cpp:65 +#: src/object/spotlight.cpp:107 +msgid "Clockwise" +msgstr "No sentido das agullas do reloxo" + +#: src/object/spotlight.cpp:107 msgid "Counter-clockwise" msgstr "Levóxiro" -#: src/object/spotlight.cpp:66 src/object/candle.cpp:78 -#: src/object/torch.cpp:92 +#: src/object/spotlight.cpp:107 +msgid "Stopped" +msgstr "Parado" + +#: src/object/spotlight.cpp:110 src/object/lit_object.cpp:69 +#: src/object/candle.cpp:76 src/object/torch.cpp:95 msgid "Layer" msgstr "Capa" @@ -257,113 +388,200 @@ msgstr "Física activada" msgid "Visible" msgstr "Visible" -#: src/object/scripted_object.cpp:73 src/badguy/willowisp.cpp:282 +#: src/object/scripted_object.cpp:73 src/badguy/willowisp.cpp:313 msgid "Hit script" msgstr "Script de golpe" -#: src/object/bonus_block.cpp:204 +#: src/object/custom_particle_system_file.cpp:53 +#: src/object/textscroller.cpp:348 src/object/music_object.cpp:109 +#: src/supertux/menu/particle_editor_open.cpp:38 +msgid "File" +msgstr "Ficheiro" + +#: src/object/bonus_block.cpp:154 +msgid "Only one custom object is allowed inside bonus blocks." +msgstr "Só se permite un obxecto personalizado dentro dos bloques extra." + +#: src/object/bonus_block.cpp:172 +msgid "Blue" +msgstr "Azul" + +#: src/object/bonus_block.cpp:173 +msgid "Orange" +msgstr "Laranxa" + +#: src/object/bonus_block.cpp:174 +msgid "Purple" +msgstr "Púrpura" + +#: src/object/bonus_block.cpp:265 src/supertux/menu/cheat_apply_menu.cpp:54 msgid "Count" msgstr "Conta" -#: src/object/bonus_block.cpp:205 +#: src/object/bonus_block.cpp:266 msgid "Content" msgstr "Contido" -#: src/object/bonus_block.cpp:206 src/object/coin.hpp:43 +#: src/object/bonus_block.cpp:267 src/object/coin.hpp:44 msgid "Coin" msgstr "Moeda" -#: src/object/bonus_block.cpp:206 +#: src/object/bonus_block.cpp:267 msgid "Growth (fire flower)" msgstr "Crecemento (flor de lume)" -#: src/object/bonus_block.cpp:206 +#: src/object/bonus_block.cpp:267 msgid "Growth (ice flower)" msgstr "Crecemento (flor de xeo)" -#: src/object/bonus_block.cpp:206 +#: src/object/bonus_block.cpp:267 msgid "Growth (air flower)" msgstr "Crecemento (flor de aire)" -#: src/object/bonus_block.cpp:207 +#: src/object/bonus_block.cpp:268 msgid "Growth (earth flower)" msgstr "Crecemento (flor de terra)" -#: src/object/bonus_block.cpp:207 +#: src/object/bonus_block.cpp:268 +msgid "Growth (retro)" +msgstr "Crecemento (retro)" + +#: src/object/bonus_block.cpp:268 src/object/powerup.cpp:66 msgid "Star" msgstr "Estrela" -#: src/object/bonus_block.cpp:207 +#: src/object/bonus_block.cpp:268 +msgid "Star (retro)" +msgstr "Estrela (retro)" + +#: src/object/bonus_block.cpp:268 msgid "Tux doll" msgstr "Boneca Tux" -#: src/object/bonus_block.cpp:207 +#: src/object/bonus_block.cpp:268 msgid "Custom" msgstr "Modificado" -#: src/object/bonus_block.cpp:207 +#: src/object/bonus_block.cpp:268 msgid "Light" msgstr "Luz" -#: src/object/bonus_block.cpp:208 src/object/trampoline.hpp:35 +#: src/object/bonus_block.cpp:268 +msgid "Light (On)" +msgstr "Luz (Acesa)" + +#: src/object/bonus_block.cpp:269 src/object/trampoline.hpp:37 msgid "Trampoline" msgstr "Trampolín" -#: src/object/bonus_block.cpp:208 +#: src/object/bonus_block.cpp:269 +msgid "Portable trampoline" +msgstr "Trampolín portátil" + +#: src/object/bonus_block.cpp:269 msgid "Coin rain" msgstr "Chuvia de moedas" -#: src/object/bonus_block.cpp:208 +#: src/object/bonus_block.cpp:269 msgid "Coin explosion" msgstr "Explosión de moedas" -#: src/object/bonus_block.cpp:212 +#: src/object/bonus_block.cpp:269 src/object/rock.hpp:43 +msgid "Rock" +msgstr "Pedra" + +#: src/object/bonus_block.cpp:269 +msgid "Potion" +msgstr "Bebedizo" + +#: src/object/bonus_block.cpp:275 msgid "Custom Content" msgstr "Contido Personalizado" -#: src/object/pneumatic_platform.hpp:62 +#: src/object/bonus_block.cpp:278 +msgid "Coin sprite" +msgstr "Fada da moeda" + +#: src/object/pneumatic_platform.hpp:65 msgid "Pneumatic Platform" msgstr "Plataforma Pneumática" -#: src/object/coin.cpp:264 src/object/tilemap.cpp:236 +#: src/object/coin.cpp:326 src/object/tilemap.cpp:287 msgid "Following path" msgstr "Seguir camiño" -#: src/object/coin.cpp:267 src/object/camera.cpp:215 -#: src/object/platform.cpp:66 src/object/tilemap.cpp:240 +#: src/object/coin.cpp:329 src/object/camera.cpp:171 +#: src/object/platform.cpp:77 src/object/tilemap.cpp:290 msgid "Path Mode" msgstr "Modo Camiño" -#: src/object/coin.cpp:270 src/object/coin.cpp:298 +#: src/object/coin.cpp:330 src/object/camera.cpp:172 +#: src/object/platform.cpp:78 src/object/tilemap.cpp:291 +#: src/badguy/willowisp.cpp:322 +msgid "Adapt Speed" +msgstr "Adaptar Velocidade" + +#: src/object/coin.cpp:331 src/object/platform.cpp:81 +#: src/object/tilemap.cpp:285 src/badguy/willowisp.cpp:318 +msgid "Starting Node" +msgstr "Nodo Inicial" + +#: src/object/coin.cpp:332 src/object/camera.cpp:173 +#: src/object/platform.cpp:82 src/object/tilemap.cpp:293 +#: src/badguy/willowisp.cpp:323 +msgid "Handle" +msgstr "Manexar" + +#: src/object/coin.cpp:335 src/object/coin.cpp:371 msgid "Collect script" msgstr "Script de recollida" -#: src/object/ghost_particle_system.hpp:36 +#: src/object/ghost_particle_system.hpp:37 msgid "Ghost Particles" msgstr "Partículas Pantasma" -#: src/object/camera.cpp:207 +#: src/object/camera.cpp:163 msgid "Mode" msgstr "Modo" -#: src/object/camera.cpp:208 +#: src/object/camera.cpp:164 msgid "normal" msgstr "normal" -#: src/object/camera.cpp:208 +#: src/object/camera.cpp:164 msgid "manual" msgstr "manual" -#: src/object/camera.cpp:208 +#: src/object/camera.cpp:164 msgid "autoscroll" msgstr "Desprazar automaticamente" -#: src/object/textscroller.cpp:280 src/object/music_object.cpp:109 -msgid "File" -msgstr "Ficheiro" +#: src/object/textscroller.cpp:349 +msgid "Finish Script" +msgstr "Script de Finalización" -#: src/object/spawnpoint.hpp:46 src/badguy/willowisp.cpp:281 -#: src/editor/worldmap_objects.cpp:173 +#: src/object/textscroller.cpp:351 +msgid "X-offset" +msgstr "Compensación en X" + +#: src/object/textscroller.cpp:352 +msgid "Controllable" +msgstr "Controlable" + +#: src/object/textscroller.cpp:354 src/object/textscroller.cpp:358 +msgid "Center" +msgstr "Centrado" + +#: src/object/textscroller.cpp:357 +msgid "Text Alignment" +msgstr "Aliñamento do Texto" + +#: src/object/lit_object.hpp:40 +msgid "Lit object" +msgstr "Obxecto iluminado" + +#: src/object/spawnpoint.hpp:48 src/badguy/willowisp.cpp:312 +#: src/worldmap/teleporter.cpp:48 msgid "Spawnpoint" msgstr "Punto de aparición" @@ -371,255 +589,396 @@ msgstr "Punto de aparición" msgid "Counter" msgstr "Contador" -#: src/object/candle.hpp:36 +#: src/object/candle.hpp:37 msgid "Candle" msgstr "Vela" -#: src/object/particlesystem.cpp:61 src/badguy/darttrap.cpp:127 -msgid "Enabled" -msgstr "Activado" +#: src/object/particlesystem.cpp:65 src/object/background.cpp:184 +#: src/object/thunderstorm.cpp:76 src/object/tilemap.cpp:277 +#: src/object/gradient.cpp:101 src/object/moving_sprite.cpp:193 +msgid "Z-pos" +msgstr "Posición-Z" -#: src/object/invisible_block.hpp:31 +#: src/object/invisible_block.hpp:30 msgid "Invisible Block" msgstr "Bloque Invisible" -#: src/object/snow_particle_system.hpp:35 +#: src/object/snow_particle_system.hpp:37 msgid "Snow Particles" msgstr "Partículas de Neve" -#: src/object/powerup.hpp:35 +#: src/object/powerup.hpp:40 msgid "Powerup" msgstr "Poderes Especiais" -#: src/object/level_time.hpp:55 -msgid "Time Limit" -msgstr "Límite de Tempo" +#: src/object/infoblock.cpp:78 +msgid "Front Color" +msgstr "Cor Dianteira" -#: src/object/ambient_sound.cpp:119 src/supertux/menu/options_menu.cpp:365 -#: data//credits.stxt:335 -msgid "Sound" -msgstr "Son" +#: src/object/infoblock.cpp:80 +msgid "Back Color" +msgstr "Cor do Fondo" -#: src/object/ambient_sound.cpp:120 -msgid "Distance factor" -msgstr "Factor de distancia" +#: src/object/infoblock.cpp:82 +msgid "Roundness" +msgstr "Redondez" -#: src/object/ambient_sound.cpp:121 -msgid "Distance bias" -msgstr "Marxe de distancia" +#: src/object/infoblock.cpp:84 +msgid "Fade Transition" +msgstr "Transición de fundido" -#: src/object/ambient_sound.cpp:122 -msgid "Volume" -msgstr "Volume" +#: src/object/fallblock.hpp:41 +msgid "Falling Platform" +msgstr "Plataforma que cae" + +#: src/object/level_time.hpp:56 +msgid "Time Limit" +msgstr "Límite de Tempo" + +#: src/object/ambient_sound.cpp:86 +msgid "Radius (in tiles)" +msgstr "Radio (en mosaicos)" #: src/object/torch.hpp:41 msgid "Torch" msgstr "Facho" -#: src/object/icecrusher.hpp:48 -msgid "Icecrusher" -msgstr "Rompexeos" +#: src/object/rublight.hpp:34 +msgid "Rublight" +msgstr "Luces de proximidade" -#: src/object/background.hpp:42 +#: src/object/background.hpp:45 msgid "Background" msgstr "Fondo" -#: src/object/firefly.hpp:36 +#: src/object/text_object.hpp:44 src/gui/menu_string_array.cpp:77 +msgid "Text" +msgstr "Texto" + +#: src/object/firefly.hpp:38 msgid "Checkpoint" msgstr "Punto de rescate" -#: src/object/ambient_light.hpp:36 +#: src/object/ambient_light.hpp:37 msgid "Ambient Light" msgstr "Luz Ambiental" -#: src/object/lantern.hpp:37 +#: src/object/lantern.hpp:38 msgid "Lantern" msgstr "Lanterna" -#: src/object/wind.hpp:40 +#: src/object/wind.hpp:43 msgid "Wind" msgstr "Vento" -#: src/object/bicycle_platform.cpp:190 +#: src/object/bicycle_platform.cpp:203 src/object/background.cpp:180 +#: src/object/pneumatic_platform.cpp:162 +#: src/supertux/menu/joystick_menu.cpp:172 src/supertux/moving_object.cpp:65 +#: src/worldmap/worldmap_object.cpp:77 +msgid "X" +msgstr "X" + +#: src/object/bicycle_platform.cpp:204 src/object/background.cpp:181 +#: src/object/pneumatic_platform.cpp:163 +#: src/supertux/menu/joystick_menu.cpp:174 src/supertux/moving_object.cpp:66 +#: src/worldmap/worldmap_object.cpp:78 +msgid "Y" +msgstr "Y" + +#: src/object/bicycle_platform.cpp:206 msgid "Platforms" msgstr "Plataformas" -#: src/object/bicycle_platform.cpp:191 src/badguy/flame.cpp:58 -#: src/badguy/crystallo.cpp:36 +#: src/object/bicycle_platform.cpp:207 src/object/circleplatform.cpp:57 +#: src/badguy/fish_swimming.cpp:76 src/badguy/flame.cpp:109 +#: src/badguy/rcrystallo.cpp:83 src/badguy/crystallo.cpp:50 msgid "Radius" msgstr "Raio" -#: src/object/bicycle_platform.cpp:192 +#: src/object/bicycle_platform.cpp:208 msgid "Momentum change rate" msgstr "Taxa de cambio do momento" -#: src/object/rain_particle_system.hpp:34 +#: src/object/rain_particle_system.hpp:41 msgid "Rain Particles" msgstr "Partículas de Choiva" -#: src/object/platform.hpp:45 +#: src/object/platform.hpp:46 msgid "Platform" msgstr "Plataforma" -#: src/object/rock.hpp:42 -msgid "Rock" -msgstr "Pedra" - -#: src/object/music_object.hpp:41 src/supertux/menu/options_menu.cpp:367 -#: data//credits.stxt:277 +#: src/object/music_object.hpp:42 src/supertux/menu/options_menu.cpp:130 +#: data//credits.stxt:309 msgid "Music" msgstr "Música" -#: src/object/rusty_trampoline.hpp:39 +#: src/object/lit_object.cpp:68 +msgid "Light sprite" +msgstr "sprite de luz" + +#: src/object/lit_object.cpp:71 +msgid "Sprite starting action" +msgstr "" + +#: src/object/lit_object.cpp:72 +msgid "Light sprite starting action" +msgstr "" + +#: src/object/lit_object.cpp:74 +msgid "Light sprite offset X" +msgstr "" + +#: src/object/lit_object.cpp:75 +msgid "Light sprite offset Y" +msgstr "" + +#: src/object/rusty_trampoline.hpp:40 msgid "Rusty Trampoline" msgstr "Trampolín Enferruxado" -#: src/object/particlesystem.hpp:57 +#: src/object/particlesystem.hpp:58 msgid "Particle system" msgstr "Sistema de Partículas" -#: src/object/candle.cpp:75 src/object/torch.cpp:90 +#: src/object/candle.cpp:73 src/object/torch.cpp:94 msgid "Burning" msgstr "Aceso" -#: src/object/candle.cpp:76 +#: src/object/candle.cpp:74 msgid "Flicker" msgstr "Intermitente" -#: src/object/text_array_object.hpp:50 +#: src/object/snow_particle_system.cpp:104 +msgid "Epsilon" +msgstr "" + +#: src/object/snow_particle_system.cpp:105 +msgid "Spin Speed" +msgstr "" + +#: src/object/snow_particle_system.cpp:106 +msgid "State Length" +msgstr "" + +#: src/object/snow_particle_system.cpp:107 +msgid "Wind Speed" +msgstr "" + +#: src/object/text_array_object.hpp:47 msgid "Text array" msgstr "Cadea de texto" -#: src/object/infoblock.hpp:36 +#: src/object/infoblock.hpp:37 msgid "Info Block" msgstr "Bloque de Información" -#: src/object/powerup.cpp:191 +#: src/object/powerup.cpp:61 +msgid "Egg" +msgstr "Ovo" + +#: src/object/powerup.cpp:62 +msgid "Fire Flower" +msgstr "" + +#: src/object/powerup.cpp:63 +msgid "Ice Flower" +msgstr "Flor de Xeo" + +#: src/object/powerup.cpp:64 +msgid "Air Flower" +msgstr "" + +#: src/object/powerup.cpp:65 +msgid "Earth Flower" +msgstr "" + +#: src/object/powerup.cpp:67 +msgid "Tux Doll" +msgstr "" + +#: src/object/powerup.cpp:68 +msgid "Flip Potion" +msgstr "" + +#: src/object/powerup.cpp:69 +msgid "Mints" +msgstr "" + +#: src/object/powerup.cpp:70 +msgid "Coffee" +msgstr "" + +#: src/object/powerup.cpp:71 +msgid "Herring" +msgstr "" + +#: src/object/powerup.cpp:302 msgid "Disable gravity" msgstr "Desactivar gravidade" -#: src/object/ambient_sound.hpp:62 +#: src/object/powerup.cpp:312 src/object/weak_block.cpp:266 +msgid "" +"Sprites no longer define the behaviour of the object.\n" +"Object types are used instead." +msgstr "" + +#: src/object/ambient_sound.hpp:43 msgid "Ambient Sound" msgstr "Son Ambiental" -#: src/object/level_time.cpp:51 src/supertux/statistics.cpp:288 -#: src/editor/node_marker.cpp:80 +#: src/object/level_time.cpp:52 src/supertux/statistics.cpp:297 +#: src/editor/node_marker.cpp:124 msgid "Time" msgstr "Tempo" -#: src/object/hurting_platform.hpp:30 +#: src/object/hurting_platform.hpp:31 msgid "Hurting Platform" msgstr "Serra" -#: src/object/background.cpp:163 +#: src/object/background.cpp:183 msgid "Fill" msgstr "Encher" -#: src/object/background.cpp:165 +#: src/object/background.cpp:185 msgid "Alignment" msgstr "Aliñamento" -#: src/object/background.cpp:166 +#: src/object/background.cpp:186 src/supertux/direction.cpp:61 msgid "none" msgstr "ningún" -#: src/object/background.cpp:166 src/editor/object_settings.cpp:112 +#: src/object/background.cpp:186 src/supertux/direction.cpp:63 msgid "left" msgstr "esquerda" -#: src/object/background.cpp:166 src/editor/object_settings.cpp:112 +#: src/object/background.cpp:186 src/supertux/direction.cpp:65 msgid "right" msgstr "dereita" -#: src/object/background.cpp:166 +#: src/object/background.cpp:186 msgid "top" msgstr "arriba" -#: src/object/background.cpp:166 +#: src/object/background.cpp:186 msgid "bottom" msgstr "fondo" -#: src/object/background.cpp:169 +#: src/object/background.cpp:189 msgid "Scroll offset x" msgstr "Desprazar compensación x" -#: src/object/background.cpp:170 +#: src/object/background.cpp:190 msgid "Scroll offset y" msgstr "Desprazar compensación y" -#: src/object/background.cpp:171 +#: src/object/background.cpp:191 msgid "Scroll speed x" msgstr "Desprazar velocidade x" -#: src/object/background.cpp:172 +#: src/object/background.cpp:192 msgid "Scroll speed y" msgstr "Desprazar velocidade y" -#: src/object/background.cpp:173 +#: src/object/background.cpp:193 msgid "Parallax Speed x" msgstr "Velocidade da Paralaxe x" -#: src/object/background.cpp:174 +#: src/object/background.cpp:194 msgid "Parallax Speed y" msgstr "Velocidade da Paralaxe y" -#: src/object/background.cpp:175 +#: src/object/background.cpp:195 msgid "Top image" msgstr "Imaxe superior" -#: src/object/background.cpp:176 +#: src/object/background.cpp:196 msgid "Image" msgstr "Imaxe" -#: src/object/background.cpp:177 +#: src/object/background.cpp:197 msgid "Bottom image" msgstr "Imaxe do fondo" -#: src/object/background.cpp:178 src/object/tilemap.cpp:228 -#: src/object/gradient.cpp:129 +#: src/object/background.cpp:198 +msgid "Colour" +msgstr "Color" + +#: src/object/background.cpp:199 src/object/tilemap.cpp:278 +#: src/object/gradient.cpp:108 msgid "Draw target" msgstr "Debuxar obxectivo" -#: src/object/background.cpp:179 src/object/tilemap.cpp:229 -#: src/object/gradient.cpp:130 -msgid "Normal" -msgstr "Normal" - -#: src/object/background.cpp:179 src/object/tilemap.cpp:229 -#: src/object/gradient.cpp:130 +#: src/object/background.cpp:200 src/object/tilemap.cpp:279 +#: src/object/gradient.cpp:109 msgid "Lightmap" msgstr "Mapa de Luz" -#: src/object/wind.cpp:63 +#: src/object/shard.hpp:35 +msgid "Shard" +msgstr "Fragmento" + +#: src/object/rublight.cpp:56 +msgid "Fading Speed" +msgstr "Velocidade de Esvaemento" + +#: src/object/rublight.cpp:57 +msgid "Glowing Strength" +msgstr "Forza do Brillo" + +#: src/object/wind.cpp:78 src/object/custom_particle_system.cpp:499 msgid "Speed X" msgstr "Velocidade X" -#: src/object/wind.cpp:64 +#: src/object/wind.cpp:79 src/object/custom_particle_system.cpp:500 msgid "Speed Y" msgstr "Velocidade Y" -#: src/object/wind.cpp:65 +#: src/object/wind.cpp:80 msgid "Acceleration" msgstr "Aceleración" -#: src/object/wind.cpp:66 +#: src/object/wind.cpp:81 msgid "Blowing" msgstr "Soplar" -#: src/object/bicycle_platform.hpp:64 +#: src/object/wind.cpp:82 +msgid "Affects Badguys" +msgstr "Afecta ós Tipos Malos" + +#: src/object/wind.cpp:83 +msgid "Affects Objects" +msgstr "Afecta ós Obxectos" + +#: src/object/wind.cpp:84 +msgid "Affects Player" +msgstr "Afecta ó Xogador" + +#: src/object/wind.cpp:85 +msgid "Fancy Particles" +msgstr "Partículas Extravagantes" + +#: src/object/bicycle_platform.hpp:67 msgid "Bicycle Platform" msgstr "Plataforma Móbil" -#: src/object/platform.cpp:67 src/object/thunderstorm.cpp:69 -#: src/object/tilemap.cpp:241 +#: src/object/platform.cpp:80 src/object/thunderstorm.cpp:77 +#: src/object/tilemap.cpp:292 src/object/conveyor_belt.cpp:62 msgid "Running" msgstr "Correr" -#: src/object/rock.cpp:182 +#: src/object/rock.cpp:71 +msgid "Small" +msgstr "Pequeno" + +#: src/object/rock.cpp:72 +msgid "Large" +msgstr "Grande" + +#: src/object/rock.cpp:234 msgid "On-grab script" msgstr "Script de agarrar" -#: src/object/rock.cpp:183 +#: src/object/rock.cpp:235 msgid "On-ungrab script" msgstr "Script de soltar" @@ -627,803 +986,1713 @@ msgstr "Script de soltar" msgid "Interactive particle system" msgstr "Sistema interactivo de partículas" -#: src/object/thunderstorm.cpp:70 +#: src/object/thunderstorm.cpp:78 msgid "Interval" msgstr "Intervalo" -#: src/object/thunderstorm.cpp:71 +#: src/object/thunderstorm.cpp:79 msgid "Strike Script" msgstr "Script de Golpear" -#: src/object/cloud_particle_system.hpp:36 +#: src/object/cloud_particle_system.hpp:42 msgid "Cloud Particles" msgstr "Partículas de Nube" -#: src/object/ispy.hpp:33 +#: src/object/custom_particle_system.cpp:423 +msgid "Texture" +msgstr "Textura" + +#: src/object/custom_particle_system.cpp:425 +msgid "Amount" +msgstr "Cantidade" + +#: src/object/custom_particle_system.cpp:426 src/object/circleplatform.cpp:59 +#: src/editor/particle_editor.cpp:141 +msgid "Delay" +msgstr "Retardo" + +#: src/object/custom_particle_system.cpp:427 +msgid "Lifetime" +msgstr "Duración" + +#: src/object/custom_particle_system.cpp:428 +msgid "Lifetime variation" +msgstr "Variación da duración" + +#: src/object/custom_particle_system.cpp:429 +#: src/editor/particle_editor.cpp:164 +msgid "Birth mode" +msgstr "Modo de creación" + +#: src/object/custom_particle_system.cpp:430 +#: src/object/custom_particle_system.cpp:465 src/object/gradient.cpp:115 +#: src/gui/menu_string_array.cpp:40 src/gui/menu_string_array.cpp:78 +#: src/supertux/menu/keyboard_menu.cpp:80 +#: src/supertux/menu/joystick_menu.cpp:108 +#: src/supertux/menu/joystick_menu.cpp:215 src/editor/object_settings.cpp:129 +#: src/editor/particle_editor.cpp:162 src/editor/particle_editor.cpp:168 +msgid "None" +msgstr "Ningún" + +#: src/object/custom_particle_system.cpp:430 +#: src/object/custom_particle_system.cpp:465 +#: src/editor/particle_editor.cpp:166 +msgid "Shrink" +msgstr "Encoller" + +#: src/object/custom_particle_system.cpp:434 +#: src/editor/particle_editor.cpp:172 +msgid "Birth easing" +msgstr "Animación ao crearse" + +#: src/object/custom_particle_system.cpp:436 +#: src/object/custom_particle_system.cpp:471 src/editor/node_marker.cpp:129 +msgid "No easing" +msgstr "Sen transición" + +#: src/object/custom_particle_system.cpp:437 +#: src/object/custom_particle_system.cpp:472 src/editor/node_marker.cpp:130 +msgid "Quad in" +msgstr "Principio cuádruplo" + +#: src/object/custom_particle_system.cpp:437 +#: src/object/custom_particle_system.cpp:472 src/editor/node_marker.cpp:130 +msgid "Quad out" +msgstr "Final cuádruplo" + +#: src/object/custom_particle_system.cpp:437 +#: src/object/custom_particle_system.cpp:472 src/editor/node_marker.cpp:130 +msgid "Quad in/out" +msgstr "Principio/Fin cuádruplo" + +#: src/object/custom_particle_system.cpp:438 +#: src/object/custom_particle_system.cpp:473 src/editor/node_marker.cpp:131 +msgid "Cubic in" +msgstr "Principio cúbico" + +#: src/object/custom_particle_system.cpp:438 +#: src/object/custom_particle_system.cpp:473 src/editor/node_marker.cpp:131 +msgid "Cubic out" +msgstr "Final cúbico" + +#: src/object/custom_particle_system.cpp:438 +#: src/object/custom_particle_system.cpp:473 src/editor/node_marker.cpp:131 +msgid "Cubic in/out" +msgstr "Principio/Fin cúbico" + +#: src/object/custom_particle_system.cpp:439 +#: src/object/custom_particle_system.cpp:474 src/editor/node_marker.cpp:132 +msgid "Quart in" +msgstr "Principio dun cuarto" + +#: src/object/custom_particle_system.cpp:439 +#: src/object/custom_particle_system.cpp:474 src/editor/node_marker.cpp:132 +msgid "Quart out" +msgstr "Final dun cuarto" + +#: src/object/custom_particle_system.cpp:439 +#: src/object/custom_particle_system.cpp:474 src/editor/node_marker.cpp:132 +msgid "Quart in/out" +msgstr "Principio/Fin dun cuarto" + +#: src/object/custom_particle_system.cpp:440 +#: src/object/custom_particle_system.cpp:475 src/editor/node_marker.cpp:133 +msgid "Quint in" +msgstr "Principio quíntuplo" + +#: src/object/custom_particle_system.cpp:440 +#: src/object/custom_particle_system.cpp:475 src/editor/node_marker.cpp:133 +msgid "Quint out" +msgstr "Final quíntuplo" + +#: src/object/custom_particle_system.cpp:440 +#: src/object/custom_particle_system.cpp:475 src/editor/node_marker.cpp:133 +msgid "Quint in/out" +msgstr "Principio/Fin quíntuplo" + +#: src/object/custom_particle_system.cpp:441 +#: src/object/custom_particle_system.cpp:476 src/editor/node_marker.cpp:134 +msgid "Sine in" +msgstr "Principio sinusoidal" + +#: src/object/custom_particle_system.cpp:441 +#: src/object/custom_particle_system.cpp:476 src/editor/node_marker.cpp:134 +msgid "Sine out" +msgstr "Final sinusoidal" + +#: src/object/custom_particle_system.cpp:441 +#: src/object/custom_particle_system.cpp:476 src/editor/node_marker.cpp:134 +msgid "Sine in/out" +msgstr "Principio/Fin sinusoidal" + +#: src/object/custom_particle_system.cpp:442 +#: src/object/custom_particle_system.cpp:477 src/editor/node_marker.cpp:135 +msgid "Circular in" +msgstr "Principio circular" + +#: src/object/custom_particle_system.cpp:442 +#: src/object/custom_particle_system.cpp:477 src/editor/node_marker.cpp:135 +msgid "Circular out" +msgstr "Final Circular" + +#: src/object/custom_particle_system.cpp:442 +#: src/object/custom_particle_system.cpp:477 src/editor/node_marker.cpp:135 +msgid "Circular in/out" +msgstr "Principio/Fin circular" + +#: src/object/custom_particle_system.cpp:443 +#: src/object/custom_particle_system.cpp:478 src/editor/node_marker.cpp:136 +msgid "Exponential in" +msgstr "Principio exponencial" + +#: src/object/custom_particle_system.cpp:443 +#: src/object/custom_particle_system.cpp:478 src/editor/node_marker.cpp:136 +msgid "Exponential out" +msgstr "Final exponencial" + +#: src/object/custom_particle_system.cpp:443 +#: src/object/custom_particle_system.cpp:478 src/editor/node_marker.cpp:136 +msgid "Exponential in/out" +msgstr "Principio/Fin exponencial" + +#: src/object/custom_particle_system.cpp:444 +#: src/object/custom_particle_system.cpp:479 src/editor/node_marker.cpp:137 +msgid "Elastic in" +msgstr "Principio elástico" + +#: src/object/custom_particle_system.cpp:444 +#: src/object/custom_particle_system.cpp:479 src/editor/node_marker.cpp:137 +msgid "Elastic out" +msgstr "Final elástico" + +#: src/object/custom_particle_system.cpp:444 +#: src/object/custom_particle_system.cpp:479 src/editor/node_marker.cpp:137 +msgid "Elastic in/out" +msgstr "Principio/Fin elástico" + +#: src/object/custom_particle_system.cpp:445 +#: src/object/custom_particle_system.cpp:480 src/editor/node_marker.cpp:138 +msgid "Back in" +msgstr "Principio de retorno" + +#: src/object/custom_particle_system.cpp:445 +#: src/object/custom_particle_system.cpp:480 src/editor/node_marker.cpp:138 +msgid "Back out" +msgstr "Final de retorno" + +#: src/object/custom_particle_system.cpp:445 +#: src/object/custom_particle_system.cpp:480 src/editor/node_marker.cpp:138 +msgid "Back in/out" +msgstr "Principio/Fin de retorno" + +#: src/object/custom_particle_system.cpp:446 +#: src/object/custom_particle_system.cpp:481 src/editor/node_marker.cpp:139 +msgid "Bounce in" +msgstr "Principio do rebote" + +#: src/object/custom_particle_system.cpp:446 +#: src/object/custom_particle_system.cpp:481 src/editor/node_marker.cpp:139 +msgid "Bounce out" +msgstr "Final do rebote" + +#: src/object/custom_particle_system.cpp:446 +#: src/object/custom_particle_system.cpp:481 src/editor/node_marker.cpp:139 +msgid "Bounce in/out" +msgstr "Principio/Fin do rebote" + +#: src/object/custom_particle_system.cpp:462 +msgid "Birth time" +msgstr "Tempo de creación" + +#: src/object/custom_particle_system.cpp:463 +msgid "Birth time variation" +msgstr "Variación do tempo da creación" + +#: src/object/custom_particle_system.cpp:464 +#: src/editor/particle_editor.cpp:170 +msgid "Death mode" +msgstr "Modo da morte" + +#: src/object/custom_particle_system.cpp:469 +#: src/editor/particle_editor.cpp:173 +msgid "Death easing" +msgstr "Animación ao eliminarse" + +#: src/object/custom_particle_system.cpp:497 +msgid "Death time" +msgstr "Tempo da morte" + +#: src/object/custom_particle_system.cpp:498 +msgid "Death time variation" +msgstr "Variación do tempo da morte" + +#: src/object/custom_particle_system.cpp:501 +msgid "Speed X (variation)" +msgstr "Velocidade en X (variación)" + +#: src/object/custom_particle_system.cpp:502 +msgid "Speed Y (variation)" +msgstr "Velocidade en Y (variación)" + +#: src/object/custom_particle_system.cpp:503 +msgid "Acceleration X" +msgstr "Aceleración X" + +#: src/object/custom_particle_system.cpp:504 +msgid "Acceleration Y" +msgstr "Aceleración Y" + +#: src/object/custom_particle_system.cpp:505 +msgid "Friction X" +msgstr "Fricción en X" + +#: src/object/custom_particle_system.cpp:506 +msgid "Friction Y" +msgstr "Fricción en Y" + +#: src/object/custom_particle_system.cpp:507 +#: src/editor/particle_editor.cpp:189 +msgid "Feather factor" +msgstr "Factor pluma" + +#: src/object/custom_particle_system.cpp:508 +msgid "Rotation" +msgstr "Rotación" + +#: src/object/custom_particle_system.cpp:509 +msgid "Rotation (variation)" +msgstr "Rotación (variación)" + +#: src/object/custom_particle_system.cpp:510 +#: src/editor/particle_editor.cpp:195 +msgid "Rotation speed" +msgstr "Velocidade da rotación" + +#: src/object/custom_particle_system.cpp:511 +msgid "Rotation speed (variation)" +msgstr "Velocidade da rotación (variación)" + +#: src/object/custom_particle_system.cpp:512 +#: src/editor/particle_editor.cpp:200 +msgid "Rotation acceleration" +msgstr "Aceleración da rotación" + +#: src/object/custom_particle_system.cpp:513 +msgid "Rotation friction" +msgstr "Fricción da rotación" + +#: src/object/custom_particle_system.cpp:514 +#: src/editor/particle_editor.cpp:208 +msgid "Rotation mode" +msgstr "Modo da rotación" + +#: src/object/custom_particle_system.cpp:515 +#: src/editor/particle_editor.cpp:206 +msgid "Fixed" +msgstr "Fixado" + +#: src/object/custom_particle_system.cpp:515 +#: src/editor/particle_editor.cpp:205 +msgid "Facing" +msgstr "Mirando para" + +#: src/object/custom_particle_system.cpp:515 +#: src/editor/particle_editor.cpp:204 +msgid "Wiggling" +msgstr "Menear" + +#: src/object/custom_particle_system.cpp:519 +#: src/editor/particle_editor.cpp:219 +msgid "Collision mode" +msgstr "Modo da colisión" + +#: src/object/custom_particle_system.cpp:520 +msgid "None (pass through)" +msgstr "Ningún (deixar estar)" + +#: src/object/custom_particle_system.cpp:520 +msgid "Stick" +msgstr "Plantarse" + +#: src/object/custom_particle_system.cpp:520 +msgid "Stick Forever" +msgstr "Plantarse para Sempre" + +#: src/object/custom_particle_system.cpp:520 +#: src/editor/particle_editor.cpp:214 +msgid "Bounce (heavy)" +msgstr "Rebote (grande)" + +#: src/object/custom_particle_system.cpp:520 +#: src/editor/particle_editor.cpp:213 +msgid "Bounce (light)" +msgstr "Rebote (pequeno)" + +#: src/object/custom_particle_system.cpp:520 +msgid "Kill particle" +msgstr "Matar partícula" + +#: src/object/custom_particle_system.cpp:520 +msgid "Fade out particle" +msgstr "Esvaer partícula" + +#: src/object/custom_particle_system.cpp:524 +msgid "Delete if off-screen" +msgstr "Eliminar ó saír da pantalla" + +#: src/object/custom_particle_system.cpp:525 +#: src/editor/particle_editor.cpp:224 +msgid "Never" +msgstr "Nunca" + +#: src/object/custom_particle_system.cpp:525 +#: src/editor/particle_editor.cpp:223 +msgid "Only on exit" +msgstr "Só ó saír" + +#: src/object/custom_particle_system.cpp:525 +msgid "Always" +msgstr "Sempre" + +#: src/object/custom_particle_system.cpp:529 +msgid "Cover screen" +msgstr "Cubrir pantalla" + +#: src/object/ispy.hpp:35 msgid "Ispy" msgstr "Semáforo" -#: src/object/skull_tile.hpp:31 -msgid "Skull Tile" -msgstr "Tesela de Caveira" +#: src/object/particle_zone.cpp:51 +msgid "Particle Name" +msgstr "Nome da Partícula" + +#: src/object/particle_zone.cpp:62 +msgid "Spawn" +msgstr "Aparecer" + +#: src/object/particle_zone.cpp:63 +msgid "Life zone" +msgstr "Zona de vida" + +#: src/object/particle_zone.cpp:64 +msgid "Life zone (clear)" +msgstr "Zona de vida (limpar)" + +#: src/object/particle_zone.cpp:65 +msgid "Kill particles" +msgstr "Matar partículas" -#: src/object/weak_block.cpp:211 -msgid "Linked" -msgstr "Ligado" +#: src/object/particle_zone.cpp:66 +msgid "Clear particles" +msgstr "Limpar partículas" -#: src/object/decal.hpp:34 +#: src/object/weak_block.cpp:98 +msgid "Hay" +msgstr "" + +#: src/object/decal.hpp:41 msgid "Decal" msgstr "Taboleiro" -#: src/object/tilemap.cpp:217 +#: src/object/tilemap.cpp:267 msgid "Resize offset x" msgstr "Cambiar tamaño da compensación x" -#: src/object/tilemap.cpp:218 +#: src/object/tilemap.cpp:268 msgid "Resize offset y" msgstr "Cambiar tamaño da compensación y" -#: src/object/tilemap.cpp:223 +#: src/object/tilemap.cpp:270 src/supertux/menu/editor_sector_menu.cpp:41 +#: src/editor/object_option.cpp:178 +msgid "Width" +msgstr "Ancho" + +#: src/object/tilemap.cpp:271 src/supertux/menu/editor_sector_menu.cpp:42 +#: src/editor/object_option.cpp:179 +msgid "Height" +msgstr "Alto" + +#: src/object/tilemap.cpp:273 msgid "Alpha" msgstr "Alfa" -#: src/object/tilemap.cpp:224 +#: src/object/tilemap.cpp:274 msgid "Speed x" msgstr "Velocidade x" -#: src/object/tilemap.cpp:225 +#: src/object/tilemap.cpp:275 msgid "Speed y" msgstr "Velocidade y" -#: src/object/tilemap.cpp:226 +#: src/object/tilemap.cpp:276 msgid "Tint" msgstr "Tonalidade" -#: src/object/tilemap.cpp:244 src/supertux/menu/editor_tilegroup_menu.cpp:26 -#: src/editor/toolbox_widget.cpp:90 +#: src/object/tilemap.cpp:296 src/supertux/menu/editor_tilegroup_menu.cpp:26 +#: src/editor/toolbox_widget.cpp:98 msgid "Tiles" msgstr "Tesela" -#: src/object/gradient.cpp:115 -msgid "Left Colour" -msgstr "Cor Esquerda" - -#: src/object/gradient.cpp:116 -msgid "Right Colour" -msgstr "Cor Dereita" +#: src/object/gradient.cpp:98 +msgid "Primary Colour" +msgstr "Cor Primaria" -#: src/object/gradient.cpp:118 -msgid "Top Colour" -msgstr "Cor de Arriba" - -#: src/object/gradient.cpp:119 -msgid "Bottom Colour" -msgstr "Cor do Fondo" +#: src/object/gradient.cpp:99 +msgid "Secondary Colour" +msgstr "Cor Secundaria" -#: src/object/gradient.cpp:125 +#: src/object/gradient.cpp:104 msgid "Vertical" msgstr "Vertical" -#: src/object/gradient.cpp:125 +#: src/object/gradient.cpp:104 msgid "Horizontal" msgstr "Horizontal" -#: src/object/gradient.cpp:125 +#: src/object/gradient.cpp:104 msgid "Vertical (whole sector)" msgstr "Vertical (sector completo)" -#: src/object/gradient.cpp:125 +#: src/object/gradient.cpp:104 msgid "Horizontal (whole sector)" msgstr "Horizontal (sector completo)" -#: src/object/gradient.cpp:135 +#: src/object/gradient.cpp:114 msgid "Blend mode" msgstr "Modo de fusión" -#: src/object/gradient.cpp:136 +#: src/object/gradient.cpp:115 msgid "Blend" msgstr "Fusión" -#: src/object/gradient.cpp:136 +#: src/object/gradient.cpp:115 msgid "Additive" msgstr "Aditivo" -#: src/object/gradient.cpp:136 +#: src/object/gradient.cpp:115 msgid "Modulate" msgstr "Modulado" -#: src/object/gradient.cpp:136 src/supertux/menu/keyboard_menu.cpp:60 -#: src/supertux/menu/joystick_menu.cpp:106 -#: src/supertux/menu/joystick_menu.cpp:213 src/editor/object_settings.cpp:124 -msgid "None" -msgstr "Ningún" +#: src/object/bumper.hpp:38 +msgid "Bumper" +msgstr "Parachoques" + +#: src/object/conveyor_belt.cpp:63 +msgid "Length" +msgstr "Lonxitude" + +#: src/object/moving_sprite.cpp:192 src/object/pneumatic_platform.cpp:161 +msgid "Sprite" +msgstr "Fada" -#: src/object/unstable_tile.hpp:34 +#: src/object/unstable_tile.hpp:42 msgid "Unstable Tile" msgstr "Tesela Inestable" -#: src/object/brick.hpp:31 -msgid "Brick" -msgstr "Ladrillo" +#: src/object/brick.hpp:70 +msgid "Heavy Brick" +msgstr "" -#: src/object/invisible_wall.hpp:34 +#: src/object/invisible_wall.hpp:37 msgid "Invisible Wall" msgstr "Muro Invisible" -#: src/object/spotlight.hpp:38 +#: src/object/spotlight.hpp:52 msgid "Spotlight" msgstr "Punto de Luz" -#: src/object/scripted_object.hpp:39 +#: src/object/scripted_object.hpp:40 msgid "Scripted Object" msgstr "Obxecto de Script" -#: src/object/coin.hpp:75 +#: src/object/custom_particle_system_file.hpp:40 +msgid "Custom Particles from file" +msgstr "Partículas Personalizados dende ficheiro" + +#: src/object/coin.hpp:97 msgid "Heavy Coin" msgstr "Moeda Pesada" -#: src/object/bonus_block.hpp:55 +#: src/object/explosion.hpp:35 +msgid "Explosion" +msgstr "Explosión" + +#: src/object/bonus_block.hpp:62 msgid "Bonus Block" msgstr "Bloque de Bono" -#: src/object/magicblock.hpp:41 +#: src/object/magicblock.hpp:42 msgid "Magic Tile" msgstr "Tesela Máxica" -#: src/object/camera.hpp:67 +#: src/object/camera.hpp:61 msgid "Camera" msgstr "Cámara" -#: src/object/textscroller.hpp:44 -msgid "TextScroller" -msgstr "Desprazamento do Texto" +#: src/object/textscroller.hpp:45 +msgid "Text Scroller" +msgstr "Texto Móbil" + +#: src/gui/notification.cpp:57 +msgid "Click for more details." +msgstr "Fai clic para máis detalles." + +#: src/gui/notification.cpp:150 +msgid "Do not show again" +msgstr "Non volver a amosar" -#: src/gui/menu_badguy_select.cpp:93 -msgid "List of enemies" -msgstr "Lista de inimigos" +#: src/gui/notification.cpp:157 src/supertux/menu/download_dialog.cpp:124 +msgid "Close" +msgstr "Pechar" + +#: src/gui/menu_string_array.cpp:40 src/gui/menu_string_array.cpp:78 +#, c++-format +msgid "Selected item: {}" +msgstr "" -#: src/gui/menu_badguy_select.cpp:95 -msgid "Enemy" -msgstr "Inimigo" +#: src/gui/menu_string_array.cpp:70 +msgid "Edit string array" +msgstr "" -#: src/gui/menu_badguy_select.cpp:96 +#: src/gui/menu_string_array.cpp:79 src/gui/menu_object_select.cpp:50 +#: src/supertux/menu/profile_menu.cpp:88 msgid "Add" msgstr "Engadir" -#: src/gui/menu_badguy_select.cpp:106 src/gui/menu_color.cpp:34 -#: src/gui/dialog.hpp:80 src/gui/menu_script.cpp:47 -#: src/supertux/menu/editor_sector_menu.cpp:46 -#: src/supertux/menu/editor_levelset_menu.cpp:62 -#: src/supertux/menu/addon_menu.cpp:349 +#: src/gui/menu_string_array.cpp:80 +msgid "Insert" +msgstr "" + +#: src/gui/menu_string_array.cpp:81 +#: src/supertux/menu/addon_preview_menu.cpp:177 src/editor/object_menu.cpp:61 +msgid "Update" +msgstr "" + +#: src/gui/menu_string_array.cpp:82 src/supertux/menu/profile_menu.cpp:108 +#: src/supertux/menu/profile_menu.cpp:110 +msgid "Delete" +msgstr "" + +#: src/gui/menu_string_array.cpp:84 src/gui/menu_object_select.cpp:61 +#: src/gui/menu_color.cpp:37 src/gui/dialog.hpp:87 src/gui/menu_script.cpp:46 +#: src/supertux/menu/editor_sector_menu.cpp:48 +#: src/supertux/menu/editor_levelset_menu.cpp:58 #: src/supertux/menu/editor_new_levelset_menu.cpp:37 -#: src/supertux/menu/editor_level_menu.cpp:44 src/editor/object_menu.cpp:43 +#: src/supertux/menu/editor_level_menu.cpp:45 src/editor/object_menu.cpp:71 msgid "OK" msgstr "OK" -#: src/gui/menu_badguy_select.cpp:135 -msgid "Do you want to delete this badguy from the list?" -msgstr "Queres eliminar a este tipo malo da lista?" +#: src/gui/menu_object_select.cpp:46 +msgid "List of objects" +msgstr "" -#: src/gui/menu_badguy_select.cpp:136 src/gui/dialog.hpp:89 -#: src/supertux/menu/editor_menu.cpp:123 src/editor/editor.cpp:478 -msgid "Yes" -msgstr "Si" +#: src/gui/menu_object_select.cpp:48 +#, c++-format +msgid "Select object ({})" +msgstr "" -#: src/gui/menu_badguy_select.cpp:139 src/gui/dialog.hpp:90 -#: src/supertux/menu/editor_menu.cpp:126 src/editor/editor.cpp:485 -msgid "No" -msgstr "Non" +#: src/gui/menu_object_select.cpp:114 +msgid "Are you sure you want to remove this object from the list?" +msgstr "" #: src/gui/menu_color.cpp:24 msgid "Mix the colour" msgstr "Mesturar a cor" -#: src/gui/menu_filesystem.cpp:111 +#: src/gui/dialog.hpp:96 src/supertux/menu/editor_level_select_menu.cpp:181 +#: src/editor/editor.cpp:663 +msgid "Yes" +msgstr "Si" + +#: src/gui/dialog.hpp:97 src/supertux/menu/editor_level_select_menu.cpp:185 +#: src/editor/particle_editor.cpp:781 src/editor/editor.cpp:670 +msgid "No" +msgstr "Non" + +#: src/gui/menu_list.cpp:38 src/gui/menu_filesystem.cpp:120 +#: src/gui/menu_paths.cpp:48 src/supertux/menu/particle_editor_save_as.cpp:42 #: src/supertux/menu/editor_sectors_menu.cpp:45 -#: src/supertux/menu/editor_sectors_menu.cpp:95 -#: src/supertux/menu/editor_sectors_menu.cpp:100 +#: src/supertux/menu/editor_sectors_menu.cpp:94 +#: src/supertux/menu/editor_sectors_menu.cpp:99 #: src/supertux/menu/editor_objectgroup_menu.cpp:42 -#: src/supertux/menu/editor_tilegroup_menu.cpp:36 src/editor/editor.cpp:489 +#: src/supertux/menu/editor_tilegroup_menu.cpp:36 +#: src/supertux/menu/editor_level_select_menu.cpp:190 +#: src/supertux/menu/editor_save_as.cpp:42 +#: src/supertux/menu/particle_editor_open.cpp:43 +#: src/editor/particle_editor.cpp:785 src/editor/editor.cpp:674 msgid "Cancel" msgstr "Cancelar" +#: src/gui/menu_filesystem.cpp:118 +msgid "Open Directory" +msgstr "" + #: src/gui/menu_script.cpp:28 msgid "Edit script" msgstr "Editar script" -#: src/badguy/toad.hpp:37 +#: src/gui/menu_paths.cpp:32 +msgid "Clone" +msgstr "Clonar" + +#: src/gui/menu_paths.cpp:41 +msgid "" +"An error occurred and the game could\n" +"not clone the path. Please contact\n" +"the developers for support." +msgstr "" + +#: src/gui/menu_paths.cpp:44 +msgid "Bind" +msgstr "Enlazar" + +#: src/gui/menu_paths.cpp:49 +msgid "" +"Do you wish to clone the path to edit it separately,\n" +"or do you want to bind both paths together\n" +"so that any edit on one edits the other?" +msgstr "" + +#: src/gui/menu_paths.cpp:56 +#, c++-format +msgid "Path {}" +msgstr "" + +#: src/gui/menu_paths.cpp:67 src/supertux/menu/integrations_menu.cpp:60 +#: src/supertux/menu/editor_converters_menu.cpp:79 +#: src/supertux/menu/video_system_menu.cpp:45 +#: src/supertux/menu/contrib_menu.cpp:102 src/supertux/menu/debug_menu.cpp:77 +#: src/supertux/menu/multiplayer_menu.cpp:39 +#: src/supertux/menu/custom_menu_menu.cpp:65 +#: src/supertux/menu/editor_level_select_menu.cpp:98 +#: src/supertux/menu/worldmap_cheat_apply_menu.cpp:42 +#: src/supertux/menu/worldmap_cheat_apply_menu.cpp:63 +#: src/supertux/menu/worldmap_cheat_menu.cpp:57 +#: src/supertux/menu/worldmap_cheat_menu.cpp:196 +#: src/supertux/menu/editor_levelset_select_menu.cpp:114 +#: src/supertux/menu/options_menu.cpp:223 +#: src/supertux/menu/editor_delete_levelset_menu.cpp:69 +#: src/supertux/menu/addon_preview_menu.cpp:193 +#: src/supertux/menu/profile_menu.cpp:118 +#: src/supertux/menu/multiplayer_players_menu.cpp:91 +#: src/supertux/menu/addon_menu.cpp:153 +#: src/supertux/menu/editor_new_levelset_menu.cpp:40 +#: src/supertux/menu/options_select_menu.cpp:44 +#: src/supertux/menu/world_set_menu.cpp:33 +#: src/supertux/menu/addon_browse_menu.cpp:162 +#: src/supertux/menu/web_asset_menu.cpp:48 +#: src/supertux/menu/profile_name_menu.cpp:45 +#: src/supertux/menu/keyboard_menu.cpp:71 +#: src/supertux/menu/sorted_contrib_menu.cpp:51 +#: src/supertux/menu/language_menu.cpp:63 +#: src/supertux/menu/joystick_menu.cpp:99 +#: src/supertux/menu/contrib_levelset_menu.cpp:67 +#: src/supertux/menu/cheat_menu.cpp:58 +#: src/supertux/menu/addon_file_install_menu.cpp:36 +#: src/supertux/menu/cheat_apply_menu.cpp:43 +#: src/supertux/menu/cheat_apply_menu.cpp:63 +#: src/supertux/menu/multiplayer_player_menu.cpp:205 +#: src/supertux/menu/editor_delete_level_menu.cpp:68 +msgid "Back" +msgstr "Atrás" + +#: src/addon/addon_manager.cpp:562 +msgid "Only one resource pack is allowed to be enabled at a time." +msgstr "" + +#: src/addon/addon_manager.cpp:837 +#, c++-format +msgid "Add-on {} by {} is already installed." +msgstr "" + +#: src/addon/addon_manager.cpp:857 +#, c++-format +msgid "Add-on {} by {} successfully installed." +msgstr "" + +#: src/addon/addon.cpp:71 src/supertux/menu/editor_levelset_menu.cpp:54 +msgid "Levelset" +msgstr "Conxunto de niveis" + +#: src/addon/addon.cpp:74 src/supertux/menu/editor_levelset_menu.cpp:54 +#: data//images/engine/editor/objects.stoi:389 +msgid "Worldmap" +msgstr "Mapa Principal" + +#: src/addon/addon.cpp:77 +msgid "World" +msgstr "Mundo" + +#: src/addon/addon.cpp:80 +msgid "Add-on" +msgstr "Complemento" + +#: src/addon/addon.cpp:83 +msgid "Language Pack" +msgstr "" + +#: src/addon/addon.cpp:86 +msgid "Resource Pack" +msgstr "" + +#: src/addon/addon.cpp:89 +msgid "Unknown" +msgstr "Descoñecido" + +#: src/addon/addon.cpp:100 +#, c++-format +msgid "{} \"{}\" by \"{}\"" +msgstr "" + +#: src/addon/addon.cpp:114 +msgid "add-on" +msgstr "" + +#: src/addon/addon.cpp:114 +msgid "add-ons" +msgstr "" + +#: src/badguy/toad.hpp:38 msgid "Toad" msgstr "Sapo" -#: src/badguy/mrtree.hpp:29 -msgid "Walking Tree" -msgstr "Árbore Andante" +#: src/badguy/mrtree.hpp:32 +msgid "Mr. Tree" +msgstr "" -#: src/badguy/plant.hpp:33 +#: src/badguy/plant.hpp:34 msgid "Plant" msgstr "Planta" -#: src/badguy/crystallo.hpp:30 +#: src/badguy/tarantula.hpp:39 src/badguy/tarantula.cpp:353 +msgid "Tarantula" +msgstr "" + +#: src/badguy/granito_giant.cpp:71 +msgid "Awake" +msgstr "" + +#: src/badguy/granito_giant.cpp:72 +msgid "Sleeping" +msgstr "" + +#: src/badguy/granito_giant.cpp:73 +msgid "Corrupted A" +msgstr "" + +#: src/badguy/granito_giant.cpp:74 +msgid "Corrupted B" +msgstr "" + +#: src/badguy/granito_giant.cpp:75 +msgid "Corrupted C" +msgstr "" + +#: src/badguy/crystallo.hpp:33 msgid "Crystallo" msgstr "Cristaliño" -#: src/badguy/totem.hpp:36 +#: src/badguy/viciousivy.cpp:45 src/badguy/snail.cpp:70 +#: src/badguy/kamikazesnowball.cpp:118 src/badguy/walkingleaf.cpp:36 +#: src/badguy/jumpy.cpp:46 src/badguy/igel.cpp:189 src/badguy/mrtree.cpp:51 +msgid "Corrupted" +msgstr "" + +#: src/badguy/totem.hpp:37 msgid "Totem" msgstr "Totem" -#: src/badguy/stalactite.hpp:38 +#: src/badguy/stalactite.hpp:42 msgid "Stalactite" msgstr "Estalactita" -#: src/badguy/haywire.hpp:42 +#: src/badguy/fish_chasing.cpp:198 +msgid "Tracking Distance" +msgstr "" + +#: src/badguy/fish_chasing.cpp:199 +msgid "Losing Distance" +msgstr "" + +#: src/badguy/fish_chasing.cpp:200 +msgid "Chase Speed" +msgstr "" + +#: src/badguy/root_sapling.hpp:41 +msgid "Root Sapling" +msgstr "" + +#: src/badguy/haywire.hpp:46 msgid "Haywire" msgstr "Bule bule" -#: src/badguy/dispenser.hpp:48 +#: src/badguy/dispenser.hpp:52 msgid "Dispenser" msgstr "Dispensador" -#: src/badguy/short_fuse.hpp:29 +#: src/badguy/short_fuse.hpp:30 msgid "Short Fuse" msgstr "Mecha Curta" -#: src/badguy/zeekling.hpp:36 +#: src/badguy/zeekling.hpp:39 msgid "Zeekling" msgstr "Dragón" -#: src/badguy/mriceblock.hpp:46 -msgid "Iceblock" -msgstr "Cubiño de xeo" +#: src/badguy/smartball.cpp:35 +msgid "Pumpkin" +msgstr "" + +#: src/badguy/bouncing_snowball.cpp:82 +msgid "Fatbat" +msgstr "" + +#: src/badguy/dive_mine.hpp:50 +msgid "Dive Mine" +msgstr "" + +#: src/badguy/granito_big.hpp:33 +msgid "Big Granito" +msgstr "" + +#: src/badguy/mriceblock.hpp:49 +msgid "Mr. Iceblock" +msgstr "" + +#: src/badguy/granito.hpp:39 src/badguy/darttrap.cpp:163 +#: src/badguy/corrupted_granito.cpp:175 src/badguy/dispenser.cpp:438 +msgid "Granito" +msgstr "" + +#: src/badguy/fish_swimming.cpp:54 src/badguy/jumpy.cpp:44 +#: data//images/ice_world.strf:10 data//images/tiles.strf:28 +#: data//images/worldmap.strf:41 +msgid "Snow" +msgstr "Neve" + +#: src/badguy/fish_swimming.cpp:55 data//images/ice_world.strf:211 +#: data//images/tiles.strf:366 data//images/worldmap.strf:67 +msgid "Forest" +msgstr "Bosque" + +#: src/badguy/crusher.hpp:71 +msgid "Crusher" +msgstr "" + +#: src/badguy/flame.cpp:84 +msgid "Fire" +msgstr "" + +#: src/badguy/flame.cpp:85 +msgid "Ghost" +msgstr "" + +#: src/badguy/corrupted_granito_big.hpp:35 +msgid "Corrupted Big Granito" +msgstr "" + +#: src/badguy/scrystallo.cpp:57 +msgid "Walk Radius" +msgstr "Raio do Paseo" + +#: src/badguy/scrystallo.cpp:58 +msgid "Awakening Radius" +msgstr "Raio ó Espertar" + +#: src/badguy/scrystallo.cpp:59 +msgid "Roof-attached" +msgstr "" -#: src/badguy/jumpy.hpp:36 +#: src/badguy/jumpy.hpp:40 msgid "Jumpy" msgstr "Chouteira" -#: src/badguy/captainsnowball.hpp:31 +#: src/badguy/captainsnowball.hpp:32 msgid "Captain Snowball" msgstr "Capitán Bóla de Neve" -#: src/badguy/ghosttree.hpp:42 +#: src/badguy/ghosttree.hpp:43 msgid "Ghost Tree" msgstr "Árbore Pantasma" -#: src/badguy/willowisp.cpp:283 +#: src/badguy/willowisp.cpp:314 msgid "Track range" msgstr "Intervalo de seguimento" -#: src/badguy/willowisp.cpp:284 +#: src/badguy/willowisp.cpp:315 msgid "Vanish range" msgstr "Intervalo de desaparición" -#: src/badguy/willowisp.cpp:285 +#: src/badguy/willowisp.cpp:316 msgid "Fly speed" msgstr "Velocidade de voo" -#: src/badguy/kugelblitz.hpp:39 +#: src/badguy/kugelblitz.hpp:40 msgid "Kugelblitz" msgstr "Chispún" -#: src/badguy/mole_rock.hpp:42 +#: src/badguy/mole_rock.hpp:44 msgid "Mole's rock" msgstr "Pedras da toupeira" -#: src/badguy/badguy.cpp:841 +#: src/badguy/badguy.cpp:1064 msgid "Death script" msgstr "Script de morte" -#: src/badguy/sspiky.hpp:36 +#: src/badguy/sspiky.hpp:37 msgid "Sleeping Spiky" msgstr "Chouteira Durminte" -#: src/badguy/yeti_stalactite.hpp:33 +#: src/badguy/yeti_stalactite.hpp:34 msgid "Yeti's Stalactite" msgstr "Estalactita do Yeti" -#: src/badguy/livefire.hpp:37 +#: src/badguy/fish_harmless.hpp:30 +msgid "Harmless Fish" +msgstr "" + +#: src/badguy/livefire.hpp:38 msgid "Walking Flame" msgstr "Lapa Camiñante" -#: src/badguy/livefire.hpp:67 +#: src/badguy/livefire.hpp:71 msgid "Sleeping Flame" msgstr "Lapa Durminte" -#: src/badguy/livefire.hpp:83 +#: src/badguy/livefire.hpp:89 msgid "Dormant Flame" msgstr "Lapa Latente" -#: src/badguy/owl.hpp:39 +#: src/badguy/owl.hpp:45 msgid "Owl" msgstr "Moucho" -#: src/badguy/igel.hpp:34 +#: src/badguy/igel.hpp:38 msgid "Igel" msgstr "Ourizo" -#: src/badguy/darttrap.cpp:126 +#: src/badguy/darttrap.cpp:148 msgid "Initial delay" msgstr "Tardanza inicial" -#: src/badguy/darttrap.cpp:128 +#: src/badguy/darttrap.cpp:150 msgid "Fire delay" msgstr "Tardanza do lume" -#: src/badguy/darttrap.cpp:129 +#: src/badguy/darttrap.cpp:151 msgid "Ammo" msgstr "Munición" -#: src/badguy/snowball.hpp:29 -msgid "Snowball" -msgstr "Bóla de neve" +#: src/badguy/darttrap.cpp:152 +msgid "Dart sprite" +msgstr "" + +#: src/badguy/darttrap.cpp:164 +msgid "Skull" +msgstr "" + +#: src/badguy/snowball.hpp:30 +msgid "Mr. Snowball" +msgstr "" -#: src/badguy/smartblock.hpp:29 -msgid "Smartblock" -msgstr "Bloque intelixente" +#: src/badguy/smartblock.hpp:30 +msgid "Mrs. Iceblock" +msgstr "" -#: src/badguy/yeti.cpp:369 +#: src/badguy/yeti.cpp:370 msgid "Fixed position" msgstr "Posición fixa" -#: src/badguy/yeti.cpp:370 +#: src/badguy/yeti.cpp:371 msgid "Lives" msgstr "Vidas" -#: src/badguy/goldbomb.hpp:49 +#: src/badguy/goldbomb.hpp:50 msgid "Gold Bomb" msgstr "Bomba Dourada" -#: src/badguy/flyingsnowball.hpp:32 +#: src/badguy/corrupted_granito.hpp:44 +msgid "Corrupted Granito" +msgstr "" + +#: src/badguy/mrbomb.cpp:48 +msgid "Classic" +msgstr "" + +#: src/badguy/flyingsnowball.hpp:33 msgid "Flying Snowball" msgstr "A Mosca" -#: src/badguy/skullyhop.hpp:37 -msgid "Skullyhop" -msgstr "Caveira Choutadora" +#: src/badguy/crusher.cpp:75 +msgid "Ice (normal)" +msgstr "" + +#: src/badguy/crusher.cpp:76 +msgid "Ice (big)" +msgstr "" + +#: src/badguy/crusher.cpp:77 +msgid "Rock (normal)" +msgstr "" + +#: src/badguy/crusher.cpp:78 +msgid "Rock (big)" +msgstr "" + +#: src/badguy/crusher.cpp:79 +msgid "Corrupted (normal)" +msgstr "" + +#: src/badguy/crusher.cpp:80 +msgid "Corrupted (big)" +msgstr "" + +#: src/badguy/crusher.cpp:492 +msgid "Sideways" +msgstr "Beirarrúas" -#: src/badguy/kamikazesnowball.hpp:32 -msgid "Snowshot" -msgstr "Bala de neve" +#: src/badguy/kamikazesnowball.hpp:34 +msgid "Kamikaze Snowball" +msgstr "" -#: src/badguy/kamikazesnowball.hpp:52 +#: src/badguy/kamikazesnowball.hpp:64 msgid "Leafshot" msgstr "Bala de folla" -#: src/badguy/flame.hpp:41 +#: src/badguy/fish_swimming.hpp:40 +msgid "Swimming Fish" +msgstr "" + +#: src/badguy/flame.hpp:47 msgid "Flame" msgstr "Lapa" -#: src/badguy/poisonivy.hpp:30 -msgid "Spring Leaf" -msgstr "Folla de Primavera" +#: src/badguy/scrystallo.hpp:31 +msgid "Sleeping Crystallo" +msgstr "Cristaliño Durminte" + +#: src/badguy/jumpy.cpp:45 +msgid "Wooden" +msgstr "" + +#: src/badguy/jumpy.cpp:47 +msgid "Metal" +msgstr "" + +#: src/badguy/jumpy.cpp:48 +msgid "Bag" +msgstr "" -#: src/badguy/willowisp.hpp:55 +#: src/badguy/willowisp.hpp:57 msgid "Will o' Wisp" msgstr "Asubía-Bólas" -#: src/badguy/badguy.hpp:53 +#: src/badguy/fish_jumping.hpp:41 +msgid "Jumping Fish" +msgstr "" + +#: src/badguy/badguy.hpp:61 msgid "Badguy" msgstr "Tipo malo" -#: src/badguy/ghostflame.hpp:30 -msgid "Ghost Flame" -msgstr "Lapa Pantasma" +#: src/badguy/rcrystallo.hpp:33 +msgid "Roof Crystallo" +msgstr "Cristaliño no Tellado" -#: src/badguy/spiky.hpp:30 +#: src/badguy/spiky.hpp:31 msgid "Spiky" msgstr "Pinchudo" -#: src/badguy/walkingleaf.hpp:30 -msgid "Autumn Leaf" -msgstr "Folla do Outono" +#: src/badguy/walkingleaf.hpp:33 +msgid "Walking Leaf" +msgstr "" + +#: src/badguy/root.hpp:39 +msgid "Root" +msgstr "" -#: src/badguy/owl.cpp:227 +#: src/badguy/owl.cpp:241 msgid "Carry" msgstr "Levar" -#: src/badguy/darttrap.hpp:33 +#: src/badguy/darttrap.hpp:35 msgid "Dart Trap" msgstr "Trampa de Dardos" -#: src/badguy/skydive.hpp:38 +#: src/badguy/skydive.hpp:43 msgid "Skydive" msgstr "Chouta-Ceos" -#: src/badguy/yeti.hpp:37 +#: src/badguy/yeti.hpp:38 msgid "Yeti" msgstr "Yeti" -#: src/badguy/mole.hpp:39 +#: src/badguy/snowball.cpp:41 +msgid "Bumpkin" +msgstr "" + +#: src/badguy/snowball.cpp:42 +msgid "BSOD" +msgstr "" + +#: src/badguy/mole.hpp:38 msgid "Mole" msgstr "Toupa" -#: src/badguy/mrbomb.hpp:42 -msgid "Bomb" -msgstr "Bomba" +#: src/badguy/corrupted_granito.cpp:176 +msgid "Skullyhop" +msgstr "Caveira Choutadora" + +#: src/badguy/mrbomb.hpp:40 +msgid "Mr. Bomb" +msgstr "" -#: src/badguy/walking_candle.hpp:40 +#: src/badguy/walking_candle.hpp:41 msgid "Walking Candle" msgstr "Vela Camiñante" -#: src/badguy/angrystone.hpp:34 +#: src/badguy/angrystone.hpp:39 msgid "Angry Stone" msgstr "Pedra Furiosa" -#: src/badguy/spidermite.hpp:35 -msgid "Spider" -msgstr "Araña" +#: src/badguy/tarantula.cpp:354 +msgid "Spidermite" +msgstr "" + +#: src/badguy/tarantula.cpp:374 +msgid "Static" +msgstr "" -#: src/badguy/ghoul.hpp:28 +#: src/badguy/ghoul.hpp:30 msgid "Ghoul" msgstr "Demo" -#: src/badguy/snowman.hpp:28 +#: src/badguy/granito_giant.hpp:32 +msgid "Giant Granito" +msgstr "" + +#: src/badguy/snowman.hpp:29 msgid "Snowman" msgstr "Boneco de Neve" -#: src/badguy/stumpy.hpp:35 -msgid "Walking Stump" -msgstr "Cañota Camiñante" +#: src/badguy/viciousivy.hpp:33 +msgid "Vicious Ivy" +msgstr "" + +#: src/badguy/stalactite.cpp:156 +msgid "ice" +msgstr "" + +#: src/badguy/stalactite.cpp:157 +msgid "rock" +msgstr "" + +#: src/badguy/fish_chasing.hpp:33 +msgid "Chasing Fish" +msgstr "" -#: src/badguy/fish.hpp:40 -msgid "Fish" -msgstr "Peixe" +#: src/badguy/stumpy.hpp:38 +msgid "Stumpy" +msgstr "" -#: src/badguy/dispenser.cpp:439 +#: src/badguy/dispenser.cpp:412 msgid "Interval (seconds)" msgstr "Intervalo (segundos)" -#: src/badguy/dispenser.cpp:440 +#: src/badguy/dispenser.cpp:413 msgid "Random" msgstr "Aleatorio" -#: src/badguy/dispenser.cpp:441 data//images/engine/editor/objects.stoi:4 -msgid "Enemies" -msgstr "Inimigos" +#: src/badguy/dispenser.cpp:416 +#: src/supertux/menu/editor_objectgroup_menu.cpp:30 +#: src/editor/toolbox_widget.cpp:101 +msgid "Objects" +msgstr "Obxectos" -#: src/badguy/dispenser.cpp:442 +#: src/badguy/dispenser.cpp:419 msgid "Limit dispensed badguys" msgstr "Limitar a cantidade de tipos malos" -#: src/badguy/dispenser.cpp:444 +#: src/badguy/dispenser.cpp:421 +msgid "Obey Gravity" +msgstr "Seguir a Gravidade" + +#: src/badguy/dispenser.cpp:423 msgid "Max concurrent badguys" msgstr "Cantidade máxima de tipos malos á vez" -#: src/badguy/dispenser.cpp:446 src/supertux/menu/editor_levelset_menu.cpp:60 -msgid "Type" -msgstr "Tipo" - -#: src/badguy/dispenser.cpp:447 -msgid "dropper" -msgstr "pingueira" - -#: src/badguy/dispenser.cpp:447 -msgid "rocket launcher" -msgstr "lanzadeira de mísil" +#: src/badguy/dispenser.cpp:435 +msgid "Dropper" +msgstr "" -#: src/badguy/dispenser.cpp:447 -msgid "cannon" -msgstr "canón" +#: src/badguy/dispenser.cpp:436 +msgid "Cannon" +msgstr "" -#: src/badguy/dispenser.cpp:447 -msgid "invisible" -msgstr "invisible" +#: src/badguy/dispenser.cpp:437 src/worldmap/special_tile.cpp:77 +msgid "Invisible" +msgstr "Invisible" -#: src/badguy/snail.hpp:42 +#: src/badguy/snail.hpp:43 msgid "Snail" msgstr "Caracol" -#: src/badguy/smartball.hpp:31 -msgid "Smartball" -msgstr "Bóla Intelixente" +#: src/badguy/smartball.hpp:32 +msgid "Mrs. Snowball" +msgstr "" -#: src/badguy/bouncing_snowball.hpp:31 +#: src/badguy/bouncing_snowball.hpp:39 msgid "Bouncing Snowball" msgstr "Bóla de Neve Saltadora" -#: src/badguy/iceflame.hpp:33 -msgid "Ice Flame" -msgstr "Lapa de Xeo" +#: src/badguy/granito_big.cpp:52 src/badguy/granito.cpp:263 +msgid "Default" +msgstr "" + +#: src/badguy/granito_big.cpp:53 src/badguy/granito.cpp:264 +msgid "Standing" +msgstr "" + +#: src/badguy/granito_big.cpp:54 src/badguy/granito.cpp:265 +msgid "Walking" +msgstr "" + +#: src/badguy/mriceblock.cpp:63 +msgid "Laptop" +msgstr "" -#: src/badguy/dart.hpp:43 +#: src/badguy/dart.hpp:44 msgid "Dart" msgstr "Dardo" -#: src/supertux/statistics.cpp:47 +#: src/badguy/granito.cpp:268 +msgid "Sitting" +msgstr "" + +#: src/supertux/statistics.cpp:54 msgid "Max coins collected:" msgstr "Máximas moedas recollidas:" -#: src/supertux/statistics.cpp:48 +#: src/supertux/statistics.cpp:55 msgid "Max fragging:" msgstr "Máximos inimigos vencidos:" -#: src/supertux/statistics.cpp:49 +#: src/supertux/statistics.cpp:56 msgid "Max secrets found:" msgstr "Máximos segredos atopados:" -#: src/supertux/statistics.cpp:50 +#: src/supertux/statistics.cpp:57 msgid "Best time completed:" msgstr "Completado no mellor tempo:" -#: src/supertux/statistics.cpp:51 +#: src/supertux/statistics.cpp:58 msgid "Level target time:" msgstr "Tempo para acadar o obxectivo do nivel:" -#: src/supertux/statistics.cpp:139 src/supertux/levelintro.cpp:160 +#: src/supertux/statistics.cpp:149 src/supertux/levelintro.cpp:175 msgid "Best Level Statistics" msgstr "Mellores Estadísticas do Nivel" -#: src/supertux/statistics.cpp:228 +#: src/supertux/statistics.cpp:238 msgid "You" msgstr "Ti" -#: src/supertux/statistics.cpp:230 +#: src/supertux/statistics.cpp:240 msgid "Best" msgstr "Mellor" -#: src/supertux/statistics.cpp:232 src/supertux/levelintro.cpp:166 +#: src/supertux/statistics.cpp:242 src/supertux/levelintro.cpp:181 msgid "Coins" msgstr "Moedas" -#: src/supertux/statistics.cpp:255 +#: src/supertux/statistics.cpp:265 msgid "Badguys" msgstr "Tipos malos" -#: src/supertux/statistics.cpp:271 src/supertux/levelintro.cpp:172 +#: src/supertux/statistics.cpp:281 src/supertux/levelintro.cpp:187 msgid "Secrets" msgstr "Segredos" -#: src/supertux/game_object.hpp:77 +#: src/supertux/game_object.hpp:88 msgid "Unknown object" msgstr "Obxecto descoñecido" -#: src/supertux/command_line_arguments.cpp:74 -#, c-format +#: src/supertux/sector.cpp:507 +msgid "Press escape to skip" +msgstr "Pulsar a tecla escape para saltar" + +#: src/supertux/command_line_arguments.cpp:92 +#, c++-format msgid "Usage: {} [OPTIONS] [LEVELFILE]" -msgstr "Utilización: {} [OPTIONS] [LEVELFILE]" +msgstr "" -#: src/supertux/command_line_arguments.cpp:75 +#: src/supertux/command_line_arguments.cpp:93 msgid "General Options:" msgstr "Opcións Xerais:" -#: src/supertux/command_line_arguments.cpp:76 +#: src/supertux/command_line_arguments.cpp:94 msgid " -h, --help Show this help message and quit" msgstr " -h, --help Amosa esta mensaxe de axuda e sae" -#: src/supertux/command_line_arguments.cpp:77 +#: src/supertux/command_line_arguments.cpp:95 msgid " -v, --version Show SuperTux version and quit" msgstr " -v, --version Amosa a versión de SuperTux e sae" -#: src/supertux/command_line_arguments.cpp:78 +#: src/supertux/command_line_arguments.cpp:96 msgid " --verbose Print verbose messages" msgstr " --verbose Publica mensaxes pormenorizadas" -#: src/supertux/command_line_arguments.cpp:79 +#: src/supertux/command_line_arguments.cpp:97 msgid " --debug Print extra verbose messages" msgstr " --verbose Publica mensaxes pormenorizadas extra" -#: src/supertux/command_line_arguments.cpp:80 +#: src/supertux/command_line_arguments.cpp:98 msgid "" " --print-datadir Print SuperTux's primary data directory." msgstr " --print-datadir Publica o directorio de datos primario de SuperTux." -#: src/supertux/command_line_arguments.cpp:82 +#: src/supertux/command_line_arguments.cpp:99 +msgid "" +" --acknowledgements Print the licenses of libraries used by " +"SuperTux." +msgstr " --agradecementos Amosa as licenzas das librerías utilizadas por SuperTux." + +#: src/supertux/command_line_arguments.cpp:101 msgid "Video Options:" msgstr "Opcións de Vídeo:" -#: src/supertux/command_line_arguments.cpp:83 +#: src/supertux/command_line_arguments.cpp:102 msgid " -f, --fullscreen Run in fullscreen mode" msgstr " -f, --fullscreen Funciona en modo pantalla completa" -#: src/supertux/command_line_arguments.cpp:84 +#: src/supertux/command_line_arguments.cpp:103 msgid " -w, --window Run in window mode" msgstr " -w, --window Funciona en modo xanela" -#: src/supertux/command_line_arguments.cpp:85 +#: src/supertux/command_line_arguments.cpp:104 msgid " -g, --geometry WIDTHxHEIGHT Run SuperTux in given resolution" msgstr " -g, --geometry ANCHOxALTO Executa SuperTux na resolución indicada" -#: src/supertux/command_line_arguments.cpp:86 +#: src/supertux/command_line_arguments.cpp:105 msgid " -a, --aspect WIDTH:HEIGHT Run SuperTux with given aspect ratio" msgstr " -a, --aspect ANCHO:ALTO Executa SuperTux coa resolución de aspecto indicada" -#: src/supertux/command_line_arguments.cpp:87 +#: src/supertux/command_line_arguments.cpp:106 msgid " -d, --default Reset video settings to default values" msgstr " -d, --default Restablece a configuración de vídeo ós valores predeterminados" -#: src/supertux/command_line_arguments.cpp:88 +#: src/supertux/command_line_arguments.cpp:107 msgid " --renderer RENDERER Use sdl, opengl, or auto to render" msgstr " --renderer REPRESENTAR Utiliza sdl, opengl, ou auto para representar" -#: src/supertux/command_line_arguments.cpp:90 +#: src/supertux/command_line_arguments.cpp:109 msgid "Audio Options:" msgstr "Opcións de Audio:" -#: src/supertux/command_line_arguments.cpp:91 +#: src/supertux/command_line_arguments.cpp:110 msgid " --disable-sound Disable sound effects" msgstr " --disable-sound Desactiva os efectos de son" -#: src/supertux/command_line_arguments.cpp:92 +#: src/supertux/command_line_arguments.cpp:111 msgid " --disable-music Disable music" msgstr " --disable-music Desactiva a músicaDisable music" -#: src/supertux/command_line_arguments.cpp:94 +#: src/supertux/command_line_arguments.cpp:113 msgid "Game Options:" msgstr "Opcións do Xogo:" -#: src/supertux/command_line_arguments.cpp:95 +#: src/supertux/command_line_arguments.cpp:114 msgid " --edit-level Open given level in editor" msgstr " --edit-level Abrir o nivel indicado no editor" -#: src/supertux/command_line_arguments.cpp:96 +#: src/supertux/command_line_arguments.cpp:115 msgid " --resave Loads given level and saves it" msgstr " --resave Carga o nivel indicado e gárdao" -#: src/supertux/command_line_arguments.cpp:97 +#: src/supertux/command_line_arguments.cpp:116 msgid " --show-fps Display framerate in levels" msgstr " --show-fps Amosa os fotogramas por segundo nos niveis" -#: src/supertux/command_line_arguments.cpp:98 +#: src/supertux/command_line_arguments.cpp:117 msgid " --no-show-fps Do not display framerate in levels" msgstr " --no-show-fps Non amosa os fotogramas por segundo nos niveis" -#: src/supertux/command_line_arguments.cpp:99 +#: src/supertux/command_line_arguments.cpp:118 msgid " --show-pos Display player's current position" msgstr " --show-pos Amosar a posición actual do xogador" -#: src/supertux/command_line_arguments.cpp:100 +#: src/supertux/command_line_arguments.cpp:119 msgid " --no-show-pos Do not display player's position" msgstr " --no-show-pos Non amosar a posición do xogador" -#: src/supertux/command_line_arguments.cpp:101 +#: src/supertux/command_line_arguments.cpp:120 msgid " --developer Switch on developer feature" msgstr " --developer Acende a función programador" -#: src/supertux/command_line_arguments.cpp:102 +#: src/supertux/command_line_arguments.cpp:121 msgid " -s, --debug-scripts Enable script debugger." msgstr " -s, --debug-scripts Activa o depurador de scripts." -#: src/supertux/command_line_arguments.cpp:103 +#: src/supertux/command_line_arguments.cpp:122 msgid "" " --spawn-pos X,Y Where in the level to spawn Tux. Only used if" " level is specified." msgstr " --spawn-pos X,Y Onde soltar a Tux no nivel. Só se utiliza de especificarse o nivel." -#: src/supertux/command_line_arguments.cpp:104 +#: src/supertux/command_line_arguments.cpp:123 msgid " --sector SECTOR Spawn Tux in SECTOR\n" msgstr " --sector SECTOR Soltar a Tux no SECTOR\n" -#: src/supertux/command_line_arguments.cpp:105 +#: src/supertux/command_line_arguments.cpp:124 msgid " --spawnpoint SPAWNPOINT Spawn Tux at SPAWNPOINT\n" msgstr " --spawnpoint PUNTO DE INICIO Soltar a Tux no PUNTO DE INICIO\n" -#: src/supertux/command_line_arguments.cpp:107 -msgid "Demo Recording Options:" -msgstr "Opcións de Gravación da Demostración:" - -#: src/supertux/command_line_arguments.cpp:108 -msgid " --record-demo FILE LEVEL Record a demo to FILE" -msgstr " --record-demo NIVEL DO FICHEIRO Gravar unha demostración a FICHEIRO" - -#: src/supertux/command_line_arguments.cpp:109 -msgid " --play-demo FILE LEVEL Play a recorded demo" -msgstr " --play-demo FICHEIRO NIVEL Reproducir unha demostración gravada" - -#: src/supertux/command_line_arguments.cpp:111 +#: src/supertux/command_line_arguments.cpp:126 msgid "Directory Options:" msgstr "Opcións do Directorio:" -#: src/supertux/command_line_arguments.cpp:112 +#: src/supertux/command_line_arguments.cpp:127 msgid "" " --datadir DIR Set the directory for the games datafiles" msgstr " --datadir DIRECTORIO Establecer o directorio para os ficheiros de datos dos xogos" -#: src/supertux/command_line_arguments.cpp:113 +#: src/supertux/command_line_arguments.cpp:128 msgid "" " --userdir DIR Set the directory for user data (savegames, " "etc.)" msgstr " --userdir DIRECTORIO Establecer o directorio para os datos de usuario (xogos gardados, etc.)" -#: src/supertux/command_line_arguments.cpp:115 +#: src/supertux/command_line_arguments.cpp:130 msgid "Add-On Options:" msgstr "Opcións dos Complementos:" -#: src/supertux/command_line_arguments.cpp:116 +#: src/supertux/command_line_arguments.cpp:131 msgid " --repository-url URL Set the URL to the Add-On repository" msgstr " --repository-url URL Establecer o URL para o repositorio de Complementos" -#: src/supertux/command_line_arguments.cpp:118 +#: src/supertux/command_line_arguments.cpp:133 msgid "Environment variables:" msgstr "Variables de entorno:" -#: src/supertux/command_line_arguments.cpp:119 +#: src/supertux/command_line_arguments.cpp:134 msgid "" " SUPERTUX2_USER_DIR Directory for user data (savegames, etc.)" msgstr " SUPERTUX2_USER_DIR Directorio para os datos do usuario (xogos gardados, etc.)" -#: src/supertux/command_line_arguments.cpp:120 +#: src/supertux/command_line_arguments.cpp:135 msgid " SUPERTUX2_DATA_DIR Directory for the games datafiles" msgstr " SUPERTUX2_DATA_DIR Directorio para os ficheiros de datos dos xogos" -#: src/supertux/title_screen.cpp:43 +#: src/supertux/title_screen.cpp:272 msgid "Copyright" msgstr "Copyright" -#: src/supertux/title_screen.cpp:44 +#: src/supertux/title_screen.cpp:273 msgid "" "This game comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to\n" "redistribute it under certain conditions; see the license file for details.\n" msgstr "Este xogo vén SEN ABSOLUTAMENTE NINGUNHA GARANTÍA. É software libre e es libre de\nredistribuílo baixo certas condicións; mira o ficheiro de licenza para os detalles.\n" -#: src/supertux/menu/contrib_menu.cpp:79 -#: src/supertux/menu/world_set_menu.cpp:31 -msgid "Contrib Levels" -msgstr "Niveis dos Colaboradores" - -#: src/supertux/menu/contrib_menu.cpp:119 -#: src/supertux/menu/contrib_menu.cpp:150 -msgid "*NEW*" -msgstr "*NOVO*" +#: src/supertux/game_object.cpp:114 +msgid "Version" +msgstr "" -#: src/supertux/menu/contrib_menu.cpp:172 src/supertux/menu/debug_menu.cpp:75 -#: src/supertux/menu/editor_level_select_menu.cpp:84 -#: src/supertux/menu/worldmap_cheat_menu.cpp:55 -#: src/supertux/menu/worldmap_cheat_menu.cpp:153 -#: src/supertux/menu/editor_levelset_select_menu.cpp:96 -#: src/supertux/menu/options_menu.cpp:405 -#: src/supertux/menu/profile_menu.cpp:47 src/supertux/menu/addon_menu.cpp:213 -#: src/supertux/menu/editor_new_levelset_menu.cpp:40 -#: src/supertux/menu/world_set_menu.cpp:33 -#: src/supertux/menu/keyboard_menu.cpp:51 -#: src/supertux/menu/language_menu.cpp:56 -#: src/supertux/menu/joystick_menu.cpp:97 -#: src/supertux/menu/contrib_levelset_menu.cpp:67 -#: src/supertux/menu/cheat_menu.cpp:44 -msgid "Back" -msgstr "Atrás" +#: src/supertux/game_object.cpp:129 +#: src/supertux/menu/editor_levelset_menu.cpp:54 +msgid "Type" +msgstr "Tipo" -#: src/supertux/menu/debug_menu.cpp:32 -msgid "Debug" -msgstr "Depurar" +#: src/supertux/menu/integrations_menu.cpp:49 +msgid "Integrations" +msgstr "Integracións" -#: src/supertux/menu/debug_menu.cpp:56 -msgid "Game Speed" -msgstr "Velocidade do Xogo" +#: src/supertux/menu/integrations_menu.cpp:51 +msgid "Do not share level names when editing" +msgstr "Non compartir os nomes dos niveis ó editar" -#: src/supertux/menu/debug_menu.cpp:57 +#: src/supertux/menu/integrations_menu.cpp:52 +msgid "" +"Enable this if you want to work on secret levels and don't want the names to" +" be spoiled" +msgstr "" + +#: src/supertux/menu/integrations_menu.cpp:54 +msgid "Enable Discord integration" +msgstr "Activar a integración con Discord" + +#: src/supertux/menu/integrations_menu.cpp:55 +msgid "" +"Sends information to your Discord application about what you're doing in the" +" game." +msgstr "" + +#: src/supertux/menu/integrations_menu.cpp:57 +msgid "Discord (disabled; not compiled)" +msgstr "Discord (desactivado; non compilado)" + +#: src/supertux/menu/editor_converters_menu.cpp:61 +#: src/supertux/menu/editor_menu.cpp:85 +msgid "Convert Tiles" +msgstr "" + +#: src/supertux/menu/editor_converters_menu.cpp:64 +msgid "Select Tile Conversion File" +msgstr "" + +#: src/supertux/menu/editor_converters_menu.cpp:72 +#, c++-format +msgid "By: {}" +msgstr "" + +#: src/supertux/menu/editor_converters_menu.cpp:75 +msgid "Convert Tiles By File" +msgstr "" + +#: src/supertux/menu/editor_converters_menu.cpp:76 +msgid "Convert all tiles in the current level by a file, specified above." +msgstr "" + +#: src/supertux/menu/editor_converters_menu.cpp:89 +msgid "No tile conversion file selected." +msgstr "" + +#: src/supertux/menu/editor_converters_menu.cpp:93 +msgid "" +"This will convert all tiles in the level. Proceed?\n" +"\n" +"Note: This should not be ran more than once on a level.\n" +"Creating a separate copy of the level is highly recommended." +msgstr "" + +#: src/supertux/menu/video_system_menu.cpp:36 +msgid "Select Video System" +msgstr "" + +#: src/supertux/menu/video_system_menu.cpp:37 +#, c++-format +msgid "Used video system: {}" +msgstr "" + +#: src/supertux/menu/video_system_menu.cpp:54 +msgid "Restart game for the changes to take effect" +msgstr "" + +#: src/supertux/menu/contrib_menu.cpp:68 +#: src/supertux/menu/world_set_menu.cpp:31 +msgid "Contrib Levels" +msgstr "Niveis dos Colaboradores" + +#: src/supertux/menu/contrib_menu.cpp:98 +#: src/supertux/menu/contrib_menu.cpp:112 +msgid "Official Contrib Levels" +msgstr "" + +#: src/supertux/menu/contrib_menu.cpp:99 +#: src/supertux/menu/contrib_menu.cpp:118 +msgid "Community Contrib Levels" +msgstr "" + +#: src/supertux/menu/contrib_menu.cpp:100 +#: src/supertux/menu/contrib_menu.cpp:124 +msgid "User Contrib Levels" +msgstr "" + +#: src/supertux/menu/contrib_menu.cpp:113 +msgid "How is this possible? There are no Official Contrib Levels!" +msgstr "" + +#: src/supertux/menu/contrib_menu.cpp:119 +msgid "No Community Contrib Levels yet. Download them from the Add-ons Menu." +msgstr "" + +#: src/supertux/menu/contrib_menu.cpp:125 +msgid "No User Contrib Levels yet. Create some with the Level Editor." +msgstr "" + +#: src/supertux/menu/debug_menu.cpp:34 +msgid "Debug" +msgstr "Depurar" + +#: src/supertux/menu/debug_menu.cpp:58 +msgid "Game Speed" +msgstr "Velocidade do Xogo" + +#: src/supertux/menu/debug_menu.cpp:59 msgid "Adjust Game Speed" msgstr "Axustar a Velocidade do Xogo" -#: src/supertux/menu/debug_menu.cpp:63 +#: src/supertux/menu/debug_menu.cpp:65 msgid "Show Collision Rects" msgstr "Amosar Rectángulos de Colisión" -#: src/supertux/menu/debug_menu.cpp:64 +#: src/supertux/menu/debug_menu.cpp:66 msgid "Show Worldmap Path" msgstr "Amosar Camiño do Mapa Principal" -#: src/supertux/menu/debug_menu.cpp:65 +#: src/supertux/menu/debug_menu.cpp:67 msgid "Show Controller" msgstr "Amosar Controlador" -#: src/supertux/menu/debug_menu.cpp:66 +#: src/supertux/menu/debug_menu.cpp:68 msgid "Show Framerate" msgstr "Amosar Fotogramas por segundo" -#: src/supertux/menu/debug_menu.cpp:67 +#: src/supertux/menu/debug_menu.cpp:69 msgid "Draw Redundant Frames" msgstr "Representar Cadros Redundantes" -#: src/supertux/menu/debug_menu.cpp:68 +#: src/supertux/menu/debug_menu.cpp:70 msgid "Show Player Position" msgstr "Amosar a Posición do Xogador" -#: src/supertux/menu/debug_menu.cpp:69 +#: src/supertux/menu/debug_menu.cpp:71 msgid "Use Bitmap Fonts" msgstr "Utilizar Fontes Bitmap" -#: src/supertux/menu/debug_menu.cpp:72 +#: src/supertux/menu/debug_menu.cpp:74 msgid "Dump Texture Cache" msgstr "Baleirar a Caché da Textura" +#: src/supertux/menu/particle_editor_save_as.cpp:33 +msgid "Save particle as" +msgstr "Gardar partícula coma" + +#: src/supertux/menu/particle_editor_save_as.cpp:37 +#: src/supertux/menu/editor_save_as.cpp:37 +msgid "File name" +msgstr "Nome do ficheiro" + +#: src/supertux/menu/particle_editor_save_as.cpp:38 +#: src/supertux/menu/editor_save_as.cpp:38 src/editor/particle_editor.cpp:767 +msgid "Save" +msgstr "Gardar" + +#: src/supertux/menu/multiplayer_menu.cpp:27 +#: src/supertux/menu/multiplayer_players_menu.cpp:34 +msgid "Multiplayer" +msgstr "" + +#: src/supertux/menu/multiplayer_menu.cpp:30 +msgid "Auto-manage Players" +msgstr "" + +#: src/supertux/menu/multiplayer_menu.cpp:31 +msgid "" +"Automatically add and remove players when controllers are plugged or " +"unplugged" +msgstr "" + +#: src/supertux/menu/multiplayer_menu.cpp:33 +msgid "Allow Multibind" +msgstr "" + +#: src/supertux/menu/multiplayer_menu.cpp:34 +msgid "Allow binding multiple joysticks to a single player" +msgstr "" + +#: src/supertux/menu/multiplayer_menu.cpp:36 +msgid "Manage Players" +msgstr "" + #: src/supertux/menu/editor_sectors_menu.cpp:31 msgid "Choose Sector" msgstr "Escoller Sector" @@ -1440,45 +2709,98 @@ msgstr "Crear Sector" msgid "Delete Sector" msgstr "Eliminar Sector" -#: src/supertux/menu/editor_sectors_menu.cpp:93 +#: src/supertux/menu/editor_sectors_menu.cpp:92 msgid "Each level must have at least one sector." msgstr "Cada nivel debe ter polo menos un sector." -#: src/supertux/menu/editor_sectors_menu.cpp:98 +#: src/supertux/menu/editor_sectors_menu.cpp:97 msgid "Do you really want to delete this sector?" msgstr "Realmente queres eliminar este sector?" -#: src/supertux/menu/editor_sectors_menu.cpp:101 +#: src/supertux/menu/editor_sectors_menu.cpp:100 msgid "Delete sector" msgstr "Eliminar sector" -#: src/supertux/menu/editor_objectgroup_menu.cpp:30 -#: src/editor/toolbox_widget.cpp:93 -msgid "Objects" -msgstr "Obxectos" +#: src/supertux/menu/custom_menu_menu.cpp:49 +#: src/supertux/menu/options_menu.cpp:191 +msgid "Menu Customization" +msgstr "" + +#: src/supertux/menu/custom_menu_menu.cpp:51 +msgid "Menu Back Color" +msgstr "" + +#: src/supertux/menu/custom_menu_menu.cpp:52 +msgid "Menu Front Color" +msgstr "" + +#: src/supertux/menu/custom_menu_menu.cpp:53 +msgid "Menu Help Back Color" +msgstr "" + +#: src/supertux/menu/custom_menu_menu.cpp:54 +msgid "Menu Help Front Color" +msgstr "" -#: src/supertux/menu/editor_level_select_menu.cpp:58 +#: src/supertux/menu/custom_menu_menu.cpp:55 +msgid "Label Text Color" +msgstr "" + +#: src/supertux/menu/custom_menu_menu.cpp:56 +msgid "Active Text Color" +msgstr "" + +#: src/supertux/menu/custom_menu_menu.cpp:57 +msgid "Divider Line Color" +msgstr "" + +#: src/supertux/menu/custom_menu_menu.cpp:58 +msgid "Menu Roundness" +msgstr "" + +#: src/supertux/menu/custom_menu_menu.cpp:60 +msgid "Editor Interface Color" +msgstr "" + +#: src/supertux/menu/custom_menu_menu.cpp:61 +msgid "Editor Hover Color" +msgstr "" + +#: src/supertux/menu/custom_menu_menu.cpp:62 +msgid "Editor Grab Color" +msgstr "" + +#: src/supertux/menu/custom_menu_menu.cpp:64 +msgid "Reset to defaults" +msgstr "" + +#: src/supertux/menu/editor_level_select_menu.cpp:72 msgid "Empty World" msgstr "Mundo Baleiro" -#: src/supertux/menu/editor_level_select_menu.cpp:73 +#: src/supertux/menu/editor_level_select_menu.cpp:87 msgid "Create Level" msgstr "Crear Nivel" -#: src/supertux/menu/editor_level_select_menu.cpp:77 +#: src/supertux/menu/editor_level_select_menu.cpp:91 msgid "Edit Worldmap" msgstr "Editar Mapa Principal" -#: src/supertux/menu/editor_level_select_menu.cpp:79 +#: src/supertux/menu/editor_level_select_menu.cpp:93 msgid "Create Worldmap" msgstr "Crear Mapa Principal" -#: src/supertux/menu/editor_level_select_menu.cpp:83 -#: src/supertux/menu/editor_levelset_menu.cpp:56 +#: src/supertux/menu/editor_level_select_menu.cpp:95 +#: src/supertux/menu/editor_delete_level_menu.cpp:55 +msgid "Delete level" +msgstr "Eliminar nivel" + +#: src/supertux/menu/editor_level_select_menu.cpp:97 +#: src/supertux/menu/editor_levelset_menu.cpp:50 msgid "World Settings" msgstr "Configuración do Mundo" -#: src/supertux/menu/editor_level_select_menu.cpp:123 +#: src/supertux/menu/editor_level_select_menu.cpp:141 msgid "" "Share this worldmap under license CC-BY-SA 4.0 International (advised).\n" "It allows modifications and redistribution by third-parties.\n" @@ -1486,7 +2808,7 @@ msgid "" "DISCLAIMER: The SuperTux authors take no responsibility for your choice of license." msgstr "Compartir este mapa principal baixo a licenza CC-BY-SA 4.0 Internacional (aconsellado).\nPermite modificacións e a súa redistribución por terceiras partes.\nSe non estás de acordo con esta licenza, cámbiaa nas propiedades do mapa principal.\nADVERTENCIA: Os autores de SuperTux non adquires ningunha responsabilidade pola túa escolla de licenza." -#: src/supertux/menu/editor_level_select_menu.cpp:130 +#: src/supertux/menu/editor_level_select_menu.cpp:148 msgid "" "Share this level under license CC-BY-SA 4.0 International (advised).\n" "It allows modifications and redistribution by third-parties.\n" @@ -1494,402 +2816,815 @@ msgid "" "DISCLAIMER: The SuperTux authors take no responsibility for your choice of license." msgstr "Compartir este nivel baixo a licenza CC-BY-SA 4.0 Internacional (aconsellado).\nPermite modificacións e a súa redistribución por terceiras partes.\nSe non estás de acordo con esta licenza, cámbiaa nas propiedades do nivel.\nADVERTENCIA: Os autores de SuperTux non adquires ningunha responsabilidade pola túa escolla de licenza." -#: src/supertux/menu/worldmap_cheat_menu.cpp:34 -#: src/supertux/menu/cheat_menu.cpp:30 +#: src/supertux/menu/editor_level_select_menu.cpp:179 +msgid "" +"An auto-save recovery file was found. Would you like to restore the recovery\n" +"file and resume where you were before the editor crashed?" +msgstr "Atopouse un ficheiro de recuperación creado automaticamente. Queres restablecer o ficheiro\nde recuperación e continuar onde estabas antes de que o editor se estragase?" + +#: src/supertux/menu/editor_level_select_menu.cpp:186 +msgid "This will delete the auto-save file. Are you sure?" +msgstr "Isto eliminará o ficheiro gardado automaticamente. Continuar?" + +#: src/supertux/menu/worldmap_cheat_apply_menu.cpp:35 +#: src/supertux/menu/worldmap_cheat_apply_menu.cpp:52 +#: src/supertux/menu/cheat_apply_menu.cpp:33 +#: src/supertux/menu/cheat_apply_menu.cpp:51 +msgid "Apply cheat to player" +msgstr "" + +#: src/supertux/menu/worldmap_cheat_apply_menu.cpp:39 +#: src/supertux/menu/worldmap_cheat_apply_menu.cpp:60 +#: src/supertux/menu/multiplayer_players_menu.cpp:39 +#: src/supertux/menu/keyboard_menu.cpp:63 +#: src/supertux/menu/cheat_apply_menu.cpp:39 +#: src/supertux/menu/cheat_apply_menu.cpp:59 +#: src/supertux/menu/multiplayer_player_menu.cpp:37 +#, c++-format +msgid "Player {}" +msgstr "Xogador {}" + +#: src/supertux/menu/worldmap_cheat_apply_menu.cpp:57 +#: src/supertux/menu/cheat_apply_menu.cpp:36 +#: src/supertux/menu/cheat_apply_menu.cpp:56 +msgid "All Players" +msgstr "Tódolos xogadores" + +#: src/supertux/menu/worldmap_cheat_menu.cpp:36 +#: src/supertux/menu/cheat_menu.cpp:31 msgid "Cheats" msgstr "Trampas" -#: src/supertux/menu/worldmap_cheat_menu.cpp:36 -#: src/supertux/menu/cheat_menu.cpp:32 +#: src/supertux/menu/worldmap_cheat_menu.cpp:38 +#: src/supertux/menu/cheat_menu.cpp:33 msgid "Bonus: Grow" msgstr "Bono: Medrar" -#: src/supertux/menu/worldmap_cheat_menu.cpp:37 -#: src/supertux/menu/cheat_menu.cpp:33 +#: src/supertux/menu/worldmap_cheat_menu.cpp:39 +#: src/supertux/menu/cheat_menu.cpp:34 msgid "Bonus: Fire" msgstr "Bono: Lume" -#: src/supertux/menu/worldmap_cheat_menu.cpp:38 -#: src/supertux/menu/cheat_menu.cpp:34 +#: src/supertux/menu/worldmap_cheat_menu.cpp:40 +#: src/supertux/menu/cheat_menu.cpp:35 msgid "Bonus: Ice" msgstr "Bono: Xeo" -#: src/supertux/menu/worldmap_cheat_menu.cpp:39 -#: src/supertux/menu/cheat_menu.cpp:35 +#: src/supertux/menu/worldmap_cheat_menu.cpp:41 +#: src/supertux/menu/cheat_menu.cpp:36 msgid "Bonus: Air" msgstr "Bono: Aire" -#: src/supertux/menu/worldmap_cheat_menu.cpp:40 -#: src/supertux/menu/cheat_menu.cpp:36 +#: src/supertux/menu/worldmap_cheat_menu.cpp:42 +#: src/supertux/menu/cheat_menu.cpp:37 msgid "Bonus: Earth" msgstr "Bono: Terra" -#: src/supertux/menu/worldmap_cheat_menu.cpp:41 +#: src/supertux/menu/worldmap_cheat_menu.cpp:43 msgid "Bonus: None" msgstr "Bono: Ningún" -#: src/supertux/menu/worldmap_cheat_menu.cpp:44 -#: src/supertux/menu/cheat_menu.cpp:42 +#: src/supertux/menu/worldmap_cheat_menu.cpp:46 +#: src/supertux/menu/cheat_menu.cpp:45 src/supertux/menu/cheat_menu.cpp:51 msgid "Leave Ghost Mode" msgstr "Deixar o Modo Pantasma" -#: src/supertux/menu/worldmap_cheat_menu.cpp:44 -#: src/supertux/menu/cheat_menu.cpp:42 +#: src/supertux/menu/worldmap_cheat_menu.cpp:46 +#: src/supertux/menu/cheat_menu.cpp:45 src/supertux/menu/cheat_menu.cpp:50 msgid "Activate Ghost Mode" msgstr "Activar o Modo Pantasma" -#: src/supertux/menu/worldmap_cheat_menu.cpp:46 -#: src/supertux/menu/cheat_menu.cpp:40 +#: src/supertux/menu/worldmap_cheat_menu.cpp:48 +#: src/supertux/menu/cheat_menu.cpp:41 msgid "Finish Level" msgstr "Rematar Nivel" -#: src/supertux/menu/worldmap_cheat_menu.cpp:47 +#: src/supertux/menu/worldmap_cheat_menu.cpp:49 msgid "Reset Level" msgstr "Restablecer Nivel" -#: src/supertux/menu/worldmap_cheat_menu.cpp:49 +#: src/supertux/menu/worldmap_cheat_menu.cpp:51 msgid "Finish Worldmap" msgstr "Rematar Mapa Principal" -#: src/supertux/menu/worldmap_cheat_menu.cpp:50 +#: src/supertux/menu/worldmap_cheat_menu.cpp:52 msgid "Reset Worldmap" msgstr "Restablecer Mapa Principal" -#: src/supertux/menu/worldmap_cheat_menu.cpp:52 +#: src/supertux/menu/worldmap_cheat_menu.cpp:54 msgid "Go to level" msgstr "Ir ó nivel" -#: src/supertux/menu/worldmap_cheat_menu.cpp:53 +#: src/supertux/menu/worldmap_cheat_menu.cpp:55 msgid "Go to main spawnpoint" msgstr "Ir ó punto de inicio principal" -#: src/supertux/menu/worldmap_cheat_menu.cpp:145 +#: src/supertux/menu/worldmap_cheat_menu.cpp:188 msgid "Select level" msgstr "Seleccionar nivel" -#: src/supertux/menu/editor_levelset_select_menu.cpp:54 +#: src/supertux/menu/editor_save_as.cpp:33 +#: src/supertux/menu/editor_menu.cpp:63 +msgid "Save Level as" +msgstr "Gardar Nivel como" + +#: src/supertux/menu/editor_save_as.cpp:33 +#: src/supertux/menu/editor_menu.cpp:64 +msgid "Save Copy" +msgstr "Gardar Copia" + +#: src/supertux/menu/editor_levelset_select_menu.cpp:71 msgid "Choose World" msgstr "Escoller Mundo" -#: src/supertux/menu/editor_levelset_select_menu.cpp:82 -#, c-format -msgid "%d level" -msgid_plural "%d levels" -msgstr[0] "%d nivel" -msgstr[1] "%d niveis" +#: src/supertux/menu/editor_levelset_select_menu.cpp:99 +#, c++-format +msgid "{} level" +msgid_plural "{} levels" +msgstr[0] "" +msgstr[1] "" -#: src/supertux/menu/editor_levelset_select_menu.cpp:95 +#: src/supertux/menu/editor_levelset_select_menu.cpp:112 msgid "Create World" msgstr "Crear Mundo" -#: src/supertux/menu/options_menu.cpp:85 src/supertux/menu/main_menu.cpp:53 -#: src/supertux/menu/game_menu.cpp:61 src/supertux/menu/worldmap_menu.cpp:31 -msgid "Options" -msgstr "Opcións" +#: src/supertux/menu/editor_levelset_select_menu.cpp:113 +#: src/supertux/menu/editor_delete_levelset_menu.cpp:41 +msgid "Delete World" +msgstr "Eliminar Mundo" -#: src/supertux/menu/options_menu.cpp:91 -#: src/supertux/menu/options_menu.cpp:127 -#: src/supertux/menu/options_menu.cpp:418 -#: src/supertux/menu/options_menu.cpp:439 src/editor/object_settings.cpp:112 -msgid "auto" -msgstr "auto" +#: src/supertux/menu/options_menu.cpp:72 +#: src/supertux/menu/options_select_menu.cpp:35 +msgid "Locale" +msgstr "Locale" -#: src/supertux/menu/options_menu.cpp:206 -msgid "Desktop" -msgstr "Escritorio" - -#: src/supertux/menu/options_menu.cpp:332 +#: src/supertux/menu/options_menu.cpp:76 msgid "Select Language" msgstr "Seleccionar Idioma" -#: src/supertux/menu/options_menu.cpp:333 +#: src/supertux/menu/options_menu.cpp:77 msgid "Select a different language to display text in" msgstr "Selecciona un idioma diferente no que amosar o texto" -#: src/supertux/menu/options_menu.cpp:335 +#: src/supertux/menu/options_menu.cpp:79 msgid "Language Packs" msgstr "Paquetes de Idioma" -#: src/supertux/menu/options_menu.cpp:336 +#: src/supertux/menu/options_menu.cpp:80 msgid "Language packs contain up-to-date translations" msgstr "Os paquetes de idioma conteñen traducións actualizadas" -#: src/supertux/menu/options_menu.cpp:338 -#: src/supertux/menu/profile_menu.cpp:30 -msgid "Select Profile" -msgstr "Seleccionar Perfil" +#: src/supertux/menu/options_menu.cpp:88 +#: src/supertux/menu/options_select_menu.cpp:37 +msgid "Video" +msgstr "Vídeo" -#: src/supertux/menu/options_menu.cpp:339 -msgid "Select a profile to play with" -msgstr "Selecciona un perfil co que xogar" - -#: src/supertux/menu/options_menu.cpp:342 +#: src/supertux/menu/options_menu.cpp:91 msgid "Window Resizable" msgstr "Xanela de tamaño axustable" -#: src/supertux/menu/options_menu.cpp:343 +#: src/supertux/menu/options_menu.cpp:92 msgid "Allow window resizing, might require a restart to take effect" msgstr "Permitir o cambio de tamaño da xanela, pode precisar un reinicio para que tome efecto" -#: src/supertux/menu/options_menu.cpp:345 -msgid "Window Resolution" -msgstr "Resolución da Xanela" - -#: src/supertux/menu/options_menu.cpp:346 -msgid "Resize the window to the given size" -msgstr "Cambiar o tamaño da xanela ó tamaño indicado" - -#: src/supertux/menu/options_menu.cpp:348 +#: src/supertux/menu/options_menu.cpp:96 msgid "Fullscreen" msgstr "Pantalla completa" -#: src/supertux/menu/options_menu.cpp:349 +#: src/supertux/menu/options_menu.cpp:97 msgid "Fill the entire screen" msgstr "Enche a pantalla completa" -#: src/supertux/menu/options_menu.cpp:351 -msgid "Fullscreen Resolution" -msgstr "Resolución de Pantalla Completa" - -#: src/supertux/menu/options_menu.cpp:352 -msgid "" -"Determine the resolution used in fullscreen mode (you must toggle fullscreen" -" to complete the change)" -msgstr "Determina a resolución utilizada no modo pantalla completa (debes activar a pantalla completa para completar o cambio)" - -#: src/supertux/menu/options_menu.cpp:354 -msgid "Magnification" -msgstr "Aumento" +#: src/supertux/menu/options_menu.cpp:104 +msgid "Fit to browser" +msgstr "Axustar ó navegador" -#: src/supertux/menu/options_menu.cpp:355 -msgid "Change the magnification of the game area" -msgstr "Cambiar o aumento da área do xogo" +#: src/supertux/menu/options_menu.cpp:105 +msgid "Fit the resolution to the size of your browser" +msgstr "Axustar a resolución ó tamaño do navegador" -#: src/supertux/menu/options_menu.cpp:357 -msgid "VSync" -msgstr "VSync" - -#: src/supertux/menu/options_menu.cpp:358 -msgid "Set the VSync mode" -msgstr "Establecer o modo VSync " +#: src/supertux/menu/options_menu.cpp:116 +msgid "Change Video System" +msgstr "Cambiar o Sistema de Vídeo" -#: src/supertux/menu/options_menu.cpp:360 -msgid "Aspect Ratio" -msgstr "Relación de Aspecto" +#: src/supertux/menu/options_menu.cpp:117 +msgid "Change video system used to render graphics" +msgstr "" -#: src/supertux/menu/options_menu.cpp:361 -msgid "Adjust the aspect ratio" -msgstr "Axustar a relación de aspecto" +#: src/supertux/menu/options_menu.cpp:124 +#: src/supertux/menu/options_select_menu.cpp:38 +msgid "Audio" +msgstr "Audio" -#: src/supertux/menu/options_menu.cpp:366 +#: src/supertux/menu/options_menu.cpp:129 msgid "Disable all sound effects" msgstr "Desactivar tódolos efectos de sonido" -#: src/supertux/menu/options_menu.cpp:368 +#: src/supertux/menu/options_menu.cpp:131 msgid "Disable all music" msgstr "Desactivar toda a música" -#: src/supertux/menu/options_menu.cpp:370 -msgid "Sound Volume" -msgstr "Volume do Son" - -#: src/supertux/menu/options_menu.cpp:371 -msgid "Adjust sound volume" -msgstr "Axustar o volume do son" - -#: src/supertux/menu/options_menu.cpp:373 -msgid "Music Volume" -msgstr "Volume da Música" - -#: src/supertux/menu/options_menu.cpp:374 -msgid "Adjust music volume" -msgstr "Axustar o volume da música" - -#: src/supertux/menu/options_menu.cpp:378 +#: src/supertux/menu/options_menu.cpp:138 msgid "Sound (disabled)" msgstr "Son (desactivado)" -#: src/supertux/menu/options_menu.cpp:379 +#: src/supertux/menu/options_menu.cpp:139 msgid "Music (disabled)" msgstr "Música (desactivada)" -#: src/supertux/menu/options_menu.cpp:382 -#: src/supertux/menu/keyboard_menu.cpp:30 +#: src/supertux/menu/options_menu.cpp:147 +#: src/supertux/menu/options_select_menu.cpp:39 +msgid "Controls" +msgstr "Controis" + +#: src/supertux/menu/options_menu.cpp:151 +msgid "Enable Rumbling Controllers" +msgstr "" + +#: src/supertux/menu/options_menu.cpp:152 +msgid "Enable vibrating the game controllers." +msgstr "" + +#: src/supertux/menu/options_menu.cpp:152 +msgid "This feature is currently only used in the multiplayer options menu." +msgstr "" + +#: src/supertux/menu/options_menu.cpp:154 +#: src/supertux/menu/keyboard_menu.cpp:34 msgid "Setup Keyboard" msgstr "Configurar Teclado" -#: src/supertux/menu/options_menu.cpp:383 +#: src/supertux/menu/options_menu.cpp:155 msgid "Configure key-action mappings" msgstr "Configurar a asignación de teclas de acción" -#: src/supertux/menu/options_menu.cpp:385 -#: src/supertux/menu/joystick_menu.cpp:52 +#: src/supertux/menu/options_menu.cpp:158 +#: src/supertux/menu/joystick_menu.cpp:54 msgid "Setup Joystick" msgstr "Configurar Joystick" -#: src/supertux/menu/options_menu.cpp:386 +#: src/supertux/menu/options_menu.cpp:159 msgid "Configure joystick control-action mappings" msgstr "Configurar a asignación do control de acción do joystick" -#: src/supertux/menu/options_menu.cpp:388 +#: src/supertux/menu/options_menu.cpp:167 +#: src/supertux/menu/options_select_menu.cpp:40 +msgid "Extras" +msgstr "Extras" + +#: src/supertux/menu/options_menu.cpp:170 +#: src/supertux/menu/profile_menu.cpp:56 +msgid "Select Profile" +msgstr "Seleccionar Perfil" + +#: src/supertux/menu/options_menu.cpp:171 +msgid "Select a profile to play with" +msgstr "Selecciona un perfil co que xogar" + +#: src/supertux/menu/options_menu.cpp:174 +msgid "Multiplayer settings" +msgstr "" + +#: src/supertux/menu/options_menu.cpp:175 +msgid "Configure settings specific to multiplayer" +msgstr "" + +#: src/supertux/menu/options_menu.cpp:178 msgid "Enable transitions" msgstr "Activar transicións" -#: src/supertux/menu/options_menu.cpp:389 +#: src/supertux/menu/options_menu.cpp:179 msgid "Enable screen transitions and smooth menu animation" msgstr "Permitir transicións de pantalla e animación suave do menú" -#: src/supertux/menu/options_menu.cpp:393 -msgid "Developer Mode" -msgstr "Modo Programador" +#: src/supertux/menu/options_menu.cpp:181 +msgid "Custom title screen levels" +msgstr "" -#: src/supertux/menu/options_menu.cpp:398 +#: src/supertux/menu/options_menu.cpp:182 +msgid "Allow overriding the title screen level, when loading certain worlds" +msgstr "" + +#: src/supertux/menu/options_menu.cpp:185 msgid "Christmas Mode" msgstr "Modo Nadal" -#: src/supertux/menu/options_menu.cpp:401 +#: src/supertux/menu/options_menu.cpp:187 +msgid "Integrations and presence" +msgstr "Integracións e presencia" + +#: src/supertux/menu/options_menu.cpp:188 +msgid "" +"Manage whether SuperTux should display the levels you play on your social " +"media profiles (Discord)" +msgstr "Xestiona se SuperTux debe amosar os niveis ós que xogas nos perfís das redes sociais (Discord)" + +#: src/supertux/menu/options_menu.cpp:192 +msgid "Customize the appearance of the menus" +msgstr "" + +#: src/supertux/menu/options_menu.cpp:199 +#: src/supertux/menu/options_select_menu.cpp:41 +msgid "Advanced" +msgstr "Avanzado" + +#: src/supertux/menu/options_menu.cpp:204 +msgid "Developer Mode" +msgstr "Modo Programador" + +#: src/supertux/menu/options_menu.cpp:206 msgid "Confirmation Dialog" msgstr "Diálogo de Confirmación" -#: src/supertux/menu/options_menu.cpp:401 +#: src/supertux/menu/options_menu.cpp:206 msgid "Confirm aborting level" msgstr "Confirma se queres cancelar o nivel" -#: src/supertux/menu/options_menu.cpp:402 +#: src/supertux/menu/options_menu.cpp:208 msgid "Pause on focus loss" msgstr "Pausa ó perder o foco" +#: src/supertux/menu/options_menu.cpp:209 +msgid "Automatically pause the game when the window loses focus" +msgstr "Poñer en pausa o xogo automaticamente cando cambie a xanela " + +#: src/supertux/menu/options_menu.cpp:211 +msgid "Use custom mouse cursor" +msgstr "Utilizar un cursor do rato personalizado" + +#: src/supertux/menu/options_menu.cpp:211 +msgid "Whether the game renders its own cursor or uses the system's cursor" +msgstr "Se o xogo representa o seu propio cursor ou utiliza o cursor do sistema" + +#: src/supertux/menu/options_menu.cpp:214 +msgid "Check for new releases" +msgstr "" + +#: src/supertux/menu/options_menu.cpp:215 +msgid "" +"Allows the game to perform checks for new SuperTux releases on startup and " +"notify if any found." +msgstr "" + +#: src/supertux/menu/options_menu.cpp:245 +#: src/supertux/menu/options_menu.cpp:288 src/supertux/direction.cpp:76 +msgid "auto" +msgstr "auto" + +#: src/supertux/menu/options_menu.cpp:281 +msgid "Magnification" +msgstr "Aumento" + +#: src/supertux/menu/options_menu.cpp:282 +msgid "Change the magnification of the game area" +msgstr "Cambiar o aumento da área do xogo" + +#: src/supertux/menu/options_menu.cpp:318 +msgid "Aspect Ratio" +msgstr "Relación de Aspecto" + +#: src/supertux/menu/options_menu.cpp:319 +msgid "Adjust the aspect ratio" +msgstr "Axustar a relación de aspecto" + +#: src/supertux/menu/options_menu.cpp:346 +msgid "Window Resolution" +msgstr "Resolución da Xanela" + +#: src/supertux/menu/options_menu.cpp:347 +msgid "Resize the window to the given size" +msgstr "Cambiar o tamaño da xanela ó tamaño indicado" + +#: src/supertux/menu/options_menu.cpp:377 +msgid "Desktop" +msgstr "Escritorio" + +#: src/supertux/menu/options_menu.cpp:404 +msgid "Fullscreen Resolution" +msgstr "Resolución de Pantalla Completa" + +#: src/supertux/menu/options_menu.cpp:405 +msgid "" +"Determine the resolution used in fullscreen mode (you must toggle fullscreen" +" to complete the change)" +msgstr "Determina a resolución utilizada no modo pantalla completa (debes activar a pantalla completa para completar o cambio)" + +#: src/supertux/menu/options_menu.cpp:411 +msgid "on" +msgstr "aceso" + +#: src/supertux/menu/options_menu.cpp:412 +msgid "off" +msgstr "apagado" + +#: src/supertux/menu/options_menu.cpp:413 +msgid "adaptive" +msgstr "adaptativo" + +#: src/supertux/menu/options_menu.cpp:431 +msgid "VSync" +msgstr "VSync" + +#: src/supertux/menu/options_menu.cpp:432 +msgid "Set the VSync mode" +msgstr "Establecer o modo VSync " + +#: src/supertux/menu/options_menu.cpp:467 +msgid "Sound Volume" +msgstr "Volume do Son" + +#: src/supertux/menu/options_menu.cpp:468 +msgid "Adjust sound volume" +msgstr "Axustar o volume do son" + +#: src/supertux/menu/options_menu.cpp:503 +msgid "Music Volume" +msgstr "Volume da Música" + +#: src/supertux/menu/options_menu.cpp:504 +msgid "Adjust music volume" +msgstr "Axustar o volume da música" + +#: src/supertux/menu/options_menu.cpp:517 +msgid "On-screen controls scale" +msgstr "" + +#: src/supertux/menu/options_menu.cpp:638 +msgid "" +"The game couldn't detect your browser resolution.\n" +"This most likely happens because it is not embedded\n" +"in the SuperTux custom HTML template.\n" +msgstr "O xogo non puido detectar a resolución do teu navegador.\nIsto acontece frecuentemente porque non está integrado\nno modelo HTML personalizado de SuperTux.\n" + +#: src/supertux/menu/editor_delete_levelset_menu.cpp:80 +msgid "You cannot delete the world that you are editing" +msgstr "" + +#: src/supertux/menu/editor_delete_levelset_menu.cpp:83 +#, c++-format +msgid "You are about to delete world \"{}\". Are you sure?" +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:82 +#, c++-format +msgid "{} \"{}\"" +msgstr "{} \"{}\"" + +#: src/supertux/menu/addon_preview_menu.cpp:87 +msgid "Some information about this add-on is not available." +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:88 +msgid "Perform a \"Check Online\" to try retrieving it." +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:92 +msgid "No author specified." +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:92 +#, c++-format +msgid "Author: {}" +msgstr "Autor: {}" + +#: src/supertux/menu/addon_preview_menu.cpp:93 +#, c++-format +msgid "Type: {}" +msgstr "Tipo: {}" + +#: src/supertux/menu/addon_preview_menu.cpp:94 +msgid "No license specified." +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:94 +#, c++-format +msgid "License: {}" +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:99 +msgid "Dependencies:" +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:108 +msgid "Installed" +msgstr "Instalado" + +#: src/supertux/menu/addon_preview_menu.cpp:108 +msgid "Not installed" +msgstr "Non instalado" + +#: src/supertux/menu/addon_preview_menu.cpp:113 +msgid "Not available!" +msgstr "Non dispoñible!" + +#: src/supertux/menu/addon_preview_menu.cpp:120 +msgid "Description:" +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:123 +msgid "No description available." +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:147 +msgid "Failed to load all available screenshot previews." +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:152 +msgid "Show screenshots" +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:165 +msgid "Screenshot previews are disabled for automatic installs." +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:169 +msgid "No screenshot previews available." +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:177 +msgid "Install" +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:190 +msgid "Uninstall" +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:214 +#, c++-format +msgid "Are you sure you want to uninstall \"{}\"?" +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:215 +msgid "" +"\n" +"Your progress won't be lost." +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:227 +#, c++-format +msgid "" +"NOTE: The add-on \"{}\" is a dependency of {} other installed {}.\n" +"Are you sure you wish to uninstall?" +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:246 +#, c++-format +msgid "" +"Cannot toggle add-on \"{}\":\n" +"{}" +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:279 +msgid "Fetching screenshot previews..." +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:300 +msgid "Updating" +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:300 +msgid "Downloading" +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:328 +msgid "Add-on uninstalled successfully." +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:333 +#, c++-format +msgid "" +"Error uninstalling add-on:\n" +"{}" +msgstr "" + +#: src/supertux/menu/addon_preview_menu.cpp:361 +msgid "" +"Please restart SuperTux\n" +"for these changes to take effect." +msgstr "Reinicie SuperTux\npara que estes cambios teñan efecto." + #: src/supertux/menu/main_menu.cpp:51 src/supertux/menu/world_set_menu.cpp:28 msgid "Start Game" msgstr "Comezar Xogo" -#: src/supertux/menu/main_menu.cpp:52 src/supertux/menu/addon_menu.cpp:122 +#: src/supertux/menu/main_menu.cpp:55 msgid "Add-ons" msgstr "Complementos" -#: src/supertux/menu/main_menu.cpp:54 src/supertux/menu/editor_menu.cpp:39 +#: src/supertux/menu/main_menu.cpp:57 src/supertux/menu/web_asset_menu.cpp:38 +msgid "Manage Assets" +msgstr "Xestionar Datos" + +#: src/supertux/menu/main_menu.cpp:59 +#: src/supertux/menu/options_select_menu.cpp:29 +#: src/supertux/menu/game_menu.cpp:58 src/supertux/menu/worldmap_menu.cpp:31 +#: src/supertux/menu/editor_menu.cpp:70 +msgid "Options" +msgstr "Opcións" + +#: src/supertux/menu/main_menu.cpp:60 src/supertux/menu/editor_menu.cpp:58 msgid "Level Editor" msgstr "Editor de Niveis" -#: src/supertux/menu/main_menu.cpp:55 +#: src/supertux/menu/main_menu.cpp:61 msgid "Credits" msgstr "Créditos" -#: src/supertux/menu/main_menu.cpp:56 +#: src/supertux/menu/main_menu.cpp:64 msgid "Donate" msgstr "Doar" -#: src/supertux/menu/main_menu.cpp:57 +#: src/supertux/menu/main_menu.cpp:67 msgid "Quit" msgstr "Saír" -#: src/supertux/menu/editor_sector_menu.cpp:35 +#: src/supertux/menu/main_menu.cpp:106 +msgid "" +"This will take you to the SuperTux donation page. Are you sure you want to " +"continue?" +msgstr "" + +#: src/supertux/menu/editor_sector_menu.cpp:34 +#, c++-format +msgid "Sector {}" +msgstr "" + +#: src/supertux/menu/editor_sector_menu.cpp:37 msgid "Initialization script" msgstr "Script de iniciación" -#: src/supertux/menu/editor_sector_menu.cpp:36 +#: src/supertux/menu/editor_sector_menu.cpp:38 msgid "Gravity" msgstr "Gravidade" -#: src/supertux/menu/editor_sector_menu.cpp:41 +#: src/supertux/menu/editor_sector_menu.cpp:43 msgid "Resize offset X" msgstr "Cambiar tamaño da compensación X" -#: src/supertux/menu/editor_sector_menu.cpp:42 +#: src/supertux/menu/editor_sector_menu.cpp:44 msgid "Resize offset Y" msgstr "Cambiar tamaño da compensación Y" -#: src/supertux/menu/editor_sector_menu.cpp:43 +#: src/supertux/menu/editor_sector_menu.cpp:45 msgid "Resize" msgstr "Cambiar o tamaño" -#: src/supertux/menu/profile_menu.cpp:37 -#, c-format -msgid "[Profile {}]" -msgstr "[Perfil {}]" +#: src/supertux/menu/profile_menu.cpp:60 +msgid "No profiles found." +msgstr "" -#: src/supertux/menu/profile_menu.cpp:41 -#, c-format +#: src/supertux/menu/profile_menu.cpp:68 +#: src/supertux/menu/profile_menu.cpp:149 +#: src/supertux/menu/profile_menu.cpp:168 +#, c++-format msgid "Profile {}" -msgstr "Perfil {}" +msgstr "" + +#: src/supertux/menu/profile_menu.cpp:69 +#, c++-format +msgid "{} (Profile {})" +msgstr "" + +#: src/supertux/menu/profile_menu.cpp:84 +msgid "No profile selected." +msgstr "" + +#: src/supertux/menu/profile_menu.cpp:91 src/supertux/menu/profile_menu.cpp:93 +#: src/supertux/menu/profile_name_menu.cpp:42 +msgid "Rename" +msgstr "" + +#: src/supertux/menu/profile_menu.cpp:98 +#: src/supertux/menu/profile_menu.cpp:100 +msgid "Reset" +msgstr "" + +#: src/supertux/menu/profile_menu.cpp:103 +#: src/supertux/menu/profile_menu.cpp:105 +msgid "Reset all" +msgstr "" + +#: src/supertux/menu/profile_menu.cpp:113 +#: src/supertux/menu/profile_menu.cpp:115 +msgid "Delete all" +msgstr "" -#: src/supertux/menu/editor_levelset_menu.cpp:59 +#: src/supertux/menu/profile_menu.cpp:148 +#, c++-format +msgid "" +"This will reset all game progress on the profile \"{}\".\n" +"Are you sure?" +msgstr "" + +#: src/supertux/menu/profile_menu.cpp:157 +msgid "This will reset your game progress on all profiles. Are you sure?" +msgstr "Isto restablecerá o progreso no xogo en tódolos perfís. Estás seguro?" + +#: src/supertux/menu/profile_menu.cpp:167 +#, c++-format +msgid "" +"This will delete the profile \"{}\",\n" +"including all game progress on it. Are you sure?" +msgstr "" + +#: src/supertux/menu/profile_menu.cpp:178 +msgid "" +"This will delete all profiles, including all game progress on them.\n" +"Are you sure?" +msgstr "" + +#: src/supertux/menu/editor_levelset_menu.cpp:53 #: src/supertux/menu/editor_new_levelset_menu.cpp:35 msgid "Description" msgstr "Descrición" -#: src/supertux/menu/editor_levelset_menu.cpp:60 -#: src/supertux/menu/addon_menu.cpp:48 -#: data//images/engine/editor/objects.stoi:332 -msgid "Worldmap" -msgstr "Mapa Principal" +#: src/supertux/menu/editor_levelset_menu.cpp:55 +msgid "Title Screen Level" +msgstr "" -#: src/supertux/menu/editor_levelset_menu.cpp:60 -#: src/supertux/menu/addon_menu.cpp:45 -msgid "Levelset" -msgstr "Conxunto de niveis" +#: src/supertux/menu/editor_levelset_menu.cpp:56 +msgid "A level to be used for the title screen, after exiting the world." +msgstr "" -#: src/supertux/menu/addon_menu.cpp:51 -msgid "World" -msgstr "Mundo" +#: src/supertux/menu/multiplayer_players_menu.cpp:46 +msgid "Add Player" +msgstr "" -#: src/supertux/menu/addon_menu.cpp:54 -msgid "Add-on" -msgstr "Complemento" +#: src/supertux/menu/multiplayer_players_menu.cpp:59 +msgid "Remove Last Player" +msgstr "" -#: src/supertux/menu/addon_menu.cpp:60 -msgid "Unknown" -msgstr "Descoñecido" +#: src/supertux/menu/multiplayer_players_menu.cpp:62 +msgid "" +"Warning: The player you are trying to\n" +"remove is currently in-game.\n" +"\n" +"Do you wish to remove them anyways?" +msgstr "" -#: src/supertux/menu/addon_menu.cpp:71 -#, c-format -msgid "{} \"{}\" by \"{}\"" -msgstr "{} \"{}\" por \"{}\"" +#: src/supertux/menu/addon_menu.cpp:68 +msgid "Installed Language Packs" +msgstr "" + +#: src/supertux/menu/addon_menu.cpp:68 +msgid "Installed Add-ons" +msgstr "" + +#: src/supertux/menu/addon_menu.cpp:76 src/supertux/menu/addon_menu.cpp:117 +msgid "No language packs installed" +msgstr "" -#: src/supertux/menu/addon_menu.cpp:129 +#: src/supertux/menu/addon_menu.cpp:76 msgid "No Add-ons installed" msgstr "Non hai Complementos instalados" -#: src/supertux/menu/addon_menu.cpp:133 -msgid "No Add-ons found" -msgstr "Non se atoparon Complementos" +#: src/supertux/menu/addon_menu.cpp:124 +#, c++-format +msgid "{} {}*UPDATE*" +msgstr "" -#: src/supertux/menu/addon_menu.cpp:179 -#, c-format -msgid "Install {} *NEW*" -msgstr "Instalar {} *NOVO*" +#: src/supertux/menu/addon_menu.cpp:130 +#, c++-format +msgid "{}{}" +msgstr "" -#: src/supertux/menu/addon_menu.cpp:190 -#, c-format -msgid "Install {}" -msgstr "Instalar {}" +#: src/supertux/menu/addon_menu.cpp:140 +msgid "No updates available." +msgstr "" -#: src/supertux/menu/addon_menu.cpp:199 -msgid "No new Add-ons found" -msgstr "Non se atoparon Complementos novos" +#: src/supertux/menu/addon_menu.cpp:144 +#, c++-format +msgid "{} {} available" +msgstr "" -#: src/supertux/menu/addon_menu.cpp:205 -msgid "Check Online (disabled)" -msgstr "Verificar En Liña (desactivado)" +#: src/supertux/menu/addon_menu.cpp:144 +msgid "update" +msgstr "" -#: src/supertux/menu/addon_menu.cpp:209 -msgid "Check Online" -msgstr "Verificar En Liña" +#: src/supertux/menu/addon_menu.cpp:144 +msgid "updates" +msgstr "" -#: src/supertux/menu/addon_menu.cpp:286 -msgid "Downloading Add-On Repository Index" -msgstr "Descargar o Índice do Repositorio de Complementos" +#: src/supertux/menu/addon_menu.cpp:146 +msgid "Check for updates" +msgstr "" -#: src/supertux/menu/addon_menu.cpp:301 -#, c-format -msgid "Downloading {}" -msgstr "Descargando {}" +#: src/supertux/menu/addon_menu.cpp:150 +msgid "Browse language packs" +msgstr "" -#: src/supertux/menu/addon_menu.cpp:348 -msgid "" -"Please restart SuperTux\n" -"for these changes to take effect." -msgstr "Reinicie SuperTux\npara que estes cambios teñan efecto." +#: src/supertux/menu/addon_menu.cpp:150 +#: src/supertux/menu/addon_browse_menu.cpp:70 +msgid "Browse Add-ons" +msgstr "" + +#: src/supertux/menu/addon_menu.cpp:151 +msgid "Install from file" +msgstr "" + +#: src/supertux/menu/addon_menu.cpp:208 +msgid "Checking for updates..." +msgstr "" #: src/supertux/menu/editor_new_levelset_menu.cpp:31 msgid "New World" @@ -1903,217 +3638,302 @@ msgstr "Introduza un nome para este subconxunto de niveis" msgid "Story Mode" msgstr "Modo Historia" -#: src/supertux/menu/game_menu.cpp:31 -msgid "Are you sure?" -msgstr "Estás seguro?" +#: src/supertux/menu/addon_browse_menu.cpp:70 +msgid "Browse Language Packs" +msgstr "" + +#: src/supertux/menu/addon_browse_menu.cpp:112 +#, c++-format +msgid "Page {}/{}" +msgstr "" + +#: src/supertux/menu/addon_browse_menu.cpp:124 +msgid "No new language packs available" +msgstr "" + +#: src/supertux/menu/addon_browse_menu.cpp:124 +msgid "No new Add-ons available" +msgstr "" + +#: src/supertux/menu/addon_browse_menu.cpp:127 +msgid "No language packs available" +msgstr "" + +#: src/supertux/menu/addon_browse_menu.cpp:127 +msgid "No Add-ons available" +msgstr "" + +#: src/supertux/menu/addon_browse_menu.cpp:135 +#: src/supertux/menu/addon_browse_menu.cpp:139 +msgid "Previous page" +msgstr "Páxina previa" + +#: src/supertux/menu/addon_browse_menu.cpp:143 +#: src/supertux/menu/addon_browse_menu.cpp:147 +msgid "Next page" +msgstr "Seguinte páxina" + +#: src/supertux/menu/addon_browse_menu.cpp:154 +msgid "Check Online (disabled)" +msgstr "Verificar En Liña (desactivado)" + +#: src/supertux/menu/addon_browse_menu.cpp:158 +msgid "Check Online" +msgstr "Verificar En Liña" + +#: src/supertux/menu/addon_browse_menu.cpp:195 +msgid "Downloading Add-On Repository Index" +msgstr "Descargar o Índice do Repositorio de Complementos" -#: src/supertux/menu/game_menu.cpp:54 src/supertux/menu/worldmap_menu.cpp:30 +#: src/supertux/menu/web_asset_menu.cpp:42 +msgid "New files location" +msgstr "Localización dos novos ficheiros" + +#: src/supertux/menu/web_asset_menu.cpp:43 +msgid "Add Files" +msgstr "Engadir Ficheiros" + +#: src/supertux/menu/web_asset_menu.cpp:44 +msgid "Download Files" +msgstr "Descargar Ficheiros" + +#: src/supertux/menu/particle_editor_open.cpp:32 +msgid "Load particle file" +msgstr "Cargar ficheiro de partícula" + +#: src/supertux/menu/particle_editor_open.cpp:39 +msgid "Open" +msgstr "Abrir" + +#: src/supertux/menu/game_menu.cpp:51 src/supertux/menu/worldmap_menu.cpp:30 msgid "Continue" msgstr "Continuar" -#: src/supertux/menu/game_menu.cpp:55 +#: src/supertux/menu/game_menu.cpp:52 msgid "Restart Level" msgstr "Reiniciar Nivel" -#: src/supertux/menu/game_menu.cpp:58 +#: src/supertux/menu/game_menu.cpp:55 msgid "Restart from Checkpoint" msgstr "Reiniciar dende o Punto de Rescate" -#: src/supertux/menu/game_menu.cpp:63 +#: src/supertux/menu/game_menu.cpp:60 msgid "Abort Level" msgstr "Cancelar Nivel" -#: src/supertux/menu/keyboard_menu.cpp:32 -#: src/supertux/menu/joystick_menu.cpp:69 -msgid "Up" -msgstr "Arriba" +#: src/supertux/menu/game_menu.cpp:76 src/supertux/menu/game_menu.cpp:87 +#: src/supertux/menu/game_menu.cpp:99 +msgid "Are you sure?" +msgstr "Estás seguro?" -#: src/supertux/menu/keyboard_menu.cpp:33 -#: src/supertux/menu/joystick_menu.cpp:70 -msgid "Down" -msgstr "Abaixo" +#: src/supertux/menu/profile_name_menu.cpp:36 +#, c++-format +msgid "Rename \"{}\"" +msgstr "" -#: src/supertux/menu/keyboard_menu.cpp:34 +#: src/supertux/menu/profile_name_menu.cpp:36 +msgid "Add profile" +msgstr "Engadir perfil" + +#: src/supertux/menu/profile_name_menu.cpp:40 +msgid "Profile names must have a maximum of 20 characters." +msgstr "Os nomes do perfil deben ter un máximo de 20 caracteres." + +#: src/supertux/menu/profile_name_menu.cpp:42 +msgid "Create" +msgstr "Crear" + +#: src/supertux/menu/profile_name_menu.cpp:56 +msgid "" +"Profile names must have a maximum of 20 characters.\n" +"Please choose a different name." +msgstr "Os nomes do perfil deben ter un máximo de 20 caracteres.\nPor favor, elixe un nome diferente." + +#: src/supertux/menu/profile_name_menu.cpp:77 +msgid "An error occurred while creating the profile." +msgstr "Produciuse un erro ó crear o perfil." + +#: src/supertux/menu/keyboard_menu.cpp:36 #: src/supertux/menu/joystick_menu.cpp:71 -msgid "Left" -msgstr "Esquerda" +msgid "Up" +msgstr "Arriba" -#: src/supertux/menu/keyboard_menu.cpp:35 +#: src/supertux/menu/keyboard_menu.cpp:37 #: src/supertux/menu/joystick_menu.cpp:72 -msgid "Right" -msgstr "Dereita" +msgid "Down" +msgstr "Abaixo" -#: src/supertux/menu/keyboard_menu.cpp:36 -#: src/supertux/menu/joystick_menu.cpp:73 +#: src/supertux/menu/keyboard_menu.cpp:40 +#: src/supertux/menu/joystick_menu.cpp:75 msgid "Jump" msgstr "Saltar" -#: src/supertux/menu/keyboard_menu.cpp:38 -#: src/supertux/menu/joystick_menu.cpp:76 +#: src/supertux/menu/keyboard_menu.cpp:43 +#: src/supertux/menu/joystick_menu.cpp:78 msgid "Peek Left" msgstr "Ollar á Esquerda" -#: src/supertux/menu/keyboard_menu.cpp:39 -#: src/supertux/menu/joystick_menu.cpp:77 +#: src/supertux/menu/keyboard_menu.cpp:44 +#: src/supertux/menu/joystick_menu.cpp:79 msgid "Peek Right" msgstr "Ollar á Dereita" -#: src/supertux/menu/keyboard_menu.cpp:40 -#: src/supertux/menu/joystick_menu.cpp:78 +#: src/supertux/menu/keyboard_menu.cpp:45 +#: src/supertux/menu/joystick_menu.cpp:80 msgid "Peek Up" msgstr "Ollar Arriba" -#: src/supertux/menu/keyboard_menu.cpp:41 -#: src/supertux/menu/joystick_menu.cpp:79 +#: src/supertux/menu/keyboard_menu.cpp:46 +#: src/supertux/menu/joystick_menu.cpp:81 msgid "Peek Down" msgstr "Ollar Embaixo" -#: src/supertux/menu/keyboard_menu.cpp:43 -#: src/supertux/menu/joystick_menu.cpp:81 +#: src/supertux/menu/keyboard_menu.cpp:51 +#: src/supertux/menu/joystick_menu.cpp:83 msgid "Console" msgstr "Consola" -#: src/supertux/menu/keyboard_menu.cpp:46 -#: src/supertux/menu/joystick_menu.cpp:82 +#: src/supertux/menu/keyboard_menu.cpp:52 +#: src/supertux/menu/joystick_menu.cpp:84 msgid "Cheat Menu" msgstr "Menú das Trampas" -#: src/supertux/menu/keyboard_menu.cpp:47 -#: src/supertux/menu/joystick_menu.cpp:83 +#: src/supertux/menu/keyboard_menu.cpp:53 +#: src/supertux/menu/joystick_menu.cpp:85 msgid "Debug Menu" msgstr "Menú da Depuración" -#: src/supertux/menu/keyboard_menu.cpp:49 -#: src/supertux/menu/joystick_menu.cpp:85 +#: src/supertux/menu/keyboard_menu.cpp:56 +#: src/supertux/menu/joystick_menu.cpp:87 msgid "Jump with Up" msgstr "Saltar coa frecha Arriba" -#: src/supertux/menu/keyboard_menu.cpp:62 +#: src/supertux/menu/keyboard_menu.cpp:82 msgid "Up cursor" msgstr "Cursor arriba" -#: src/supertux/menu/keyboard_menu.cpp:64 +#: src/supertux/menu/keyboard_menu.cpp:84 msgid "Down cursor" msgstr "Cursor abaixo" -#: src/supertux/menu/keyboard_menu.cpp:66 +#: src/supertux/menu/keyboard_menu.cpp:86 msgid "Left cursor" msgstr "Cursor esquerdo" -#: src/supertux/menu/keyboard_menu.cpp:68 +#: src/supertux/menu/keyboard_menu.cpp:88 msgid "Right cursor" msgstr "Cursor dereito" -#: src/supertux/menu/keyboard_menu.cpp:70 +#: src/supertux/menu/keyboard_menu.cpp:90 msgid "Return" msgstr "Retroceso" -#: src/supertux/menu/keyboard_menu.cpp:72 +#: src/supertux/menu/keyboard_menu.cpp:92 msgid "Space" msgstr "Espazo" -#: src/supertux/menu/keyboard_menu.cpp:74 +#: src/supertux/menu/keyboard_menu.cpp:94 msgid "Right Shift" msgstr "Maiúscula Dereita" -#: src/supertux/menu/keyboard_menu.cpp:76 +#: src/supertux/menu/keyboard_menu.cpp:96 msgid "Left Shift" msgstr "Maiúscula Esquerda" -#: src/supertux/menu/keyboard_menu.cpp:78 +#: src/supertux/menu/keyboard_menu.cpp:98 msgid "Right Control" msgstr "Control Dereita" -#: src/supertux/menu/keyboard_menu.cpp:80 +#: src/supertux/menu/keyboard_menu.cpp:100 msgid "Left Control" msgstr "Control Esquerda" -#: src/supertux/menu/keyboard_menu.cpp:82 +#: src/supertux/menu/keyboard_menu.cpp:102 msgid "Right Alt" msgstr "Alt Dereita" -#: src/supertux/menu/keyboard_menu.cpp:84 +#: src/supertux/menu/keyboard_menu.cpp:104 msgid "Left Alt" msgstr "Alt Esquerda" -#: src/supertux/menu/keyboard_menu.cpp:86 +#: src/supertux/menu/keyboard_menu.cpp:106 msgid "Right Command" msgstr "Tecla Orde Dereita" -#: src/supertux/menu/keyboard_menu.cpp:88 +#: src/supertux/menu/keyboard_menu.cpp:108 msgid "Left Command" msgstr "Tecla Orde Esquerda" -#: src/supertux/menu/keyboard_menu.cpp:102 +#: src/supertux/menu/keyboard_menu.cpp:122 msgid "Press Key" msgstr "Preme Tecla" -#: src/supertux/menu/language_menu.cpp:40 +#: src/supertux/menu/language_menu.cpp:43 msgid "Language" msgstr "Idioma" -#: src/supertux/menu/language_menu.cpp:42 +#: src/supertux/menu/language_menu.cpp:45 msgid "" msgstr "" -#: src/supertux/menu/joystick_menu.cpp:55 +#: src/supertux/menu/joystick_menu.cpp:57 msgid "Manual Configuration" msgstr "Configuración Manual" -#: src/supertux/menu/joystick_menu.cpp:57 +#: src/supertux/menu/joystick_menu.cpp:59 msgid "" "Use manual configuration instead of SDL2's automatic GameController support" msgstr "Utiliza a configuración manual en vez da asistencia automática GameController SDL2" -#: src/supertux/menu/joystick_menu.cpp:75 +#: src/supertux/menu/joystick_menu.cpp:77 msgid "Pause/Menu" msgstr "Pausa/Menú" -#: src/supertux/menu/joystick_menu.cpp:91 +#: src/supertux/menu/joystick_menu.cpp:93 msgid "No Joysticks found" msgstr "Non se atoparon Joysticks" -#: src/supertux/menu/joystick_menu.cpp:92 +#: src/supertux/menu/joystick_menu.cpp:94 msgid "Scan for Joysticks" msgstr "Buscar Joysticks" -#: src/supertux/menu/joystick_menu.cpp:125 +#: src/supertux/menu/joystick_menu.cpp:127 msgid "Press Button" msgstr "Premer Botón" -#: src/supertux/menu/joystick_menu.cpp:162 +#: src/supertux/menu/joystick_menu.cpp:164 msgid "Axis " msgstr "Eixo" -#: src/supertux/menu/joystick_menu.cpp:165 +#: src/supertux/menu/joystick_menu.cpp:167 msgid "-" msgstr "-" -#: src/supertux/menu/joystick_menu.cpp:167 +#: src/supertux/menu/joystick_menu.cpp:169 msgid "+" msgstr "+" -#: src/supertux/menu/joystick_menu.cpp:174 +#: src/supertux/menu/joystick_menu.cpp:176 msgid "X2" msgstr "X2" -#: src/supertux/menu/joystick_menu.cpp:176 +#: src/supertux/menu/joystick_menu.cpp:178 msgid "Y2" msgstr "Y2" -#: src/supertux/menu/joystick_menu.cpp:189 +#: src/supertux/menu/joystick_menu.cpp:191 msgid "Hat Up" msgstr "Inclinar Arriba" -#: src/supertux/menu/joystick_menu.cpp:193 +#: src/supertux/menu/joystick_menu.cpp:195 msgid "Hat Down" msgstr "Inclinar Abaixo" -#: src/supertux/menu/joystick_menu.cpp:197 +#: src/supertux/menu/joystick_menu.cpp:199 msgid "Hat Left" msgstr "Inclinar Esquerda" -#: src/supertux/menu/joystick_menu.cpp:201 +#: src/supertux/menu/joystick_menu.cpp:203 msgid "Hat Right" msgstr "Inclinar Dereito" @@ -2125,37 +3945,103 @@ msgstr "Pausa" msgid "Leave World" msgstr "Deixar o Mundo" -#: src/supertux/menu/download_dialog.cpp:27 +#: src/supertux/menu/download_dialog.cpp:42 msgid "Abort Download" msgstr "Cancelar a Descarga" -#: src/supertux/menu/download_dialog.cpp:42 -msgid "Error:\n" -msgstr "Erro:\n" - -#: src/supertux/menu/download_dialog.cpp:96 -msgid "Close" -msgstr "Pechar" +#: src/supertux/menu/download_dialog.cpp:59 +#, c++-format +msgid "" +"Error:\n" +"{}" +msgstr "Erro:\n{}" -#: src/supertux/menu/cheat_menu.cpp:37 +#: src/supertux/menu/cheat_menu.cpp:38 msgid "Bonus: Star" msgstr "Bono: Estrela" -#: src/supertux/menu/cheat_menu.cpp:38 +#: src/supertux/menu/cheat_menu.cpp:39 msgid "Shrink Tux" -msgstr "Afundir Tux" +msgstr "Encoller a Tux" -#: src/supertux/menu/cheat_menu.cpp:39 +#: src/supertux/menu/cheat_menu.cpp:40 msgid "Kill Tux" msgstr "Destruír a Tux" +#: src/supertux/menu/cheat_menu.cpp:55 +msgid "Prevent Death" +msgstr "" + +#: src/supertux/menu/addon_file_install_menu.cpp:32 +msgid "Install Add-on from file" +msgstr "" + +#: src/supertux/menu/addon_file_install_menu.cpp:34 +msgid "Drag and drop add-on ZIP archive" +msgstr "" + +#: src/supertux/menu/particle_editor_menu.cpp:32 +msgid "Particle Editor" +msgstr "Editor de Partículas" + +#: src/supertux/menu/particle_editor_menu.cpp:36 +#: src/supertux/menu/editor_menu.cpp:60 +msgid "Return to Editor" +msgstr "Volver ó Editor" + +#: src/supertux/menu/particle_editor_menu.cpp:37 +msgid "New Particle Config" +msgstr "Nova Configuración da Partícula" + +#: src/supertux/menu/particle_editor_menu.cpp:38 +msgid "Save Particle Config" +msgstr "Gardar Configuración da Partícula" + +#: src/supertux/menu/particle_editor_menu.cpp:39 +msgid "Save Particle Config as..." +msgstr "Gardar Configuración da Partícula como..." + +#: src/supertux/menu/particle_editor_menu.cpp:40 +msgid "Load Another Particle Config" +msgstr "Cargar Outra Configuración da Partícula" + +#: src/supertux/menu/particle_editor_menu.cpp:44 +msgid "Open Particle Directory" +msgstr "Abrir Directorio da Partícula" + +#: src/supertux/menu/particle_editor_menu.cpp:45 +#: src/supertux/menu/editor_menu.cpp:118 +msgid "Keyboard Shortcuts" +msgstr "Atallos do Teclado" + +#: src/supertux/menu/particle_editor_menu.cpp:49 +msgid "Exit Particle Editor" +msgstr "Saír do Editor da Partícula" + +#: src/supertux/menu/particle_editor_menu.cpp:121 +msgid "" +"Keyboard Shortcuts:\n" +"---------------------\n" +"Esc = Open Menu\n" +"Ctrl+S = Save\n" +"Ctrl+Shift+S = Save as\n" +"Ctrl+O = Open\n" +"Ctrl+Z = Undo\n" +"Ctrl+Y = Redo" +msgstr "Atallos de Teclado:\n---------------------\nEsc = Abrir Menú\nCtrl+S = Gardar\nCtrl+Shift+S = Gardar coma\nCtrl+O = Abrir\nCtrl+Z = Desfacer\nCtrl+Y = Refacer" + +#: src/supertux/menu/particle_editor_menu.cpp:122 +#: src/supertux/menu/editor_menu.cpp:206 +msgid "Got it!" +msgstr "Conseguido!" + #: src/supertux/menu/editor_level_menu.cpp:31 -#: src/supertux/menu/editor_menu.cpp:70 +#: src/supertux/menu/editor_menu.cpp:116 msgid "Worldmap Settings" msgstr "Configuración do Mapa Principal" #: src/supertux/menu/editor_level_menu.cpp:31 -#: src/supertux/menu/editor_menu.cpp:70 +#: src/supertux/menu/editor_menu.cpp:116 msgid "Level Settings" msgstr "Configuración do Nivel" @@ -2163,7 +4049,7 @@ msgstr "Configuración do Nivel" msgid "Author" msgstr "Autor" -#: src/supertux/menu/editor_level_menu.cpp:35 data//credits.stxt:1129 +#: src/supertux/menu/editor_level_menu.cpp:35 data//credits.stxt:1253 msgid "Contact" msgstr "Contacto" @@ -2172,106 +4058,152 @@ msgid "License" msgstr "Licenza" #: src/supertux/menu/editor_level_menu.cpp:37 +msgid "Level Note" +msgstr "Nota do Nivel" + +#: src/supertux/menu/editor_level_menu.cpp:38 msgid "Tileset" msgstr "Conxunto de Teselas" -#: src/supertux/menu/editor_level_menu.cpp:40 +#: src/supertux/menu/editor_level_menu.cpp:41 msgid "Target Time" msgstr "Tempo para acadar o Obxectivo" -#: src/supertux/menu/editor_level_menu.cpp:82 +#: src/supertux/menu/editor_level_menu.cpp:83 msgid "Please enter a name for this level." msgstr "Introduce un nome para este nivel." -#: src/supertux/menu/editor_level_menu.cpp:86 +#: src/supertux/menu/editor_level_menu.cpp:87 msgid "Please enter a level author for this level." msgstr "Introduce un autor do nivel para este nivel." -#: src/supertux/menu/editor_level_menu.cpp:90 +#: src/supertux/menu/editor_level_menu.cpp:91 msgid "Please enter a license for this level." msgstr "Introduce unha licenza para este nivel." -#: src/supertux/menu/editor_menu.cpp:34 -msgid "1/8 tile (4px)" -msgstr "1/8 tesela (4px)" +#: src/supertux/menu/editor_menu.cpp:53 +msgid "tiny tile (4px)" +msgstr "tesela minúscula (4px)" -#: src/supertux/menu/editor_menu.cpp:35 -msgid "1/4 tile (8px)" -msgstr "1/4 tesela (8px)" - -#: src/supertux/menu/editor_menu.cpp:36 -msgid "1/2 tile (16px)" -msgstr "1/2 tesela (16px)" +#: src/supertux/menu/editor_menu.cpp:54 +msgid "small tile (8px)" +msgstr "tesela pequena (8px)" -#: src/supertux/menu/editor_menu.cpp:37 -msgid "1 tile (32px)" -msgstr "1 tesela (32px)" +#: src/supertux/menu/editor_menu.cpp:55 +msgid "medium tile (16px)" +msgstr "tesela media (16px)" -#: src/supertux/menu/editor_menu.cpp:41 -msgid "Return to Editor" -msgstr "Volver ó Editor" +#: src/supertux/menu/editor_menu.cpp:56 +msgid "big tile (32px)" +msgstr "tesela grande (32px)" -#: src/supertux/menu/editor_menu.cpp:42 +#: src/supertux/menu/editor_menu.cpp:61 msgid "Save Worldmap" msgstr "Gardar Mapa Principal" -#: src/supertux/menu/editor_menu.cpp:42 +#: src/supertux/menu/editor_menu.cpp:61 msgid "Save Level" msgstr "Gardar Nivel" -#: src/supertux/menu/editor_menu.cpp:45 +#: src/supertux/menu/editor_menu.cpp:65 msgid "Test Level" msgstr "Probar Nivel" -#: src/supertux/menu/editor_menu.cpp:49 +#: src/supertux/menu/editor_menu.cpp:67 msgid "Test Worldmap" msgstr "Probar Mapa Principal" -#: src/supertux/menu/editor_menu.cpp:52 +#: src/supertux/menu/editor_menu.cpp:72 msgid "Share Level" msgstr "Compartir Nivel" -#: src/supertux/menu/editor_menu.cpp:54 +#: src/supertux/menu/editor_menu.cpp:74 +msgid "Package Add-On" +msgstr "Empaquetar como extensión" + +#: src/supertux/menu/editor_menu.cpp:76 msgid "Open Level Directory" msgstr "Abrir o Directorio do Nivel" -#: src/supertux/menu/editor_menu.cpp:57 +#: src/supertux/menu/editor_menu.cpp:79 msgid "Edit Another Level" msgstr "Editar Outro Nivel" -#: src/supertux/menu/editor_menu.cpp:60 +#: src/supertux/menu/editor_menu.cpp:81 msgid "Edit Another World" msgstr "Editar Outro Mundo" -#: src/supertux/menu/editor_menu.cpp:64 +#: src/supertux/menu/editor_menu.cpp:86 +msgid "Convert all tiles in the level using converters." +msgstr "" + +#: src/supertux/menu/editor_menu.cpp:90 msgid "Grid Size" msgstr "Tamaño da Grade" -#: src/supertux/menu/editor_menu.cpp:65 +#: src/supertux/menu/editor_menu.cpp:91 msgid "Show Grid" msgstr "Amosar Grade" -#: src/supertux/menu/editor_menu.cpp:66 +#: src/supertux/menu/editor_menu.cpp:92 msgid "Grid Snapping" msgstr "Axuste da Grade" -#: src/supertux/menu/editor_menu.cpp:67 -msgid "Render Background" -msgstr "Representar Fondo" +#: src/supertux/menu/editor_menu.cpp:93 +msgid "Render Background" +msgstr "Representar Fondo" + +#: src/supertux/menu/editor_menu.cpp:94 +msgid "Render Light" +msgstr "Representar Luz" + +#: src/supertux/menu/editor_menu.cpp:95 +msgid "Autotile Mode" +msgstr "Modo de Tesela Automática" + +#: src/supertux/menu/editor_menu.cpp:96 +msgid "Enable Autotile Help" +msgstr "Activar axuda de autoteselado" + +#: src/supertux/menu/editor_menu.cpp:97 +msgid "Enable Object Undo Tracking" +msgstr "" + +#: src/supertux/menu/editor_menu.cpp:100 +msgid "Undo Stack Size" +msgstr "" + +#: src/supertux/menu/editor_menu.cpp:102 +msgid "Autosave Frequency" +msgstr "Frecuencia de Auto-gardado" + +#: src/supertux/menu/editor_menu.cpp:108 +msgid "Check for Deprecated Tiles" +msgstr "" + +#: src/supertux/menu/editor_menu.cpp:109 +msgid "Check if any deprecated tiles are currently present in the level." +msgstr "" -#: src/supertux/menu/editor_menu.cpp:68 -msgid "Render Light" -msgstr "Representar Luz" +#: src/supertux/menu/editor_menu.cpp:110 +msgid "Show Deprecated Tiles" +msgstr "" -#: src/supertux/menu/editor_menu.cpp:72 -msgid "Keyboard Shortcuts" -msgstr "Atallos do Teclado" +#: src/supertux/menu/editor_menu.cpp:111 +msgid "" +"Indicate all deprecated tiles on the active tilemap, without the need of " +"hovering over." +msgstr "" -#: src/supertux/menu/editor_menu.cpp:75 +#: src/supertux/menu/editor_menu.cpp:121 msgid "Exit Level Editor" msgstr "Saír do Editor do Niveis" -#: src/supertux/menu/editor_menu.cpp:122 +#: src/supertux/menu/editor_menu.cpp:170 +msgid "Do you want to package this world as an add-on?" +msgstr "Queres empaquetar este mundo como unha expansión extra?" + +#: src/supertux/menu/editor_menu.cpp:196 msgid "" "We encourage you to share your levels in the SuperTux forum.\n" "To find your level, click the\n" @@ -2279,7 +4211,7 @@ msgid "" "Do you want to go to the forum now?" msgstr "Animámoste a que compartas os teus niveis no foro de SuperTux.\nPara atopar o teu nivel, preme o\nelemento do menú \"Abrir Directorio de Niveis\".\nQueres ir xa ó foro?" -#: src/supertux/menu/editor_menu.cpp:134 +#: src/supertux/menu/editor_menu.cpp:205 msgid "" "Keyboard Shortcuts:\n" "---------------------\n" @@ -2290,127 +4222,456 @@ msgid "" "Ctrl+Y = Redo\n" "F6 = Render Light\n" "F7 = Grid Snapping\n" -"F8 = Show Grid" -msgstr "Atallos do Teclado:\n---------------------\nEsc = Abrir Menú\nCtrl+S = Gardar\nCtrl+T = Probar\nCtrl+Z = Desfacer\nCtrl+Y = Refacer\nF6 = Representar a Luz\nF7 = Axuste á Grade\nF8 = Amosar Grade" +"F8 = Show Grid\n" +"Ctrl++ or Ctrl+Scroll Up = Zoom In\n" +"Ctrl+- or Ctrl+Scroll Down = Zoom Out\n" +"Ctrl+D = Reset Zoom\n" +"\n" +"Scripting Shortcuts:\n" +" ------------- \n" +"Home = Go to beginning of line\n" +"End = Go to end of line\n" +"Left arrow = Go back in text\n" +"Right arrow = Go forward in text\n" +"Backspace = Delete in front of text cursor\n" +"Delete = Delete behind text cursor\n" +"Ctrl+X = Cut whole line\n" +"Ctrl+C = Copy whole line\n" +"Ctrl+V = Paste\n" +"Ctrl+D = Duplicate line\n" +"Ctrl+Z = Undo\n" +"Ctrl+Y = Redo" +msgstr "" -#: src/supertux/menu/editor_menu.cpp:135 -msgid "Got it!" -msgstr "Conseguido!" +#: src/supertux/menu/editor_menu.cpp:232 +msgid "Deprecated tiles are still present in the level." +msgstr "" + +#: src/supertux/menu/editor_menu.cpp:239 +msgid "Do you want to show all deprecated tiles on active tilemaps?" +msgstr "" + +#: src/supertux/menu/editor_menu.cpp:246 +msgid "There are no more deprecated tiles in the level!" +msgstr "" + +#: src/supertux/menu/multiplayer_player_menu.cpp:40 +msgid "Play with the keyboard" +msgstr "Xogar co teclado" + +#: src/supertux/menu/multiplayer_player_menu.cpp:58 +msgid "Remove Player" +msgstr "Eliminar Xogador" + +#: src/supertux/menu/multiplayer_player_menu.cpp:82 +msgid "Respawn Player" +msgstr "" + +#: src/supertux/menu/multiplayer_player_menu.cpp:108 +msgid "Spawn Player" +msgstr "" + +#: src/supertux/menu/multiplayer_player_menu.cpp:136 +msgid "Controllers" +msgstr "" + +#: src/supertux/menu/multiplayer_player_menu.cpp:152 +msgid "" +"This controller does not support rumbling;\n" +"please check the controllers manually." +msgstr "" + +#: src/supertux/menu/multiplayer_player_menu.cpp:157 +msgid "" +"This SuperTux build does not support rumbling\n" +"controllers; please check the controllers manually." +msgstr "" + +#: src/supertux/menu/multiplayer_player_menu.cpp:184 +msgid "" +"This joystick does not support rumbling;\n" +"please check the joysticks manually." +msgstr "" -#: src/supertux/levelintro.cpp:136 -#, c-format +#: src/supertux/menu/multiplayer_player_menu.cpp:189 +msgid "" +"This SuperTux build does not support rumbling\n" +"joysticks; please check the joysticks manually." +msgstr "" + +#: src/supertux/menu/editor_delete_level_menu.cpp:59 +msgid "No levels available" +msgstr "Non hai niveis dispoñibles" + +#: src/supertux/menu/editor_delete_level_menu.cpp:79 +msgid "You cannot delete the level that you are editing!" +msgstr "Non podes eliminar o nivel que estas editando!" + +#: src/supertux/menu/editor_delete_level_menu.cpp:82 +#, c++-format +msgid "You are about to delete level \"{}\". Are you sure?" +msgstr "" + +#: src/supertux/levelintro.cpp:137 +#, c++-format msgid "contributed by {}" -msgstr "aportado por {}" +msgstr "" -#: src/supertux/levelintro.cpp:169 +#: src/supertux/levelintro.cpp:184 msgid "Badguys killed" msgstr "Tipos malos destruídos" -#: src/supertux/levelintro.cpp:177 +#: src/supertux/levelintro.cpp:192 msgid "Best time" msgstr "Mellor tempo" -#: src/supertux/levelintro.cpp:181 +#: src/supertux/levelintro.cpp:196 msgid "Level target time" msgstr "Tempo para acadar o obxectivo do nivel" -#: src/supertux/tile_set.cpp:92 +#: src/supertux/tile_set.cpp:113 msgid "Others" msgstr "Outros" -#: src/supertux/moving_object.cpp:44 +#: src/supertux/direction.cpp:67 +msgid "up" +msgstr "arriba" + +#: src/supertux/direction.cpp:69 +msgid "down" +msgstr "abaixo" + +#: src/supertux/moving_object.cpp:63 msgid "Region" msgstr "Rexión" +#: src/supertux/main.cpp:801 +#, c++-format +msgid "New release: SuperTux v{}!" +msgstr "" + +#: src/supertux/main.cpp:804 +#, c++-format +msgid "" +"A new release of SuperTux (v{}) is available!\n" +"For more information, you can visit the SuperTux website.\n" +"\n" +"Do you want to visit the website now?" +msgstr "" + +#: src/supertux/main.cpp:815 +msgid "Checking for new releases..." +msgstr "" + #: src/control/joystick_config.cpp:85 msgid "Joystick Mappings" msgstr "Asignación do Joystick" -#: src/worldmap/worldmap_parser.cpp:167 +#: src/worldmap/sprite_change.cpp:91 +msgid "Stay action" +msgstr "Posición estática" + +#: src/worldmap/sprite_change.cpp:92 +msgid "Initial stay action" +msgstr "Posición estática inicial" + +#: src/worldmap/sprite_change.cpp:93 +msgid "Stay group" +msgstr "Grupo estático" + +#: src/worldmap/sprite_change.cpp:94 +msgid "Change on touch" +msgstr "Cambiar ó tocar" + +#: src/worldmap/special_tile.hpp:36 +msgid "Special Tile" +msgstr "" + +#: src/worldmap/level_tile.hpp:36 src/worldmap/level_tile.cpp:161 +msgid "Level" +msgstr "Nivel" + +#: src/worldmap/teleporter.cpp:50 +msgid "Automatic" +msgstr "Automático" + +#: src/worldmap/teleporter.cpp:51 +msgid "Target worldmap" +msgstr "Mapa principal obxectivo" + +#: src/worldmap/sprite_change.hpp:35 +msgid "Sprite Change" +msgstr "Cambio de Fada" + +#: src/worldmap/special_tile.cpp:75 +msgid "Show message" +msgstr "Amosar mensaxe" + +#: src/worldmap/level_tile.cpp:84 msgid "" msgstr "" -#: src/editor/node_marker.cpp:79 +#: src/worldmap/level_tile.cpp:162 +msgid "Outro script" +msgstr "Script de saída" + +#: src/worldmap/level_tile.cpp:163 +msgid "Auto play" +msgstr "Reprodución automática" + +#: src/worldmap/level_tile.cpp:164 +msgid "Title colour" +msgstr "Cor do título" + +#: src/worldmap/teleporter.hpp:34 +msgid "Teleporter" +msgstr "Teletransporte" + +#: src/editor/tip.cpp:80 +msgid "" +"This object's current functionality is deprecated.\n" +"Updating to get its latest functionality is recommended." +msgstr "" + +#: src/editor/node_marker.cpp:122 msgid "Path Node" msgstr "Nodo do Camiño" -#: src/editor/object_settings.cpp:112 -msgid "up" -msgstr "arriba" +#: src/editor/node_marker.cpp:123 +msgid "Press CTRL to move Bezier handles" +msgstr "Pulsa CTRL para mover os puntos de control Bézier" -#: src/editor/object_settings.cpp:112 -msgid "down" -msgstr "abaixo" +#: src/editor/node_marker.cpp:127 +msgid "Easing" +msgstr "Transición animada" -#: src/editor/object_settings.cpp:124 +#: src/editor/object_settings.cpp:129 msgid "West" msgstr "Oeste" -#: src/editor/object_settings.cpp:124 +#: src/editor/object_settings.cpp:129 msgid "East" msgstr "Leste" -#: src/editor/object_settings.cpp:124 +#: src/editor/object_settings.cpp:129 msgid "North" msgstr "Norte" -#: src/editor/object_settings.cpp:124 +#: src/editor/object_settings.cpp:129 msgid "South" msgstr "Sur" -#: src/editor/object_settings.cpp:137 +#: src/editor/object_settings.cpp:142 msgid "One shot" msgstr "Un tiro" -#: src/editor/object_settings.cpp:137 +#: src/editor/object_settings.cpp:142 msgid "Ping-pong" msgstr "Ping-pong" -#: src/editor/object_settings.cpp:137 +#: src/editor/object_settings.cpp:142 msgid "Circular" msgstr "Circular" -#: src/editor/object_settings.cpp:137 -msgid "Unordered" -msgstr "Desordenado" +#: src/editor/layers_widget.cpp:331 +#, c++-format +msgid "Sector: {}" +msgstr "" -#: src/editor/object_option.cpp:83 +#: src/editor/object_option.cpp:92 msgid "true" msgstr "certo" -#: src/editor/object_option.cpp:83 +#: src/editor/object_option.cpp:92 msgid "false" msgstr "falso" -#: src/editor/object_option.cpp:246 src/editor/object_option.cpp:295 +#: src/editor/object_option.cpp:308 src/editor/object_option.cpp:356 msgid "invalid" msgstr "non válido" -#: src/editor/object_option.cpp:553 +#: src/editor/object_option.cpp:665 +msgid "Scale X" +msgstr "" + +#: src/editor/object_option.cpp:666 +msgid "Scale Y" +msgstr "" + +#: src/editor/object_option.cpp:667 +msgid "Offset X" +msgstr "" + +#: src/editor/object_option.cpp:668 +msgid "Offset Y" +msgstr "" + +#: src/editor/object_option.cpp:672 src/editor/object_menu.cpp:67 msgid "Remove" msgstr "Eliminar" -#: src/editor/worldmap_objects.hpp:56 src/editor/worldmap_objects.cpp:129 -msgid "Level" -msgstr "Nivel" +#: src/editor/object_option.cpp:689 +msgid "Test from here" +msgstr "Probar dende aquí" -#: src/editor/worldmap_objects.hpp:79 -msgid "Teleporter" -msgstr "Teletransporte" +#: src/editor/object_option.cpp:706 +msgid "Open Particle Editor" +msgstr "Abrir o Editor de Partículas" -#: src/editor/worldmap_objects.hpp:119 -msgid "Sprite Change" -msgstr "Cambio de Fada" +#: src/editor/particle_editor.cpp:114 +msgid "Change texture... ->" +msgstr "" + +#: src/editor/particle_editor.cpp:126 +msgid "Max amount" +msgstr "Cantidade máxima" + +#: src/editor/particle_editor.cpp:142 +msgid "Spawn anywhere" +msgstr "Aparecer en calquera lugar" + +#: src/editor/particle_editor.cpp:143 +msgid "Life duration" +msgstr "Duración de vida" -#: src/editor/worldmap_objects.hpp:140 -msgid "Special tile" -msgstr "Tesela especial" +#: src/editor/particle_editor.cpp:148 +msgid "Birth duration" +msgstr "Tempo de creación" -#: src/editor/editor.cpp:477 +#: src/editor/particle_editor.cpp:153 +msgid "Death duration" +msgstr "Tempo de destrucción" + +#: src/editor/particle_editor.cpp:160 +msgid "Grow" +msgstr "Crecer" + +#: src/editor/particle_editor.cpp:175 +msgid "Horizontal speed" +msgstr "Velocidade horizontal" + +#: src/editor/particle_editor.cpp:180 +msgid "Vertical speed" +msgstr "Velocidade vertical" + +#: src/editor/particle_editor.cpp:185 +msgid "Horizontal acceleration" +msgstr "Aceleración horizontal" + +#: src/editor/particle_editor.cpp:186 +msgid "Vertical acceleration" +msgstr "Aceleración vertical" + +#: src/editor/particle_editor.cpp:187 +msgid "Horizontal friction" +msgstr "Fricción horizontal" + +#: src/editor/particle_editor.cpp:188 +msgid "Vertical friction" +msgstr "Fricción vertical" + +#: src/editor/particle_editor.cpp:190 +msgid "Initial rotation" +msgstr "Rotación inicial" + +#: src/editor/particle_editor.cpp:201 +msgid "Rotation friction/decceleration" +msgstr "Fricción de giro/desaceleración" + +#: src/editor/particle_editor.cpp:211 +msgid "Destroy" +msgstr "Destruír" + +#: src/editor/particle_editor.cpp:215 +msgid "Stick to surface" +msgstr "Pegarse á superficie" + +#: src/editor/particle_editor.cpp:216 +msgid "Stick and stay" +msgstr "Pegarse e quedarse" + +#: src/editor/particle_editor.cpp:217 +msgid "No collision" +msgstr "Sen colisión" + +#: src/editor/particle_editor.cpp:222 +msgid "Always destroy" +msgstr "Destruír sempre" + +#: src/editor/particle_editor.cpp:226 +msgid "Offscreen mode" +msgstr "Modo fora da pantalla" + +#: src/editor/particle_editor.cpp:229 +msgid "Clear" +msgstr "" + +#: src/editor/particle_editor.cpp:245 +msgid "<- General settings" +msgstr "" + +#: src/editor/particle_editor.cpp:255 +msgid "Likeliness" +msgstr "" + +#: src/editor/particle_editor.cpp:266 +msgid "Color (RGBA)" +msgstr "" + +#: src/editor/particle_editor.cpp:311 +msgid "Scale (x, y)" +msgstr "" + +#: src/editor/particle_editor.cpp:332 +msgid "Hitbox scale (x, y)" +msgstr "" + +#: src/editor/particle_editor.cpp:353 +msgid "Hitbox offset relative to scale" +msgstr "" + +#: src/editor/particle_editor.cpp:372 +msgid "Change texture..." +msgstr "" + +#: src/editor/particle_editor.cpp:766 +msgid "" +"This particle configuration contains unsaved changes,\n" +"do you want to save?" +msgstr "Estos axustes de partícula teñen cambios sen gardar, \nqueres gardar?" + +#: src/editor/particle_editor.cpp:774 +msgid "Save as" +msgstr "Gardar coma" + +#: src/editor/editor.cpp:577 +msgid "" +"This level contains deprecated tiles.\n" +"It is strongly recommended to replace all deprecated tiles\n" +"to avoid loss of compatibility in future versions." +msgstr "" + +#: src/editor/editor.cpp:579 +msgid "Tip: Turn on \"Show Deprecated Tiles\" from the level editor menu." +msgstr "" + +#: src/editor/editor.cpp:626 +msgid "" +"Don't forget that your levels and assets\n" +"aren't saved between sessions!\n" +"If you want to keep your levels, download them\n" +"from the \"Manage Assets\" menu." +msgstr "Non esquezas que os teus niveles e datos\ngárdanse entre sesións!\nSe queres gardar os niveis, descárgaos\ndende o menú de “Xestionar Datos”." + +#: src/editor/editor.cpp:661 msgid "This level contains unsaved changes, do you want to save?" msgstr "Este nivel contén cambios non gardados, queres gardalos?" -#: src/editor/editor.cpp:517 +#: src/editor/editor.cpp:662 +msgid "This level may contain unsaved changes, do you want to save?" +msgstr "" + +#: src/editor/editor.cpp:797 msgid "" "Some obsolete add-ons are still active\n" "and might cause collisions with default Super Tux structure.\n" @@ -2418,432 +4679,463 @@ msgid "" "Disabling these add-ons will not delete your game progress." msgstr "Algúns complementos obsoletos aínda están activos\ne poden crear colisións coa estrutura predeterminada de Super Tux.\nAínda podes activar estes complementos no menú.\nDesactivar estes complementos non eliminará o teu progreso no xogo." -#: src/editor/editor.cpp:520 +#: src/editor/editor.cpp:800 msgid "Disable add-ons" msgstr "Desactivar complementos" -#: src/editor/editor.cpp:525 +#: src/editor/editor.cpp:805 msgid "Ignore (not advised)" msgstr "Ignorar (non aconsellado)" -#: src/editor/editor.cpp:529 +#: src/editor/editor.cpp:809 msgid "Leave editor" msgstr "Deixar o editor" -#: src/editor/editor.cpp:740 +#: src/editor/editor.cpp:1023 msgid "" "Couldn't find a \"main\" sector.\n" "Please change the name of the sector where\n" "you'd like the player to start to \"main\"" msgstr "Non se puido atopar un sector \"principal\".\nCambia o nome do sector onde\nqueiras que o xogador inicie como \"principal\"" -#: src/editor/editor.cpp:744 +#: src/editor/editor.cpp:1027 msgid "" "Couldn't find a \"main\" spawnpoint.\n" " Please change the name of the spawnpoint where\n" "you'd like the player to start to \"main\"" msgstr "Non se puido atopar un punto de inicio \"principal\".\nCambia o nome do punto de inicio onde\nqueiras que o xogador inicie como \"principal\"" -#: src/editor/worldmap_objects.cpp:130 -msgid "Outro script" -msgstr "Script de saída" - -#: src/editor/worldmap_objects.cpp:131 -msgid "Auto play" -msgstr "Reprodución automática" - -#: src/editor/worldmap_objects.cpp:133 -msgid "Title colour" -msgstr "Cor do título" +#: src/editor/object_menu.cpp:60 +msgid "Patch Notes" +msgstr "" -#: src/editor/worldmap_objects.cpp:175 -msgid "Automatic" -msgstr "Automático" +#: src/editor/object_menu.cpp:84 +msgid "" +"This will update the object to its latest functionality.\n" +"Check the \"Patch Notes\" for more information.\n" +"\n" +"Keep in mind this is very likely to break the proper behaviour of the object.\n" +"Make sure to re-check any behaviour, related to the object." +msgstr "" -#: src/editor/worldmap_objects.cpp:177 -msgid "Target worldmap" -msgstr "Mapa principal obxectivo" +#: src/editor/object_menu.cpp:98 +#, c++-format +msgid "Patch notes for v{}:" +msgstr "" -#: src/editor/worldmap_objects.cpp:240 -msgid "Stay action" -msgstr "Posición estática" +#: src/editor/overlay_widget.cpp:1062 +msgid "Cannot select deprecated tiles" +msgstr "" -#: src/editor/worldmap_objects.cpp:241 -msgid "Initial stay action" -msgstr "Posición estática inicial" +#: src/editor/overlay_widget.cpp:1567 +msgid "Autotile mode is on" +msgstr "O modo de Tesela Automática está activado" -#: src/editor/worldmap_objects.cpp:242 -msgid "Stay group" -msgstr "Grupo estático" +#: src/editor/overlay_widget.cpp:1571 +msgid "Hold Ctrl to enable autotile" +msgstr "Pulsar a tecla Ctrl para activar a tesela automática" -#: src/editor/worldmap_objects.cpp:243 -msgid "Change on touch" -msgstr "Cambiar ó tocar" +#: src/editor/overlay_widget.cpp:1578 +msgid "Autotile erasing mode is on" +msgstr "O modo de borrado de tesela automática está activado" -#: src/editor/worldmap_objects.cpp:273 -msgid "Show message" -msgstr "Amosar mensaxe" +#: src/editor/overlay_widget.cpp:1582 +msgid "Selected tile isn't autotileable" +msgstr "A tesela seleccionada non é autoteselable" -#: src/editor/worldmap_objects.cpp:275 -msgid "Invisible" -msgstr "Invisible" +#: src/editor/overlay_widget.cpp:1587 +msgid "Hold Ctrl to enable autotile erasing" +msgstr "Pulsar a tecla Ctrl para activar o borrado da tesela automática" #: data//credits.stxt:25 msgid "Current SuperTux Team" msgstr "Equipo Actual de SuperTux" #: data//credits.stxt:30 -msgid "Programming, project lead ad interim" -msgstr "Programación, líder do proxecto como interino" +msgid "Maintainer, Programming" +msgstr "" #: data//credits.stxt:35 msgid "Graphics, Level Design, Story" msgstr "Gráficos, Deseño de Niveis, Historia" #: data//credits.stxt:40 -msgid "Graphics, Story, Optimisation" -msgstr "Gráficos, Historia, Optimización" +msgid "Level Design, Story, Optimisation, Coordination" +msgstr "Deseño de Niveis, Historia, Optimización, Coordinación" -#: data//credits.stxt:45 data//credits.stxt:100 data//credits.stxt:186 -#: data//credits.stxt:498 +#: data//credits.stxt:45 data//credits.stxt:120 data//credits.stxt:206 +#: data//credits.stxt:538 msgid "Graphics" msgstr "Gráficos" -#: data//credits.stxt:50 data//credits.stxt:60 data//credits.stxt:82 -#: data//credits.stxt:88 +#: data//credits.stxt:50 data//credits.stxt:102 data//credits.stxt:108 msgid "Graphics, Programming, Level Design" msgstr "Gráficos, Programación, Deseño de Niveis" #: data//credits.stxt:55 +msgid "Features and Programming" +msgstr "Funcións e Programación" + +#: data//credits.stxt:60 +msgid "Minor features and programming" +msgstr "Pequenas melloras e programación" + +#: data//credits.stxt:65 +msgid "Programming, Level Updates" +msgstr "Programación, Actualización de Niveis" + +#: data//credits.stxt:70 msgid "Graphics, Programming" msgstr "Gráficos, Programación" -#: data//credits.stxt:65 data//credits.stxt:130 data//credits.stxt:135 -#: data//credits.stxt:140 data//credits.stxt:145 data//credits.stxt:160 -#: data//credits.stxt:165 data//credits.stxt:494 data//credits.stxt:506 +#: data//credits.stxt:75 data//credits.stxt:85 data//credits.stxt:150 +#: data//credits.stxt:155 data//credits.stxt:160 data//credits.stxt:165 +#: data//credits.stxt:180 data//credits.stxt:185 data//credits.stxt:534 +#: data//credits.stxt:546 msgid "Programming" msgstr "Programación" -#: data//credits.stxt:71 +#: data//credits.stxt:80 data//credits.stxt:266 +msgid "Level Design" +msgstr "Deseño de Niveis" + +#: data//credits.stxt:91 msgid "Original Developers" msgstr "Programadores Orixinais" -#: data//credits.stxt:76 +#: data//credits.stxt:96 msgid "Original Developer" msgstr "Programador Orixinal" -#: data//credits.stxt:94 +#: data//credits.stxt:114 msgid "Music, Level Design" msgstr "Música, Deseño de Niveis" -#: data//credits.stxt:106 +#: data//credits.stxt:126 msgid "Programming, Graphics, Level Design" msgstr "Programación, Gráficos, Deseño de Niveis" -#: data//credits.stxt:112 +#: data//credits.stxt:132 msgid "Programming, Level Design" msgstr "Programación, Deseño de Niveis" -#: data//credits.stxt:118 +#: data//credits.stxt:138 msgid "Graphics, Story" msgstr "Gráficos, Historia" -#: data//credits.stxt:124 +#: data//credits.stxt:144 msgid "Programming, Documentation" msgstr "Programación, Documentación" -#: data//credits.stxt:150 +#: data//credits.stxt:170 msgid "Coordination" msgstr "Coordinación" -#: data//credits.stxt:155 +#: data//credits.stxt:175 msgid "Programming, \"Flexlay\" Level editor" msgstr "Programación, Editor de Niveis \"Flexlay\"" -#: data//credits.stxt:170 +#: data//credits.stxt:190 msgid "Windows build fixes" msgstr "Arranxos das compilacións de Windows" -#: data//credits.stxt:175 +#: data//credits.stxt:195 msgid "Packaging, Nightly builds" msgstr "Empaquetado, Compilacións automáticas" -#: data//credits.stxt:180 +#: data//credits.stxt:200 msgid "Translation Guru (and many details anyone else could have done)" msgstr "Gurú da Tradución (e moitos máis detalles que ninguén máis ten feito)" -#: data//credits.stxt:240 -msgid "Level Design" -msgstr "Deseño de Niveis" - -#: data//credits.stxt:414 +#: data//credits.stxt:450 msgid "Additional contributors" msgstr "Colaboradores adicionais" -#: data//credits.stxt:419 +#: data//credits.stxt:455 msgid "Bug fixes" msgstr "Arranxos de erros" -#: data//credits.stxt:423 +#: data//credits.stxt:459 msgid "Scripting functions, Level fixes" msgstr "Funcións de script, Arranxos de niveis" -#: data//credits.stxt:427 +#: data//credits.stxt:463 msgid "Code quality fixes" msgstr "Arranxos da calidade do código" -#: data//credits.stxt:431 data//credits.stxt:435 data//credits.stxt:439 -#: data//credits.stxt:466 +#: data//credits.stxt:467 data//credits.stxt:471 data//credits.stxt:475 +#: data//credits.stxt:502 msgid "Various contributions" msgstr "Contribucións varias" -#: data//credits.stxt:443 +#: data//credits.stxt:479 msgid "Build issue fix" msgstr "Arranxo de incidencia da compilación" -#: data//credits.stxt:447 data//credits.stxt:451 +#: data//credits.stxt:483 data//credits.stxt:487 msgid "Code contributions" msgstr "Contribucións de código" -#: data//credits.stxt:454 +#: data//credits.stxt:490 msgid "Code contribution, AppData file" msgstr "Contribución de código, Ficheiro AppData" -#: data//credits.stxt:458 +#: data//credits.stxt:494 msgid "Bug fix" msgstr "Amaño de erros" -#: data//credits.stxt:462 +#: data//credits.stxt:498 msgid "Menu reorganization" msgstr "Reorganización do Menú" -#: data//credits.stxt:470 +#: data//credits.stxt:506 msgid "Fixing tile bugs" msgstr "Amañar erros das teselas" -#: data//credits.stxt:474 +#: data//credits.stxt:510 msgid "Build error fix" msgstr "Arranxo de erro da compilación" -#: data//credits.stxt:478 +#: data//credits.stxt:514 msgid "Scripting function fix" msgstr "Arranxo da función de script" -#: data//credits.stxt:482 +#: data//credits.stxt:518 +msgid "New features and notable updates" +msgstr "Novas funcións e actualizacións importantes" + +#: data//credits.stxt:522 msgid "Support for \"glbinding\" as optional OpenGL binding" msgstr "Asistencia para \"glbinding\" como vínculo opcional a OpenGL" -#: data//credits.stxt:486 +#: data//credits.stxt:526 msgid "New menu code" msgstr "Código do novo menú" -#: data//credits.stxt:490 +#: data//credits.stxt:530 msgid "Big Tux Walking Sprites improvements" msgstr "Grandes melloras das Fadas Camiñantes de Tux" -#: data//credits.stxt:502 data//credits.stxt:510 +#: data//credits.stxt:542 data//credits.stxt:550 msgid "Contrib Programming" msgstr "Programación de Colaboradores" -#: data//credits.stxt:514 +#: data//credits.stxt:554 msgid "Programming, Previous Maintainer" msgstr "Programación, Encargado de Mantemento Anterior" -#: data//credits.stxt:518 +#: data//credits.stxt:558 msgid "Various Contributions" msgstr "Contribucións Varias" -#: data//credits.stxt:522 data//credits.stxt:526 data//credits.stxt:530 -#: data//credits.stxt:534 data//credits.stxt:538 data//credits.stxt:542 -#: data//credits.stxt:546 data//credits.stxt:550 data//credits.stxt:554 +#: data//credits.stxt:562 data//credits.stxt:566 data//credits.stxt:570 +#: data//credits.stxt:574 data//credits.stxt:578 data//credits.stxt:582 +#: data//credits.stxt:586 data//credits.stxt:590 data//credits.stxt:594 +#: data//credits.stxt:598 data//credits.stxt:602 data//credits.stxt:606 +#: data//credits.stxt:610 data//credits.stxt:614 data//credits.stxt:618 +#: data//credits.stxt:622 data//credits.stxt:626 data//credits.stxt:630 +#: data//credits.stxt:634 data//credits.stxt:638 data//credits.stxt:642 +#: data//credits.stxt:646 data//credits.stxt:650 data//credits.stxt:654 +#: data//credits.stxt:658 data//credits.stxt:662 msgid "Contributions" msgstr "Colaboracións" -#: data//credits.stxt:560 +#: data//credits.stxt:668 msgid "Localization" msgstr "Localización" -#: data//credits.stxt:1107 +#: data//credits.stxt:1231 msgid " Special Thanks to" msgstr "Agradecemento Especial a" -#: data//credits.stxt:1112 +#: data//credits.stxt:1236 msgid "Creator of Tux, the Linux penguin" msgstr "Creador de Tux, o pingüín de Linux" -#: data//credits.stxt:1116 +#: data//credits.stxt:1240 msgid "SDL, OpenAL and OpenGL" msgstr "SDL, OpenAL e OpenGL" -#: data//credits.stxt:1117 +#: data//credits.stxt:1241 msgid "" "For making such a great gaming experience\n" " possible on Linux" msgstr "Por facer posible esta gran experiencia de xogo\nen Linux" -#: data//credits.stxt:1122 +#: data//credits.stxt:1246 msgid "and you, the player" msgstr "e a ti, o xogador" -#: data//credits.stxt:1123 +#: data//credits.stxt:1247 msgid "for giving this game a chance and playing it" msgstr "por darlle unha oportunidade e xogar con el" -#: data//credits.stxt:1134 +#: data//credits.stxt:1258 msgid "Visit our webpage at" msgstr "Visita a nosa páxina web en" -#: data//credits.stxt:1143 +#: data//credits.stxt:1267 msgid "Or visit us directly at IRC:" msgstr "Ou visítanos directamente no IRC:" -#: data//credits.stxt:1147 -msgid "#supertux at webchat.freenode.net" -msgstr "#supertux en webchat.freenode.net" +#: data//credits.stxt:1271 +msgid "#supertux at web.libera.chat" +msgstr "#supertux en web.libera.chat" -#: data//credits.stxt:1152 +#: data//credits.stxt:1276 msgid "Or at our Forum:" msgstr "Ou no Foro:" -#: data//credits.stxt:1161 +#: data//credits.stxt:1285 msgid "Comments, ideas and suggestions" msgstr "Comentarios, ideas e suxerencias" -#: data//credits.stxt:1165 +#: data//credits.stxt:1289 msgid "go to our mailing list" msgstr "vai á nosa lista de correo" #. l10n: typo contact -#: data//credits.stxt:1175 +#: data//credits.stxt:1299 msgid "Typographical errors can be" msgstr "Os erros tipográficos poden" #. l10n: typo contact -#: data//credits.stxt:1180 +#: data//credits.stxt:1304 msgid "reported to" msgstr "informarse en" #. l10n: typo contact, see -#: data//credits.stxt:1185 +#: data//credits.stxt:1309 msgid "supertux-devel@lists.lethargik.org" msgstr "supertux-devel@lists.lethargik.org" -#: data//credits.stxt:1192 +#: data//credits.stxt:1316 msgid "Want to help…" msgstr "Queres axudar..." -#: data//credits.stxt:1197 +#: data//credits.stxt:1321 msgid "…with localization?" msgstr "...coa localización?" -#: data//credits.stxt:1207 +#: data//credits.stxt:1331 msgid "…with something else?" msgstr "...con algo máis?" -#: data//credits.stxt:1218 +#: data//credits.stxt:1342 msgid "Thank you for" msgstr "Grazas por" -#: data//credits.stxt:1222 +#: data//credits.stxt:1346 msgid "playing" msgstr "xogar" -#: data//credits.stxt:1232 +#: data//credits.stxt:1356 msgid "Penny awaits you in warmer temperatures!" msgstr "Penny agárdate en temperaturas máis cálidas!" -#: data//images/engine/editor/objects.stoi:156 +#: data//images/engine/editor/objects.stoi:4 +msgid "Enemies" +msgstr "Inimigos" + +#: data//images/engine/editor/objects.stoi:162 msgid "Bosses" msgstr "Xefes" -#: data//images/engine/editor/objects.stoi:167 +#: data//images/engine/editor/objects.stoi:173 msgid "Projectiles" msgstr "Proxectís" -#: data//images/engine/editor/objects.stoi:181 +#: data//images/engine/editor/objects.stoi:184 msgid "Environment" msgstr "Ambiente" -#: data//images/ice_world.strf:6 data//images/tiles.strf:327 -#: data//images/worldmap.strf:67 -msgid "Forest" -msgstr "Bosque" - -#: data//images/ice_world.strf:106 +#: data//images/ice_world.strf:80 msgid "Ice Cave & Crystal" msgstr "Cova de Xeo & Cristal" -#: data//images/ice_world.strf:153 +#: data//images/ice_world.strf:127 msgid "Embellishments" msgstr "Adornos" -#: data//images/ice_world.strf:237 -msgid "Ice" -msgstr "Xeo" +#: data//images/ice_world.strf:320 +msgid "Underground Forest" +msgstr "Bosque Subterráneo" -#: data//images/ice_world.strf:282 data//images/tiles.strf:693 -msgid "Castle" -msgstr "Castelo" +#: data//images/ice_world.strf:375 +msgid "Trees & Bushes" +msgstr "Árbores & Arbustos" + +#: data//images/ice_world.strf:406 +msgid "Seasonal" +msgstr "Estacional" + +#: data//images/ice_world.strf:496 +msgid "Structure" +msgstr "Estrutura" -#: data//images/ice_world.strf:328 +#: data//images/ice_world.strf:557 msgid "Pathing" msgstr "Camiñar" -#: data//images/ice_world.strf:424 +#: data//images/ice_world.strf:718 msgid "Water" msgstr "Auga" -#: data//images/tiles.strf:19 data//images/worldmap.strf:41 -msgid "Snow" -msgstr "Neve" - -#: data//images/tiles.strf:124 +#: data//images/tiles.strf:252 msgid "Snow Background" msgstr "Fondo de Neve" -#: data//images/tiles.strf:162 -msgid "Snow Mountain" -msgstr "Montaña Nevada" - -#: data//images/tiles.strf:236 +#: data//images/tiles.strf:300 msgid "Crystal" msgstr "Cristal" -#: data//images/tiles.strf:457 +#: data//images/tiles.strf:539 msgid "Forest Background" msgstr "Fondo de Bosque" -#: data//images/tiles.strf:572 +#: data//images/tiles.strf:690 +msgid "Corrupted Forest" +msgstr "" + +#: data//images/tiles.strf:868 +msgid "Corrupted Background" +msgstr "" + +#: data//images/tiles.strf:991 msgid "Block + Bonus" msgstr "Bloque + Bono" -#: data//images/tiles.strf:618 +#: data//images/tiles.strf:1069 msgid "Pole + Signs" msgstr "Signos de Polo +" -#: data//images/tiles.strf:661 +#: data//images/tiles.strf:1113 msgid "Liquid" msgstr "Líquido" -#: data//images/tiles.strf:833 data//images/worldmap.strf:199 +#: data//images/tiles.strf:1131 +msgid "Castle" +msgstr "Castelo" + +#: data//images/tiles.strf:1231 data//images/worldmap.strf:199 msgid "Halloween" msgstr "Halloween" -#: data//images/tiles.strf:861 +#: data//images/tiles.strf:1272 msgid "Industrial" msgstr "Industrial" -#: data//images/tiles.strf:876 +#: data//images/tiles.strf:1287 msgid "Unisolid + Lightmap" msgstr "Unisolid + Mapa de Luz" -#: data//images/tiles.strf:893 +#: data//images/tiles.strf:1314 msgid "Miscellaneous" msgstr "Miscelánea" -#: data//images/tiles.strf:927 -msgid "Old/Unused" -msgstr "Antigo/Non utilizado" +#: data//images/tiles.strf:1342 +msgid "Retro Tiles" +msgstr "" #: data//images/worldmap.strf:24 msgid "Water paths" @@ -2856,3 +5148,19 @@ msgstr "Camiños do castelo" #: data//images/worldmap.strf:135 msgid "Darker Forest" msgstr "O Bosque Máis Escuro" + +#: data//images/converters/data.stcd:3 +msgid "Nightly Tiles" +msgstr "" + +#: data//images/converters/data.stcd:5 +msgid "For levels, created in previous Nightly builds." +msgstr "" + +#: data//images/converters/data.stcd:8 +msgid "Pre-0.6.3 Crystal Tiles" +msgstr "" + +#: data//images/converters/data.stcd:10 +msgid "For levels, created in pre-0.6.3 versions, which use crystal tiles." +msgstr "" From dc981ecf176cf07d654e2437c52be9c45d0514cd Mon Sep 17 00:00:00 2001 From: Daniel Ward <39805490+weluvgoatz@users.noreply.github.com> Date: Wed, 10 Jul 2024 00:31:04 -0700 Subject: [PATCH 16/33] Update yeti behavior (#2969) * Add boss class, add pinch mode * New Yeti behavior!!!!! * Update yeti.cpp * Update yeti.cpp * The yeti can no longer ascend to heaven * Add big snowball attack for Yeti * Update bigsnowball.cpp * Update bigsnowball.cpp * yeah * yeah 2 * unerror thineself * Update the rolling snowball a bit * PLAYER CAN BUTTJUMP BALL * Rolling balls die in spikes now * They kill enemies now * ugh * More dynamics for the big snowball * Yeti snowball changes [read desc] - No more propagation of movement - Don't break if merging with upwards spikes. This is for some levels. Only break on downwards spikes if they fall hard on them. --- data/images/creatures/ghosttree/hudlife.png | Bin 0 -> 9435 bytes data/images/engine/editor/objects.stoi | 5 +- .../objects/big_snowball/big_snowball.png | Bin 0 -> 3737 bytes .../objects/big_snowball/big_snowball.sprite | 11 + .../big_snowball/big_snowball_particle.png | Bin 0 -> 2929 bytes src/badguy/boss.cpp | 93 ++++++ src/badguy/boss.hpp | 52 ++++ src/badguy/bouncing_snowball.cpp | 22 +- src/badguy/bouncing_snowball.hpp | 3 + src/badguy/ghosttree.cpp | 33 ++- src/badguy/ghosttree.hpp | 8 +- src/badguy/yeti.cpp | 276 +++++++++++++----- src/badguy/yeti.hpp | 26 +- src/object/bigsnowball.cpp | 223 ++++++++++++++ src/object/bigsnowball.hpp | 59 ++++ src/object/bumper.cpp | 10 +- src/object/bumper.hpp | 2 + src/object/pushbutton.cpp | 5 +- src/supertux/game_object_factory.cpp | 2 + 19 files changed, 717 insertions(+), 113 deletions(-) create mode 100644 data/images/creatures/ghosttree/hudlife.png create mode 100644 data/images/objects/big_snowball/big_snowball.png create mode 100644 data/images/objects/big_snowball/big_snowball.sprite create mode 100644 data/images/objects/big_snowball/big_snowball_particle.png create mode 100644 src/badguy/boss.cpp create mode 100644 src/badguy/boss.hpp create mode 100644 src/object/bigsnowball.cpp create mode 100644 src/object/bigsnowball.hpp diff --git a/data/images/creatures/ghosttree/hudlife.png b/data/images/creatures/ghosttree/hudlife.png new file mode 100644 index 0000000000000000000000000000000000000000..80d24a63c6015c4793beabf7a438adbebd599383 GIT binary patch literal 9435 zcmeHqXHZjJ)NYU}(t9Ta5D)?+^d>Eofb=3DC}}{X1ViXuKq8>h1?fdVibxZXq7*@- zNt341RHP_^G(q78-#+)7x%1B4@86p<=j7~Fp1szy*WPp1O>MmxhY;AMm}Mto&v5+K!oKg#(*j5*HLCEIj-9_{U*W_-0%?<=x8hH~6rC z`{@p!vd5Q0cY?Rgp7b8l=H=}l_4_XOe)EkD2jy-4bojP>RK0c-9I;pA;}XtYHZ;t* zG%4tCkZ>iOZrk2+JdV(Qp1fgL3(~5&KMeT!_I1i7aQNHKsg31>8D!|3X{>d))9ze5 zXJKPPAd*JyVBb3d(t3s%B*v*GmRWQsTGwD`XEd!E%$zv)eC2S$Ze+xA42L_QOxvgv zbgLR(eQQ>4x&MYGoI)i${Al;dx80@KeU0$_wSfm=L!H%=3vUB1ZVMj-<<+e=2fJ`; zV03acvkqn!HI~j(!S6j$O;6A3oaHKf^R(wm%mnMXN>}L8eCv0BW3SlLkiFiGLzSQC zn-U(Jv|>U7OdHR6jNK6W3wO7d&BSY-vr7Vp&jiOU1cQ%EXLDD+c%)_CU4A{!J@D;? z;Bm8N=se&3>w9q@g2bkm9IW#8S-AC^X&w~8gQN2nT$MRo$na2y=*bP_#u ziVAL51tgB%@kn`3U*m_6pB7%CovNQAlN6286tz(v2RlIPJf4>;tf_oV1ur|+!fNi? zB}>}kCGMx&2HjGysc24jaIa{K;b1m#Z%(tliT|YEQdEp5Ye4Gf+36I=e1e+4Sm8+C_WchKa^Gb8M-n+D7e~SBqeoU!mH{R9|U!(9FtQS*Y{R z**U@dkD6sM@u^-?b7j{WQmchp-*-oIM_A~o6FId31yQoWoyLzq zuTZnFp@$o<2aVQBHLGHu7^XWrH{%%}NEascDO^&hA=chpS1d7X`;b%-)1BVRZeZ%A z)|&Z>!I)C^ThV9c%qqk9@ey~M6TH_Ppdl^dwtC2@Nsb)vE3ZMjt|LPvYVPt7w|gG zWz>6U-cl8BzV5z@{GLBDd^vPpf4);ZQftqqgYZ7r-3&Hp)EKihE28{PXId^h&ENLN zBy&!^;Ns*ift*K?=Cdw!6qRVNQG-T;WjduD`PmWH^saj`_w$S*u5G8BVq|s==DWXA zY5nmf1mLtrkkQHn{THCwZpw*q5ACsijr46_ z_VhDhei}y`R9$c;TWnFp9 z>!xJ=o{OBm$aekRScvMwgq;r|*~bXMm5kBBncP zudI8`r}o9U?zR>xn}}+*owI7-StJ+ct+hT_Eicg(ajl|L%hJ^#3U`?-j?AxRalO zmiZy3R5;j?TD;sn2W!0g=@t8HaxvBc6E@ycOuB1~%{Dr)({!`wZ@{EtphR^&T4QE; zDx&!<7By@+K$u_~N-@4(V$ug;8WITt7AZk5c{PvYXX(;@==(@rej=w7sxNOsb ze|c+?j)q{p2|DHb?(JLea`lwUM1IKD#Ky{n0GV4o;jY3O{qt$T(0DBk^hCL$(X@diIN=VR6fd`{+uX{Ddw&!@k--BlU!EjioCXQj#Lmz>HqKfqIk*P;%o zNWq*yAP1Qn!>$9zD98dnhZ;rj~^rYaW;I z(YLAn_DZJU?5$SsmrxzIK-HT?Ba1sJf__4G9+}5`E}B_WoDE#aw|GY119JI#M{)jjJ$3TE^5Ejf zi#&PWo8k50j<45=$vUFDHKp2TAc#(0Al>Enr#(5Wldk8?zZb7(QKuW;v{(1_PG)LF z+jdtvYunrW_!=7FYNlWZ85{^)zzz zeZc~aNfa&8{FWh9l5te;Xeq2A>DFmyPAG32_P)QEJEU7TD$*E#h(2J@I@srBjFn@% zo3yO2%&Gp8>0w<`MLjV?+pCfeu6u+2`I$>8Iu`WCWi926PxZ}gp9WNlO9M2z$*dTR z5G^CLHtlH>virRH>gyEz*FJDmM;ARX5=|%TrbthYdfedC#`^lUb9Hh%x5^79nh_WN zBwkB@OWLC9AoOS#IC+a-M4C3NYpnc8>~zV4Q(A64SzGKYA8$~wskQOLy7jFD#~s;X zZcE>fPMP~0lrWJ4psF3_jS)XAS5FRR@3h&?U~t>EOnlcK$s5*oGwyqb%jlwzfVedM zWZ)y7SeKzak$59BJ^HRY*SB=83Qo~lJ-Nr?>mUZxlx4|sfM-d#Cw~AM?+|l%p6TAZ z2IweQPX{i4SR7nwdtKZqfa;ydQit;>WsmE80uFY$iu~;D!pySN*(kU%<0f?;Rw)%m z)mnBxtGwXE8#nfW;rrRg6wjsxh^{?o#+5QRJ^qT9l7?Si$w>sPE(%|>q>SJl$eN>n zVX!pKusTU@5q+xsF@;y{EfoY$gLISZ%R&1*AXkYbW>vJMIr5ECqSeRTzJN#1m_Np* z5bk4oSo?4uB4>5zqcUh-bFi8i7Z|k8FIK!3DYY(rG$4{2*S8g4qd_ zNJ=XvE;^J>Zl|Q}SGvBU>$@V_Pfrhud5TZueWcUHdkxx2nfPrTwQ z_c_fdvCGjQb?No45H(jImNmcSOip+)Ty4xrC~Ci~@D0~sgrhW>_G>Z|3HMcDvn)CB zLF#h%Lj^7r|3RC{756W@b6-6`G3>RIq89AjU9bIU4rx{cE?}c>fybZD21~@)+_?5& zU$gWG{!ro_ZFK)PSLEHA5zFMBuQVn2FR%09OI*aIs%Paq@x=kD5Yt8Sh6n1(ccsVB zpel!i!uk@+1*OZm<%1Wk)W)JZ*o587^3Uid3vX8ky;A3y80nv`p>YLV~6_>(NzwqI(w0!}V{6+X(D&^=)ESuuQcy?a%XW^nB6UU!?dp zq*Bp*eCpmr$~};8)+PWz7K7E*HHYi!{?WCNdX?W;h;Dn(!pEaT;_q%+L2CCpwF)m(8I& z!28V||2+Z!4FImHo2|(6l)1H)8BAD5weH;hm61rVZ4^Z)NUq)v522jg^krncveBvD z|MN{=k--oT-B+4!p9^Cqi}Z_`CRR(WW_)N$i?ip&1SVImci(Zm%NMqk-8kJZ7Zr34 zV#X)Ju?3cDkd^#IyD5Lo(AN6pUI~A?3htV%5&P>Vv2X;i;-N^hsSlThl+X=j3d6E| zBFlwntPLEJnE#U)AO2#uw@);wf=2%~Wom&|{m=REuPv8^l@wM)C_!3>@tDwrQ%6qu zmm4ZKQ2ph3fOgk;BhQ0=1?SzA?W_0j-sv^)g?v1kp@MFkUC z6K`FN8`dxgkFg3ewMGTGqg2o!&GWSC0jeYbPYeM84Dj^u@=*=Y0R6&MCB2`BWkA4R zCIoj4ke!J+P#1^C0Oh6SrDef-0a!mM=sYb@9glWVwS?*a4nZ1efZPZKZ&eu?e}8{z ze>rI!-c<&oqM{-r3zdOF!6XZ?PoNh85dik`5k7(V4FiVpLE*991T4-Ac!G&Q;(Q4j zAP`9p{3AY3ZxfS0;k|r*XMx0rOaQ`L1|lsh2Ft3bD1hamXebz=gjNPCC}QMQTx1nd3JS=-LBYLz2na6}<^+la zE{!GOxF8kLE-DBJSV37y5iGAl@oH7`#DC+{2my=flBb6agFiOQmMG2*VkyVjb_yvVVsp{kKo(R%%Vm%SA z7#VLb*I$Yg!d11+;Tj;QwCrCJa}NZ;h2%im16VIK&fn)Rl{MBAV?{um@Ci|ZC`06A zl~j}!l@%dMN`D#IV(>nsT0B98$V$sWe`!t@MwOHfiCV--rIG-C$w}F$>f$j70uFDD z!+B_cPJ#lSc>bw2A#Er$f`EV_2pAHmEL2`qR#6oKv4%iY<>XW$B=(e4W&dW6Lt|Y6 z|6kT8+Xtxr+oBs{eMs{M{u2GRr>rp7ejEKZ^uYewOhDkTZJ~-l{g#3c!ViP~6(>qOM|4{uzzG8|GvkNR)wP6~TW|rVNt#Jz1HP z6XTC;)n)!KKGc61{OyP#`TZs%9bKf8Q0C90@OQpQvHoxVeqV?G%_)Gu|0elY{QgJR ze{}sT2L6@tf7SILUH^)Ke`Wk%b^U*%i}tT(3gbok0`e!dN^cIHkCNIfDx|Ri3~+pM z<+qilkR+$Q4efmZfHSNoHyPkwHWx`qO@N!|QGcR3!y?4OKxKIe0HDc(!?djpdo|Jr z@7y==?FnDDZrcbZU7y=STS}MvcL$U`m6o`l+2JolqkAnP4DGw|95+*eh-eDQBg#|m zBDIl}M3X`(kchAlvjhmAY6pLG(=(=qjFCH7UGA-h#?MgAgLXk1U%NMvHfh%7s>|xj z50+K7?i|ZE3|##2X#!`SdIhz#`He0;b(+ql4mNgnRrS?lXR3FSlDfUqI|)n-fg5d; z$~l3#!C%h3-9o(yQ1V`8;NyEXG6F8C)9rRbLz}g2Cgi_`7mNkpEDVXO%qYM;bz&}D z`p$X2w<_z((wpy$)BEK6`@RPDs+M276ImS$5?;DJuYqQNt;_pKKKG-?H6vle`|}Ky zm{?Zpri(Lf7*KGL_N`aGRE+6fgjaRpCu?9VF&BsgG!4yHg!}JZM*Hqq%(x6yREOoI z9wqL`QU1I<^o9IBHuW((R1w#}cU5kfj zo1T+XiTFby8W$ZSeIq88=+}ld{i~~2WOMSM{J0`7Lt96YZeJZAPUfx)o1mLd&SU(S zH8b+wbzyJsIckawGpXq7J8 zs~w)!p(83kZoFLT>0oK8#mt;+b3yEB0oG4E?o9U6eeQA5+I9caTDg+%WOnroR(2$x z{N#W64$>tz*%z|zIs8|!mSIbX;srs*o)cbQxxObN(j#wKPm!L7* zcL&b;OW?JAwTyJ2vOpOlftKy%klk+=PctLqx@jO(-dju(x@gnfyUL7ZMTE71SxDVx zixlJWjp=db+1Y1;LOh$E=EzGCJL16?r$bg}v$?DC9avHpQXV;HzWQAG2zsDgS{hjb z4-nkUeIB@#A>k<}*3V~j8-CkJo0eXpvY=hpV}oTziRrt$HLF980P1X+xP7`sdc}Ta z3vhJfsDT@le=cB$jo%=hEcr#PA&ow7G*k3rlkO(-!KommwJAg6ip-V#dvl#=ZgXVo zEyM1{&q8mJrnYQNcJn#&jxZ6jI3eN`sEISAWPiZtd#&*BtxJNinb+DZNQzG*<4mj~ z^ocxv{$YAHc?F(E(V`){QU!s6BW85S9r3+^dIYkzXI-nTL)?K>@6@cL z%c0pmb}YyUCSbI*&{-Y248?3k#!oVu!}~)r*i{~jF3w5jx4QBRYgg$TSQ@0S@{jv_ z-&?RY$8_KoX3R$(`wT>LQNKAd?4V#80P2_V7L^0LVQ;BGJpmyw*8GPCBA4_B%_qA? zH7L3SH>wg_*yCDt#bmq#O|5W6{ha1DFczVK?_ZBp|L~|HH6Q=m_a6uI%-M8d(0u)dMsqo!sBkpQsUsv8lBwgQ3&`(o((zbk^sLpd zH?wFb3hl4FC)XDi(u*Y`6-zuB0yf$31fd(l^pc zFyhVkOe?uj?q!iDJFVk%id8Bofi{id{8Ne*veh@|eB0tP3ux^>UK_Gt3-y`{yJb4! zT91!W->{fm(tDbcWEs>XeOB~>Ide9Lv%+fhk>%j%D2MB$nRq{0djM@-PS@yrAw0uQ z4ujCqjg-x&1vAntU%7`kw-45~sh7DPI%+Ej_oPelN|k%wVgibit?vl{gA#`6mRa9Kc4AItSD1;4i!lyfR`bPR|-7cJZ48YgadRhv(L@m*U&TN^!tfR?XA z;;6(Fm$5-HftXp?nc&0uR0|rbk^MoIrUu!B&kQ?OFIRczpE105vxf4G4mZCt^{eaJ zaq+8|Bv?W>kkF(RMd?XK-t#-3-(=K46`(jvbTU8~;p<>!?| zq;c+E-xk@8q(GtmX!R>Ed}ak$h2?KCqi{lYS_!lXOx#JM%;z=ZKk>z1;<_Q^mag(7 zN_guFn=ja=ZP>#vFP>9#Fy#EgRvPC@y0Cr`y=sn-onG$RMpOl@1eorD7YIUch>!kQ zT2^7<#ARUc1#t|#KJtmSYeDpjXIoznYu?gO&ZNW^-$V>21xq54gXV#def&sm y?RtixZszj(I$yE}t$3h6Yo%5wXHqwg>~>$sK!U4OJL&5M0M|2xJ=Af&{(k^zBl+9_ literal 0 HcmV?d00001 diff --git a/data/images/engine/editor/objects.stoi b/data/images/engine/editor/objects.stoi index 090bfbc3ef9..a0314e2b306 100644 --- a/data/images/engine/editor/objects.stoi +++ b/data/images/engine/editor/objects.stoi @@ -177,7 +177,10 @@ (icon "images/engine/editor/stalactite_ice_yeti.png")) (object (class "dart") - (icon "images/creatures/darttrap/granito/root_dart_left.png")) + (icon "images/creatures/darttrap/granito/root_dart_left.png")) + (object + (class "bigsnowball") + (icon "images/objects/big_snowball/big_snowball.png")) ) (objectgroup diff --git a/data/images/objects/big_snowball/big_snowball.png b/data/images/objects/big_snowball/big_snowball.png new file mode 100644 index 0000000000000000000000000000000000000000..f8e7f6d46e7a7c6aa62dd2a90bb16e121a9c7c76 GIT binary patch literal 3737 zcmV;K4rcL*P)EX>4Tx04R}tkv&MmKpe$iQ?()$5j%)<$WS|35EXHhDi*;)X)CnqU~=h)(4-+r zad8w}3l4rPRvlcNb#-tR1i=pwX9p)m7b)?7NufoI2gm(*ckglc4iFj@rkY*jfT~$W zIuRFh`4utniXH?ph$zAmGxcOitw zOXs{#9AafjAwDM_Gw6cEk6f2se&bwnSm2oiDq zBgZ_dP$4;f@IUz7ty!F$aFc>@p!>zPKSqJTF3_yo_V=-EH%|cnGjOG~{nZ9A^GSNW ztwoN2fo~U-2exN zK(s{JYaZ|J?dy{D4^000SaNLh0L z01FcU01FcV0GgZ_00007bV*G`2j~V25h*(x{Knq^01TB$L_t(|+U=cNj9q0F$Isqp zpX*F#re&BZ(;M`L7=(hoL?8@cQLF@_K53!}ni%!L7!zK~lMmptFFyF$j7Aumqa!mTx_++5PsnFW*`J{@3MO+bUfr z***W{4~DvBSyS>4mOVC9_wC(te5m(aPlmX?uINs=EPAui&}qt!=oglj7KVBf$G?_; zNRz&(Y1$gJfdrn}@U0*pi z)Gz+??`MoB?U zH%diM(=_)1Ec_A2vFIH?54l-b`0C5g8Oykd z#VkgFwl0pBb--KG~=OMk={;dIN=^jlQoik|-P{7+*zfiV}cL z*_Qt1VvJd8t21Z;;>K$VS!Kkyme)5#|J83^5`FRC|M*xS%UDK%#4JXE#QCr%Jo()p z3tl{Y^b2zQks}91zon^gR0ESCCPsiAKT_ZcV?9nNt5@_^D_~!at+U3Mvll4)>iNpb z5?pHna73rF4DWHJuk(zJPl*1|=k?j+k}YwzG|`(l^Ou)C)PDoUG72PSF$yGC1ykSr z$>V195ljI2nOXtuR1y>oxzClB~U9H@Zx|SSvU?9 zEL9M$-`db?O*WJPI%Q>aD?Np*-LtoderE5TqEFNmLen&r7~R#xvW#UENX%jsNJhdG z!{AAzY~;R!hxKGD&4m#M(3A;l15$ue85pTmD!J#{fSoAOi3SnfI6Yy2i-jW`MuyOF zJEb}p;La&6a$sDm2lh38@PM8S-FMyNdGB@g}9WWIRFh6i72CVT~%oy@nx`D#-7C5le z(0grVS%lE0qfc<;sjrK^d~V@5-t#YqI*S~PWfVxvViZU+Fm>?ZqY?@}Hvga;pPQZ5 z)kDZS##;7a<_uqxrVw6gfS@!3O?EDfl<4#kf>IrSrLQ4z)?d}&JeC2oA?Y2mdmb{0 zZUu2L&Iw+|F#DRP=T>m7{r7%W^j5q53?BJ8V;Kb$vls=E3{1tX%cAeNLt{{NB=;Lm zepI**2GT>F5}5|^s29e$zld^Eojy8-128cU@X`(RTCG6mY*zF>8&%cofRwojb?6AQ z6c#_YWRGPl_nn;TxT5>G&)o;qSw4UAZDCf62BwNBW-$sR&aT6cNS12gXhpYEQ{4;H z!SQ^>jN7HfNypHNm0|jc9TD&aW!PJV{b8d1GOhY@uI8Ao*uC8n&!8Usu*+Zdp7KE|_q zzMfmzti=qa3uldG6j97#6iA#h!ppNWGcZ*PD`w@w0^>yl3qn@eBHZbi2=h1ygC}u* zkpm?e0gnUFvdOyQ4mZ(QBj)LYSy>pxnA?HUE@U99kK@KNZU8ZhQ6O<@ zb&WyQ5o_Y+6bs>E#$+;OoFOxPU@2fqj9+Eo3pYfEix5OeAq!$ydkR~XvyN(-d(UK9 z0p{t0HT6;CkOG=qKfpbs`rX5Ej49dr9&E6zauT7XHD)$oYA_cP5U5o|6{A&nbvBG=+ z7QwxK+|y@U`58BcsY&9v;e`-NDDVdgJKTU%8W9H@z=`W2rW6CFHoEG>EqC?3l@h%c z3nzM>jv0g)U$Ts46j97#6iA%Tnznas3V9Lk`!c@6Z%{6DTmr)rvGNllVh_NP)uX1ZJ;E2#cSco#+67shnwp@h* zpjXKa6h@*b$%P0yxoyB&8?2I$=p}TD!R|8b2=5JhA(Mfh``${H)iRb*KrxF^AaPDC zEJ_olYEuh(9z1kEhN)R);zbCXH!__8bc~O1w2gjKF>-@d#BCU{$~bhacVahAz*+() ziz$E*OsVe!QgENl%GsIwSGZegYY%oGOlkADrXd12cV0&s6q#7!b&X{dUCd$>NE~lt zRd#Xox}61uqx?c8HeKNuCg|w|B_k@p$-W{B``|{jxnpK9Q|d|X#v+G|Z-;IPAxkv% zKF6x4NRRboX71cj=h=iF>{Zl~wJ%-9JPLglw@Y{1s^k3|%P5eT#VC+C+@ZhcPVKsR z^2~YBXJ)i-IUPU>Sq($Y+{}_%`Hmi)AS=!9Th0dX`NHMWzpZ)cc5Q4Y0|`N)fZ#(D9~2f`KU`{}-nC$3~DW4fRte-jZ)8 zY}mprpBhXerc$`w|M$3 z8Fch<8MAe2T;Zaw=DFNh)hd|MpOS z@EhO%?NER7Z-0GisPFj7(=vW?Ty2;=rUp^|R$rDomf(~HU@R_TM?uI!0>vrUS6HC4 zxejNITb`L!T(z{`DMo5w4A2w;`j#%O>n%qL%iLDnUDGjD!1CIKi=vNWP{uL}DrPYX zBqN&)$KzX`9qO;W{<^@_UH9nr~%FO$M$*_iVYZp@@&M=S_)sL7y1n*W-$sR zSM}u+_C$L0k$K4m&L4e3XveM7(=u1RuFRy}^K-A}fk6?DdWZ`#PGygPpa%3RbV8Yr zd3v}m%Q(-!_rB;?E~-8`g=+k^!cGkMS_kA_yrk!Ptt-;Y>uSE3Y%HTdViu!7@{zvN z_q87$7cAJeZHLUYW5-Sz6V{YvMW~^goYId;@zbBRO8&>K*gz&zU=Xv33d8RTkIOA( zbc|Vb`nvy)%x7|-@Wsqs2-dW5>4NAho@>6-ce9CEi~@=CQBJ<-Tf2t(`a373f?;vt zUBQ>n%|9mN=ccu%`Uc7@msb@c(h;2#CYzdJv@nKy^aAYN>-H6n)=`$Z*6xVjZtLek zt6dF!Uq)Q359jXk`{!g*%eLhU?hCKHIBzWDCKIz51rqC8OnT^4L(h$B_CS2_DQWjbx5MvJAStbS)pI@eVO)yICu!0pM&VZS4K90tD| z>g)eK^{t`4w)jrRSjJ5(W-$sR*7dsZXTJI!$Ov1 z?CKCl3R5W?2xFgJlB7Q!>Wi86iEID%1058s}hEX>4Tx04R}tkv&MmKpe$iQ?()$5j%)<$WS|35EXHhDi*;)X)CnqU~=h)(4-+r zad8w}3l4rPRvlcNb#-tR1i=pwX9p)m7b)?7NufoI2gm(*ckglc4iFj@rkY*jfT~$W zIuRFh`4utniXH?ph$zAmGxcOitw zOXs{#9AafjAwDM_Gw6cEk6f2se&bwnSm2oiDq zBgZ_dP$4;f@IUz7ty!F$aFc>@p!>zPKSqJTF3_yo_V=-EH%|cnGjOG~{nZ9A^GSNW ztwoN2fo~U-2exN zK(s{JYaZ|J?dy{D4^000SaNLh0L z01FcU01FcV0GgZ_00007bV*G`2j~V30stWd1lj@s010hLL_t(o!=0Dgk0sYthrfNP zs&h_X=hkD-&DZhFAP8f}nSkTq*aRb@D3(AGNC+f?gb)uALh{S-#6!$8LgGKjQzVNB zgaitXqWB>wiAfaMV|y+h51yXsZg=;&)NNlE57lEsFyN$~N?Ti1Yp=b2-})`Z$9x`s z=8J!(lv+pWrL&Jda=C6h+IoRChRJx0GM4u?H?QWDzJcUMM5Z^s^N)Y`alWnozYQm! zc>2-F;f;T~^u*(5_gjZCn&T%5>+&erDUOV_{s&ApZQGfMB#{T$U78Gi@DRNQkxsWqA9|H~80o`DZrYxpwvHw_bkiqyA++YVoxLvikdbH?I8cPyf&U^uibanUqvkqkx!&K4yFp#$~~%uoTu{ zwIXGqcAmNqtm*^qmIHePhNy4FVeT|Wq^CdYVOJK!uj*x`0|&3kM-p-pwLQTjV8;zYe>XA zsG+h3lp^I!8zQZXv@sJ>CgkA&07fg8D~pebX&=#Avs7rRGZ%RGNB{O&Jz4qs;?Au- z1MuAMer5Mdzxf+H^zcI%V?k+B&bXN9e8R>q zOG@49X*JKpQl$?Cx=|}BjzwnE1pE`9Ct-xwcmQ2nGjj&Q#VoZnv z5kVC6F%C)z5u;_0g$Owh1dTaU`$TE$v{XMqckEAC1XXC(}&fcMFvHPVr^tFdH`D% zq45cYqH%%c(h^dl50P2j;C!H|n-7UujYf<{6_N#I6ooMut-vQ-id5DNm9I1cxHL#H zi?DD*(XChI!Bq-I4_R>`(Kt^NGLjN)?{G<|JBRBXXoJoPQ&t14VvJO6Li&)H z^S0;6p>?LnP&c z=A`rhECeKBHHc)q_gJM^Dh;L8G%nEk%*td$Srp8sGg1mD5xT{UZhz;Jz5Uv&*B&`{ zfh*VEWn<$QDGw@eF_D6&2?rs-Z_jkGd+N;+zz`o0yZ@vCw3Jph>Dzwsopp<5HJi>>FkC6}q zv(B+St=U`DlnP3%FiLPS5>lorEIvl&ooC*=ArpPi&h9?5MS~2OrQY5|L|y{W082;j z`>k8o-^MD%ee26SczD9ZC`9ssy&EL8w`f_kJvl}6LC+9`dE2wQXz9a%>RIQR^`1#t zvNjpfENa@WMFHJxibO}fbN9cSn)iPA-L2ynKKVou`g7;bpJRDkktJcZA!h*@q}#bb z)As}QLd1p0&b;B~&XoPSqw|qz(=m6ENm-)EY;A4he2+?jW^Wr~Ewekf@Ll`TJ&X5& zy-Ul7U;NJZzW1dIpSZ}06USMfOi)Vk{=A`cncfHHZO6Rr2`Qu0z?F3HUKJK&3`!fu zRYCHe*KgdQTP&!oMa4jHJ)KUp(>?y{9P)wDeeZ|g-IdYu*K>4VT|crR39Woi%$k0f zPDB_LmeOhpV_2#R4lhr*e|?1$hu1i~G-g~_6wtICH*UVm?Cu@bmX}eBDKg!oc8<+k z*XXA2pIzL!wfBDxKfm+U%lYKV)9Uo;Gx%ykbe^^KRmNpWRSY(NToi*OQ^NVkyzRL= zZP;D3%$u5ay2o1RXxa|%diL+U$9C6#X)o;E0%+EZF ze(H~2e7W7*excGzpE`4fN6((ci$RrRW_2^Tr{D)i?mS)ZY1^7+cL&$j;+wf7@BU%$ z=39Tbd;N|1&pnmjdw%J+|M+e{+dW +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +namespace +{ + const int DEFAULT_LIVES = 5; // default lives + const int DEFAULT_PINCH_LIVES = 2; // default pinch lives +} + +#include "badguy/boss.hpp" + +#include "object/player.hpp" +#include "sprite/sprite.hpp" +#include "supertux/sector.hpp" +#include "util/reader_mapping.hpp" +#include "video/surface.hpp" + +Boss::Boss(const ReaderMapping& reader, const std::string& sprite_name, int layer) : + BadGuy(reader, sprite_name, layer), + m_lives(), + m_pinch_lives(), + m_hud_head(), + m_hud_icon(), + m_pinch_mode(), + m_pinch_activation_script() +{ + reader.get("lives", m_lives, DEFAULT_LIVES); + reader.get("pinch-lives", m_pinch_lives, DEFAULT_PINCH_LIVES); + m_countMe = true; + + reader.get("pinch-activation-script", m_pinch_activation_script, ""); +} + +void +Boss::boss_update(float dt_sec) +{ + if (!m_pinch_mode && (m_lives <= m_pinch_lives)) + { + m_pinch_mode = true; + Sector::get().run_script(m_pinch_activation_script, "pinch-activation-script"); + } +} + +void +Boss::draw(DrawingContext& context) +{ + draw_hit_points(context); + BadGuy::draw(context); +} + +void +Boss::draw_hit_points(DrawingContext& context) +{ + if (m_hud_head) + { + context.push_transform(); + context.set_translation(Vector(0, 0)); + context.transform().scale = 1.f; + + for (int i = 0; i < m_lives; ++i) + { + context.color().draw_surface(m_hud_head, Vector(BORDER_X + (static_cast(i * m_hud_head->get_width())), BORDER_Y + 1), LAYER_HUD); + } + + context.pop_transform(); + } +} + +ObjectSettings +Boss::get_settings() +{ + ObjectSettings result = BadGuy::get_settings(); + + result.add_text("hud-icon", &m_hud_icon, "hud-icon", "images/creatures/yeti/hudlife.png", OPTION_HIDDEN); + result.add_int(_("Lives"), &m_lives, "lives", DEFAULT_LIVES); + result.add_int(_("Lives to Pinch Mode"), &m_pinch_lives, "pinch-lives", DEFAULT_PINCH_LIVES); + result.add_script(_("Pinch Mode Activation Script"), &m_pinch_activation_script, "pinch-activation-script"); + + return result; +} diff --git a/src/badguy/boss.hpp b/src/badguy/boss.hpp new file mode 100644 index 00000000000..7fa942174b8 --- /dev/null +++ b/src/badguy/boss.hpp @@ -0,0 +1,52 @@ +// SuperTux +// Copyright (C) 2024 Daniel Ward +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#ifndef HEADER_SUPERTUX_BADGUY_BOSS_HPP +#define HEADER_SUPERTUX_BADGUY_BOSS_HPP + +#include "badguy/badguy.hpp" + +// This is a class for our (currently two) bosses, but can apply to future ones also. +// Includes information on lives, HUD, pinch mode activation, and death behavior. + +class Boss : public BadGuy +{ +public: + Boss(const ReaderMapping& mapping, const std::string& sprite_name, int layer = LAYER_OBJECTS); + virtual void boss_update(float dt_sec); + virtual void draw(DrawingContext& context) override; + void draw_hit_points(DrawingContext& context); + virtual ObjectSettings get_settings() override; + + virtual bool is_flammable() const override { return false; } + virtual bool is_freezable() const override { return false; } + +protected: + int m_lives; + int m_pinch_lives; + SurfacePtr m_hud_head; + std::string m_hud_icon; + bool m_pinch_mode; + std::string m_pinch_activation_script; + +private: + Boss(const Boss&) = delete; + Boss& operator=(const Boss&) = delete; +}; + +#endif + +/* EOF */ diff --git a/src/badguy/bouncing_snowball.cpp b/src/badguy/bouncing_snowball.cpp index 125a8d3d93e..ff397a347a1 100644 --- a/src/badguy/bouncing_snowball.cpp +++ b/src/badguy/bouncing_snowball.cpp @@ -24,16 +24,26 @@ static const float JUMPSPEED = -450; static const float BSNOWBALL_WALKSPEED = 80; -BouncingSnowball::BouncingSnowball(const ReaderMapping& reader) - : BadGuy(reader, "images/creatures/bouncing_snowball/bouncing_snowball.sprite") +BouncingSnowball::BouncingSnowball(const ReaderMapping& reader) : + BadGuy(reader, "images/creatures/bouncing_snowball/bouncing_snowball.sprite"), + m_x_speed() { + m_x_speed = BSNOWBALL_WALKSPEED; parse_type(reader); } +BouncingSnowball::BouncingSnowball(const Vector& pos, Direction d, float x_vel) : + BadGuy(pos, d, "images/creatures/bouncing_snowball/bouncing_snowball.sprite"), + m_x_speed() +{ + m_countMe = false; + m_x_speed = x_vel; +} + void BouncingSnowball::initialize() { - m_physic.set_velocity_x(m_dir == Direction::LEFT ? -BSNOWBALL_WALKSPEED : BSNOWBALL_WALKSPEED); + m_physic.set_velocity_x(m_dir == Direction::LEFT ? -m_x_speed : m_x_speed); set_action(m_dir); } @@ -49,8 +59,10 @@ BouncingSnowball::active_update(float dt_sec) set_action(m_dir); } Rectf lookbelow = get_bbox(); - lookbelow.set_bottom(lookbelow.get_bottom() + 48); - lookbelow.set_top(lookbelow.get_top() + 31); + lookbelow.set_bottom(get_bbox().get_bottom() + 48); + lookbelow.set_left(get_bbox().get_left() + 10); + lookbelow.set_right(get_bbox().get_right() - 10); + lookbelow.set_top(get_bbox().get_top() + 31); bool groundBelow = !Sector::get().is_free_of_statics(lookbelow); if (groundBelow && (m_physic.get_velocity_y() >= 64.0f)) { diff --git a/src/badguy/bouncing_snowball.hpp b/src/badguy/bouncing_snowball.hpp index 3b65c5319a2..e5cd1b9d641 100644 --- a/src/badguy/bouncing_snowball.hpp +++ b/src/badguy/bouncing_snowball.hpp @@ -23,6 +23,7 @@ class BouncingSnowball final : public BadGuy { public: BouncingSnowball(const ReaderMapping& reader); + BouncingSnowball(const Vector& pos, Direction d, float x_vel = 80); virtual void initialize() override; @@ -55,6 +56,8 @@ class BouncingSnowball final : public BadGuy FATBAT }; + float m_x_speed; + private: BouncingSnowball(const BouncingSnowball&) = delete; BouncingSnowball& operator=(const BouncingSnowball&) = delete; diff --git a/src/badguy/ghosttree.cpp b/src/badguy/ghosttree.cpp index b74b3b60725..c777ddaed45 100644 --- a/src/badguy/ghosttree.cpp +++ b/src/badguy/ghosttree.cpp @@ -29,6 +29,8 @@ #include "sprite/sprite_manager.hpp" #include "supertux/flip_level_transformer.hpp" #include "supertux/sector.hpp" +#include "util/reader_mapping.hpp" +#include "video/surface.hpp" static const size_t WILLOWISP_COUNT = 10; static const float WILLOWISP_TOP_OFFSET = -64; @@ -36,7 +38,7 @@ static const Vector SUCK_TARGET_OFFSET = Vector(-16,-16); static const float SUCK_TARGET_SPREAD = 8; GhostTree::GhostTree(const ReaderMapping& mapping) : - BadGuy(mapping, "images/creatures/ghosttree/ghosttree.sprite", LAYER_OBJECTS - 10), + Boss(mapping, "images/creatures/ghosttree/ghosttree.sprite", LAYER_OBJECTS - 10), mystate(STATE_IDLE), willowisp_timer(), willo_spawn_y(0), @@ -49,9 +51,13 @@ GhostTree::GhostTree(const ReaderMapping& mapping) : root_timer(), treecolor(0), suck_lantern_color(), + m_taking_life(), suck_lantern(nullptr), willowisps() { + mapping.get("hud-icon", m_hud_icon, "images/creatures/ghosttree/hudlife.png"); + m_hud_head = Surface::from_file(m_hud_icon); + set_colgroup_active(COLGROUP_TOUCHABLE); SoundManager::current()->preload("sounds/tree_howling.ogg"); SoundManager::current()->preload("sounds/tree_suck.ogg"); @@ -60,14 +66,17 @@ GhostTree::GhostTree(const ReaderMapping& mapping) : void GhostTree::die() { - mystate = STATE_DYING; - set_action("dying", 1); - glow_sprite->set_action("dying", 1); for (const auto& willo : willowisps) { willo->vanish(); } - run_dead_script(); + + if (m_lives <= 0) { + mystate = STATE_DYING; + set_action("dying", 1); + glow_sprite->set_action("dying", 1); + run_dead_script(); + } } void @@ -79,9 +88,12 @@ GhostTree::activate() } void -GhostTree::active_update(float /*dt_sec*/) +GhostTree::active_update(float dt_sec) { + Boss::boss_update(dt_sec); + if (mystate == STATE_IDLE) { + m_taking_life = false; if (colorchange_timer.check()) { SoundManager::current()->play("sounds/tree_howling.ogg", get_pos()); suck_timer.start(3); @@ -180,8 +192,13 @@ GhostTree::active_update(float /*dt_sec*/) // Wait until the lantern is swallowed completely. if (m_sprite->animation_done()) { if (is_color_deadly(suck_lantern_color)) { + if (!m_taking_life) { + m_lives--; + m_taking_life = true; + } die(); - } else { + } + if (m_lives > 0) { set_action("normal"); mystate = STATE_IDLE; spawn_lantern(); @@ -215,7 +232,7 @@ GhostTree::willowisp_died(TreeWillOWisp* willowisp) void GhostTree::draw(DrawingContext& context) { - BadGuy::draw(context); + Boss::draw(context); context.push_transform(); if (mystate == STATE_SUCKING) { diff --git a/src/badguy/ghosttree.hpp b/src/badguy/ghosttree.hpp index caad21d9ca9..19fac6ddf62 100644 --- a/src/badguy/ghosttree.hpp +++ b/src/badguy/ghosttree.hpp @@ -17,18 +17,16 @@ #ifndef HEADER_SUPERTUX_BADGUY_GHOSTTREE_HPP #define HEADER_SUPERTUX_BADGUY_GHOSTTREE_HPP -#include "badguy/badguy.hpp" +#include "badguy/boss.hpp" class TreeWillOWisp; class Lantern; -class GhostTree final : public BadGuy +class GhostTree final : public Boss { public: GhostTree(const ReaderMapping& mapping); - virtual bool is_flammable() const override { return false; } - virtual bool is_freezable() const override { return false; } virtual void kill_fall() override { } virtual void activate() override; @@ -75,6 +73,8 @@ class GhostTree final : public BadGuy int treecolor; Color suck_lantern_color; + bool m_taking_life; + Lantern* suck_lantern; /**< Lantern that is currently being sucked in */ std::vector willowisps; diff --git a/src/badguy/yeti.cpp b/src/badguy/yeti.cpp index 2bc4d7ef3c1..13b8e6079bf 100644 --- a/src/badguy/yeti.cpp +++ b/src/badguy/yeti.cpp @@ -20,8 +20,10 @@ #include #include "audio/sound_manager.hpp" +#include "badguy/bouncing_snowball.hpp" #include "badguy/yeti_stalactite.hpp" #include "math/random.hpp" +#include "object/bigsnowball.hpp" #include "object/camera.hpp" #include "object/player.hpp" #include "sprite/sprite.hpp" @@ -31,21 +33,19 @@ namespace { -const float JUMP_DOWN_VX = 250; /**< Horizontal speed while jumping off the dais. */ -const float JUMP_DOWN_VY = -250; /**< Vertical speed while jumping off the dais. */ - const float RUN_VX = 350; /**< Horizontal speed while running. */ +const float RUN_PINCH_VX = 400; /**< Horizontal speed while running. */ -const float JUMP_UP_VX = 350; /**< Horizontal speed while jumping on the dais. */ -const float JUMP_UP_VY = -700; /**< Vertical speed while jumping on the dais. */ +const float JUMP_UP_VY = -750; /**< Vertical speed while jumping on the dais. */ const float STOMP_VY = -300; /**< Vertical speed while stomping on the dais. */ const float RUN_DISTANCE = 1060; /**< Distance between the x-coordinates of left and right end positions. */ const float JUMP_SPACE = 448; /**< Distance between the jump position and the stand position. */ +const float BEFORE_WAIT = 3; +const float BALL_WAIT = 2; const float STOMP_WAIT = 0.5; /**< Time we stay on the dais before jumping again. */ -const float SAFE_TIME = 0.5; /**< The time we are safe when Tux just hit us. */ -const int INITIAL_HITPOINTS = 5; /**< Number of hits we can take. */ +const float SAFE_TIME = 1; /**< The time we are safe when Tux just hit us. */ const float YETI_SQUISH_TIME = 3; @@ -56,34 +56,32 @@ const float SNOW_EXPLOSIONS_VY = -200; /**< Speed of snowballs. */ } Yeti::Yeti(const ReaderMapping& reader) : - BadGuy(reader, "images/creatures/yeti/yeti.sprite"), + Boss(reader, "images/creatures/yeti/yeti.sprite"), m_state(), m_state_timer(), m_safe_timer(), m_stomp_count(), - m_hit_points(), - m_hud_head(), m_left_stand_x(), m_right_stand_x(), m_left_jump_x(), m_right_jump_x(), m_fixed_pos(), - m_hud_icon() + m_just_hit(), + m_just_threw(), + m_grabbed_tux(), + m_jumped() { - reader.get("lives", m_hit_points, INITIAL_HITPOINTS); - m_countMe = true; - SoundManager::current()->preload("sounds/yeti_gna.wav"); - SoundManager::current()->preload("sounds/yeti_roar.wav"); - reader.get("hud-icon", m_hud_icon, "images/creatures/yeti/hudlife.png"); m_hud_head = Surface::from_file(m_hud_icon); + SoundManager::current()->preload("sounds/yeti_gna.wav"); + SoundManager::current()->preload("sounds/yeti_roar.wav"); initialize(); reader.get("fixed-pos", m_fixed_pos, false); if (m_fixed_pos) { - m_left_stand_x = 80; - m_right_stand_x = 1140; + m_left_stand_x = 216; + m_right_stand_x = 1014; m_left_jump_x = 528; m_right_jump_x = 692; } else { @@ -95,7 +93,7 @@ void Yeti::initialize() { m_dir = Direction::RIGHT; - jump_down(); + run(); } void @@ -120,46 +118,103 @@ Yeti::draw(DrawingContext& context) if (m_safe_timer.started() && size_t(g_game_time * 40) % 2) return; - draw_hit_points(context); - - BadGuy::draw(context); + Boss::draw(context); } void -Yeti::draw_hit_points(DrawingContext& context) +Yeti::active_update(float dt_sec) { - if (m_hud_head) - { - context.push_transform(); - context.set_translation(Vector(0, 0)); - context.transform().scale = 1.f; + Boss::boss_update(dt_sec); + auto player = get_nearest_player(); - for (int i = 0; i < m_hit_points; ++i) - { - context.color().draw_surface(m_hud_head, Vector(BORDER_X + (static_cast(i * m_hud_head->get_width())), BORDER_Y + 1), LAYER_FOREGROUND1); - } + float push_distance; + push_distance = player ? (glm::length(get_bbox().get_middle() - player->get_bbox().get_middle())) : 0.f; - context.pop_transform(); + if (on_ground() && (m_state == BE_ANGRY || m_state == THROW) && push_distance <= 160.f && m_physic.get_velocity_x() == 0.f) + { + m_state_timer.stop(); + m_physic.enable_gravity(false); + set_group(COLGROUP_DISABLED); + m_state = REMOVE_TUX; } -} -void -Yeti::active_update(float dt_sec) -{ switch (m_state) { - case JUMP_DOWN: - m_physic.set_velocity_x((m_dir==Direction::RIGHT)?+JUMP_DOWN_VX:-JUMP_DOWN_VX); - break; case RUN: - m_physic.set_velocity_x((m_dir==Direction::RIGHT)?+RUN_VX:-RUN_VX); - if (((m_dir == Direction::RIGHT) && (get_pos().x >= m_right_jump_x)) || ((m_dir == Direction::LEFT) && (get_pos().x <= m_left_jump_x))) jump_up(); + if (!m_just_threw || m_state_timer.check()) + { + set_action("jump", m_dir); + m_just_threw = false; + if (!m_jumped && (push_distance >= 160.f)) { + m_physic.set_velocity_y(STOMP_VY * 2.5f / 3.f); + m_jumped = true; + } + + if (m_pinch_mode) + { + if (std::abs(m_physic.get_velocity_x()) < (RUN_PINCH_VX - 10.f)) { + m_physic.set_acceleration_x(5.f * (m_dir == Direction::RIGHT ? RUN_PINCH_VX : -RUN_PINCH_VX)); + } + else + { + m_physic.set_acceleration_x(0.f); + m_physic.set_velocity_x(RUN_PINCH_VX * (m_dir == Direction::RIGHT ? 1.f : -1.f)); + } + } + else + { + if (std::abs(m_physic.get_velocity_x()) < (RUN_VX - 10.f)) { + m_physic.set_acceleration_x(5.f * (m_dir == Direction::RIGHT ? RUN_VX : -RUN_VX)); + } + else + { + m_physic.set_acceleration_x(0.f); + m_physic.set_velocity_x(RUN_VX * (m_dir == Direction::RIGHT ? 1.f : -1.f)); + } + } + + if (((m_dir == Direction::RIGHT) && (get_pos().x >= m_right_jump_x)) || ((m_dir == Direction::LEFT) && (get_pos().x <= m_left_jump_x))) jump_up(); + } break; case JUMP_UP: - m_physic.set_velocity_x((m_dir==Direction::RIGHT)?+JUMP_UP_VX:-JUMP_UP_VX); - if (((m_dir == Direction::RIGHT) && (get_pos().x >= m_right_stand_x)) || ((m_dir == Direction::LEFT) && (get_pos().x <= m_left_stand_x))) be_angry(); + if (((m_dir == Direction::RIGHT) && (get_pos().x >= m_right_stand_x)) || ((m_dir == Direction::LEFT) && (get_pos().x <= m_left_stand_x))) + { + m_jumped = false; + m_dir = (m_dir == Direction::RIGHT) ? Direction::LEFT : Direction::RIGHT; + throw_snowballs(); + } + break; + case THROW: + m_physic.set_velocity_x((std::abs(m_physic.get_velocity_x()) > 10.f) ? (m_physic.get_velocity_x() / 1.125f) : 0.f); + if (m_state_timer.check()) + { + summon_snowball(); + set_action("stand", m_dir); + m_stomp_count++; + if ((m_pinch_mode && m_stomp_count == 3) || (!m_pinch_mode && m_stomp_count == 2)) { + be_angry(); + } else { + m_state_timer.start(BALL_WAIT / (m_pinch_mode ? 1.2f : 1.f)); + } + } + break; + case THROW_BIG: + if (m_state_timer.check()) + { + summon_big_snowball(); + set_action("stand", m_dir); + m_stomp_count++; + if ((m_lives == 1 && m_stomp_count == 3) || (m_lives > 1 && m_stomp_count == 1)) { + m_just_threw = true; + run(); + } + else { + m_state_timer.start(BALL_WAIT); + } + } break; case BE_ANGRY: - if (m_state_timer.check() && on_ground()) { + if (m_state_timer.check() && on_ground()) + { m_physic.set_velocity_y(STOMP_VY); set_action("stomp", m_dir); SoundManager::current()->play("sounds/yeti_gna.wav", get_pos()); @@ -176,7 +231,8 @@ Yeti::active_update(float dt_sec) m_dir = newdir; set_action("jump", m_dir); } - if (m_state_timer.check()) { + if (m_state_timer.check()) + { BadGuy::kill_fall(); m_state = FALLING; m_physic.set_velocity_y(JUMP_UP_VY / 2); // Move up a bit before falling @@ -189,56 +245,93 @@ Yeti::active_update(float dt_sec) break; case FALLING: break; + case REMOVE_TUX: + if (push_distance < 160.f && player) + { + if (!m_grabbed_tux) { + player->get_physic().set_velocity(5.f * Vector(get_bbox().get_middle().x - player->get_bbox().get_middle().x, + get_bbox().get_middle().y - player->get_bbox().get_middle().y)); + } + if (!m_grabbed_tux && push_distance < 10.f) + { + m_state_timer.start(BALL_WAIT / 2.f); + m_grabbed_tux = true; + player->get_physic().set_velocity(m_dir == Direction::RIGHT ? 600.f : -600.f, -200.f); + } + } + if (m_state_timer.check()) + { + set_group(COLGROUP_MOVING); + m_physic.enable_gravity(true); + m_grabbed_tux = false; + throw_snowballs(); + } + break; } m_col.set_movement(m_physic.get_movement(dt_sec)); } -void -Yeti::jump_down() -{ - set_action("jump", m_dir); - m_physic.set_velocity(m_dir == Direction::RIGHT ? JUMP_DOWN_VX : -JUMP_DOWN_VX, JUMP_DOWN_VY); - m_state = JUMP_DOWN; -} - void Yeti::run() { - set_action("walking", m_dir); - m_physic.set_velocity(m_dir == Direction::RIGHT ? RUN_VX : -RUN_VX, 0); m_state = RUN; + m_state_timer.start(BEFORE_WAIT); } void Yeti::jump_up() { set_action("jump", m_dir); - m_physic.set_velocity(m_dir == Direction::RIGHT ? JUMP_UP_VX : -JUMP_UP_VX, JUMP_UP_VY); + m_physic.set_velocity_y(JUMP_UP_VY); m_state = JUMP_UP; } void -Yeti::be_angry() +Yeti::throw_snowballs() { // Turn around. - m_dir = (m_dir==Direction::RIGHT) ? Direction::LEFT : Direction::RIGHT; - set_action("stand", m_dir); - m_physic.set_velocity_x(0); + + m_stomp_count = 0; + m_state = THROW; + m_state_timer.start(STOMP_WAIT / (m_pinch_mode ? 1.2f : 1.f)); +} + +void +Yeti::throw_big_snowballs() +{ + m_stomp_count = 0; + m_state = THROW_BIG; + m_state_timer.start(BALL_WAIT); +} + +void +Yeti::be_angry() +{ m_stomp_count = 0; m_state = BE_ANGRY; - m_state_timer.start(STOMP_WAIT); + m_state_timer.start(BALL_WAIT); } bool Yeti::collision_squished(GameObject& object) { - kill_squished(object); + if (m_state != YetiState::JUMP_UP && m_state != YetiState::RUN && m_state != YetiState::BE_ANGRY) { + return false; + } + kill_squished(object); return true; } +HitResponse +Yeti::collision_badguy(BadGuy& badguy, const CollisionHit& hit) +{ + badguy.kill_fall(); + return FORCE_MOVE; +} + void Yeti::kill_squished(GameObject& object) { @@ -251,13 +344,16 @@ Yeti::kill_squished(GameObject& object) void Yeti::take_hit(Player& ) { - if (m_safe_timer.started()) + if (m_safe_timer.started() || m_just_hit || + std::abs(m_left_stand_x - get_pos().x) < 80 || std::abs(m_right_stand_x - get_pos().x) < 80) return; + m_just_hit = true; + SoundManager::current()->play("sounds/yeti_roar.wav", get_pos()); - m_hit_points--; + m_lives--; - if (m_hit_points <= 0) { + if (m_lives <= 0) { // We're dead. m_physic.set_velocity((m_dir == Direction::RIGHT ? RUN_VX : -RUN_VX) / 5, 0); @@ -292,7 +388,7 @@ Yeti::drop_stalactite() for (auto& stalactite : Sector::get().get_objects_by_type()) { if (stalactite.is_hanging()) { - if (m_hit_points >= 3) { + if (!m_pinch_mode) { // Drop stalactites within 3 units of player, going out with each jump. float distancex = fabsf(stalactite.get_bbox().get_middle().x - player->get_bbox().get_middle().x); if (distancex < static_cast(m_stomp_count) * 32.0f) { @@ -308,6 +404,20 @@ Yeti::drop_stalactite() } } +void +Yeti::summon_snowball() +{ + Vector bs_pos = get_pos() + Vector(m_dir == Direction::LEFT ? -32.f : (get_bbox().get_width() + 1.f), 0.f); + Sector::get().add(bs_pos, m_dir, 150.f * (m_pinch_mode ? 1.2f : 1.f)); +} + +void +Yeti::summon_big_snowball() +{ + Vector bs_pos = Vector(get_bbox().get_middle().x - 44.f, get_bbox().get_top() - 89.f); + Sector::get().add(bs_pos, m_dir, true); +} + void Yeti::collision_solid(const CollisionHit& hit) { @@ -316,13 +426,17 @@ Yeti::collision_solid(const CollisionHit& hit) // Hit floor or roof. m_physic.set_velocity_y(0); switch (m_state) { - case JUMP_DOWN: - run(); - break; case RUN: + if (!m_just_threw) { + set_action("walking", m_dir); + } break; case JUMP_UP: break; + case THROW: + break; + case THROW_BIG: + break; case BE_ANGRY: // We just landed. if (!m_state_timer.started()) @@ -334,12 +448,18 @@ Yeti::collision_solid(const CollisionHit& hit) // Go to the other side after 3 jumps. if (m_stomp_count == 3) { - jump_down(); + m_just_hit = false; + if (m_pinch_mode) { + throw_big_snowballs(); + } + else { + run(); + } } else { // Jump again. - m_state_timer.start(STOMP_WAIT); + m_state_timer.start(STOMP_WAIT / (m_pinch_mode ? 1.2f : 1.f)); } } break; @@ -347,6 +467,8 @@ Yeti::collision_solid(const CollisionHit& hit) break; case FALLING: break; + case REMOVE_TUX: + break; } } else if (hit.left || hit.right) { // Hit wall. @@ -355,20 +477,12 @@ Yeti::collision_solid(const CollisionHit& hit) } } -bool -Yeti::is_flammable() const -{ - return false; -} - ObjectSettings Yeti::get_settings() { - ObjectSettings result = BadGuy::get_settings(); + ObjectSettings result = Boss::get_settings(); - result.add_text("hud-icon", &m_hud_icon, "hud-icon", "images/creatures/yeti/hudlife.png", OPTION_HIDDEN); result.add_bool(_("Fixed position"), &m_fixed_pos, "fixed-pos", false); - result.add_int(_("Lives"), &m_hit_points, "lives", 5); return result; } diff --git a/src/badguy/yeti.hpp b/src/badguy/yeti.hpp index 68aea592bb5..8b98b2e9132 100644 --- a/src/badguy/yeti.hpp +++ b/src/badguy/yeti.hpp @@ -18,9 +18,9 @@ #ifndef HEADER_SUPERTUX_BADGUY_YETI_HPP #define HEADER_SUPERTUX_BADGUY_YETI_HPP -#include "badguy/badguy.hpp" +#include "badguy/boss.hpp" -class Yeti final : public BadGuy +class Yeti final : public Boss { public: Yeti(const ReaderMapping& mapping); @@ -30,9 +30,9 @@ class Yeti final : public BadGuy virtual void active_update(float dt_sec) override; virtual void collision_solid(const CollisionHit& hit) override; virtual bool collision_squished(GameObject& object) override; + virtual HitResponse collision_badguy(BadGuy& badguy, const CollisionHit& hit) override; virtual void kill_fall() override; - virtual bool is_flammable() const override; static std::string class_name() { return "yeti"; } virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Yeti"); } @@ -48,11 +48,12 @@ class Yeti final : public BadGuy private: void run(); void jump_up(); + void throw_snowballs(); + void throw_big_snowballs(); void be_angry(); void drop_stalactite(); - void jump_down(); - - void draw_hit_points(DrawingContext& context); + void summon_snowball(); + void summon_big_snowball(); void take_hit(Player& player); @@ -61,12 +62,14 @@ class Yeti final : public BadGuy private: enum YetiState { - JUMP_DOWN, RUN, JUMP_UP, + THROW, + THROW_BIG, BE_ANGRY, SQUISHED, - FALLING + FALLING, + REMOVE_TUX }; private: @@ -74,8 +77,6 @@ class Yeti final : public BadGuy Timer m_state_timer; Timer m_safe_timer; int m_stomp_count; - int m_hit_points; - SurfacePtr m_hud_head; float m_left_stand_x; float m_right_stand_x; @@ -83,7 +84,10 @@ class Yeti final : public BadGuy float m_right_jump_x; bool m_fixed_pos; - std::string m_hud_icon; + bool m_just_hit; + bool m_just_threw; + bool m_grabbed_tux; + bool m_jumped; class SnowExplosionParticle: public BadGuy { diff --git a/src/object/bigsnowball.cpp b/src/object/bigsnowball.cpp new file mode 100644 index 00000000000..3f8239b8ebf --- /dev/null +++ b/src/object/bigsnowball.cpp @@ -0,0 +1,223 @@ +// Copyright (C) 2024 Daniel Ward +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include "object/bigsnowball.hpp" + +#include "badguy/badguy.hpp" +#include "badguy/yeti.hpp" +#include "math/random.hpp" +#include "math/util.hpp" +#include "object/bumper.hpp" +#include "object/player.hpp" +#include "object/sprite_particle.hpp" +#include "object/trampoline.hpp" +#include "sprite/sprite.hpp" +#include "sprite/sprite_manager.hpp" +#include "supertux/sector.hpp" +#include "supertux/tile.hpp" +#include "util/reader_mapping.hpp" + +namespace { + const float SPEED_X = 350.f; + const float SPEED_Y = -300.f; +} + +BigSnowball::BigSnowball(const ReaderMapping& reader) : + MovingSprite(reader, "images/objects/big_snowball/big_snowball.sprite", LAYER_OBJECTS, COLGROUP_MOVING_STATIC), + m_physic(), + m_dir(Direction::LEFT), + m_speed(), + m_break_on_impact(), + m_bounce() +{ + reader.get("speed", m_speed, SPEED_X); + reader.get("break-on-impact", m_break_on_impact, false); + reader.get("bounce", m_bounce, true); + std::string dir_str; + if (reader.get("direction", dir_str)) { + m_dir = string_to_dir(dir_str); + } + m_physic.set_velocity_x(m_dir == Direction::RIGHT ? m_speed : -m_speed); + set_action("normal", m_dir); +} + +BigSnowball::BigSnowball(const Vector& pos, const Direction& dir, bool bounce) : + MovingSprite(pos, "images/objects/big_snowball/big_snowball.sprite", LAYER_OBJECTS, COLGROUP_MOVING_STATIC), + m_physic(), + m_dir(Direction::LEFT), + m_speed(), + m_break_on_impact(), + m_bounce() +{ + // settings used by Yeti when it throws it + m_dir = dir; + m_speed = SPEED_X; + m_break_on_impact = true; + m_bounce = false; + m_physic.set_velocity_x(m_dir == Direction::RIGHT ? SPEED_X : -SPEED_X); + if (bounce) { + m_physic.set_velocity_y(SPEED_Y); + } + set_action("normal", m_dir); +} + +ObjectSettings +BigSnowball::get_settings() +{ + ObjectSettings result = MovingSprite::get_settings(); + + result.add_direction(_("Direction"), &m_dir, { Direction::RIGHT, Direction::LEFT }, "direction"); + result.add_float(_("Speed"), &m_speed, "speed", SPEED_X); + result.add_bool(_("Break on impact?"), &m_break_on_impact, "break-on-impact", false); + result.add_bool(_("Bounce?"), &m_bounce, "bounce", true); + result.reorder({ "direction", "speed", "break-on-impact", "bounce", "sprite", "x", "y" }); + return result; +} + +void +BigSnowball::update(float dt_sec) +{ + if (get_bbox().get_top() > Sector::get().get_height()) { + remove_me(); + } + + // Left-right faux collision + + Rectf side_look_box = get_bbox().grown(-1.f); + side_look_box.set_left(get_bbox().get_left() + (m_dir == Direction::LEFT ? -1.f : 1.f)); + side_look_box.set_right(get_bbox().get_right() + (m_dir == Direction::LEFT ? -1.f : 1.f)); + if (!Sector::get().is_free_of_statics(side_look_box)) + { + if (m_break_on_impact) { + spawn_particles(); + } + else + { + m_dir = m_dir == Direction::LEFT ? Direction::RIGHT : Direction::LEFT; + set_action(m_dir); + m_physic.set_velocity_x(-m_physic.get_velocity_x()); + } + } + + Rectf spikebox = get_bbox().grown(-6.f); + spikebox.set_bottom(get_bbox().get_bottom() - (m_physic.get_velocity_y() > 300.f ? 6.f : 40.f)); + if (!Sector::get().is_free_of_tiles(spikebox, false, Tile::HURTS)) { + spawn_particles(); + } + + bool in_water = !Sector::get().is_free_of_tiles(get_bbox(), true, Tile::WATER); + + Vector movement = m_physic.get_movement(dt_sec) * Vector(in_water ? 0.4f : 1.f, in_water ? 0.6f : 1.f); + m_sprite->set_angle(m_sprite->get_angle() + movement.x * 3.141592653898f / 2.f); + m_col.set_movement(movement); + //m_col.propagate_movement(movement); +} + +HitResponse +BigSnowball::collision(GameObject& other, const CollisionHit& hit) +{ + // ignore collisions with yeti + auto yeti = dynamic_cast(&other); // cppcheck-suppress constVariablePointer + if (yeti) { + return ABORT_MOVE; + } + + auto badguy = dynamic_cast(&other); // cppcheck-suppress constVariablePointer + if (badguy && ((m_dir == Direction::LEFT && hit.left) || (m_dir == Direction::RIGHT && hit.right) || hit.bottom)) + { + badguy->kill_fall(); + return ABORT_MOVE; + } + + auto player = dynamic_cast(&other); // cppcheck-suppress constVariablePointer + if (player && player->m_does_buttjump && hit.top) + { + spawn_particles(); + return ABORT_MOVE; + } + + auto bs = dynamic_cast(&other); // cppcheck-suppress constVariablePointer + if (bs) { + collision_solid(hit); + return ABORT_MOVE; + } + + auto tramp = dynamic_cast(&other); // cppcheck-suppress constVariablePointer + if (tramp) + { + m_physic.set_velocity_y(-500.f); + tramp->bounce(); + return ABORT_MOVE; + } + + auto bumper = dynamic_cast(&other); // cppcheck-suppress constVariablePointer + if (bumper) + { + m_physic.set_velocity_x(-m_physic.get_velocity_x()); + m_dir = m_dir == Direction::LEFT ? Direction::RIGHT : Direction::LEFT; + bumper->bounce(); + return ABORT_MOVE; + } + + return FORCE_MOVE; +} + +void +BigSnowball::collision_solid(const CollisionHit& hit) +{ + if (hit.bottom) + { + if (m_physic.get_velocity_y() > 10.f && m_bounce) { + m_physic.set_velocity_y(-std::pow(m_physic.get_velocity_y(), (9.f / 10.f))); + } + else { + m_physic.set_velocity_y(0.f); + } + } + + if ((hit.left || hit.right) && m_break_on_impact) { + spawn_particles(); + } + + if (!m_break_on_impact) + { + if (m_dir == Direction::LEFT && hit.left) + { + m_physic.set_velocity_x(m_speed); + m_dir = Direction::RIGHT; + } + if (m_dir == Direction::RIGHT && hit.right) + { + m_physic.set_velocity_x(-m_speed); + m_dir = Direction::LEFT; + } + } +} + +void +BigSnowball::spawn_particles() +{ + for (int i = 0; i < 8; i++) + { + Sector::get().add(m_sprite_name, "particle", + get_bbox().get_middle() + (15.f * Vector(std::cos(math::PI_4*static_cast(i)), std::sin(math::PI_4*static_cast(i)))), + ANCHOR_MIDDLE, (150.f * (glm::normalize(Vector(std::cos(math::PI_4*static_cast(i)), std::sin(math::PI_4*static_cast(i)))))) + + Vector(gameRandom.randf(-40.f, 40.f), gameRandom.randf(-40.f, 40.f)), + Vector(0.f, 1000.f), LAYER_OBJECTS + 1, true); + } + remove_me(); +} + +/* EOF */ diff --git a/src/object/bigsnowball.hpp b/src/object/bigsnowball.hpp new file mode 100644 index 00000000000..f22c2e5dcfe --- /dev/null +++ b/src/object/bigsnowball.hpp @@ -0,0 +1,59 @@ +// Copyright (C) 2024 Daniel Ward +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#ifndef HEADER_SUPERTUX_OBJECT_BIGSNOWBALL_HPP +#define HEADER_SUPERTUX_OBJECT_BIGSNOWBALL_HPP + +#include "object/moving_sprite.hpp" + +#include "supertux/physic.hpp" + +enum class Direction; + +class BigSnowball final : public MovingSprite +{ +public: + BigSnowball(const ReaderMapping& reader); + BigSnowball(const Vector& pos, const Direction& dir, bool bounce = false); + + virtual ObjectSettings get_settings() override; + + virtual void update(float dt_sec) override; + virtual void collision_solid(const CollisionHit& hit) override; + virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; + + static std::string class_name() { return "bigsnowball"; } + virtual std::string get_class_name() const override { return class_name(); } + static std::string display_name() { return _("Big Snowball"); } + virtual std::string get_display_name() const override { return display_name(); } + +private: + void spawn_particles(); + +private: + Physic m_physic; + Direction m_dir; + float m_speed; + bool m_break_on_impact; + bool m_bounce; + +private: + BigSnowball(const BigSnowball&) = delete; + BigSnowball& operator=(const BigSnowball&) = delete; +}; + +#endif + +/* EOF */ diff --git a/src/object/bumper.cpp b/src/object/bumper.cpp index 3e28edb4d91..aed2c14b563 100644 --- a/src/object/bumper.cpp +++ b/src/object/bumper.cpp @@ -101,8 +101,7 @@ Bumper::collision(GameObject& other, const CollisionHit& hit) { player->get_physic().set_velocity(0.f, player->is_swimming() ? 0.f : BOUNCE_Y); player->sideways_push(m_dir == Direction::LEFT ? -BOUNCE_X : BOUNCE_X); - SoundManager::current()->play(TRAMPOLINE_SOUND, get_pos()); - set_action("swinging", m_dir, 1); + bounce(); } auto badguy = dynamic_cast (&other); @@ -143,4 +142,11 @@ Bumper::on_flip(float height) FlipLevelTransformer::transform_flip(m_flip); } +void +Bumper::bounce() +{ + SoundManager::current()->play(TRAMPOLINE_SOUND, get_pos()); + set_action("swinging", m_dir, 1); +} + /* EOF */ diff --git a/src/object/bumper.hpp b/src/object/bumper.hpp index bc9b40c8700..d4b6a3aab3a 100644 --- a/src/object/bumper.hpp +++ b/src/object/bumper.hpp @@ -43,6 +43,8 @@ class Bumper final : public StickyObject Physic& get_physic(); + void bounce(); + private: Physic m_physic; diff --git a/src/object/pushbutton.cpp b/src/object/pushbutton.cpp index 9d50f9e5e13..c49d462c899 100644 --- a/src/object/pushbutton.cpp +++ b/src/object/pushbutton.cpp @@ -17,6 +17,7 @@ #include "object/pushbutton.hpp" #include "audio/sound_manager.hpp" +#include "object/bigsnowball.hpp" #include "object/player.hpp" #include "object/rock.hpp" #include "sprite/sprite.hpp" @@ -88,7 +89,9 @@ PushButton::collision(GameObject& other, const CollisionHit& hit) { auto player = dynamic_cast(&other); auto rock = dynamic_cast(&other); - if (!player && !rock) + auto bs = dynamic_cast(&other); + + if (!player && !rock && !bs) return FORCE_MOVE; if (player) { diff --git a/src/supertux/game_object_factory.cpp b/src/supertux/game_object_factory.cpp index ff14c62f316..66185b31a54 100644 --- a/src/supertux/game_object_factory.cpp +++ b/src/supertux/game_object_factory.cpp @@ -84,6 +84,7 @@ #include "object/ambient_sound.hpp" #include "object/background.hpp" #include "object/bicycle_platform.hpp" +#include "object/bigsnowball.hpp" #include "object/bonus_block.hpp" #include "object/brick.hpp" #include "object/bumper.hpp" @@ -251,6 +252,7 @@ GameObjectFactory::init_factories() add_factory("ambient_sound"); // Backward compatibilty. add_factory("ambient-sound"); add_factory("background", OBJ_PARAM_WORLDMAP); + add_factory("bigsnowball", OBJ_PARAM_DISPENSABLE); add_factory("path"); add_factory("bicycle-platform"); add_factory("bonusblock", OBJ_PARAM_DISPENSABLE); From be1b59606282445293187032823016ac2e310207 Mon Sep 17 00:00:00 2001 From: SuperTux Bot Date: Thu, 11 Jul 2024 01:37:40 +0000 Subject: [PATCH 17/33] Update translations --- data/locale/gl.po | 564 +++++++++++++++++++++++----------------------- data/locale/ja.po | 2 +- data/locale/nl.po | 2 +- data/locale/pt.po | 2 +- 4 files changed, 285 insertions(+), 285 deletions(-) diff --git a/data/locale/gl.po b/data/locale/gl.po index 2278c70a8b4..72ec2e59114 100644 --- a/data/locale/gl.po +++ b/data/locale/gl.po @@ -500,7 +500,7 @@ msgstr "Contido Personalizado" #: src/object/bonus_block.cpp:278 msgid "Coin sprite" -msgstr "Fada da moeda" +msgstr "Gráfico animado da moeda" #: src/object/pneumatic_platform.hpp:65 msgid "Pneumatic Platform" @@ -714,23 +714,23 @@ msgstr "Música" #: src/object/lit_object.cpp:68 msgid "Light sprite" -msgstr "sprite de luz" +msgstr "Gráfico animado de luz" #: src/object/lit_object.cpp:71 msgid "Sprite starting action" -msgstr "" +msgstr "Acción inicial do gráfico animado" #: src/object/lit_object.cpp:72 msgid "Light sprite starting action" -msgstr "" +msgstr "Acción inicial do gráfico animado de luz" #: src/object/lit_object.cpp:74 msgid "Light sprite offset X" -msgstr "" +msgstr "Desprazamento do eixo X do gráfico animado de luz" #: src/object/lit_object.cpp:75 msgid "Light sprite offset Y" -msgstr "" +msgstr "Desprazamento do eixo Y do gráfico animado de luz" #: src/object/rusty_trampoline.hpp:40 msgid "Rusty Trampoline" @@ -750,19 +750,19 @@ msgstr "Intermitente" #: src/object/snow_particle_system.cpp:104 msgid "Epsilon" -msgstr "" +msgstr "Epsilon" #: src/object/snow_particle_system.cpp:105 msgid "Spin Speed" -msgstr "" +msgstr "Velocidade de Rotación" #: src/object/snow_particle_system.cpp:106 msgid "State Length" -msgstr "" +msgstr "Duración do Estado" #: src/object/snow_particle_system.cpp:107 msgid "Wind Speed" -msgstr "" +msgstr "Velocidade do Vento" #: src/object/text_array_object.hpp:47 msgid "Text array" @@ -778,7 +778,7 @@ msgstr "Ovo" #: src/object/powerup.cpp:62 msgid "Fire Flower" -msgstr "" +msgstr "Flor de Lume" #: src/object/powerup.cpp:63 msgid "Ice Flower" @@ -786,31 +786,31 @@ msgstr "Flor de Xeo" #: src/object/powerup.cpp:64 msgid "Air Flower" -msgstr "" +msgstr "Flor de Aire" #: src/object/powerup.cpp:65 msgid "Earth Flower" -msgstr "" +msgstr "Flor de Terra" #: src/object/powerup.cpp:67 msgid "Tux Doll" -msgstr "" +msgstr "Boneco de Tux" #: src/object/powerup.cpp:68 msgid "Flip Potion" -msgstr "" +msgstr "Poción de viraxe" #: src/object/powerup.cpp:69 msgid "Mints" -msgstr "" +msgstr "Mentolados" #: src/object/powerup.cpp:70 msgid "Coffee" -msgstr "" +msgstr "Café" #: src/object/powerup.cpp:71 msgid "Herring" -msgstr "" +msgstr "Arenque" #: src/object/powerup.cpp:302 msgid "Disable gravity" @@ -820,7 +820,7 @@ msgstr "Desactivar gravidade" msgid "" "Sprites no longer define the behaviour of the object.\n" "Object types are used instead." -msgstr "" +msgstr "Os sprites xa non definen o comportamento do obxecto.\nEmpreganse tipos de obxecto en troques." #: src/object/ambient_sound.hpp:43 msgid "Ambient Sound" @@ -1388,7 +1388,7 @@ msgstr "Limpar partículas" #: src/object/weak_block.cpp:98 msgid "Hay" -msgstr "" +msgstr "Feo" #: src/object/decal.hpp:41 msgid "Decal" @@ -1483,7 +1483,7 @@ msgstr "Lonxitude" #: src/object/moving_sprite.cpp:192 src/object/pneumatic_platform.cpp:161 msgid "Sprite" -msgstr "Fada" +msgstr "Gráfico animado \"sprite\"" #: src/object/unstable_tile.hpp:42 msgid "Unstable Tile" @@ -1491,7 +1491,7 @@ msgstr "Tesela Inestable" #: src/object/brick.hpp:70 msgid "Heavy Brick" -msgstr "" +msgstr "Ladrillo Pesado" #: src/object/invisible_wall.hpp:37 msgid "Invisible Wall" @@ -1548,11 +1548,11 @@ msgstr "Pechar" #: src/gui/menu_string_array.cpp:40 src/gui/menu_string_array.cpp:78 #, c++-format msgid "Selected item: {}" -msgstr "" +msgstr "Elemento escollido: {}" #: src/gui/menu_string_array.cpp:70 msgid "Edit string array" -msgstr "" +msgstr "Editar matriz de cadeas" #: src/gui/menu_string_array.cpp:79 src/gui/menu_object_select.cpp:50 #: src/supertux/menu/profile_menu.cpp:88 @@ -1561,17 +1561,17 @@ msgstr "Engadir" #: src/gui/menu_string_array.cpp:80 msgid "Insert" -msgstr "" +msgstr "Inserir" #: src/gui/menu_string_array.cpp:81 #: src/supertux/menu/addon_preview_menu.cpp:177 src/editor/object_menu.cpp:61 msgid "Update" -msgstr "" +msgstr "Actualizar" #: src/gui/menu_string_array.cpp:82 src/supertux/menu/profile_menu.cpp:108 #: src/supertux/menu/profile_menu.cpp:110 msgid "Delete" -msgstr "" +msgstr "Eliminar" #: src/gui/menu_string_array.cpp:84 src/gui/menu_object_select.cpp:61 #: src/gui/menu_color.cpp:37 src/gui/dialog.hpp:87 src/gui/menu_script.cpp:46 @@ -1584,16 +1584,16 @@ msgstr "OK" #: src/gui/menu_object_select.cpp:46 msgid "List of objects" -msgstr "" +msgstr "Lista de Obxectos" #: src/gui/menu_object_select.cpp:48 #, c++-format msgid "Select object ({})" -msgstr "" +msgstr "Escoller obxecto ({})" #: src/gui/menu_object_select.cpp:114 msgid "Are you sure you want to remove this object from the list?" -msgstr "" +msgstr "Estás certo de que queres eliminar este obxecto da lista?" #: src/gui/menu_color.cpp:24 msgid "Mix the colour" @@ -1625,7 +1625,7 @@ msgstr "Cancelar" #: src/gui/menu_filesystem.cpp:118 msgid "Open Directory" -msgstr "" +msgstr "Abrir Cartafol" #: src/gui/menu_script.cpp:28 msgid "Edit script" @@ -1640,7 +1640,7 @@ msgid "" "An error occurred and the game could\n" "not clone the path. Please contact\n" "the developers for support." -msgstr "" +msgstr "Produciuse un erro e o xogo non puido clonar a ruta. Por favor, contacta cos desenroladores para obter soporte." #: src/gui/menu_paths.cpp:44 msgid "Bind" @@ -1651,12 +1651,12 @@ msgid "" "Do you wish to clone the path to edit it separately,\n" "or do you want to bind both paths together\n" "so that any edit on one edits the other?" -msgstr "" +msgstr "Queres clonar a ruta para editala por separado,\nou prefires ligar ambas as rutas\nde maneira que calquera edición nunha se reflicta na outra?" #: src/gui/menu_paths.cpp:56 #, c++-format msgid "Path {}" -msgstr "" +msgstr "Ruta {}" #: src/gui/menu_paths.cpp:67 src/supertux/menu/integrations_menu.cpp:60 #: src/supertux/menu/editor_converters_menu.cpp:79 @@ -1698,17 +1698,17 @@ msgstr "Atrás" #: src/addon/addon_manager.cpp:562 msgid "Only one resource pack is allowed to be enabled at a time." -msgstr "" +msgstr "Só se permite activar un paquete de recursos á vez." #: src/addon/addon_manager.cpp:837 #, c++-format msgid "Add-on {} by {} is already installed." -msgstr "" +msgstr "O complemento {} de {} xa está instalado." #: src/addon/addon_manager.cpp:857 #, c++-format msgid "Add-on {} by {} successfully installed." -msgstr "" +msgstr "O complemento {} de {} instalouse correctamente." #: src/addon/addon.cpp:71 src/supertux/menu/editor_levelset_menu.cpp:54 msgid "Levelset" @@ -1729,11 +1729,11 @@ msgstr "Complemento" #: src/addon/addon.cpp:83 msgid "Language Pack" -msgstr "" +msgstr "Paquete de Idiomas" #: src/addon/addon.cpp:86 msgid "Resource Pack" -msgstr "" +msgstr "Paquete de Recursos" #: src/addon/addon.cpp:89 msgid "Unknown" @@ -1742,15 +1742,15 @@ msgstr "Descoñecido" #: src/addon/addon.cpp:100 #, c++-format msgid "{} \"{}\" by \"{}\"" -msgstr "" +msgstr "{} \"{}\" por \"{}\"" #: src/addon/addon.cpp:114 msgid "add-on" -msgstr "" +msgstr "complemento" #: src/addon/addon.cpp:114 msgid "add-ons" -msgstr "" +msgstr "complementos" #: src/badguy/toad.hpp:38 msgid "Toad" @@ -1758,7 +1758,7 @@ msgstr "Sapo" #: src/badguy/mrtree.hpp:32 msgid "Mr. Tree" -msgstr "" +msgstr "Sr. árbore" #: src/badguy/plant.hpp:34 msgid "Plant" @@ -1766,27 +1766,27 @@ msgstr "Planta" #: src/badguy/tarantula.hpp:39 src/badguy/tarantula.cpp:353 msgid "Tarantula" -msgstr "" +msgstr "tarántula" #: src/badguy/granito_giant.cpp:71 msgid "Awake" -msgstr "" +msgstr "Esperto" #: src/badguy/granito_giant.cpp:72 msgid "Sleeping" -msgstr "" +msgstr "Durmindo" #: src/badguy/granito_giant.cpp:73 msgid "Corrupted A" -msgstr "" +msgstr "Corrompido A" #: src/badguy/granito_giant.cpp:74 msgid "Corrupted B" -msgstr "" +msgstr "Corrompido B" #: src/badguy/granito_giant.cpp:75 msgid "Corrupted C" -msgstr "" +msgstr "Corrompido C" #: src/badguy/crystallo.hpp:33 msgid "Crystallo" @@ -1796,7 +1796,7 @@ msgstr "Cristaliño" #: src/badguy/kamikazesnowball.cpp:118 src/badguy/walkingleaf.cpp:36 #: src/badguy/jumpy.cpp:46 src/badguy/igel.cpp:189 src/badguy/mrtree.cpp:51 msgid "Corrupted" -msgstr "" +msgstr "Corrompido" #: src/badguy/totem.hpp:37 msgid "Totem" @@ -1808,19 +1808,19 @@ msgstr "Estalactita" #: src/badguy/fish_chasing.cpp:198 msgid "Tracking Distance" -msgstr "" +msgstr "Distancia de Seguimento" #: src/badguy/fish_chasing.cpp:199 msgid "Losing Distance" -msgstr "" +msgstr "Distancia de Perda" #: src/badguy/fish_chasing.cpp:200 msgid "Chase Speed" -msgstr "" +msgstr "Velocidade de Persecución" #: src/badguy/root_sapling.hpp:41 msgid "Root Sapling" -msgstr "" +msgstr "Gromo de Ráiz" #: src/badguy/haywire.hpp:46 msgid "Haywire" @@ -1840,28 +1840,28 @@ msgstr "Dragón" #: src/badguy/smartball.cpp:35 msgid "Pumpkin" -msgstr "" +msgstr "Cabaza" #: src/badguy/bouncing_snowball.cpp:82 msgid "Fatbat" -msgstr "" +msgstr "Morcego Gordo" #: src/badguy/dive_mine.hpp:50 msgid "Dive Mine" -msgstr "" +msgstr "Mina de mergullo" #: src/badguy/granito_big.hpp:33 msgid "Big Granito" -msgstr "" +msgstr "Granito Grande" #: src/badguy/mriceblock.hpp:49 msgid "Mr. Iceblock" -msgstr "" +msgstr "Mr. Bloque de Xeo" #: src/badguy/granito.hpp:39 src/badguy/darttrap.cpp:163 #: src/badguy/corrupted_granito.cpp:175 src/badguy/dispenser.cpp:438 msgid "Granito" -msgstr "" +msgstr "Granito" #: src/badguy/fish_swimming.cpp:54 src/badguy/jumpy.cpp:44 #: data//images/ice_world.strf:10 data//images/tiles.strf:28 @@ -1876,19 +1876,19 @@ msgstr "Bosque" #: src/badguy/crusher.hpp:71 msgid "Crusher" -msgstr "" +msgstr "Trituradora" #: src/badguy/flame.cpp:84 msgid "Fire" -msgstr "" +msgstr "Lume" #: src/badguy/flame.cpp:85 msgid "Ghost" -msgstr "" +msgstr "Pantasma" #: src/badguy/corrupted_granito_big.hpp:35 msgid "Corrupted Big Granito" -msgstr "" +msgstr "Granito Grande Corrompido" #: src/badguy/scrystallo.cpp:57 msgid "Walk Radius" @@ -1900,7 +1900,7 @@ msgstr "Raio ó Espertar" #: src/badguy/scrystallo.cpp:59 msgid "Roof-attached" -msgstr "" +msgstr "Fixado ao tellado" #: src/badguy/jumpy.hpp:40 msgid "Jumpy" @@ -1948,7 +1948,7 @@ msgstr "Estalactita do Yeti" #: src/badguy/fish_harmless.hpp:30 msgid "Harmless Fish" -msgstr "" +msgstr "Peixe inofensivo" #: src/badguy/livefire.hpp:38 msgid "Walking Flame" @@ -1984,19 +1984,19 @@ msgstr "Munición" #: src/badguy/darttrap.cpp:152 msgid "Dart sprite" -msgstr "" +msgstr "Gráfico animado escuro" #: src/badguy/darttrap.cpp:164 msgid "Skull" -msgstr "" +msgstr "Cranio" #: src/badguy/snowball.hpp:30 msgid "Mr. Snowball" -msgstr "" +msgstr "Sr. Bola de Neve" #: src/badguy/smartblock.hpp:30 msgid "Mrs. Iceblock" -msgstr "" +msgstr "Sra. Bloque de Xeo" #: src/badguy/yeti.cpp:370 msgid "Fixed position" @@ -2012,11 +2012,11 @@ msgstr "Bomba Dourada" #: src/badguy/corrupted_granito.hpp:44 msgid "Corrupted Granito" -msgstr "" +msgstr "Granito Corrompido" #: src/badguy/mrbomb.cpp:48 msgid "Classic" -msgstr "" +msgstr "Clásico" #: src/badguy/flyingsnowball.hpp:33 msgid "Flying Snowball" @@ -2024,27 +2024,27 @@ msgstr "A Mosca" #: src/badguy/crusher.cpp:75 msgid "Ice (normal)" -msgstr "" +msgstr "Xeo (normal)" #: src/badguy/crusher.cpp:76 msgid "Ice (big)" -msgstr "" +msgstr "Xeo (grande)" #: src/badguy/crusher.cpp:77 msgid "Rock (normal)" -msgstr "" +msgstr "Rocha (normal)" #: src/badguy/crusher.cpp:78 msgid "Rock (big)" -msgstr "" +msgstr "Rocha (grande)" #: src/badguy/crusher.cpp:79 msgid "Corrupted (normal)" -msgstr "" +msgstr "Corrompido (normal)" #: src/badguy/crusher.cpp:80 msgid "Corrupted (big)" -msgstr "" +msgstr "Corrompido (grande)" #: src/badguy/crusher.cpp:492 msgid "Sideways" @@ -2052,7 +2052,7 @@ msgstr "Beirarrúas" #: src/badguy/kamikazesnowball.hpp:34 msgid "Kamikaze Snowball" -msgstr "" +msgstr "Bola de neve kamikaze" #: src/badguy/kamikazesnowball.hpp:64 msgid "Leafshot" @@ -2060,7 +2060,7 @@ msgstr "Bala de folla" #: src/badguy/fish_swimming.hpp:40 msgid "Swimming Fish" -msgstr "" +msgstr "Peixe Nadador" #: src/badguy/flame.hpp:47 msgid "Flame" @@ -2072,15 +2072,15 @@ msgstr "Cristaliño Durminte" #: src/badguy/jumpy.cpp:45 msgid "Wooden" -msgstr "" +msgstr "Madeira" #: src/badguy/jumpy.cpp:47 msgid "Metal" -msgstr "" +msgstr "Metal" #: src/badguy/jumpy.cpp:48 msgid "Bag" -msgstr "" +msgstr "Saco" #: src/badguy/willowisp.hpp:57 msgid "Will o' Wisp" @@ -2088,7 +2088,7 @@ msgstr "Asubía-Bólas" #: src/badguy/fish_jumping.hpp:41 msgid "Jumping Fish" -msgstr "" +msgstr "Peixe Brincador" #: src/badguy/badguy.hpp:61 msgid "Badguy" @@ -2104,11 +2104,11 @@ msgstr "Pinchudo" #: src/badguy/walkingleaf.hpp:33 msgid "Walking Leaf" -msgstr "" +msgstr "Folla Andante" #: src/badguy/root.hpp:39 msgid "Root" -msgstr "" +msgstr "Ráiz" #: src/badguy/owl.cpp:241 msgid "Carry" @@ -2128,11 +2128,11 @@ msgstr "Yeti" #: src/badguy/snowball.cpp:41 msgid "Bumpkin" -msgstr "" +msgstr "Pailán" #: src/badguy/snowball.cpp:42 msgid "BSOD" -msgstr "" +msgstr "BSOD" #: src/badguy/mole.hpp:38 msgid "Mole" @@ -2144,7 +2144,7 @@ msgstr "Caveira Choutadora" #: src/badguy/mrbomb.hpp:40 msgid "Mr. Bomb" -msgstr "" +msgstr "Sr. Bomba" #: src/badguy/walking_candle.hpp:41 msgid "Walking Candle" @@ -2156,11 +2156,11 @@ msgstr "Pedra Furiosa" #: src/badguy/tarantula.cpp:354 msgid "Spidermite" -msgstr "" +msgstr "Ácaro araña" #: src/badguy/tarantula.cpp:374 msgid "Static" -msgstr "" +msgstr "Estático" #: src/badguy/ghoul.hpp:30 msgid "Ghoul" @@ -2168,7 +2168,7 @@ msgstr "Demo" #: src/badguy/granito_giant.hpp:32 msgid "Giant Granito" -msgstr "" +msgstr "Granito Xigante" #: src/badguy/snowman.hpp:29 msgid "Snowman" @@ -2176,23 +2176,23 @@ msgstr "Boneco de Neve" #: src/badguy/viciousivy.hpp:33 msgid "Vicious Ivy" -msgstr "" +msgstr "Hedra Viciosa" #: src/badguy/stalactite.cpp:156 msgid "ice" -msgstr "" +msgstr "xeo" #: src/badguy/stalactite.cpp:157 msgid "rock" -msgstr "" +msgstr "rocha" #: src/badguy/fish_chasing.hpp:33 msgid "Chasing Fish" -msgstr "" +msgstr "Perseguindo Peixes" #: src/badguy/stumpy.hpp:38 msgid "Stumpy" -msgstr "" +msgstr "Tronco" #: src/badguy/dispenser.cpp:412 msgid "Interval (seconds)" @@ -2222,11 +2222,11 @@ msgstr "Cantidade máxima de tipos malos á vez" #: src/badguy/dispenser.cpp:435 msgid "Dropper" -msgstr "" +msgstr "Contagotas" #: src/badguy/dispenser.cpp:436 msgid "Cannon" -msgstr "" +msgstr "canón" #: src/badguy/dispenser.cpp:437 src/worldmap/special_tile.cpp:77 msgid "Invisible" @@ -2238,7 +2238,7 @@ msgstr "Caracol" #: src/badguy/smartball.hpp:32 msgid "Mrs. Snowball" -msgstr "" +msgstr "Sra. Bola de neve" #: src/badguy/bouncing_snowball.hpp:39 msgid "Bouncing Snowball" @@ -2246,19 +2246,19 @@ msgstr "Bóla de Neve Saltadora" #: src/badguy/granito_big.cpp:52 src/badguy/granito.cpp:263 msgid "Default" -msgstr "" +msgstr "Predeterminado" #: src/badguy/granito_big.cpp:53 src/badguy/granito.cpp:264 msgid "Standing" -msgstr "" +msgstr "De pé" #: src/badguy/granito_big.cpp:54 src/badguy/granito.cpp:265 msgid "Walking" -msgstr "" +msgstr "Camiñando" #: src/badguy/mriceblock.cpp:63 msgid "Laptop" -msgstr "" +msgstr "Portátil" #: src/badguy/dart.hpp:44 msgid "Dart" @@ -2266,7 +2266,7 @@ msgstr "Dardo" #: src/badguy/granito.cpp:268 msgid "Sitting" -msgstr "" +msgstr "Sentado" #: src/supertux/statistics.cpp:54 msgid "Max coins collected:" @@ -2323,7 +2323,7 @@ msgstr "Pulsar a tecla escape para saltar" #: src/supertux/command_line_arguments.cpp:92 #, c++-format msgid "Usage: {} [OPTIONS] [LEVELFILE]" -msgstr "" +msgstr "Uso: {} [OPCIÓNS] [ARQUIVO NÍVEL]" #: src/supertux/command_line_arguments.cpp:93 msgid "General Options:" @@ -2494,7 +2494,7 @@ msgstr "Este xogo vén SEN ABSOLUTAMENTE NINGUNHA GARANTÍA. É software libre e #: src/supertux/game_object.cpp:114 msgid "Version" -msgstr "" +msgstr "Versión" #: src/supertux/game_object.cpp:129 #: src/supertux/menu/editor_levelset_menu.cpp:54 @@ -2513,7 +2513,7 @@ msgstr "Non compartir os nomes dos niveis ó editar" msgid "" "Enable this if you want to work on secret levels and don't want the names to" " be spoiled" -msgstr "" +msgstr "Activa isto se queres traballar en niveis secretos e non queres que se desvelen os nomes." #: src/supertux/menu/integrations_menu.cpp:54 msgid "Enable Discord integration" @@ -2523,7 +2523,7 @@ msgstr "Activar a integración con Discord" msgid "" "Sends information to your Discord application about what you're doing in the" " game." -msgstr "" +msgstr "Envía información á túa aplicación de Discord sobre o que estás a facer no xogo." #: src/supertux/menu/integrations_menu.cpp:57 msgid "Discord (disabled; not compiled)" @@ -2532,28 +2532,28 @@ msgstr "Discord (desactivado; non compilado)" #: src/supertux/menu/editor_converters_menu.cpp:61 #: src/supertux/menu/editor_menu.cpp:85 msgid "Convert Tiles" -msgstr "" +msgstr "Converter Bloques" #: src/supertux/menu/editor_converters_menu.cpp:64 msgid "Select Tile Conversion File" -msgstr "" +msgstr "Seleccione Ficheiro de conversión de Bloques" #: src/supertux/menu/editor_converters_menu.cpp:72 #, c++-format msgid "By: {}" -msgstr "" +msgstr "Por: {}" #: src/supertux/menu/editor_converters_menu.cpp:75 msgid "Convert Tiles By File" -msgstr "" +msgstr "Converter Bloques por ficheiro" #: src/supertux/menu/editor_converters_menu.cpp:76 msgid "Convert all tiles in the current level by a file, specified above." -msgstr "" +msgstr "Converte todos os bloques do nivel actual mediante un ficheiro, especificado anteriormente." #: src/supertux/menu/editor_converters_menu.cpp:89 msgid "No tile conversion file selected." -msgstr "" +msgstr "Non se seleccionou ningún ficheiro de conversión de bloque." #: src/supertux/menu/editor_converters_menu.cpp:93 msgid "" @@ -2561,20 +2561,20 @@ msgid "" "\n" "Note: This should not be ran more than once on a level.\n" "Creating a separate copy of the level is highly recommended." -msgstr "" +msgstr "Isto converterá tódolos bloques do nivel. Queres continuar?\n\nNota: Non se debe executar máis dunha vez nun nivel.\nRecoméndase crear unha copia separada do nivel." #: src/supertux/menu/video_system_menu.cpp:36 msgid "Select Video System" -msgstr "" +msgstr "Escolle Sistema de vídeo" #: src/supertux/menu/video_system_menu.cpp:37 #, c++-format msgid "Used video system: {}" -msgstr "" +msgstr "Sistema de vídeo usado: {}" #: src/supertux/menu/video_system_menu.cpp:54 msgid "Restart game for the changes to take effect" -msgstr "" +msgstr "Reinicia o xogo para que os cambios teñan efecto" #: src/supertux/menu/contrib_menu.cpp:68 #: src/supertux/menu/world_set_menu.cpp:31 @@ -2584,29 +2584,29 @@ msgstr "Niveis dos Colaboradores" #: src/supertux/menu/contrib_menu.cpp:98 #: src/supertux/menu/contrib_menu.cpp:112 msgid "Official Contrib Levels" -msgstr "" +msgstr "Niveis oficiais dos colaboradores" #: src/supertux/menu/contrib_menu.cpp:99 #: src/supertux/menu/contrib_menu.cpp:118 msgid "Community Contrib Levels" -msgstr "" +msgstr "Niveis de colaboración comunitaria" #: src/supertux/menu/contrib_menu.cpp:100 #: src/supertux/menu/contrib_menu.cpp:124 msgid "User Contrib Levels" -msgstr "" +msgstr "Niveis de colaboración do usuario" #: src/supertux/menu/contrib_menu.cpp:113 msgid "How is this possible? There are no Official Contrib Levels!" -msgstr "" +msgstr "Como é posible? Non hai niveis Oficiais de Contribución!" #: src/supertux/menu/contrib_menu.cpp:119 msgid "No Community Contrib Levels yet. Download them from the Add-ons Menu." -msgstr "" +msgstr "Aínda non hai niveis da Comunidade. Descárgaos dende o menú de Complementos." #: src/supertux/menu/contrib_menu.cpp:125 msgid "No User Contrib Levels yet. Create some with the Level Editor." -msgstr "" +msgstr "Aínda non hai niveis de Usuarios. Crea algúns co Editor de Niveis." #: src/supertux/menu/debug_menu.cpp:34 msgid "Debug" @@ -2669,29 +2669,29 @@ msgstr "Gardar" #: src/supertux/menu/multiplayer_menu.cpp:27 #: src/supertux/menu/multiplayer_players_menu.cpp:34 msgid "Multiplayer" -msgstr "" +msgstr "Multixogador" #: src/supertux/menu/multiplayer_menu.cpp:30 msgid "Auto-manage Players" -msgstr "" +msgstr "Xestionar Automaticamente os Xogadores" #: src/supertux/menu/multiplayer_menu.cpp:31 msgid "" "Automatically add and remove players when controllers are plugged or " "unplugged" -msgstr "" +msgstr "Engade e elimina xogadores automaticamente cando se conecten ou desconecten os mandos." #: src/supertux/menu/multiplayer_menu.cpp:33 msgid "Allow Multibind" -msgstr "" +msgstr "Permitir Multivinculación" #: src/supertux/menu/multiplayer_menu.cpp:34 msgid "Allow binding multiple joysticks to a single player" -msgstr "" +msgstr "Permite vincular varios joysticks a un único xogador." #: src/supertux/menu/multiplayer_menu.cpp:36 msgid "Manage Players" -msgstr "" +msgstr "Xestionar Xogadores" #: src/supertux/menu/editor_sectors_menu.cpp:31 msgid "Choose Sector" @@ -2724,55 +2724,55 @@ msgstr "Eliminar sector" #: src/supertux/menu/custom_menu_menu.cpp:49 #: src/supertux/menu/options_menu.cpp:191 msgid "Menu Customization" -msgstr "" +msgstr "Personalización do menú" #: src/supertux/menu/custom_menu_menu.cpp:51 msgid "Menu Back Color" -msgstr "" +msgstr "Cor de fondo do menú" #: src/supertux/menu/custom_menu_menu.cpp:52 msgid "Menu Front Color" -msgstr "" +msgstr "Cor frontal do Menú" #: src/supertux/menu/custom_menu_menu.cpp:53 msgid "Menu Help Back Color" -msgstr "" +msgstr "Cor de Fondo do Menú de Axuda " #: src/supertux/menu/custom_menu_menu.cpp:54 msgid "Menu Help Front Color" -msgstr "" +msgstr "Cor frontal do Menú de Axuda" #: src/supertux/menu/custom_menu_menu.cpp:55 msgid "Label Text Color" -msgstr "" +msgstr "Cor do texto da etiqueta" #: src/supertux/menu/custom_menu_menu.cpp:56 msgid "Active Text Color" -msgstr "" +msgstr "Cor activa do texto" #: src/supertux/menu/custom_menu_menu.cpp:57 msgid "Divider Line Color" -msgstr "" +msgstr "Cor da liña divisoria" #: src/supertux/menu/custom_menu_menu.cpp:58 msgid "Menu Roundness" -msgstr "" +msgstr "Redondez do menú" #: src/supertux/menu/custom_menu_menu.cpp:60 msgid "Editor Interface Color" -msgstr "" +msgstr "Cor da interface do editor" #: src/supertux/menu/custom_menu_menu.cpp:61 msgid "Editor Hover Color" -msgstr "" +msgstr "Editor de cor do cursor" #: src/supertux/menu/custom_menu_menu.cpp:62 msgid "Editor Grab Color" -msgstr "" +msgstr "Cor de Capturar no editor" #: src/supertux/menu/custom_menu_menu.cpp:64 msgid "Reset to defaults" -msgstr "" +msgstr "Restablecer os valores predeterminados" #: src/supertux/menu/editor_level_select_menu.cpp:72 msgid "Empty World" @@ -2831,7 +2831,7 @@ msgstr "Isto eliminará o ficheiro gardado automaticamente. Continuar?" #: src/supertux/menu/cheat_apply_menu.cpp:33 #: src/supertux/menu/cheat_apply_menu.cpp:51 msgid "Apply cheat to player" -msgstr "" +msgstr "Aplicar trucos ao xogador" #: src/supertux/menu/worldmap_cheat_apply_menu.cpp:39 #: src/supertux/menu/worldmap_cheat_apply_menu.cpp:60 @@ -2941,8 +2941,8 @@ msgstr "Escoller Mundo" #, c++-format msgid "{} level" msgid_plural "{} levels" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "{} nivel" +msgstr[1] "{} niveis" #: src/supertux/menu/editor_levelset_select_menu.cpp:112 msgid "Create World" @@ -3009,7 +3009,7 @@ msgstr "Cambiar o Sistema de Vídeo" #: src/supertux/menu/options_menu.cpp:117 msgid "Change video system used to render graphics" -msgstr "" +msgstr "Cambiar o sistema de vídeo empregado para renderizar gráficos." #: src/supertux/menu/options_menu.cpp:124 #: src/supertux/menu/options_select_menu.cpp:38 @@ -3039,15 +3039,15 @@ msgstr "Controis" #: src/supertux/menu/options_menu.cpp:151 msgid "Enable Rumbling Controllers" -msgstr "" +msgstr "Activar mandos con vibración" #: src/supertux/menu/options_menu.cpp:152 msgid "Enable vibrating the game controllers." -msgstr "" +msgstr "Activa a vibración dos mandos do xogo." #: src/supertux/menu/options_menu.cpp:152 msgid "This feature is currently only used in the multiplayer options menu." -msgstr "" +msgstr "Esta característica só se utiliza actualmente no menú de opcións multixogador." #: src/supertux/menu/options_menu.cpp:154 #: src/supertux/menu/keyboard_menu.cpp:34 @@ -3083,11 +3083,11 @@ msgstr "Selecciona un perfil co que xogar" #: src/supertux/menu/options_menu.cpp:174 msgid "Multiplayer settings" -msgstr "" +msgstr "Configuración multixogador" #: src/supertux/menu/options_menu.cpp:175 msgid "Configure settings specific to multiplayer" -msgstr "" +msgstr "Configura axustes específicos para o multixogador" #: src/supertux/menu/options_menu.cpp:178 msgid "Enable transitions" @@ -3099,11 +3099,11 @@ msgstr "Permitir transicións de pantalla e animación suave do menú" #: src/supertux/menu/options_menu.cpp:181 msgid "Custom title screen levels" -msgstr "" +msgstr "Niveis de pantalla de título personalizados" #: src/supertux/menu/options_menu.cpp:182 msgid "Allow overriding the title screen level, when loading certain worlds" -msgstr "" +msgstr "Permitir substituír o nivel da pantalla de título ao cargar certos mundos." #: src/supertux/menu/options_menu.cpp:185 msgid "Christmas Mode" @@ -3121,7 +3121,7 @@ msgstr "Xestiona se SuperTux debe amosar os niveis ós que xogas nos perfís das #: src/supertux/menu/options_menu.cpp:192 msgid "Customize the appearance of the menus" -msgstr "" +msgstr "Personaliza a aparencia dos menús" #: src/supertux/menu/options_menu.cpp:199 #: src/supertux/menu/options_select_menu.cpp:41 @@ -3158,13 +3158,13 @@ msgstr "Se o xogo representa o seu propio cursor ou utiliza o cursor do sistema" #: src/supertux/menu/options_menu.cpp:214 msgid "Check for new releases" -msgstr "" +msgstr "Consulta novas versións" #: src/supertux/menu/options_menu.cpp:215 msgid "" "Allows the game to perform checks for new SuperTux releases on startup and " "notify if any found." -msgstr "" +msgstr "Permite ao xogo realizar comprobacións de novas versións de SuperTux ao iniciarse e notificar se se atopan algunhas." #: src/supertux/menu/options_menu.cpp:245 #: src/supertux/menu/options_menu.cpp:288 src/supertux/direction.cpp:76 @@ -3247,7 +3247,7 @@ msgstr "Axustar o volume da música" #: src/supertux/menu/options_menu.cpp:517 msgid "On-screen controls scale" -msgstr "" +msgstr "Escala de controis en pantalla" #: src/supertux/menu/options_menu.cpp:638 msgid "" @@ -3258,12 +3258,12 @@ msgstr "O xogo non puido detectar a resolución do teu navegador.\nIsto acontece #: src/supertux/menu/editor_delete_levelset_menu.cpp:80 msgid "You cannot delete the world that you are editing" -msgstr "" +msgstr "Non podes eliminar o mundo que estás editando" #: src/supertux/menu/editor_delete_levelset_menu.cpp:83 #, c++-format msgid "You are about to delete world \"{}\". Are you sure?" -msgstr "" +msgstr "Estás a piques de eliminar o mundo \"{}\". Estás certo?" #: src/supertux/menu/addon_preview_menu.cpp:82 #, c++-format @@ -3272,15 +3272,15 @@ msgstr "{} \"{}\"" #: src/supertux/menu/addon_preview_menu.cpp:87 msgid "Some information about this add-on is not available." -msgstr "" +msgstr "Algunha información sobre este complemento non está dispoñible." #: src/supertux/menu/addon_preview_menu.cpp:88 msgid "Perform a \"Check Online\" to try retrieving it." -msgstr "" +msgstr "Realiza un \"Comprobar en liña\" para tentar recuperalo." #: src/supertux/menu/addon_preview_menu.cpp:92 msgid "No author specified." -msgstr "" +msgstr "Non se especifica ningún autor." #: src/supertux/menu/addon_preview_menu.cpp:92 #, c++-format @@ -3294,16 +3294,16 @@ msgstr "Tipo: {}" #: src/supertux/menu/addon_preview_menu.cpp:94 msgid "No license specified." -msgstr "" +msgstr "Non se especifica ningunha licenza." #: src/supertux/menu/addon_preview_menu.cpp:94 #, c++-format msgid "License: {}" -msgstr "" +msgstr "Licenza: {}" #: src/supertux/menu/addon_preview_menu.cpp:99 msgid "Dependencies:" -msgstr "" +msgstr "Dependencias:" #: src/supertux/menu/addon_preview_menu.cpp:108 msgid "Installed" @@ -3319,83 +3319,83 @@ msgstr "Non dispoñible!" #: src/supertux/menu/addon_preview_menu.cpp:120 msgid "Description:" -msgstr "" +msgstr "Descrición:" #: src/supertux/menu/addon_preview_menu.cpp:123 msgid "No description available." -msgstr "" +msgstr "Non hai descrición dispoñible." #: src/supertux/menu/addon_preview_menu.cpp:147 msgid "Failed to load all available screenshot previews." -msgstr "" +msgstr "Produciuse un erro ao cargar todas as vistas previas das capturas de pantalla dispoñibles." #: src/supertux/menu/addon_preview_menu.cpp:152 msgid "Show screenshots" -msgstr "" +msgstr "Mostrar capturas de pantalla" #: src/supertux/menu/addon_preview_menu.cpp:165 msgid "Screenshot previews are disabled for automatic installs." -msgstr "" +msgstr "As vistas previas das capturas de pantalla están desactivadas para as instalacións automáticas." #: src/supertux/menu/addon_preview_menu.cpp:169 msgid "No screenshot previews available." -msgstr "" +msgstr "Non hai vistas previas de capturas de pantalla dispoñibles." #: src/supertux/menu/addon_preview_menu.cpp:177 msgid "Install" -msgstr "" +msgstr "Instalar" #: src/supertux/menu/addon_preview_menu.cpp:190 msgid "Uninstall" -msgstr "" +msgstr "Desinstalar" #: src/supertux/menu/addon_preview_menu.cpp:214 #, c++-format msgid "Are you sure you want to uninstall \"{}\"?" -msgstr "" +msgstr "Estás seguro de que queres desinstalar \"{}\"?" #: src/supertux/menu/addon_preview_menu.cpp:215 msgid "" "\n" "Your progress won't be lost." -msgstr "" +msgstr "\nO teu progreso non se perderá." #: src/supertux/menu/addon_preview_menu.cpp:227 #, c++-format msgid "" "NOTE: The add-on \"{}\" is a dependency of {} other installed {}.\n" "Are you sure you wish to uninstall?" -msgstr "" +msgstr "NOTA: O complemento \"{}\" é unha dependencia de {} outros complementos instalados{}.\nEstás certo de que desexas desinstalar?" #: src/supertux/menu/addon_preview_menu.cpp:246 #, c++-format msgid "" "Cannot toggle add-on \"{}\":\n" "{}" -msgstr "" +msgstr "Non se pode alternar o complemento \"{}\":\n{}" #: src/supertux/menu/addon_preview_menu.cpp:279 msgid "Fetching screenshot previews..." -msgstr "" +msgstr "Obtendo vistas previas das capturas de pantalla..." #: src/supertux/menu/addon_preview_menu.cpp:300 msgid "Updating" -msgstr "" +msgstr "Actualizando" #: src/supertux/menu/addon_preview_menu.cpp:300 msgid "Downloading" -msgstr "" +msgstr "Descargando" #: src/supertux/menu/addon_preview_menu.cpp:328 msgid "Add-on uninstalled successfully." -msgstr "" +msgstr "O complemento desinstalouse correctamente." #: src/supertux/menu/addon_preview_menu.cpp:333 #, c++-format msgid "" "Error uninstalling add-on:\n" "{}" -msgstr "" +msgstr "Produciuse un erro ao desinstalar o complemento:\n{}" #: src/supertux/menu/addon_preview_menu.cpp:361 msgid "" @@ -3442,12 +3442,12 @@ msgstr "Saír" msgid "" "This will take you to the SuperTux donation page. Are you sure you want to " "continue?" -msgstr "" +msgstr "Isto levaráche á páxina de doazóns de SuperTux. Estás seguro de que queres continuar?" #: src/supertux/menu/editor_sector_menu.cpp:34 #, c++-format msgid "Sector {}" -msgstr "" +msgstr "Sector {}" #: src/supertux/menu/editor_sector_menu.cpp:37 msgid "Initialization script" @@ -3471,50 +3471,50 @@ msgstr "Cambiar o tamaño" #: src/supertux/menu/profile_menu.cpp:60 msgid "No profiles found." -msgstr "" +msgstr "Non se atoparon perfís." #: src/supertux/menu/profile_menu.cpp:68 #: src/supertux/menu/profile_menu.cpp:149 #: src/supertux/menu/profile_menu.cpp:168 #, c++-format msgid "Profile {}" -msgstr "" +msgstr "Perfil {}" #: src/supertux/menu/profile_menu.cpp:69 #, c++-format msgid "{} (Profile {})" -msgstr "" +msgstr "{} (Perfil {})" #: src/supertux/menu/profile_menu.cpp:84 msgid "No profile selected." -msgstr "" +msgstr "Non se seleccionou ningún perfil." #: src/supertux/menu/profile_menu.cpp:91 src/supertux/menu/profile_menu.cpp:93 #: src/supertux/menu/profile_name_menu.cpp:42 msgid "Rename" -msgstr "" +msgstr "Renomear" #: src/supertux/menu/profile_menu.cpp:98 #: src/supertux/menu/profile_menu.cpp:100 msgid "Reset" -msgstr "" +msgstr "Restablecer" #: src/supertux/menu/profile_menu.cpp:103 #: src/supertux/menu/profile_menu.cpp:105 msgid "Reset all" -msgstr "" +msgstr "Restablecer todo" #: src/supertux/menu/profile_menu.cpp:113 #: src/supertux/menu/profile_menu.cpp:115 msgid "Delete all" -msgstr "" +msgstr "Eliminar todo" #: src/supertux/menu/profile_menu.cpp:148 #, c++-format msgid "" "This will reset all game progress on the profile \"{}\".\n" "Are you sure?" -msgstr "" +msgstr "Isto reseteará todo o progreso do xogo no perfil \"{}\".\nEstás seguro/a?" #: src/supertux/menu/profile_menu.cpp:157 msgid "This will reset your game progress on all profiles. Are you sure?" @@ -3525,13 +3525,13 @@ msgstr "Isto restablecerá o progreso no xogo en tódolos perfís. Estás seguro msgid "" "This will delete the profile \"{}\",\n" "including all game progress on it. Are you sure?" -msgstr "" +msgstr "Isto eliminará o perfil \"{}\", incluíndo todo o progreso do xogo nel. Estás seguro/a?" #: src/supertux/menu/profile_menu.cpp:178 msgid "" "This will delete all profiles, including all game progress on them.\n" "Are you sure?" -msgstr "" +msgstr "Isto eliminará todos os perfís, incluíndo todo o progreso do xogo neles.\nEstás seguro/a?" #: src/supertux/menu/editor_levelset_menu.cpp:53 #: src/supertux/menu/editor_new_levelset_menu.cpp:35 @@ -3540,19 +3540,19 @@ msgstr "Descrición" #: src/supertux/menu/editor_levelset_menu.cpp:55 msgid "Title Screen Level" -msgstr "" +msgstr "Nivel de pantalla de título" #: src/supertux/menu/editor_levelset_menu.cpp:56 msgid "A level to be used for the title screen, after exiting the world." -msgstr "" +msgstr "Un nivel para ser usado para a pantalla de título, despois de saír do mundo." #: src/supertux/menu/multiplayer_players_menu.cpp:46 msgid "Add Player" -msgstr "" +msgstr "Engadir xogador" #: src/supertux/menu/multiplayer_players_menu.cpp:59 msgid "Remove Last Player" -msgstr "" +msgstr "Eliminar o último xogador" #: src/supertux/menu/multiplayer_players_menu.cpp:62 msgid "" @@ -3560,19 +3560,19 @@ msgid "" "remove is currently in-game.\n" "\n" "Do you wish to remove them anyways?" -msgstr "" +msgstr "Aviso: O xogador que estás a intentar \neliminar está actualmente no xogo.\n\nQueres eliminá-lo de todos xeitos?" #: src/supertux/menu/addon_menu.cpp:68 msgid "Installed Language Packs" -msgstr "" +msgstr "Paquetes de idioma instalados" #: src/supertux/menu/addon_menu.cpp:68 msgid "Installed Add-ons" -msgstr "" +msgstr "Complementos instalados" #: src/supertux/menu/addon_menu.cpp:76 src/supertux/menu/addon_menu.cpp:117 msgid "No language packs installed" -msgstr "" +msgstr "Non hai paquetes de idioma instalados" #: src/supertux/menu/addon_menu.cpp:76 msgid "No Add-ons installed" @@ -3581,50 +3581,50 @@ msgstr "Non hai Complementos instalados" #: src/supertux/menu/addon_menu.cpp:124 #, c++-format msgid "{} {}*UPDATE*" -msgstr "" +msgstr "{} {}*ACTUALIZACIÓN*" #: src/supertux/menu/addon_menu.cpp:130 #, c++-format msgid "{}{}" -msgstr "" +msgstr "{}{}" #: src/supertux/menu/addon_menu.cpp:140 msgid "No updates available." -msgstr "" +msgstr "Non hai actualizacións dispoñibles." #: src/supertux/menu/addon_menu.cpp:144 #, c++-format msgid "{} {} available" -msgstr "" +msgstr "{} {} dispoñibles" #: src/supertux/menu/addon_menu.cpp:144 msgid "update" -msgstr "" +msgstr "actualizar" #: src/supertux/menu/addon_menu.cpp:144 msgid "updates" -msgstr "" +msgstr "actualizacións" #: src/supertux/menu/addon_menu.cpp:146 msgid "Check for updates" -msgstr "" +msgstr "Comproba se hai actualizacións" #: src/supertux/menu/addon_menu.cpp:150 msgid "Browse language packs" -msgstr "" +msgstr "Explorar paquetes de idiomas" #: src/supertux/menu/addon_menu.cpp:150 #: src/supertux/menu/addon_browse_menu.cpp:70 msgid "Browse Add-ons" -msgstr "" +msgstr "Explorar complementos" #: src/supertux/menu/addon_menu.cpp:151 msgid "Install from file" -msgstr "" +msgstr "Instalar dende o ficheiro" #: src/supertux/menu/addon_menu.cpp:208 msgid "Checking for updates..." -msgstr "" +msgstr "Buscando actualizacións..." #: src/supertux/menu/editor_new_levelset_menu.cpp:31 msgid "New World" @@ -3640,28 +3640,28 @@ msgstr "Modo Historia" #: src/supertux/menu/addon_browse_menu.cpp:70 msgid "Browse Language Packs" -msgstr "" +msgstr "Explorar paquetes de idiomas" #: src/supertux/menu/addon_browse_menu.cpp:112 #, c++-format msgid "Page {}/{}" -msgstr "" +msgstr "Páxina {}/{}" #: src/supertux/menu/addon_browse_menu.cpp:124 msgid "No new language packs available" -msgstr "" +msgstr "Non hai novos paquetes de idiomas dispoñibles" #: src/supertux/menu/addon_browse_menu.cpp:124 msgid "No new Add-ons available" -msgstr "" +msgstr "Non hai novos complementos dispoñibles" #: src/supertux/menu/addon_browse_menu.cpp:127 msgid "No language packs available" -msgstr "" +msgstr "Non hai paquetes de idiomas dispoñibles" #: src/supertux/menu/addon_browse_menu.cpp:127 msgid "No Add-ons available" -msgstr "" +msgstr "Non hai complementos dispoñibles" #: src/supertux/menu/addon_browse_menu.cpp:135 #: src/supertux/menu/addon_browse_menu.cpp:139 @@ -3729,7 +3729,7 @@ msgstr "Estás seguro?" #: src/supertux/menu/profile_name_menu.cpp:36 #, c++-format msgid "Rename \"{}\"" -msgstr "" +msgstr "Renomear \"{}\"" #: src/supertux/menu/profile_name_menu.cpp:36 msgid "Add profile" @@ -3970,15 +3970,15 @@ msgstr "Destruír a Tux" #: src/supertux/menu/cheat_menu.cpp:55 msgid "Prevent Death" -msgstr "" +msgstr "Previr a Morte" #: src/supertux/menu/addon_file_install_menu.cpp:32 msgid "Install Add-on from file" -msgstr "" +msgstr "Instala o complemento desde o ficheiro" #: src/supertux/menu/addon_file_install_menu.cpp:34 msgid "Drag and drop add-on ZIP archive" -msgstr "" +msgstr "Arrastra e solta o arquivo ZIP do complemento" #: src/supertux/menu/particle_editor_menu.cpp:32 msgid "Particle Editor" @@ -4135,7 +4135,7 @@ msgstr "Editar Outro Mundo" #: src/supertux/menu/editor_menu.cpp:86 msgid "Convert all tiles in the level using converters." -msgstr "" +msgstr "Converte todos os bloques do nivel usando conversores." #: src/supertux/menu/editor_menu.cpp:90 msgid "Grid Size" @@ -4167,11 +4167,11 @@ msgstr "Activar axuda de autoteselado" #: src/supertux/menu/editor_menu.cpp:97 msgid "Enable Object Undo Tracking" -msgstr "" +msgstr "Activar o seguimento de desfacer de obxectos" #: src/supertux/menu/editor_menu.cpp:100 msgid "Undo Stack Size" -msgstr "" +msgstr "Desfacer o tamaño da pila" #: src/supertux/menu/editor_menu.cpp:102 msgid "Autosave Frequency" @@ -4179,21 +4179,21 @@ msgstr "Frecuencia de Auto-gardado" #: src/supertux/menu/editor_menu.cpp:108 msgid "Check for Deprecated Tiles" -msgstr "" +msgstr "Verificar bloques obsoletos" #: src/supertux/menu/editor_menu.cpp:109 msgid "Check if any deprecated tiles are currently present in the level." -msgstr "" +msgstr "Comproba se hai algún bloque obsoleto presente actualmente no nivel." #: src/supertux/menu/editor_menu.cpp:110 msgid "Show Deprecated Tiles" -msgstr "" +msgstr "Mostrar Bloques Obsoletos" #: src/supertux/menu/editor_menu.cpp:111 msgid "" "Indicate all deprecated tiles on the active tilemap, without the need of " "hovering over." -msgstr "" +msgstr "Indica todos os bloques obsoletos no mapa de bloques activo, sen necesidade de pasar o rato." #: src/supertux/menu/editor_menu.cpp:121 msgid "Exit Level Editor" @@ -4241,19 +4241,19 @@ msgid "" "Ctrl+D = Duplicate line\n" "Ctrl+Z = Undo\n" "Ctrl+Y = Redo" -msgstr "" +msgstr "Atallos de teclado:\n---------------------\nEsc = Abrir menú\nCtrl+S = Gardar\nCtrl+T = Probar\nCtrl+Z = Desfacer\nCtrl+Y = Refacer\nF6 = Renderizar luz\nF7 = Axuste á grella\nF8 = Mostrar grella\nCtrl++ ou Ctrl+Rodar arriba = Zoom dentro\nCtrl+- ou Ctrl+Rodar abaixo = Zoom fóra\nCtrl+D = Restablecer zoom\n\nAtallos de escritura:\n---------------------\nInicio = Ir ao comezo da liña\nFin = Ir ao final da liña\nFrecha esquerda = Retroceder no texto\nFrecha dereita = Avanzar no texto\nRetroceso = Eliminar diante do cursor\nSuprimir = Eliminar detrás do cursor\nCtrl+X = Cortar toda a liña\nCtrl+C = Copiar toda a liña\nCtrl+V = Pegar\nCtrl+D = Duplicar liña\nCtrl+Z = Desfacer\nCtrl+Y = Refacer" #: src/supertux/menu/editor_menu.cpp:232 msgid "Deprecated tiles are still present in the level." -msgstr "" +msgstr "Os bloques obsoletos aínda están presentes no nivel." #: src/supertux/menu/editor_menu.cpp:239 msgid "Do you want to show all deprecated tiles on active tilemaps?" -msgstr "" +msgstr "Queres mostrar todos os bloques obsoletos nos mapas de bloques ativos?" #: src/supertux/menu/editor_menu.cpp:246 msgid "There are no more deprecated tiles in the level!" -msgstr "" +msgstr "Non hai máis bloques obsoletos no nivel!" #: src/supertux/menu/multiplayer_player_menu.cpp:40 msgid "Play with the keyboard" @@ -4265,39 +4265,39 @@ msgstr "Eliminar Xogador" #: src/supertux/menu/multiplayer_player_menu.cpp:82 msgid "Respawn Player" -msgstr "" +msgstr "Reiniciar Xogador" #: src/supertux/menu/multiplayer_player_menu.cpp:108 msgid "Spawn Player" -msgstr "" +msgstr "Crear Xogador" #: src/supertux/menu/multiplayer_player_menu.cpp:136 msgid "Controllers" -msgstr "" +msgstr "Mandos" #: src/supertux/menu/multiplayer_player_menu.cpp:152 msgid "" "This controller does not support rumbling;\n" "please check the controllers manually." -msgstr "" +msgstr "Este mando non admite vibracións; \ncomproba os mandos manualmente, por favor." #: src/supertux/menu/multiplayer_player_menu.cpp:157 msgid "" "This SuperTux build does not support rumbling\n" "controllers; please check the controllers manually." -msgstr "" +msgstr "Esta compilación de SuperTux non admite mandos con vibración; \ncomproba os mandos manualmente, por favor." #: src/supertux/menu/multiplayer_player_menu.cpp:184 msgid "" "This joystick does not support rumbling;\n" "please check the joysticks manually." -msgstr "" +msgstr "Este joystick non admite vibracións; \ncomproba os joysticks manualmente, por favor." #: src/supertux/menu/multiplayer_player_menu.cpp:189 msgid "" "This SuperTux build does not support rumbling\n" "joysticks; please check the joysticks manually." -msgstr "" +msgstr "Esta compilación de SuperTux non admite joysticks con vibración; \ncomproba os joysticks manualmente, por favor." #: src/supertux/menu/editor_delete_level_menu.cpp:59 msgid "No levels available" @@ -4310,12 +4310,12 @@ msgstr "Non podes eliminar o nivel que estas editando!" #: src/supertux/menu/editor_delete_level_menu.cpp:82 #, c++-format msgid "You are about to delete level \"{}\". Are you sure?" -msgstr "" +msgstr "Estás a piques de eliminar o nivel \"{}\". Estás certo?" #: src/supertux/levelintro.cpp:137 #, c++-format msgid "contributed by {}" -msgstr "" +msgstr "aportado por {}" #: src/supertux/levelintro.cpp:184 msgid "Badguys killed" @@ -4348,7 +4348,7 @@ msgstr "Rexión" #: src/supertux/main.cpp:801 #, c++-format msgid "New release: SuperTux v{}!" -msgstr "" +msgstr "Nova versión: SuperTux v{}!" #: src/supertux/main.cpp:804 #, c++-format @@ -4357,11 +4357,11 @@ msgid "" "For more information, you can visit the SuperTux website.\n" "\n" "Do you want to visit the website now?" -msgstr "" +msgstr "Hai unha nova versión de SuperTux (v{}) dispoñible!\nPara máis información, podes visitar o sitio web de SuperTux.\n\nQueres visitar o sitio web agora?" #: src/supertux/main.cpp:815 msgid "Checking for new releases..." -msgstr "" +msgstr "Buscando novos lanzamentos..." #: src/control/joystick_config.cpp:85 msgid "Joystick Mappings" @@ -4385,7 +4385,7 @@ msgstr "Cambiar ó tocar" #: src/worldmap/special_tile.hpp:36 msgid "Special Tile" -msgstr "" +msgstr "Bloque especial" #: src/worldmap/level_tile.hpp:36 src/worldmap/level_tile.cpp:161 msgid "Level" @@ -4401,7 +4401,7 @@ msgstr "Mapa principal obxectivo" #: src/worldmap/sprite_change.hpp:35 msgid "Sprite Change" -msgstr "Cambio de Fada" +msgstr "Cambio de gráfico animado \"sprite\"" #: src/worldmap/special_tile.cpp:75 msgid "Show message" @@ -4431,7 +4431,7 @@ msgstr "Teletransporte" msgid "" "This object's current functionality is deprecated.\n" "Updating to get its latest functionality is recommended." -msgstr "" +msgstr "A funcionalidade actual deste obxecto está obsoleta.\nRecoméndase actualizar para obter a súa última funcionalidade." #: src/editor/node_marker.cpp:122 msgid "Path Node" @@ -4476,7 +4476,7 @@ msgstr "Circular" #: src/editor/layers_widget.cpp:331 #, c++-format msgid "Sector: {}" -msgstr "" +msgstr "Sector: {}" #: src/editor/object_option.cpp:92 msgid "true" @@ -4492,19 +4492,19 @@ msgstr "non válido" #: src/editor/object_option.cpp:665 msgid "Scale X" -msgstr "" +msgstr "Escala X" #: src/editor/object_option.cpp:666 msgid "Scale Y" -msgstr "" +msgstr "Escala Y" #: src/editor/object_option.cpp:667 msgid "Offset X" -msgstr "" +msgstr "Desprazamento X" #: src/editor/object_option.cpp:668 msgid "Offset Y" -msgstr "" +msgstr "Desprazamento Y" #: src/editor/object_option.cpp:672 src/editor/object_menu.cpp:67 msgid "Remove" @@ -4520,7 +4520,7 @@ msgstr "Abrir o Editor de Partículas" #: src/editor/particle_editor.cpp:114 msgid "Change texture... ->" -msgstr "" +msgstr "Cambiar textura... ->" #: src/editor/particle_editor.cpp:126 msgid "Max amount" @@ -4604,35 +4604,35 @@ msgstr "Modo fora da pantalla" #: src/editor/particle_editor.cpp:229 msgid "Clear" -msgstr "" +msgstr "Limpar" #: src/editor/particle_editor.cpp:245 msgid "<- General settings" -msgstr "" +msgstr "<- Configuración xeral" #: src/editor/particle_editor.cpp:255 msgid "Likeliness" -msgstr "" +msgstr "Probabilidade" #: src/editor/particle_editor.cpp:266 msgid "Color (RGBA)" -msgstr "" +msgstr "Color (RGBA)" #: src/editor/particle_editor.cpp:311 msgid "Scale (x, y)" -msgstr "" +msgstr "Escala (x, y)" #: src/editor/particle_editor.cpp:332 msgid "Hitbox scale (x, y)" -msgstr "" +msgstr "Escala da caixa de colisión (x, y)" #: src/editor/particle_editor.cpp:353 msgid "Hitbox offset relative to scale" -msgstr "" +msgstr "Desprazamento da caixa de colisión relativo á escala" #: src/editor/particle_editor.cpp:372 msgid "Change texture..." -msgstr "" +msgstr "Cambiar textura..." #: src/editor/particle_editor.cpp:766 msgid "" @@ -4649,11 +4649,11 @@ msgid "" "This level contains deprecated tiles.\n" "It is strongly recommended to replace all deprecated tiles\n" "to avoid loss of compatibility in future versions." -msgstr "" +msgstr "Este nivel contén bloques obsoletos.\nRecoméndase encarecidamente substituír todos os bloques obsoletos para evitar a perda de compatibilidade en versións futuras." #: src/editor/editor.cpp:579 msgid "Tip: Turn on \"Show Deprecated Tiles\" from the level editor menu." -msgstr "" +msgstr "Consello: Activa \"Mostrar bloques obsoletos\" dende o menú do editor de niveis." #: src/editor/editor.cpp:626 msgid "" @@ -4669,7 +4669,7 @@ msgstr "Este nivel contén cambios non gardados, queres gardalos?" #: src/editor/editor.cpp:662 msgid "This level may contain unsaved changes, do you want to save?" -msgstr "" +msgstr "Este nivel pode conter cambios sen gardar, queres gardar?" #: src/editor/editor.cpp:797 msgid "" @@ -4707,7 +4707,7 @@ msgstr "Non se puido atopar un punto de inicio \"principal\".\nCambia o nome do #: src/editor/object_menu.cpp:60 msgid "Patch Notes" -msgstr "" +msgstr "Notas do parche" #: src/editor/object_menu.cpp:84 msgid "" @@ -4716,16 +4716,16 @@ msgid "" "\n" "Keep in mind this is very likely to break the proper behaviour of the object.\n" "Make sure to re-check any behaviour, related to the object." -msgstr "" +msgstr "Isto actualizará o obxecto á súa última funcionalidade.\nConsulta as \"Notas do parche\" para máis información.\n\nTen en conta que isto probablemente afectará o comportamento correcto do obxecto.\nAsegúrate de volver comprobar calquera comportamento relacionado co obxecto." #: src/editor/object_menu.cpp:98 #, c++-format msgid "Patch notes for v{}:" -msgstr "" +msgstr "Notas do parche para v{}:" #: src/editor/overlay_widget.cpp:1062 msgid "Cannot select deprecated tiles" -msgstr "" +msgstr "Non se poden seleccionar bloques obsoletos" #: src/editor/overlay_widget.cpp:1567 msgid "Autotile mode is on" @@ -4753,7 +4753,7 @@ msgstr "Equipo Actual de SuperTux" #: data//credits.stxt:30 msgid "Maintainer, Programming" -msgstr "" +msgstr "Mantedor, Programación" #: data//credits.stxt:35 msgid "Graphics, Level Design, Story" @@ -4914,7 +4914,7 @@ msgstr "Código do novo menú" #: data//credits.stxt:530 msgid "Big Tux Walking Sprites improvements" -msgstr "Grandes melloras das Fadas Camiñantes de Tux" +msgstr "Grandes melloras nos Gráficos animados do camiñar de Tux" #: data//credits.stxt:542 data//credits.stxt:550 msgid "Contrib Programming" @@ -5095,11 +5095,11 @@ msgstr "Fondo de Bosque" #: data//images/tiles.strf:690 msgid "Corrupted Forest" -msgstr "" +msgstr "Bosque corrupto" #: data//images/tiles.strf:868 msgid "Corrupted Background" -msgstr "" +msgstr "Fondo corrompido" #: data//images/tiles.strf:991 msgid "Block + Bonus" @@ -5135,7 +5135,7 @@ msgstr "Miscelánea" #: data//images/tiles.strf:1342 msgid "Retro Tiles" -msgstr "" +msgstr "Bloques retro" #: data//images/worldmap.strf:24 msgid "Water paths" @@ -5151,16 +5151,16 @@ msgstr "O Bosque Máis Escuro" #: data//images/converters/data.stcd:3 msgid "Nightly Tiles" -msgstr "" +msgstr "bloques nocturnos (nightly)" #: data//images/converters/data.stcd:5 msgid "For levels, created in previous Nightly builds." -msgstr "" +msgstr "Para niveis, creados en compilacións nocturnas (nightly) anteriores." #: data//images/converters/data.stcd:8 msgid "Pre-0.6.3 Crystal Tiles" -msgstr "" +msgstr "Bloques de cristal anteriores á versión -0.6.3" #: data//images/converters/data.stcd:10 msgid "For levels, created in pre-0.6.3 versions, which use crystal tiles." -msgstr "" +msgstr "Para niveis creados en versións anteriores á -0.6.3, que usan bloques de cristal." diff --git a/data/locale/ja.po b/data/locale/ja.po index 08a13639956..80f4b296003 100644 --- a/data/locale/ja.po +++ b/data/locale/ja.po @@ -6,7 +6,7 @@ # 0ea743a388003249c3a27027490eb004_eb62725 <93be5fa112647d5d896be9f7b3c2eda8_426397>, 2019 # 111More1, 2023 # b1e11c107ebf1f339ff7adfc86b9dbe0_2e3e89d, 2016 -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # 515ce455fbf38ec9585626e8d26b6324_7a9a6ef, 2016-2017 # Ryo Nakano, 2016 # Ryo Nakano, 2018-2022,2024 diff --git a/data/locale/nl.po b/data/locale/nl.po index 3437fabee78..918fdf5803a 100644 --- a/data/locale/nl.po +++ b/data/locale/nl.po @@ -7,7 +7,7 @@ # Frank van der Loo , 2014-2015 # Heimen Stoffels , 2021-2022,2024 # Heimen Stoffels , 2015-2016,2018-2020 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # thetuxgirl, 2024 # Pieter De Decker , 2007,2013 # 62bd5b1da39b746abffbed10afdf3f48_dd9a6d2 , 2015 diff --git a/data/locale/pt.po b/data/locale/pt.po index 787d4db65eb..05653a8d010 100644 --- a/data/locale/pt.po +++ b/data/locale/pt.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # André Pinheiro , 2021 # Benjamin Leduc , 2015 # BlaCoiso, 2016 From 6d7afa2f8448e16a40ba4cb56fa02cddffa85486 Mon Sep 17 00:00:00 2001 From: SuperTux Bot Date: Fri, 12 Jul 2024 01:36:21 +0000 Subject: [PATCH 18/33] Update translations --- data/levels/community2016/es.po | 37 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/data/levels/community2016/es.po b/data/levels/community2016/es.po index 1778c1472c5..f37f9312d09 100644 --- a/data/levels/community2016/es.po +++ b/data/levels/community2016/es.po @@ -4,8 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Germana , 2019 -# Tam Ezquerra , 2019 +# Diego Enmanuel Rosales Santander, 2024 # #, fuzzy msgid "" @@ -14,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: Tam Ezquerra , 2019\n" +"Last-Translator: Diego Enmanuel Rosales Santander, 2024\n" "Language-Team: Spanish (https://app.transifex.com/arctic-games/teams/95/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -28,64 +27,64 @@ msgstr "Las Ruinas Antiguas del Bosque" #: data/levels/community2016/Double_Problems (herobrine).stl:3 msgid "Double Problems" -msgstr "Problemas dobles" +msgstr "Problemas Dobles" #: data/levels/community2016/Double_Problems (herobrine).stl:82 msgid "-Concentrate! Tux! It's not Mario!" -msgstr "¡Concéntrate, Tux! - ¡No es Mario!" +msgstr "" #: data/levels/community2016/Double_Problems (herobrine).stl:142 msgid "You found a secret area!" -msgstr "¡Hallaste un área secreta!" +msgstr "" #: data/levels/community2016/Entrance_To_Cave (gelada).stl:3 msgid "The Entrance To The Cave" -msgstr "La entrada a la Cueva" +msgstr "La Entrada A La Cueva" #: data/levels/community2016/Entrance_To_Lava_Castle (herobrine).stl:3 msgid "The Entrance To The Lava Castle" -msgstr "La Entrada al Castillo de Lava" +msgstr "La Entrada Al Castillo De Lava" #: data/levels/community2016/HMS_Snowballs_Ahoy (Vellidragon).stl:3 msgid "HMS Snowball Ahoy!" -msgstr "¡Bola de nieve HMS a la vista!" +msgstr "¡Bola de Nieve HMS a la Vista!" #: data/levels/community2016/Into_The_Palace (ThomyW).stl:3 msgid "Into The Palace" -msgstr "Dentro del Palacio" +msgstr "" #: data/levels/community2016/Is_The_Biggest_Fish (cookie monster).stl:3 msgid "Is The Biggest Fish" -msgstr "Es el Pez más Grande" +msgstr "" #: data/levels/community2016/Problem_With_Green (herobrine).stl:3 msgid "The Problem With GREEN" -msgstr "El Problema con el VERDE" +msgstr "" #: data/levels/community2016/Sunny_Hills (Serano).stl:3 msgid "Sunny Hills" -msgstr "Colinas Soleadas" +msgstr "" #: data/levels/community2016/The_Mountains (gelada).stl:3 msgid "The Mountains" -msgstr "Las Montañas" +msgstr "" #: data/levels/community2016/The_Strange_Thing (herobrine).stl:3 msgid "The Strange Thing" -msgstr "La Cosa Extraña" +msgstr "" #: data/levels/community2016/Uncontrolled_Lift (gelada).stl:3 msgid "Uncontrolled Lift" -msgstr "Ascenso Incontrolable" +msgstr "" #: data/levels/community2016/Up_Or_Down (Serano).stl:3 msgid "Up, Or Down?" -msgstr "¿Arriba o Abajo?" +msgstr "" #: data/levels/community2016/Welcome_To_Icy_Island (gelada).stl:3 msgid "Welcome To The Icy Island" -msgstr "Bienvenido a la Isla Helada" +msgstr "" #: data/levels/community2016/worldmap.stwm:3 msgid "Community Island 2016" -msgstr "Isla de la Comunidad 2016" +msgstr "" From aac5e669fed572dbe448684251ed282fc27e8709 Mon Sep 17 00:00:00 2001 From: SuperTux Bot Date: Sun, 14 Jul 2024 01:44:49 +0000 Subject: [PATCH 19/33] Update translations --- data/levels/bonus1/ar.po | 4 ++-- data/levels/bonus1/az.po | 4 ++-- data/levels/bonus1/ca.po | 4 ++-- data/levels/bonus1/el.po | 4 ++-- data/levels/bonus1/et.po | 4 ++-- data/levels/bonus1/eu.po | 4 ++-- data/levels/bonus1/fr_CA.po | 4 ++-- data/levels/bonus1/he.po | 4 ++-- data/levels/bonus1/hr.po | 4 ++-- data/levels/bonus1/hy.po | 4 ++-- data/levels/bonus1/is.po | 4 ++-- data/levels/bonus1/nb.po | 4 ++-- data/levels/bonus1/nn.po | 4 ++-- data/levels/bonus1/sk.po | 4 ++-- data/levels/bonus1/sq.po | 4 ++-- data/levels/bonus1/tr.po | 4 ++-- data/levels/bonus1/tt.po | 4 ++-- data/levels/bonus1/uk.po | 2 +- data/levels/bonus1/uz.po | 4 ++-- data/levels/bonus2/ar.po | 4 ++-- data/levels/bonus2/az.po | 4 ++-- data/levels/bonus2/et.po | 4 ++-- data/levels/bonus2/fr_CA.po | 4 ++-- data/levels/bonus2/he.po | 4 ++-- data/levels/bonus2/hr.po | 4 ++-- data/levels/bonus2/hy.po | 4 ++-- data/levels/bonus2/id.po | 4 ++-- data/levels/bonus2/is.po | 4 ++-- data/levels/bonus2/sk.po | 4 ++-- data/levels/bonus2/sq.po | 4 ++-- data/levels/bonus2/uk.po | 2 +- data/levels/bonus2/uz.po | 4 ++-- data/levels/bonus3/ar.po | 4 ++-- data/levels/bonus3/az.po | 4 ++-- data/levels/bonus3/ca.po | 4 ++-- data/levels/bonus3/el.po | 4 ++-- data/levels/bonus3/et.po | 4 ++-- data/levels/bonus3/eu.po | 4 ++-- data/levels/bonus3/fr_CA.po | 4 ++-- data/levels/bonus3/he.po | 4 ++-- data/levels/bonus3/hr.po | 4 ++-- data/levels/bonus3/hy.po | 4 ++-- data/levels/bonus3/id.po | 4 ++-- data/levels/bonus3/is.po | 4 ++-- data/levels/bonus3/nb.po | 4 ++-- data/levels/bonus3/nn.po | 4 ++-- data/levels/bonus3/ro.po | 4 ++-- data/levels/bonus3/sk.po | 4 ++-- data/levels/bonus3/sq.po | 4 ++-- data/levels/bonus3/tr.po | 4 ++-- data/levels/bonus3/tt.po | 4 ++-- data/levels/bonus3/uk.po | 4 ++-- data/levels/bonus3/uz.po | 4 ++-- data/levels/bonus4/ar.po | 4 ++-- data/levels/bonus4/az.po | 4 ++-- data/levels/bonus4/ca.po | 4 ++-- data/levels/bonus4/el.po | 4 ++-- data/levels/bonus4/eo.po | 4 ++-- data/levels/bonus4/et.po | 4 ++-- data/levels/bonus4/fr_CA.po | 4 ++-- data/levels/bonus4/he.po | 4 ++-- data/levels/bonus4/hr.po | 4 ++-- data/levels/bonus4/hy.po | 4 ++-- data/levels/bonus4/id.po | 4 ++-- data/levels/bonus4/is.po | 4 ++-- data/levels/bonus4/nb.po | 4 ++-- data/levels/bonus4/sk.po | 4 ++-- data/levels/bonus4/sq.po | 4 ++-- data/levels/bonus4/tt.po | 4 ++-- data/levels/bonus4/uk.po | 4 ++-- data/levels/bonus4/uz.po | 4 ++-- data/levels/community2016/ar.po | 4 ++-- data/levels/community2016/az.po | 4 ++-- data/levels/community2016/ca.po | 4 ++-- data/levels/community2016/el.po | 4 ++-- data/levels/community2016/eo.po | 4 ++-- data/levels/community2016/et.po | 4 ++-- data/levels/community2016/fr_CA.po | 4 ++-- data/levels/community2016/he.po | 4 ++-- data/levels/community2016/hr.po | 4 ++-- data/levels/community2016/hy.po | 4 ++-- data/levels/community2016/id.po | 4 ++-- data/levels/community2016/is.po | 4 ++-- data/levels/community2016/nb.po | 4 ++-- data/levels/community2016/ro.po | 4 ++-- data/levels/community2016/sk.po | 4 ++-- data/levels/community2016/sq.po | 4 ++-- data/levels/community2016/tt.po | 4 ++-- data/levels/community2016/uk.po | 4 ++-- data/levels/community2016/uz.po | 4 ++-- data/levels/halloween2014/ar.po | 4 ++-- data/levels/halloween2014/az.po | 4 ++-- data/levels/halloween2014/eo.po | 4 ++-- data/levels/halloween2014/et.po | 4 ++-- data/levels/halloween2014/fr_CA.po | 4 ++-- data/levels/halloween2014/he.po | 4 ++-- data/levels/halloween2014/hr.po | 4 ++-- data/levels/halloween2014/hy.po | 4 ++-- data/levels/halloween2014/id.po | 4 ++-- data/levels/halloween2014/is.po | 4 ++-- data/levels/halloween2014/ro.po | 4 ++-- data/levels/halloween2014/sq.po | 4 ++-- data/levels/halloween2014/uz.po | 4 ++-- data/levels/world1/ar.po | 4 ++-- data/levels/world1/az.po | 4 ++-- data/levels/world1/ca.po | 4 ++-- data/levels/world1/el.po | 4 ++-- data/levels/world1/fr_CA.po | 6 +++--- data/levels/world1/he.po | 4 ++-- data/levels/world1/hr.po | 4 ++-- data/levels/world1/hy.po | 4 ++-- data/levels/world1/id.po | 4 ++-- data/levels/world1/is.po | 4 ++-- data/levels/world1/nb.po | 4 ++-- data/levels/world1/ro.po | 2 +- data/levels/world1/sk.po | 4 ++-- data/levels/world1/sq.po | 4 ++-- data/levels/world1/tr.po | 4 ++-- data/levels/world1/tt.po | 4 ++-- data/levels/world1/uk.po | 2 +- data/levels/world1/uz.po | 6 +++--- data/levels/world2/ar.po | 4 ++-- data/levels/world2/az.po | 4 ++-- data/levels/world2/ca.po | 4 ++-- data/levels/world2/el.po | 4 ++-- data/levels/world2/et.po | 6 +++--- data/levels/world2/eu.po | 4 ++-- data/levels/world2/fr_CA.po | 4 ++-- data/levels/world2/he.po | 4 ++-- data/levels/world2/hr.po | 4 ++-- data/levels/world2/hu.po | 4 ++-- data/levels/world2/hy.po | 4 ++-- data/levels/world2/is.po | 4 ++-- data/levels/world2/ja.po | 4 ++-- data/levels/world2/ko.po | 4 ++-- data/levels/world2/nb.po | 4 ++-- data/levels/world2/nn.po | 4 ++-- data/levels/world2/ro.po | 4 ++-- data/levels/world2/sk.po | 4 ++-- data/levels/world2/sq.po | 4 ++-- data/levels/world2/tr.po | 4 ++-- data/levels/world2/tt.po | 4 ++-- data/levels/world2/uk.po | 4 ++-- data/levels/world2/uz.po | 4 ++-- data/locale/bg.po | 2 +- 145 files changed, 288 insertions(+), 288 deletions(-) diff --git a/data/levels/bonus1/ar.po b/data/levels/bonus1/ar.po index 2a37c11bd6c..f4a7ad8baab 100644 --- a/data/levels/bonus1/ar.po +++ b/data/levels/bonus1/ar.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # Israa Zamzami, 2018 # Hasan Nahleh , 2019 msgid "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Arabic (http://app.transifex.com/arctic-games/supertux/language/ar/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/az.po b/data/levels/bonus1/az.po index 1a12fb97c1a..07e67ea2289 100644 --- a/data/levels/bonus1/az.po +++ b/data/levels/bonus1/az.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Azerbaijani (http://app.transifex.com/arctic-games/supertux/language/az/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/ca.po b/data/levels/bonus1/ca.po index c8813141678..cd597ce979e 100644 --- a/data/levels/bonus1/ca.po +++ b/data/levels/bonus1/ca.po @@ -5,7 +5,7 @@ # Translators: # Ariadna Pascual , 2016 # Catalanoic , 2016 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # 76352799d6904fac47e3a0fa3ed5fd59_334826e , 2014 # Yael Codesal, 2016 msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Catalan (http://app.transifex.com/arctic-games/supertux/language/ca/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/el.po b/data/levels/bonus1/el.po index 30e14872ce3..90147c52686 100644 --- a/data/levels/bonus1/el.po +++ b/data/levels/bonus1/el.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # I will not tell you that , 2015 # Vangelis Nomikos , 2013-2014 # Vangelis Skarmoutsos (SkarmoutsosV) , 2016 @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Greek (http://app.transifex.com/arctic-games/supertux/language/el/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/et.po b/data/levels/bonus1/et.po index 7eb5817d339..853e3dd3f0f 100644 --- a/data/levels/bonus1/et.po +++ b/data/levels/bonus1/et.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Estonian (http://app.transifex.com/arctic-games/supertux/language/et/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/eu.po b/data/levels/bonus1/eu.po index 18c74761d7b..12e00218a62 100644 --- a/data/levels/bonus1/eu.po +++ b/data/levels/bonus1/eu.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # Mielanjel Iraeta , 2018 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Basque (http://app.transifex.com/arctic-games/supertux/language/eu/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/fr_CA.po b/data/levels/bonus1/fr_CA.po index 5334c354a3a..9adecdbce35 100644 --- a/data/levels/bonus1/fr_CA.po +++ b/data/levels/bonus1/fr_CA.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Jean-Philippe L'Étoile , 2019 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: French (Canada) (http://app.transifex.com/arctic-games/supertux/language/fr_CA/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/he.po b/data/levels/bonus1/he.po index 9c6a3379e1e..189546fa421 100644 --- a/data/levels/bonus1/he.po +++ b/data/levels/bonus1/he.po @@ -4,7 +4,7 @@ # # Translators: # Evgeny Satanovsky , 2019 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2020-2021 # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2021 # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2020 @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Hebrew (http://app.transifex.com/arctic-games/supertux/language/he/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/hr.po b/data/levels/bonus1/hr.po index 7d56e464ad8..b2893a8e30d 100644 --- a/data/levels/bonus1/hr.po +++ b/data/levels/bonus1/hr.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Croatian (http://app.transifex.com/arctic-games/supertux/language/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/hy.po b/data/levels/bonus1/hy.po index cd2dad81ffb..467351e8de7 100644 --- a/data/levels/bonus1/hy.po +++ b/data/levels/bonus1/hy.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Armenian (http://app.transifex.com/arctic-games/supertux/language/hy/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/is.po b/data/levels/bonus1/is.po index 7c9a2f9c8f3..5bca0218218 100644 --- a/data/levels/bonus1/is.po +++ b/data/levels/bonus1/is.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Kristján Magnússon, 2022 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Icelandic (http://app.transifex.com/arctic-games/supertux/language/is/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/nb.po b/data/levels/bonus1/nb.po index 345a62cd9f0..3f8d459d871 100644 --- a/data/levels/bonus1/nb.po +++ b/data/levels/bonus1/nb.po @@ -4,7 +4,7 @@ # # Translators: # Allan Nordhøy , 2016 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Karl Ove Hufthammer , 2007,2015-2016 msgid "" msgstr "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Norwegian Bokmål (http://app.transifex.com/arctic-games/supertux/language/nb/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/nn.po b/data/levels/bonus1/nn.po index 5005ee9e993..4282ac67389 100644 --- a/data/levels/bonus1/nn.po +++ b/data/levels/bonus1/nn.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Karl Ove Hufthammer , 2006-2007,2015-2016,2019-2020 # Karl Ove Hufthammer , 2015 msgid "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Norwegian Nynorsk (http://app.transifex.com/arctic-games/supertux/language/nn/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/sk.po b/data/levels/bonus1/sk.po index 64a7bfc7712..5380e36b742 100644 --- a/data/levels/bonus1/sk.po +++ b/data/levels/bonus1/sk.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # c79a840bffc1621596a73d9f7d995b66_5f97bea <821296eb068acbf38f8fe02d322f4248_155187>, 2014 # MiroslavR , 2015-2016 msgid "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Slovak (http://app.transifex.com/arctic-games/supertux/language/sk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/sq.po b/data/levels/bonus1/sq.po index 151c275081b..9dc718b52c5 100644 --- a/data/levels/bonus1/sq.po +++ b/data/levels/bonus1/sq.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Indrit Bashkimi , 2015 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Albanian (http://app.transifex.com/arctic-games/supertux/language/sq/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/tr.po b/data/levels/bonus1/tr.po index db01f12f67c..15713eb6715 100644 --- a/data/levels/bonus1/tr.po +++ b/data/levels/bonus1/tr.po @@ -6,7 +6,7 @@ # Alkım Kaçmaz , 2013 # mahmut özcan , 2015 # Tan Siret Akıncı , 2020 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # mahmut özcan , 2020 # Yusuf Özsoy , 2013 msgid "" @@ -15,7 +15,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Turkish (http://app.transifex.com/arctic-games/supertux/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/tt.po b/data/levels/bonus1/tt.po index f90b06dcdb4..3b3fa937264 100644 --- a/data/levels/bonus1/tt.po +++ b/data/levels/bonus1/tt.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Булат Ибраһим , 2016 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Tatar (http://app.transifex.com/arctic-games/supertux/language/tt/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus1/uk.po b/data/levels/bonus1/uk.po index d82d440fba0..df7ed42c818 100644 --- a/data/levels/bonus1/uk.po +++ b/data/levels/bonus1/uk.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Asemif official, 2023 # Ievgen Tkach , 2018 # Max Lyashuk , 2015 diff --git a/data/levels/bonus1/uz.po b/data/levels/bonus1/uz.po index c06b347c550..be027da7ed8 100644 --- a/data/levels/bonus1/uz.po +++ b/data/levels/bonus1/uz.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:04+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Uzbek (http://app.transifex.com/arctic-games/supertux/language/uz/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus2/ar.po b/data/levels/bonus2/ar.po index 58182779d35..07837069ad3 100644 --- a/data/levels/bonus2/ar.po +++ b/data/levels/bonus2/ar.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:07+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Arabic (http://app.transifex.com/arctic-games/supertux/language/ar/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus2/az.po b/data/levels/bonus2/az.po index 1b730353fc2..a39c7943163 100644 --- a/data/levels/bonus2/az.po +++ b/data/levels/bonus2/az.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:07+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Azerbaijani (http://app.transifex.com/arctic-games/supertux/language/az/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus2/et.po b/data/levels/bonus2/et.po index c07c26109fe..bb823a674ed 100644 --- a/data/levels/bonus2/et.po +++ b/data/levels/bonus2/et.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:07+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Estonian (http://app.transifex.com/arctic-games/supertux/language/et/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus2/fr_CA.po b/data/levels/bonus2/fr_CA.po index 649f323ab15..7c2ab7846ec 100644 --- a/data/levels/bonus2/fr_CA.po +++ b/data/levels/bonus2/fr_CA.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:07+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: French (Canada) (http://app.transifex.com/arctic-games/supertux/language/fr_CA/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus2/he.po b/data/levels/bonus2/he.po index ada2b26ce59..65aa28a1bc1 100644 --- a/data/levels/bonus2/he.po +++ b/data/levels/bonus2/he.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2020-2021 # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2020 msgid "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:07+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Hebrew (http://app.transifex.com/arctic-games/supertux/language/he/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus2/hr.po b/data/levels/bonus2/hr.po index b7fbd430516..adcaa17fd11 100644 --- a/data/levels/bonus2/hr.po +++ b/data/levels/bonus2/hr.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:07+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Croatian (http://app.transifex.com/arctic-games/supertux/language/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus2/hy.po b/data/levels/bonus2/hy.po index 98839c2e1be..3902437e10b 100644 --- a/data/levels/bonus2/hy.po +++ b/data/levels/bonus2/hy.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:07+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Armenian (http://app.transifex.com/arctic-games/supertux/language/hy/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus2/id.po b/data/levels/bonus2/id.po index 312528a323d..c52dfd2b938 100644 --- a/data/levels/bonus2/id.po +++ b/data/levels/bonus2/id.po @@ -6,14 +6,14 @@ # Chris , 2017 # Chris , 2022 # Chris , 2017 -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:07+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Indonesian (http://app.transifex.com/arctic-games/supertux/language/id/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus2/is.po b/data/levels/bonus2/is.po index 3bb2eec8a18..4f50e901bf6 100644 --- a/data/levels/bonus2/is.po +++ b/data/levels/bonus2/is.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:07+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Icelandic (http://app.transifex.com/arctic-games/supertux/language/is/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus2/sk.po b/data/levels/bonus2/sk.po index 947851b6f88..8625ca8b0b7 100644 --- a/data/levels/bonus2/sk.po +++ b/data/levels/bonus2/sk.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # c79a840bffc1621596a73d9f7d995b66_5f97bea <821296eb068acbf38f8fe02d322f4248_155187>, 2014 # MiroslavR , 2016 # Roman 'Kaktuxista' Benji , 2014 @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:07+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Slovak (http://app.transifex.com/arctic-games/supertux/language/sk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus2/sq.po b/data/levels/bonus2/sq.po index 5fa532e4613..f0ffa470a48 100644 --- a/data/levels/bonus2/sq.po +++ b/data/levels/bonus2/sq.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Indrit Bashkimi , 2015 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:07+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Albanian (http://app.transifex.com/arctic-games/supertux/language/sq/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus2/uk.po b/data/levels/bonus2/uk.po index df68bf5ce2e..542ee25daeb 100644 --- a/data/levels/bonus2/uk.po +++ b/data/levels/bonus2/uk.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Asemif official, 2023 # Max Lyashuk , 2015 msgid "" diff --git a/data/levels/bonus2/uz.po b/data/levels/bonus2/uz.po index e7fcc8a38f3..cef82b2f99c 100644 --- a/data/levels/bonus2/uz.po +++ b/data/levels/bonus2/uz.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:07+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Uzbek (http://app.transifex.com/arctic-games/supertux/language/uz/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/ar.po b/data/levels/bonus3/ar.po index a482f083f3c..5be232781c9 100644 --- a/data/levels/bonus3/ar.po +++ b/data/levels/bonus3/ar.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # Israa Zamzami, 2018 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Arabic (http://app.transifex.com/arctic-games/supertux/language/ar/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/az.po b/data/levels/bonus3/az.po index a40ff8802ea..3b02bd8527f 100644 --- a/data/levels/bonus3/az.po +++ b/data/levels/bonus3/az.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Azerbaijani (http://app.transifex.com/arctic-games/supertux/language/az/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/ca.po b/data/levels/bonus3/ca.po index a40b779224f..b4252c2332e 100644 --- a/data/levels/bonus3/ca.po +++ b/data/levels/bonus3/ca.po @@ -5,7 +5,7 @@ # Translators: # Ariadna Pascual , 2016 # Catalanoic , 2016 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # 76352799d6904fac47e3a0fa3ed5fd59_334826e , 2015 # Yael Codesal, 2016 msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Catalan (http://app.transifex.com/arctic-games/supertux/language/ca/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/el.po b/data/levels/bonus3/el.po index 6544754ae7f..4835c63ecf6 100644 --- a/data/levels/bonus3/el.po +++ b/data/levels/bonus3/el.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # I will not tell you that , 2015 # Vangelis Nomikos , 2013-2014 # Vangelis Skarmoutsos (SkarmoutsosV) , 2016,2019 @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Greek (http://app.transifex.com/arctic-games/supertux/language/el/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/et.po b/data/levels/bonus3/et.po index 7a9de61f9d8..13b8f4403e8 100644 --- a/data/levels/bonus3/et.po +++ b/data/levels/bonus3/et.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Estonian (http://app.transifex.com/arctic-games/supertux/language/et/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/eu.po b/data/levels/bonus3/eu.po index 0d999ab40e8..e489a0a2e34 100644 --- a/data/levels/bonus3/eu.po +++ b/data/levels/bonus3/eu.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # Mielanjel Iraeta , 2018-2019 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Basque (http://app.transifex.com/arctic-games/supertux/language/eu/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/fr_CA.po b/data/levels/bonus3/fr_CA.po index 24457458d5a..79976dd7d39 100644 --- a/data/levels/bonus3/fr_CA.po +++ b/data/levels/bonus3/fr_CA.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022-2023 +# IAN RODRÍGUEZ Lorenzo, 2022-2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2022-2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022-2023\n" "Language-Team: French (Canada) (http://app.transifex.com/arctic-games/supertux/language/fr_CA/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/he.po b/data/levels/bonus3/he.po index 77efeee6229..73ec1a1a1eb 100644 --- a/data/levels/bonus3/he.po +++ b/data/levels/bonus3/he.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2020-2021 # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2020 msgid "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Hebrew (http://app.transifex.com/arctic-games/supertux/language/he/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/hr.po b/data/levels/bonus3/hr.po index 16f40adef6f..8bc5f7f868d 100644 --- a/data/levels/bonus3/hr.po +++ b/data/levels/bonus3/hr.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Croatian (http://app.transifex.com/arctic-games/supertux/language/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/hy.po b/data/levels/bonus3/hy.po index f675a251b57..ada538a29b8 100644 --- a/data/levels/bonus3/hy.po +++ b/data/levels/bonus3/hy.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Armenian (http://app.transifex.com/arctic-games/supertux/language/hy/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/id.po b/data/levels/bonus3/id.po index ba9077b7e50..10349160563 100644 --- a/data/levels/bonus3/id.po +++ b/data/levels/bonus3/id.po @@ -4,14 +4,14 @@ # # Translators: # Chris , 2017 -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Indonesian (http://app.transifex.com/arctic-games/supertux/language/id/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/is.po b/data/levels/bonus3/is.po index 97a2ee0dc98..4302db0c9a3 100644 --- a/data/levels/bonus3/is.po +++ b/data/levels/bonus3/is.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Icelandic (http://app.transifex.com/arctic-games/supertux/language/is/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/nb.po b/data/levels/bonus3/nb.po index 3c45e9cb15c..ed8f099dbaa 100644 --- a/data/levels/bonus3/nb.po +++ b/data/levels/bonus3/nb.po @@ -4,7 +4,7 @@ # # Translators: # Allan Nordhøy , 2016,2018 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Karl Ove Hufthammer , 2015-2016 msgid "" msgstr "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Norwegian Bokmål (http://app.transifex.com/arctic-games/supertux/language/nb/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/nn.po b/data/levels/bonus3/nn.po index 6f96248296b..6410d76e9de 100644 --- a/data/levels/bonus3/nn.po +++ b/data/levels/bonus3/nn.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Karl Ove Hufthammer , 2015-2016,2018-2020 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Norwegian Nynorsk (http://app.transifex.com/arctic-games/supertux/language/nn/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/ro.po b/data/levels/bonus3/ro.po index 96ca7e89277..fcd4d25812f 100644 --- a/data/levels/bonus3/ro.po +++ b/data/levels/bonus3/ro.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # Nicolae Crefelean, 2015-2016,2019 # drazvan, 2019 msgid "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Romanian (http://app.transifex.com/arctic-games/supertux/language/ro/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/sk.po b/data/levels/bonus3/sk.po index 4ec1748e72b..3dea149cef5 100644 --- a/data/levels/bonus3/sk.po +++ b/data/levels/bonus3/sk.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Jose Riha , 2021 # Roman 'Kaktuxista' Benji , 2014 # Roman 'Kaktuxista' Benji , 2014 @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Slovak (http://app.transifex.com/arctic-games/supertux/language/sk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/sq.po b/data/levels/bonus3/sq.po index 42f6b9751cc..90ac37d0a54 100644 --- a/data/levels/bonus3/sq.po +++ b/data/levels/bonus3/sq.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Indrit Bashkimi , 2015 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Albanian (http://app.transifex.com/arctic-games/supertux/language/sq/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/tr.po b/data/levels/bonus3/tr.po index c49e6518ec9..b43ec2b2ded 100644 --- a/data/levels/bonus3/tr.po +++ b/data/levels/bonus3/tr.po @@ -6,7 +6,7 @@ # Alkım Kaçmaz , 2013 # Erdoğan Şahin, 2016 # mahmut özcan , 2015-2016 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # mahmut özcan , 2020 # 9d4282795e87ad099e39d98812f1a822_ade2f01 , 2014 # Yusuf Özsoy , 2013 @@ -16,7 +16,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Turkish (http://app.transifex.com/arctic-games/supertux/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/tt.po b/data/levels/bonus3/tt.po index cb91761d1f4..9614fbc94e7 100644 --- a/data/levels/bonus3/tt.po +++ b/data/levels/bonus3/tt.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Timur Seber , 2021 # Булат Ибраһим , 2016 msgid "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Tatar (http://app.transifex.com/arctic-games/supertux/language/tt/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/uk.po b/data/levels/bonus3/uk.po index e8840ab9924..7650393fa88 100644 --- a/data/levels/bonus3/uk.po +++ b/data/levels/bonus3/uk.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Max Lyashuk , 2015 # Olexandr Nesterenko , 2019 msgid "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Ukrainian (http://app.transifex.com/arctic-games/supertux/language/uk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus3/uz.po b/data/levels/bonus3/uz.po index 0f171d99e7b..fbde3d92449 100644 --- a/data/levels/bonus3/uz.po +++ b/data/levels/bonus3/uz.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:08+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Uzbek (http://app.transifex.com/arctic-games/supertux/language/uz/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/ar.po b/data/levels/bonus4/ar.po index 7c2b071bfb2..28c9a57ede7 100644 --- a/data/levels/bonus4/ar.po +++ b/data/levels/bonus4/ar.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Arabic (https://app.transifex.com/arctic-games/teams/95/ar/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/az.po b/data/levels/bonus4/az.po index e6c0e5df6bb..c9400ef4104 100644 --- a/data/levels/bonus4/az.po +++ b/data/levels/bonus4/az.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Azerbaijani (https://app.transifex.com/arctic-games/teams/95/az/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/ca.po b/data/levels/bonus4/ca.po index 2c2a05c9635..2329233f5bb 100644 --- a/data/levels/bonus4/ca.po +++ b/data/levels/bonus4/ca.po @@ -5,7 +5,7 @@ # # Translators: # Yael Codesal, 2019 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Catalan (https://app.transifex.com/arctic-games/teams/95/ca/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/el.po b/data/levels/bonus4/el.po index 36fe8d8d7b8..3ce69f6e117 100644 --- a/data/levels/bonus4/el.po +++ b/data/levels/bonus4/el.po @@ -7,7 +7,7 @@ # Vangelis Nomikos , 2019 # I will not tell you that , 2019 # Vangelis Skarmoutsos (SkarmoutsosV) , 2019 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -16,7 +16,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Greek (https://app.transifex.com/arctic-games/teams/95/el/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/eo.po b/data/levels/bonus4/eo.po index d6516085e7b..1fff866ced1 100644 --- a/data/levels/bonus4/eo.po +++ b/data/levels/bonus4/eo.po @@ -5,7 +5,7 @@ # # Translators: # tellovishous , 2021 -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Esperanto (https://app.transifex.com/arctic-games/teams/95/eo/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/et.po b/data/levels/bonus4/et.po index 00ab61f91b4..54a3d4ea79b 100644 --- a/data/levels/bonus4/et.po +++ b/data/levels/bonus4/et.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Estonian (https://app.transifex.com/arctic-games/teams/95/et/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/fr_CA.po b/data/levels/bonus4/fr_CA.po index babd64941dd..275fb420411 100644 --- a/data/levels/bonus4/fr_CA.po +++ b/data/levels/bonus4/fr_CA.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: French (Canada) (https://app.transifex.com/arctic-games/teams/95/fr_CA/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/he.po b/data/levels/bonus4/he.po index bf0f8381af6..97a5cc96b61 100644 --- a/data/levels/bonus4/he.po +++ b/data/levels/bonus4/he.po @@ -5,7 +5,7 @@ # # Translators: # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2020 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Hebrew (https://app.transifex.com/arctic-games/teams/95/he/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/hr.po b/data/levels/bonus4/hr.po index 17dae55b4d7..ff10d52c605 100644 --- a/data/levels/bonus4/hr.po +++ b/data/levels/bonus4/hr.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Croatian (https://app.transifex.com/arctic-games/teams/95/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/hy.po b/data/levels/bonus4/hy.po index 2ea3c752733..a8933189930 100644 --- a/data/levels/bonus4/hy.po +++ b/data/levels/bonus4/hy.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Armenian (https://app.transifex.com/arctic-games/teams/95/hy/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/id.po b/data/levels/bonus4/id.po index 5a7ba33eb8c..dbb6140df62 100644 --- a/data/levels/bonus4/id.po +++ b/data/levels/bonus4/id.po @@ -5,7 +5,7 @@ # # Translators: # Chris , 2019 -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Indonesian (https://app.transifex.com/arctic-games/teams/95/id/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/is.po b/data/levels/bonus4/is.po index ac374495cfc..0a4605c9ecb 100644 --- a/data/levels/bonus4/is.po +++ b/data/levels/bonus4/is.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Icelandic (https://app.transifex.com/arctic-games/teams/95/is/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/nb.po b/data/levels/bonus4/nb.po index d6786ccf4fc..2fc7ee3b0d6 100644 --- a/data/levels/bonus4/nb.po +++ b/data/levels/bonus4/nb.po @@ -5,7 +5,7 @@ # # Translators: # Karl Ove Hufthammer , 2019 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Norwegian Bokmål (https://app.transifex.com/arctic-games/teams/95/nb/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/sk.po b/data/levels/bonus4/sk.po index 57938ae26b9..117449ecc90 100644 --- a/data/levels/bonus4/sk.po +++ b/data/levels/bonus4/sk.po @@ -5,7 +5,7 @@ # # Translators: # Roman 'Kaktuxista' Benji , 2019 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Slovak (https://app.transifex.com/arctic-games/teams/95/sk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/sq.po b/data/levels/bonus4/sq.po index 167f88fed5e..6fe9b6a000b 100644 --- a/data/levels/bonus4/sq.po +++ b/data/levels/bonus4/sq.po @@ -5,7 +5,7 @@ # # Translators: # Indrit Bashkimi , 2019 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Albanian (https://app.transifex.com/arctic-games/teams/95/sq/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/tt.po b/data/levels/bonus4/tt.po index 203e7c812b1..db3c61726f5 100644 --- a/data/levels/bonus4/tt.po +++ b/data/levels/bonus4/tt.po @@ -6,7 +6,7 @@ # Translators: # Булат Ибраһим , 2019 # Timur Seber , 2021 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -15,7 +15,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Tatar (https://app.transifex.com/arctic-games/teams/95/tt/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/uk.po b/data/levels/bonus4/uk.po index e15c02c74ea..ae59e051ef7 100644 --- a/data/levels/bonus4/uk.po +++ b/data/levels/bonus4/uk.po @@ -5,7 +5,7 @@ # # Translators: # Max Lyashuk , 2019 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Ukrainian (https://app.transifex.com/arctic-games/teams/95/uk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/bonus4/uz.po b/data/levels/bonus4/uz.po index 7717b95b60d..c6a6dbe7a27 100644 --- a/data/levels/bonus4/uz.po +++ b/data/levels/bonus4/uz.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:58+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Uzbek (https://app.transifex.com/arctic-games/teams/95/uz/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/ar.po b/data/levels/community2016/ar.po index 2d358c4d890..37d50b1e016 100644 --- a/data/levels/community2016/ar.po +++ b/data/levels/community2016/ar.po @@ -5,7 +5,7 @@ # # Translators: # Israa Zamzami, 2019 -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Arabic (https://app.transifex.com/arctic-games/teams/95/ar/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/az.po b/data/levels/community2016/az.po index e4951f93632..e5a49964ddc 100644 --- a/data/levels/community2016/az.po +++ b/data/levels/community2016/az.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Azerbaijani (https://app.transifex.com/arctic-games/teams/95/az/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/ca.po b/data/levels/community2016/ca.po index d61195626bd..1977ddfadc0 100644 --- a/data/levels/community2016/ca.po +++ b/data/levels/community2016/ca.po @@ -5,7 +5,7 @@ # # Translators: # Alícia Folgarona , 2019 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Catalan (https://app.transifex.com/arctic-games/teams/95/ca/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/el.po b/data/levels/community2016/el.po index 08b55243860..1d59210883e 100644 --- a/data/levels/community2016/el.po +++ b/data/levels/community2016/el.po @@ -5,7 +5,7 @@ # # Translators: # Vangelis Nomikos , 2019 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Greek (https://app.transifex.com/arctic-games/teams/95/el/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/eo.po b/data/levels/community2016/eo.po index b113dd75c30..4b8a6a555df 100644 --- a/data/levels/community2016/eo.po +++ b/data/levels/community2016/eo.po @@ -5,7 +5,7 @@ # # Translators: # vpzomtrrfrt , 2020 -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Esperanto (https://app.transifex.com/arctic-games/teams/95/eo/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/et.po b/data/levels/community2016/et.po index 6a4454df97a..49123363130 100644 --- a/data/levels/community2016/et.po +++ b/data/levels/community2016/et.po @@ -5,7 +5,7 @@ # # Translators: # Günter Kits , 2019 -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Estonian (https://app.transifex.com/arctic-games/teams/95/et/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/fr_CA.po b/data/levels/community2016/fr_CA.po index b0e882722ef..66c63ebc1e0 100644 --- a/data/levels/community2016/fr_CA.po +++ b/data/levels/community2016/fr_CA.po @@ -5,7 +5,7 @@ # # Translators: # Jean-Philippe L'Étoile , 2019 -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: French (Canada) (https://app.transifex.com/arctic-games/teams/95/fr_CA/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/he.po b/data/levels/community2016/he.po index 8048600b5b5..a7c94554c09 100644 --- a/data/levels/community2016/he.po +++ b/data/levels/community2016/he.po @@ -6,7 +6,7 @@ # Translators: # gk , 2019 # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2021 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -15,7 +15,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Hebrew (https://app.transifex.com/arctic-games/teams/95/he/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/hr.po b/data/levels/community2016/hr.po index 81558ba82cb..952061c7941 100644 --- a/data/levels/community2016/hr.po +++ b/data/levels/community2016/hr.po @@ -5,7 +5,7 @@ # # Translators: # Ilija Ćulap , 2019 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Croatian (https://app.transifex.com/arctic-games/teams/95/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/hy.po b/data/levels/community2016/hy.po index 6da42d46a92..3409ff614a1 100644 --- a/data/levels/community2016/hy.po +++ b/data/levels/community2016/hy.po @@ -5,7 +5,7 @@ # # Translators: # Grant Davtjan, 2019 -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Armenian (https://app.transifex.com/arctic-games/teams/95/hy/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/id.po b/data/levels/community2016/id.po index ecd7c273f87..a16cabed6f0 100644 --- a/data/levels/community2016/id.po +++ b/data/levels/community2016/id.po @@ -5,7 +5,7 @@ # # Translators: # Chris , 2019 -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Indonesian (https://app.transifex.com/arctic-games/teams/95/id/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/is.po b/data/levels/community2016/is.po index 51418df81f4..b4bed63e5bc 100644 --- a/data/levels/community2016/is.po +++ b/data/levels/community2016/is.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Icelandic (https://app.transifex.com/arctic-games/teams/95/is/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/nb.po b/data/levels/community2016/nb.po index 3cab939275f..4dc7bf3d0af 100644 --- a/data/levels/community2016/nb.po +++ b/data/levels/community2016/nb.po @@ -5,7 +5,7 @@ # # Translators: # Benjamin Leduc , 2019 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Norwegian Bokmål (https://app.transifex.com/arctic-games/teams/95/nb/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/ro.po b/data/levels/community2016/ro.po index ba03799a4cc..7a89121c48d 100644 --- a/data/levels/community2016/ro.po +++ b/data/levels/community2016/ro.po @@ -6,7 +6,7 @@ # Translators: # Nicolae Crefelean, 2019 # Laurențiu Matei, 2022 -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -15,7 +15,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Romanian (https://app.transifex.com/arctic-games/teams/95/ro/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/sk.po b/data/levels/community2016/sk.po index 6f1ee117321..096ff3f305b 100644 --- a/data/levels/community2016/sk.po +++ b/data/levels/community2016/sk.po @@ -5,7 +5,7 @@ # # Translators: # Jose Riha , 2021 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Slovak (https://app.transifex.com/arctic-games/teams/95/sk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/sq.po b/data/levels/community2016/sq.po index b1fcff0c277..06466c2f864 100644 --- a/data/levels/community2016/sq.po +++ b/data/levels/community2016/sq.po @@ -5,7 +5,7 @@ # # Translators: # Indrit Bashkimi , 2019 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Albanian (https://app.transifex.com/arctic-games/teams/95/sq/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/tt.po b/data/levels/community2016/tt.po index 1ed71c5d602..c85fa116525 100644 --- a/data/levels/community2016/tt.po +++ b/data/levels/community2016/tt.po @@ -5,7 +5,7 @@ # # Translators: # Булат Ибраһим , 2019 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Tatar (https://app.transifex.com/arctic-games/teams/95/tt/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/uk.po b/data/levels/community2016/uk.po index 23ad7db18ec..889b483f1d2 100644 --- a/data/levels/community2016/uk.po +++ b/data/levels/community2016/uk.po @@ -5,7 +5,7 @@ # # Translators: # Max Lyashuk , 2019 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Ukrainian (https://app.transifex.com/arctic-games/teams/95/uk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/community2016/uz.po b/data/levels/community2016/uz.po index 3c78eecaaf8..b682a009089 100644 --- a/data/levels/community2016/uz.po +++ b/data/levels/community2016/uz.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Uzbek (https://app.transifex.com/arctic-games/teams/95/uz/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/halloween2014/ar.po b/data/levels/halloween2014/ar.po index 5bc42bae344..c8b15055ecc 100644 --- a/data/levels/halloween2014/ar.po +++ b/data/levels/halloween2014/ar.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2015-10-19 18:02+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Arabic (http://app.transifex.com/arctic-games/supertux/language/ar/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/halloween2014/az.po b/data/levels/halloween2014/az.po index 1b62b407764..9ba5919de1a 100644 --- a/data/levels/halloween2014/az.po +++ b/data/levels/halloween2014/az.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2015-10-19 18:02+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Azerbaijani (http://app.transifex.com/arctic-games/supertux/language/az/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/halloween2014/eo.po b/data/levels/halloween2014/eo.po index 5fe108a3c8a..3497f75e8f1 100644 --- a/data/levels/halloween2014/eo.po +++ b/data/levels/halloween2014/eo.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # Robin van der Vliet , 2015 # Любомир Василев, 2016 msgid "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2015-10-19 18:02+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Esperanto (http://app.transifex.com/arctic-games/supertux/language/eo/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/halloween2014/et.po b/data/levels/halloween2014/et.po index b0374b140dd..5ac278d2cbb 100644 --- a/data/levels/halloween2014/et.po +++ b/data/levels/halloween2014/et.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2015-10-19 18:02+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Estonian (http://app.transifex.com/arctic-games/supertux/language/et/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/halloween2014/fr_CA.po b/data/levels/halloween2014/fr_CA.po index 1f012ea1d3c..d57f3b0e9c3 100644 --- a/data/levels/halloween2014/fr_CA.po +++ b/data/levels/halloween2014/fr_CA.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2015-10-19 18:02+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: French (Canada) (http://app.transifex.com/arctic-games/supertux/language/fr_CA/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/halloween2014/he.po b/data/levels/halloween2014/he.po index d96098a5fac..dcabe020b0e 100644 --- a/data/levels/halloween2014/he.po +++ b/data/levels/halloween2014/he.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2020 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2015-10-19 18:02+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Hebrew (http://app.transifex.com/arctic-games/supertux/language/he/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/halloween2014/hr.po b/data/levels/halloween2014/hr.po index a5399886f6e..bda1ec9a930 100644 --- a/data/levels/halloween2014/hr.po +++ b/data/levels/halloween2014/hr.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2015-10-19 18:02+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Croatian (http://app.transifex.com/arctic-games/supertux/language/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/halloween2014/hy.po b/data/levels/halloween2014/hy.po index 366c68a1144..d77063fded9 100644 --- a/data/levels/halloween2014/hy.po +++ b/data/levels/halloween2014/hy.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2015-10-19 18:02+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Armenian (http://app.transifex.com/arctic-games/supertux/language/hy/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/halloween2014/id.po b/data/levels/halloween2014/id.po index 89e4eafbfac..afe5772d990 100644 --- a/data/levels/halloween2014/id.po +++ b/data/levels/halloween2014/id.po @@ -4,14 +4,14 @@ # # Translators: # Chris , 2017 -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2015-10-19 18:02+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Indonesian (http://app.transifex.com/arctic-games/supertux/language/id/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/halloween2014/is.po b/data/levels/halloween2014/is.po index 302a604745c..198942650ad 100644 --- a/data/levels/halloween2014/is.po +++ b/data/levels/halloween2014/is.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2015-10-19 18:02+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Icelandic (http://app.transifex.com/arctic-games/supertux/language/is/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/halloween2014/ro.po b/data/levels/halloween2014/ro.po index aeb76a66c9d..c8d5b416472 100644 --- a/data/levels/halloween2014/ro.po +++ b/data/levels/halloween2014/ro.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2015-10-19 18:02+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Romanian (http://app.transifex.com/arctic-games/supertux/language/ro/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/halloween2014/sq.po b/data/levels/halloween2014/sq.po index 702ee95aaed..da57e192cd6 100644 --- a/data/levels/halloween2014/sq.po +++ b/data/levels/halloween2014/sq.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2015-10-19 18:02+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Albanian (http://app.transifex.com/arctic-games/supertux/language/sq/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/halloween2014/uz.po b/data/levels/halloween2014/uz.po index db9a7434382..94c6ad494b2 100644 --- a/data/levels/halloween2014/uz.po +++ b/data/levels/halloween2014/uz.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2015-10-19 18:02+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Uzbek (http://app.transifex.com/arctic-games/supertux/language/uz/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world1/ar.po b/data/levels/world1/ar.po index 50e819d31ab..3c67e18a0f2 100644 --- a/data/levels/world1/ar.po +++ b/data/levels/world1/ar.po @@ -4,7 +4,7 @@ # # Translators: # Fahad Al-Saidi , 2016 -# 111More1, 2022-2023 +# IAN RODRÍGUEZ Lorenzo, 2022-2023 # Israa Zamzami, 2018 # Hasan Nahleh , 2022 msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 22:58+0000\n" -"Last-Translator: 111More1, 2022-2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022-2023\n" "Language-Team: Arabic (http://app.transifex.com/arctic-games/supertux/language/ar/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world1/az.po b/data/levels/world1/az.po index d3819137b48..5d62b0ee8e7 100644 --- a/data/levels/world1/az.po +++ b/data/levels/world1/az.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 22:58+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Azerbaijani (http://app.transifex.com/arctic-games/supertux/language/az/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world1/ca.po b/data/levels/world1/ca.po index 4384e29f570..321179b4956 100644 --- a/data/levels/world1/ca.po +++ b/data/levels/world1/ca.po @@ -5,7 +5,7 @@ # Translators: # Ariadna Pascual , 2016 # Catalanoic , 2016 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # 76352799d6904fac47e3a0fa3ed5fd59_334826e , 2014-2015 # Yael Codesal, 2016 msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 22:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Catalan (http://app.transifex.com/arctic-games/supertux/language/ca/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world1/el.po b/data/levels/world1/el.po index f449986d612..5fd8436f3d3 100644 --- a/data/levels/world1/el.po +++ b/data/levels/world1/el.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # I will not tell you that , 2015 # Vangelis Nomikos , 2013-2014 # Vangelis Skarmoutsos (SkarmoutsosV) , 2016,2019 @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 22:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Greek (http://app.transifex.com/arctic-games/supertux/language/el/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world1/fr_CA.po b/data/levels/world1/fr_CA.po index bc5a3af4c3e..83655da374c 100644 --- a/data/levels/world1/fr_CA.po +++ b/data/levels/world1/fr_CA.po @@ -3,8 +3,8 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Jean-Philippe L'Étoile , 2018-2019 msgid "" msgstr "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 22:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: French (Canada) (http://app.transifex.com/arctic-games/supertux/language/fr_CA/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world1/he.po b/data/levels/world1/he.po index e710c685277..9481a85ddac 100644 --- a/data/levels/world1/he.po +++ b/data/levels/world1/he.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2020-2022 # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2021 # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2020 @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 22:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Hebrew (http://app.transifex.com/arctic-games/supertux/language/he/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world1/hr.po b/data/levels/world1/hr.po index 478ee47e5c5..745ab8ebd52 100644 --- a/data/levels/world1/hr.po +++ b/data/levels/world1/hr.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Ilija Ćulap , 2013 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 22:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Croatian (http://app.transifex.com/arctic-games/supertux/language/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world1/hy.po b/data/levels/world1/hy.po index 458b7b1596b..b8738a06bc1 100644 --- a/data/levels/world1/hy.po +++ b/data/levels/world1/hy.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 22:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Armenian (http://app.transifex.com/arctic-games/supertux/language/hy/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world1/id.po b/data/levels/world1/id.po index 5db3c9c0604..1a2ab6bec4e 100644 --- a/data/levels/world1/id.po +++ b/data/levels/world1/id.po @@ -6,14 +6,14 @@ # Chris , 2022 # Chris , 2017 # Christian Elbrianno Yoga, 2017 -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 22:58+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Indonesian (http://app.transifex.com/arctic-games/supertux/language/id/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world1/is.po b/data/levels/world1/is.po index 246d7a41d72..364155feff7 100644 --- a/data/levels/world1/is.po +++ b/data/levels/world1/is.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 22:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Icelandic (http://app.transifex.com/arctic-games/supertux/language/is/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world1/nb.po b/data/levels/world1/nb.po index 48b2935a04d..80c546e0d39 100644 --- a/data/levels/world1/nb.po +++ b/data/levels/world1/nb.po @@ -4,7 +4,7 @@ # # Translators: # Allan Nordhøy , 2016,2018 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Karl Ove Hufthammer , 2007,2013,2015-2016 msgid "" msgstr "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 22:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Norwegian Bokmål (http://app.transifex.com/arctic-games/supertux/language/nb/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world1/ro.po b/data/levels/world1/ro.po index e7f0dc528ea..e60fdc81e1e 100644 --- a/data/levels/world1/ro.po +++ b/data/levels/world1/ro.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # Ioan Moldovan , 2019,2023 # Nicolae Crefelean, 2015-2016 # Razvan , 2007 diff --git a/data/levels/world1/sk.po b/data/levels/world1/sk.po index 514cf644f97..a16c6bb40f6 100644 --- a/data/levels/world1/sk.po +++ b/data/levels/world1/sk.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Jose Riha , 2021 # c79a840bffc1621596a73d9f7d995b66_5f97bea <821296eb068acbf38f8fe02d322f4248_155187>, 2014 # MiroslavR , 2015-2016 @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 22:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Slovak (http://app.transifex.com/arctic-games/supertux/language/sk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world1/sq.po b/data/levels/world1/sq.po index abb4c5c2a46..a7bc573aad4 100644 --- a/data/levels/world1/sq.po +++ b/data/levels/world1/sq.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Indrit Bashkimi , 2015-2016 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 22:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Albanian (http://app.transifex.com/arctic-games/supertux/language/sq/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world1/tr.po b/data/levels/world1/tr.po index 5126b32d6ff..64a7f9a2dc6 100644 --- a/data/levels/world1/tr.po +++ b/data/levels/world1/tr.po @@ -5,7 +5,7 @@ # Translators: # Alkım Kaçmaz , 2013 # mahmut özcan , 2015-2016 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Tan Siret Akıncı , 2021 # 9d4282795e87ad099e39d98812f1a822_ade2f01 , 2013-2014 # Yusuf Özsoy , 2013 @@ -15,7 +15,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 22:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Turkish (http://app.transifex.com/arctic-games/supertux/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world1/tt.po b/data/levels/world1/tt.po index 4c217d4c49b..fbfae8e9a1c 100644 --- a/data/levels/world1/tt.po +++ b/data/levels/world1/tt.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Булат Ибраһим , 2016 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 22:58+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Tatar (http://app.transifex.com/arctic-games/supertux/language/tt/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world1/uk.po b/data/levels/world1/uk.po index e2d593b9287..917c8cb1668 100644 --- a/data/levels/world1/uk.po +++ b/data/levels/world1/uk.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Asemif official, 2023 # Benjamin Leduc , 2015 # Max Lyashuk , 2015-2016 diff --git a/data/levels/world1/uz.po b/data/levels/world1/uz.po index 54d787064b6..05eac7a866f 100644 --- a/data/levels/world1/uz.po +++ b/data/levels/world1/uz.po @@ -3,15 +3,15 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022-2023 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022-2023 +# IAN RODRÍGUEZ Lorenzo, 2022 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 22:58+0000\n" -"Last-Translator: 111More1, 2022-2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022-2023\n" "Language-Team: Uzbek (http://app.transifex.com/arctic-games/supertux/language/uz/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/ar.po b/data/levels/world2/ar.po index 55e0fbe0a1f..ed0c26ca355 100644 --- a/data/levels/world2/ar.po +++ b/data/levels/world2/ar.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022-2023 +# IAN RODRÍGUEZ Lorenzo, 2022-2023 # Israa Zamzami, 2018 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022-2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022-2023\n" "Language-Team: Arabic (http://app.transifex.com/arctic-games/supertux/language/ar/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/az.po b/data/levels/world2/az.po index 8804d4334ed..a0158d497bd 100644 --- a/data/levels/world2/az.po +++ b/data/levels/world2/az.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Azerbaijani (http://app.transifex.com/arctic-games/supertux/language/az/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/ca.po b/data/levels/world2/ca.po index ae3ed84068b..291c367713a 100644 --- a/data/levels/world2/ca.po +++ b/data/levels/world2/ca.po @@ -5,7 +5,7 @@ # Translators: # Ariadna Pascual , 2016 # Catalanoic , 2016 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # 76352799d6904fac47e3a0fa3ed5fd59_334826e , 2014-2015 # Yael Codesal, 2016 msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Catalan (http://app.transifex.com/arctic-games/supertux/language/ca/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/el.po b/data/levels/world2/el.po index 5aaaefd98bf..a037712a03c 100644 --- a/data/levels/world2/el.po +++ b/data/levels/world2/el.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Vangelis Nomikos , 2013-2014 # Vangelis Skarmoutsos (SkarmoutsosV) , 2016,2019 msgid "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Greek (http://app.transifex.com/arctic-games/supertux/language/el/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/et.po b/data/levels/world2/et.po index 94df704a29a..53e8b71921f 100644 --- a/data/levels/world2/et.po +++ b/data/levels/world2/et.po @@ -3,8 +3,8 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2022 +# IAN RODRÍGUEZ Lorenzo, 2023 # Urmas Kvell, 2020,2022 # Urmas Kvell, 2020 msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Estonian (http://app.transifex.com/arctic-games/supertux/language/et/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/eu.po b/data/levels/world2/eu.po index 12337abccb6..9dd2ddf599c 100644 --- a/data/levels/world2/eu.po +++ b/data/levels/world2/eu.po @@ -4,7 +4,7 @@ # # Translators: # Bingen Galartza Iparragirre , 2017 -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # Mielanjel Iraeta , 2018-2020 # Urtzi Odriozola , 2017 msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Basque (http://app.transifex.com/arctic-games/supertux/language/eu/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/fr_CA.po b/data/levels/world2/fr_CA.po index bdf4e48ed6f..fa014627be0 100644 --- a/data/levels/world2/fr_CA.po +++ b/data/levels/world2/fr_CA.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: French (Canada) (http://app.transifex.com/arctic-games/supertux/language/fr_CA/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/he.po b/data/levels/world2/he.po index eac7e77bf0c..51bf724b097 100644 --- a/data/levels/world2/he.po +++ b/data/levels/world2/he.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2020-2021 # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2021 # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2020 @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Hebrew (http://app.transifex.com/arctic-games/supertux/language/he/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/hr.po b/data/levels/world2/hr.po index d55613af7a5..cb4aaa7456b 100644 --- a/data/levels/world2/hr.po +++ b/data/levels/world2/hr.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Croatian (http://app.transifex.com/arctic-games/supertux/language/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/hu.po b/data/levels/world2/hu.po index 7a964962fd9..9bc937ce554 100644 --- a/data/levels/world2/hu.po +++ b/data/levels/world2/hu.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Balázs Úr, 2018 # Levente Krisztián Büte , 2014 # D. J. S. , 2012 @@ -21,7 +21,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Hungarian (http://app.transifex.com/arctic-games/supertux/language/hu/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/hy.po b/data/levels/world2/hy.po index 8ad005dbc76..65675cb8729 100644 --- a/data/levels/world2/hy.po +++ b/data/levels/world2/hy.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Armenian (http://app.transifex.com/arctic-games/supertux/language/hy/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/is.po b/data/levels/world2/is.po index 525eb7690c9..29fccc0ba23 100644 --- a/data/levels/world2/is.po +++ b/data/levels/world2/is.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Icelandic (http://app.transifex.com/arctic-games/supertux/language/is/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/ja.po b/data/levels/world2/ja.po index 917c959d5f1..ea9908d6a1e 100644 --- a/data/levels/world2/ja.po +++ b/data/levels/world2/ja.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # 515ce455fbf38ec9585626e8d26b6324_7a9a6ef, 2017 # Ryo Nakano, 2019-2021 # b1e11c107ebf1f339ff7adfc86b9dbe0_2e3e89d, 2016 @@ -16,7 +16,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Japanese (http://app.transifex.com/arctic-games/supertux/language/ja/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/ko.po b/data/levels/world2/ko.po index 5fb5f15f063..92a90e3c7e4 100644 --- a/data/levels/world2/ko.po +++ b/data/levels/world2/ko.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Junghee Lee , 2022 # Junghee Lee , 2022 # Myeongjin , 2016-2017,2019,2021 @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Korean (http://app.transifex.com/arctic-games/supertux/language/ko/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/nb.po b/data/levels/world2/nb.po index bf263144a7a..cf946157206 100644 --- a/data/levels/world2/nb.po +++ b/data/levels/world2/nb.po @@ -4,7 +4,7 @@ # # Translators: # Allan Nordhøy , 2016,2018 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Karl Ove Hufthammer , 2007,2013,2015-2016 msgid "" msgstr "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Norwegian Bokmål (http://app.transifex.com/arctic-games/supertux/language/nb/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/nn.po b/data/levels/world2/nn.po index 3e6c63712d1..b6658b8fae5 100644 --- a/data/levels/world2/nn.po +++ b/data/levels/world2/nn.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Karl Ove Hufthammer , 2006-2007,2013-2016,2018-2020 # Karl Ove Hufthammer , 2015 msgid "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Norwegian Nynorsk (http://app.transifex.com/arctic-games/supertux/language/nn/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/ro.po b/data/levels/world2/ro.po index b037ff2f704..8f96b6a712e 100644 --- a/data/levels/world2/ro.po +++ b/data/levels/world2/ro.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # Nicolae Crefelean, 2015-2016 # Razvan , 2007 msgid "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Romanian (http://app.transifex.com/arctic-games/supertux/language/ro/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/sk.po b/data/levels/world2/sk.po index dcc9affdc2d..fe23836849e 100644 --- a/data/levels/world2/sk.po +++ b/data/levels/world2/sk.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Jose Riha , 2021 # c79a840bffc1621596a73d9f7d995b66_5f97bea <821296eb068acbf38f8fe02d322f4248_155187>, 2014 # MiroslavR , 2016 @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Slovak (http://app.transifex.com/arctic-games/supertux/language/sk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/sq.po b/data/levels/world2/sq.po index 55c602c28e4..5b547c72ffc 100644 --- a/data/levels/world2/sq.po +++ b/data/levels/world2/sq.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Indrit Bashkimi , 2015 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Albanian (http://app.transifex.com/arctic-games/supertux/language/sq/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/tr.po b/data/levels/world2/tr.po index 85928abdb09..2dfea0422cc 100644 --- a/data/levels/world2/tr.po +++ b/data/levels/world2/tr.po @@ -4,7 +4,7 @@ # # Translators: # Alkım Kaçmaz , 2013 -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # mahmut özcan , 2020 # 9d4282795e87ad099e39d98812f1a822_ade2f01 , 2013 # Yusuf Özsoy , 2013 @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Turkish (http://app.transifex.com/arctic-games/supertux/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/tt.po b/data/levels/world2/tt.po index 1be246124c0..d77c30b61c6 100644 --- a/data/levels/world2/tt.po +++ b/data/levels/world2/tt.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Булат Ибраһим , 2016 msgid "" msgstr "" @@ -11,7 +11,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Tatar (http://app.transifex.com/arctic-games/supertux/language/tt/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/uk.po b/data/levels/world2/uk.po index 191c87263ab..f45f1b4c847 100644 --- a/data/levels/world2/uk.po +++ b/data/levels/world2/uk.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2022 +# IAN RODRÍGUEZ Lorenzo, 2022 # Max Lyashuk , 2015-2016 # Olexandr Nesterenko , 2019 msgid "" @@ -12,7 +12,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2022\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2022\n" "Language-Team: Ukrainian (http://app.transifex.com/arctic-games/supertux/language/uk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/levels/world2/uz.po b/data/levels/world2/uz.po index 5d340e0a9fd..a518d063542 100644 --- a/data/levels/world2/uz.po +++ b/data/levels/world2/uz.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 msgid "" msgstr "" "Project-Id-Version: SuperTux\n" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-03-03 03:26+0100\n" "PO-Revision-Date: 2013-08-10 23:00+0000\n" -"Last-Translator: 111More1, 2023\n" +"Last-Translator: IAN RODRÍGUEZ Lorenzo, 2023\n" "Language-Team: Uzbek (http://app.transifex.com/arctic-games/supertux/language/uz/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/data/locale/bg.po b/data/locale/bg.po index 7e76e5548b6..d24358bcf01 100644 --- a/data/locale/bg.po +++ b/data/locale/bg.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the SuperTux package. # # Translators: -# 111More1, 2023 +# IAN RODRÍGUEZ Lorenzo, 2023 # Любомир Василев, 2015-2016 # Tony Ivanov , 2014 # Любомир Василев, 2016,2018-2020 From edb4a9ccd9102e52d4b9607c7023c6b14e624923 Mon Sep 17 00:00:00 2001 From: Vankata453 <78196474+Vankata453@users.noreply.github.com> Date: Sun, 14 Jul 2024 15:41:45 +0300 Subject: [PATCH 20/33] SimpleSquirrel: Fix error converting Squirrel array to `std::vector` --- external/simplesquirrel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/simplesquirrel b/external/simplesquirrel index e7eab2d6203..c7a7259903b 160000 --- a/external/simplesquirrel +++ b/external/simplesquirrel @@ -1 +1 @@ -Subproject commit e7eab2d62035d933022ac1a15272c00951a7385b +Subproject commit c7a7259903b920eacf8c37c5382a386381cfbab9 From c9255d99bd6d3a5e1b58358169ee9d0193b5061d Mon Sep 17 00:00:00 2001 From: Vankata453 <78196474+Vankata453@users.noreply.github.com> Date: Sun, 14 Jul 2024 21:37:19 +0300 Subject: [PATCH 21/33] SimpleSquirrel: Call `Array::convert()` from `Array::convertRaw()` Eliminates some code duplication. [ci skip] --- external/simplesquirrel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/simplesquirrel b/external/simplesquirrel index c7a7259903b..801de40151c 160000 --- a/external/simplesquirrel +++ b/external/simplesquirrel @@ -1 +1 @@ -Subproject commit c7a7259903b920eacf8c37c5382a386381cfbab9 +Subproject commit 801de40151ca978b8554a9e590b01c398b7417c0 From 60f5cb36d88aa2fc90eca7bf2cfc4c332fe2e0e7 Mon Sep 17 00:00:00 2001 From: SuperTux Bot Date: Mon, 15 Jul 2024 01:40:05 +0000 Subject: [PATCH 22/33] Update translations --- data/locale/de.po | 87 ++++++++++++++++++++------------------- data/locale/pt_BR.po | 98 ++++++++++++++++++++++---------------------- 2 files changed, 93 insertions(+), 92 deletions(-) diff --git a/data/locale/de.po b/data/locale/de.po index 692c26d8c0d..6cfa8b3f9e1 100644 --- a/data/locale/de.po +++ b/data/locale/de.po @@ -15,6 +15,7 @@ # Larson März , 2016 # Marcel Haring , 2013-2014 # Matthias Braun , 2004 +# Moritz Hofmann , 2024 # mteufel, 2018 # mteufel, 2018 # Sless , 2014 @@ -29,7 +30,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-05-30 16:19+0200\n" "PO-Revision-Date: 2013-08-10 22:56+0000\n" -"Last-Translator: Iwan Gabovitch, 2024\n" +"Last-Translator: Moritz Hofmann , 2024\n" "Language-Team: German (http://app.transifex.com/arctic-games/supertux/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -1666,7 +1667,7 @@ msgid "" "Do you wish to clone the path to edit it separately,\n" "or do you want to bind both paths together\n" "so that any edit on one edits the other?" -msgstr "" +msgstr "Möchtest du den Pfad klonen, um ihn separat zu bearbeiten,\noder möchtest du beide Pfade miteinander verbinden\nso dass jede Bearbeitung des einen Pfads auch den anderen Pfad bearbeitet?" #: src/gui/menu_paths.cpp:56 #, c++-format @@ -1781,7 +1782,7 @@ msgstr "Pflanze" #: src/badguy/tarantula.hpp:39 src/badguy/tarantula.cpp:353 msgid "Tarantula" -msgstr "" +msgstr "Vogelspinne" #: src/badguy/granito_giant.cpp:71 msgid "Awake" @@ -1863,7 +1864,7 @@ msgstr "" #: src/badguy/dive_mine.hpp:50 msgid "Dive Mine" -msgstr "" +msgstr "Tauchergrube" #: src/badguy/granito_big.hpp:33 msgid "Big Granito" @@ -1871,7 +1872,7 @@ msgstr "" #: src/badguy/mriceblock.hpp:49 msgid "Mr. Iceblock" -msgstr "" +msgstr "Mr. Eisblock" #: src/badguy/granito.hpp:39 src/badguy/darttrap.cpp:163 #: src/badguy/corrupted_granito.cpp:175 src/badguy/dispenser.cpp:438 @@ -2031,7 +2032,7 @@ msgstr "Korrupter Granito" #: src/badguy/mrbomb.cpp:48 msgid "Classic" -msgstr "" +msgstr "Klassisch" #: src/badguy/flyingsnowball.hpp:33 msgid "Flying Snowball" @@ -2067,7 +2068,7 @@ msgstr "Seitwärts" #: src/badguy/kamikazesnowball.hpp:34 msgid "Kamikaze Snowball" -msgstr "" +msgstr "Kamikaze Schneeball" #: src/badguy/kamikazesnowball.hpp:64 msgid "Leafshot" @@ -2123,7 +2124,7 @@ msgstr "Laufendes Blatt" #: src/badguy/root.hpp:39 msgid "Root" -msgstr "" +msgstr "Wurzel" #: src/badguy/owl.cpp:241 msgid "Carry" @@ -2143,7 +2144,7 @@ msgstr "Yeti" #: src/badguy/snowball.cpp:41 msgid "Bumpkin" -msgstr "" +msgstr "Tölpel" #: src/badguy/snowball.cpp:42 msgid "BSOD" @@ -2171,11 +2172,11 @@ msgstr "Wütender Stein" #: src/badguy/tarantula.cpp:354 msgid "Spidermite" -msgstr "" +msgstr "Spinne" #: src/badguy/tarantula.cpp:374 msgid "Static" -msgstr "" +msgstr "Statisch" #: src/badguy/ghoul.hpp:30 msgid "Ghoul" @@ -2183,7 +2184,7 @@ msgstr "Ghul" #: src/badguy/granito_giant.hpp:32 msgid "Giant Granito" -msgstr "" +msgstr "Riesiger Granito" #: src/badguy/snowman.hpp:29 msgid "Snowman" @@ -2191,7 +2192,7 @@ msgstr "Schneemann" #: src/badguy/viciousivy.hpp:33 msgid "Vicious Ivy" -msgstr "" +msgstr "Tückischer Efeu" #: src/badguy/stalactite.cpp:156 msgid "ice" @@ -2237,7 +2238,7 @@ msgstr "Maximale Anzahl gleichzeitiger Gegner" #: src/badguy/dispenser.cpp:435 msgid "Dropper" -msgstr "" +msgstr "Pipette" #: src/badguy/dispenser.cpp:436 msgid "Cannon" @@ -2265,11 +2266,11 @@ msgstr "Standard" #: src/badguy/granito_big.cpp:53 src/badguy/granito.cpp:264 msgid "Standing" -msgstr "" +msgstr "Stehend" #: src/badguy/granito_big.cpp:54 src/badguy/granito.cpp:265 msgid "Walking" -msgstr "" +msgstr "Laufend" #: src/badguy/mriceblock.cpp:63 msgid "Laptop" @@ -2281,7 +2282,7 @@ msgstr "Dart" #: src/badguy/granito.cpp:268 msgid "Sitting" -msgstr "" +msgstr "Sitzend" #: src/supertux/statistics.cpp:54 msgid "Max coins collected:" @@ -3291,7 +3292,7 @@ msgstr "Einige Informationen über dieses Add-on sind nicht verfügbar." #: src/supertux/menu/addon_preview_menu.cpp:88 msgid "Perform a \"Check Online\" to try retrieving it." -msgstr "" +msgstr "Führe eine \"Online-Prüfung\" durch, um zu versuchen, sie abzurufen." #: src/supertux/menu/addon_preview_menu.cpp:92 msgid "No author specified." @@ -4182,11 +4183,11 @@ msgstr "Kachel-Hilfsmodus aktivieren" #: src/supertux/menu/editor_menu.cpp:97 msgid "Enable Object Undo Tracking" -msgstr "" +msgstr "Objekt-Rückgängig-Verfolgung einschalten" #: src/supertux/menu/editor_menu.cpp:100 msgid "Undo Stack Size" -msgstr "" +msgstr "Stapelgröße rückgängig machen" #: src/supertux/menu/editor_menu.cpp:102 msgid "Autosave Frequency" @@ -4256,7 +4257,7 @@ msgid "" "Ctrl+D = Duplicate line\n" "Ctrl+Z = Undo\n" "Ctrl+Y = Redo" -msgstr "" +msgstr "Tastaturabkürzungen:\n---------------------\nEsc = Menü öffnen\nStrg+S = Speichern\nStrg+T = Testen\nStrg+Z = Rückgängig\nStrg+Y = Wiederholen\nF6 = Licht rendern\nF7 = Raster fangen\nF8 = Raster anzeigen\nStrg++ oder Strg+Scroll Up = Vergrößern\nStrg+- oder Strg+Scroll Down = Herauszoomen\nStrg+D = Zoom zurücksetzen\n\nSkripting-Kurzbefehle:\n------------- \nHome = Zum Anfang der Zeile gehen\nEnde = Zum Ende der Zeile gehen\nPfeil nach links = Im Text zurückgehen\nPfeil nach rechts = Im Text vorwärts gehen\nBackspace = Löschen vor dem Textcursor\nLöschen = Löschen hinter dem Textcursor\nStrg+X = Ganze Zeile ausschneiden\nStrg+C = Ganze Zeile kopieren\nStrg+V = Einfügen\nStrg+D = Zeile duplizieren\nStrg+Z = Rückgängig\nStrg+Y = Wiederholen" #: src/supertux/menu/editor_menu.cpp:232 msgid "Deprecated tiles are still present in the level." @@ -4280,11 +4281,11 @@ msgstr "Spieler entfernen" #: src/supertux/menu/multiplayer_player_menu.cpp:82 msgid "Respawn Player" -msgstr "" +msgstr "Spieler respawnen" #: src/supertux/menu/multiplayer_player_menu.cpp:108 msgid "Spawn Player" -msgstr "" +msgstr "Spieler spawnen" #: src/supertux/menu/multiplayer_player_menu.cpp:136 msgid "Controllers" @@ -4400,7 +4401,7 @@ msgstr "Bei Berührung verändern" #: src/worldmap/special_tile.hpp:36 msgid "Special Tile" -msgstr "" +msgstr "Spezielle Kacheln" #: src/worldmap/level_tile.hpp:36 src/worldmap/level_tile.cpp:161 msgid "Level" @@ -4446,7 +4447,7 @@ msgstr "Teleporter" msgid "" "This object's current functionality is deprecated.\n" "Updating to get its latest functionality is recommended." -msgstr "" +msgstr "Die aktuelle Funktionalität dieses Objekts ist veraltet.\nEs wird empfohlen, es zu aktualisieren, um seine neuesten Funktionen zu erhalten." #: src/editor/node_marker.cpp:122 msgid "Path Node" @@ -4507,19 +4508,19 @@ msgstr "ungültig" #: src/editor/object_option.cpp:665 msgid "Scale X" -msgstr "" +msgstr "X Skalierung" #: src/editor/object_option.cpp:666 msgid "Scale Y" -msgstr "" +msgstr "Y Versatz" #: src/editor/object_option.cpp:667 msgid "Offset X" -msgstr "" +msgstr "X Versatz" #: src/editor/object_option.cpp:668 msgid "Offset Y" -msgstr "" +msgstr "Y Versatz" #: src/editor/object_option.cpp:672 src/editor/object_menu.cpp:67 msgid "Remove" @@ -4619,7 +4620,7 @@ msgstr "Außerhalb-des-Bildschirm-Modus" #: src/editor/particle_editor.cpp:229 msgid "Clear" -msgstr "" +msgstr "Leeren" #: src/editor/particle_editor.cpp:245 msgid "<- General settings" @@ -4627,7 +4628,7 @@ msgstr "<- Allgemeine Einstellungen" #: src/editor/particle_editor.cpp:255 msgid "Likeliness" -msgstr "" +msgstr "Ähnlichkeit" #: src/editor/particle_editor.cpp:266 msgid "Color (RGBA)" @@ -4635,15 +4636,15 @@ msgstr "Farbe (RGBA)" #: src/editor/particle_editor.cpp:311 msgid "Scale (x, y)" -msgstr "" +msgstr "Skalierung (x, y)" #: src/editor/particle_editor.cpp:332 msgid "Hitbox scale (x, y)" -msgstr "" +msgstr "Hitbox Skalierung (x, y)" #: src/editor/particle_editor.cpp:353 msgid "Hitbox offset relative to scale" -msgstr "" +msgstr "Hitbox-Versatz relativ zur Skalierung" #: src/editor/particle_editor.cpp:372 msgid "Change texture..." @@ -4664,11 +4665,11 @@ msgid "" "This level contains deprecated tiles.\n" "It is strongly recommended to replace all deprecated tiles\n" "to avoid loss of compatibility in future versions." -msgstr "" +msgstr "Dieses Level enthält veraltete Kacheln.\nEs wird dringend empfohlen, alle veralteten Kacheln zu ersetzen, um Kompatibilitätsverluste in zukünftigen Versionen zu vermeiden." #: src/editor/editor.cpp:579 msgid "Tip: Turn on \"Show Deprecated Tiles\" from the level editor menu." -msgstr "" +msgstr "Tipp: Aktiviere die Option \"Veraltete Kacheln anzeigen\" im Menü des Leveleditors." #: src/editor/editor.cpp:626 msgid "" @@ -4684,7 +4685,7 @@ msgstr "Dieser Level enthält nicht gespeicherte Änderungen, möchtest du speic #: src/editor/editor.cpp:662 msgid "This level may contain unsaved changes, do you want to save?" -msgstr "" +msgstr "Dieses Level enthält möglicherweise ungespeicherte Änderungen. Möchtest du das Level speichern?" #: src/editor/editor.cpp:797 msgid "" @@ -4722,7 +4723,7 @@ msgstr "Konnte den »main«-Spawnpoint nicht finden.\nBitte ändere den Namen de #: src/editor/object_menu.cpp:60 msgid "Patch Notes" -msgstr "" +msgstr "Änderungsnotizen" #: src/editor/object_menu.cpp:84 msgid "" @@ -4731,7 +4732,7 @@ msgid "" "\n" "Keep in mind this is very likely to break the proper behaviour of the object.\n" "Make sure to re-check any behaviour, related to the object." -msgstr "" +msgstr "Dadurch wird das Objekt auf die neuesten Funktionen aktualisiert.\nIn den Änderungsnotizen finden Sie weitere Informationen.\n\nDenke daran, dass dies sehr wahrscheinlich das korrekte Verhalten des Objekts beeinträchtigt.\nStelle sicher, dass Sie das Verhalten des Objekts erneut überprüfen." #: src/editor/object_menu.cpp:98 #, c++-format @@ -5166,16 +5167,16 @@ msgstr "Dunklerer Wald" #: data//images/converters/data.stcd:3 msgid "Nightly Tiles" -msgstr "" +msgstr "Nächtliche Kacheln" #: data//images/converters/data.stcd:5 msgid "For levels, created in previous Nightly builds." -msgstr "" +msgstr "Für Level, die in früheren Nightly-Builds erstellt wurden." #: data//images/converters/data.stcd:8 msgid "Pre-0.6.3 Crystal Tiles" -msgstr "" +msgstr "Vor-0.6.3 Kristallkacheln" #: data//images/converters/data.stcd:10 msgid "For levels, created in pre-0.6.3 versions, which use crystal tiles." -msgstr "" +msgstr "Für Levels, die in Versionen vor pre-0.6.3 erstellt wurden, die Kristallkacheln verwenden." diff --git a/data/locale/pt_BR.po b/data/locale/pt_BR.po index f3a02e44603..ac9c59b04f6 100644 --- a/data/locale/pt_BR.po +++ b/data/locale/pt_BR.po @@ -24,7 +24,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-05-30 16:19+0200\n" "PO-Revision-Date: 2013-08-10 22:56+0000\n" -"Last-Translator: Jesusaves , 2021,2024\n" +"Last-Translator: Fúlvio Alves , 2020-2021,2023-2024\n" "Language-Team: Portuguese (Brazil) (http://app.transifex.com/arctic-games/supertux/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -47,7 +47,7 @@ msgstr "Nome" #: src/trigger/secretarea_trigger.cpp:56 msgid "Fade tilemap" -msgstr "Esmaecer mapa de telas" +msgstr "Esmaecer mapa de blocos" #: src/trigger/secretarea_trigger.cpp:57 src/trigger/climbable.cpp:59 #: src/object/infoblock.cpp:76 src/worldmap/teleporter.cpp:49 @@ -162,7 +162,7 @@ msgstr "Novo ponto de partida do mapa mundi" #: src/trigger/sequence_trigger.cpp:54 msgid "Worldmap fade tilemap" -msgstr "Esmaecer mapa de telas do mapa-múndi" +msgstr "Esmaecer mapa de blocos do mapa-múndi" #: src/trigger/sequence_trigger.cpp:55 #: src/object/custom_particle_system.cpp:430 @@ -283,7 +283,7 @@ msgstr "Gradiente" #: src/object/tilemap.hpp:58 msgid "Tilemap" -msgstr "Mapa de Pisos" +msgstr "Mapa de Blocos" #: src/object/sound_object.cpp:69 src/object/ambient_sound.cpp:85 #: src/object/sound_object.hpp:42 src/supertux/menu/options_menu.cpp:128 @@ -1441,7 +1441,7 @@ msgstr "Matiz" #: src/object/tilemap.cpp:296 src/supertux/menu/editor_tilegroup_menu.cpp:26 #: src/editor/toolbox_widget.cpp:98 msgid "Tiles" -msgstr "Pisos" +msgstr "Blocos" #: src/object/gradient.cpp:98 msgid "Primary Colour" @@ -1830,7 +1830,7 @@ msgstr "Velocidade de Perseguição" #: src/badguy/root_sapling.hpp:41 msgid "Root Sapling" -msgstr "" +msgstr "Muda de raiz" #: src/badguy/haywire.hpp:46 msgid "Haywire" @@ -1854,11 +1854,11 @@ msgstr "Abóbora" #: src/badguy/bouncing_snowball.cpp:82 msgid "Fatbat" -msgstr "" +msgstr "Morcego gordo" #: src/badguy/dive_mine.hpp:50 msgid "Dive Mine" -msgstr "" +msgstr "Mina de mergulho" #: src/badguy/granito_big.hpp:33 msgid "Big Granito" @@ -1910,7 +1910,7 @@ msgstr "Raio de Despertar" #: src/badguy/scrystallo.cpp:59 msgid "Roof-attached" -msgstr "" +msgstr "Fixado no teto" #: src/badguy/jumpy.hpp:40 msgid "Jumpy" @@ -2042,11 +2042,11 @@ msgstr "Gelo (grande)" #: src/badguy/crusher.cpp:77 msgid "Rock (normal)" -msgstr "" +msgstr "Pedra (normal)" #: src/badguy/crusher.cpp:78 msgid "Rock (big)" -msgstr "" +msgstr "Pedra (grande)" #: src/badguy/crusher.cpp:79 msgid "Corrupted (normal)" @@ -2070,7 +2070,7 @@ msgstr "Folha-Bala" #: src/badguy/fish_swimming.hpp:40 msgid "Swimming Fish" -msgstr "" +msgstr "Peixes nadando" #: src/badguy/flame.hpp:47 msgid "Flame" @@ -2082,7 +2082,7 @@ msgstr "Cristal Adormecido" #: src/badguy/jumpy.cpp:45 msgid "Wooden" -msgstr "" +msgstr "De madeira" #: src/badguy/jumpy.cpp:47 msgid "Metal" @@ -2090,7 +2090,7 @@ msgstr "Metal" #: src/badguy/jumpy.cpp:48 msgid "Bag" -msgstr "" +msgstr "Bolsa" #: src/badguy/willowisp.hpp:57 msgid "Will o' Wisp" @@ -2098,7 +2098,7 @@ msgstr "Chama Perseguidora" #: src/badguy/fish_jumping.hpp:41 msgid "Jumping Fish" -msgstr "" +msgstr "Peixe saltador" #: src/badguy/badguy.hpp:61 msgid "Badguy" @@ -2114,7 +2114,7 @@ msgstr "Espinhoso" #: src/badguy/walkingleaf.hpp:33 msgid "Walking Leaf" -msgstr "" +msgstr "Folha ambulante" #: src/badguy/root.hpp:39 msgid "Root" @@ -2138,7 +2138,7 @@ msgstr "Yeti" #: src/badguy/snowball.cpp:41 msgid "Bumpkin" -msgstr "" +msgstr "Caipira" #: src/badguy/snowball.cpp:42 msgid "BSOD" @@ -2166,7 +2166,7 @@ msgstr "Pedra Irritada" #: src/badguy/tarantula.cpp:354 msgid "Spidermite" -msgstr "" +msgstr "Ácaro-aranha" #: src/badguy/tarantula.cpp:374 msgid "Static" @@ -2186,7 +2186,7 @@ msgstr "Homem neve" #: src/badguy/viciousivy.hpp:33 msgid "Vicious Ivy" -msgstr "" +msgstr "Hera Viciosa" #: src/badguy/stalactite.cpp:156 msgid "ice" @@ -2194,11 +2194,11 @@ msgstr "gelo" #: src/badguy/stalactite.cpp:157 msgid "rock" -msgstr "" +msgstr "pedra" #: src/badguy/fish_chasing.hpp:33 msgid "Chasing Fish" -msgstr "" +msgstr "Peixe perseguidor" #: src/badguy/stumpy.hpp:38 msgid "Stumpy" @@ -2232,7 +2232,7 @@ msgstr "Máximo de badguys simultâneos" #: src/badguy/dispenser.cpp:435 msgid "Dropper" -msgstr "" +msgstr "Conta-gotas" #: src/badguy/dispenser.cpp:436 msgid "Cannon" @@ -2260,7 +2260,7 @@ msgstr "Padrão" #: src/badguy/granito_big.cpp:53 src/badguy/granito.cpp:264 msgid "Standing" -msgstr "" +msgstr "Em pé" #: src/badguy/granito_big.cpp:54 src/badguy/granito.cpp:265 msgid "Walking" @@ -2523,7 +2523,7 @@ msgstr "Não compartilhar o nome dos níveis enquanto edita" msgid "" "Enable this if you want to work on secret levels and don't want the names to" " be spoiled" -msgstr "" +msgstr "Ative isso se quiser trabalhar em níveis secretos e não quiser que os nomes sejam entregues" #: src/supertux/menu/integrations_menu.cpp:54 msgid "Enable Discord integration" @@ -2533,7 +2533,7 @@ msgstr "Ativar integração com o Discord" msgid "" "Sends information to your Discord application about what you're doing in the" " game." -msgstr "" +msgstr "Envia informações para seu aplicativo Discord sobre o que você está fazendo no jogo." #: src/supertux/menu/integrations_menu.cpp:57 msgid "Discord (disabled; not compiled)" @@ -2542,11 +2542,11 @@ msgstr "Discord (desativado; não compilado)" #: src/supertux/menu/editor_converters_menu.cpp:61 #: src/supertux/menu/editor_menu.cpp:85 msgid "Convert Tiles" -msgstr "" +msgstr "Converter blocos" #: src/supertux/menu/editor_converters_menu.cpp:64 msgid "Select Tile Conversion File" -msgstr "" +msgstr "Selecione o arquivo de conversão de bloco" #: src/supertux/menu/editor_converters_menu.cpp:72 #, c++-format @@ -2555,15 +2555,15 @@ msgstr "Por: {}" #: src/supertux/menu/editor_converters_menu.cpp:75 msgid "Convert Tiles By File" -msgstr "" +msgstr "Converter blocos por arquivo" #: src/supertux/menu/editor_converters_menu.cpp:76 msgid "Convert all tiles in the current level by a file, specified above." -msgstr "" +msgstr "Converter todos os blocos no nível atual por um arquivo, especificado acima." #: src/supertux/menu/editor_converters_menu.cpp:89 msgid "No tile conversion file selected." -msgstr "" +msgstr "Nenhum arquivo de conversão de bloco selecionado." #: src/supertux/menu/editor_converters_menu.cpp:93 msgid "" @@ -2571,7 +2571,7 @@ msgid "" "\n" "Note: This should not be ran more than once on a level.\n" "Creating a separate copy of the level is highly recommended." -msgstr "" +msgstr "Isso converterá todos os blocos no nível. Continuar?\n\nNota: Isso não deve ser executado mais de uma vez em um nível.\nÉ altamente recomendado criar uma cópia separada do nível." #: src/supertux/menu/video_system_menu.cpp:36 msgid "Select Video System" @@ -2679,11 +2679,11 @@ msgstr "Salvar" #: src/supertux/menu/multiplayer_menu.cpp:27 #: src/supertux/menu/multiplayer_players_menu.cpp:34 msgid "Multiplayer" -msgstr "" +msgstr "Multijogador" #: src/supertux/menu/multiplayer_menu.cpp:30 msgid "Auto-manage Players" -msgstr "" +msgstr "Gerenciar jogadores automaticamente" #: src/supertux/menu/multiplayer_menu.cpp:31 msgid "" @@ -4074,7 +4074,7 @@ msgstr "Nota do Nível" #: src/supertux/menu/editor_level_menu.cpp:38 msgid "Tileset" -msgstr "Blocos" +msgstr "Conjunto de blocos" #: src/supertux/menu/editor_level_menu.cpp:41 msgid "Target Time" @@ -4146,7 +4146,7 @@ msgstr "Editar Outro Mundo" #: src/supertux/menu/editor_menu.cpp:86 msgid "Convert all tiles in the level using converters." -msgstr "" +msgstr "Converter todos os blocos do nível usando conversores." #: src/supertux/menu/editor_menu.cpp:90 msgid "Grid Size" @@ -4190,21 +4190,21 @@ msgstr "Frequência de Salvamento Automático" #: src/supertux/menu/editor_menu.cpp:108 msgid "Check for Deprecated Tiles" -msgstr "" +msgstr "Verificar por blocos obsoletos" #: src/supertux/menu/editor_menu.cpp:109 msgid "Check if any deprecated tiles are currently present in the level." -msgstr "" +msgstr "Verificar se há algum bloco obsoleto presente no nível." #: src/supertux/menu/editor_menu.cpp:110 msgid "Show Deprecated Tiles" -msgstr "" +msgstr "Mostrar blocos obsoletos" #: src/supertux/menu/editor_menu.cpp:111 msgid "" "Indicate all deprecated tiles on the active tilemap, without the need of " "hovering over." -msgstr "" +msgstr "Indicar todos os blocos obsoletos no mapa de blocos ativos, sem a necessidade de passar o mouse sobre eles." #: src/supertux/menu/editor_menu.cpp:121 msgid "Exit Level Editor" @@ -4256,15 +4256,15 @@ msgstr "" #: src/supertux/menu/editor_menu.cpp:232 msgid "Deprecated tiles are still present in the level." -msgstr "" +msgstr "Blocos obsoletos ainda estão presentes no nível." #: src/supertux/menu/editor_menu.cpp:239 msgid "Do you want to show all deprecated tiles on active tilemaps?" -msgstr "" +msgstr "Você quer mostrar todos os blocos obsoletos no mapa de blocos ativos?" #: src/supertux/menu/editor_menu.cpp:246 msgid "There are no more deprecated tiles in the level!" -msgstr "" +msgstr "Não há mais blocos obsoletos no nível!" #: src/supertux/menu/multiplayer_player_menu.cpp:40 msgid "Play with the keyboard" @@ -4660,11 +4660,11 @@ msgid "" "This level contains deprecated tiles.\n" "It is strongly recommended to replace all deprecated tiles\n" "to avoid loss of compatibility in future versions." -msgstr "" +msgstr "Este nível contém blocos obsoletos.\nÉ altamente recomendado substituir todos os blocos obsoletos\npara evitar perda de compatibilidade em versões futuras." #: src/editor/editor.cpp:579 msgid "Tip: Turn on \"Show Deprecated Tiles\" from the level editor menu." -msgstr "" +msgstr "Dica: Ative \"Mostrar blocos obsoletos\" no menu do editor de níveis." #: src/editor/editor.cpp:626 msgid "" @@ -4736,7 +4736,7 @@ msgstr "" #: src/editor/overlay_widget.cpp:1062 msgid "Cannot select deprecated tiles" -msgstr "" +msgstr "Não é possível selecionar blocos obsoletos." #: src/editor/overlay_widget.cpp:1567 msgid "Autotile mode is on" @@ -5146,7 +5146,7 @@ msgstr "Miscelânea" #: data//images/tiles.strf:1342 msgid "Retro Tiles" -msgstr "" +msgstr "Blocos retrô" #: data//images/worldmap.strf:24 msgid "Water paths" @@ -5162,7 +5162,7 @@ msgstr "Floresta Escura" #: data//images/converters/data.stcd:3 msgid "Nightly Tiles" -msgstr "" +msgstr "Blocos noturnos" #: data//images/converters/data.stcd:5 msgid "For levels, created in previous Nightly builds." @@ -5170,8 +5170,8 @@ msgstr "" #: data//images/converters/data.stcd:8 msgid "Pre-0.6.3 Crystal Tiles" -msgstr "" +msgstr "Blocos de cristal pré-0.6.3" #: data//images/converters/data.stcd:10 msgid "For levels, created in pre-0.6.3 versions, which use crystal tiles." -msgstr "" +msgstr "Para níveis criados em versões anteriores à 0.6.3, que utilizam blocos de cristal." From 874cec31e7ffe924d63cb09d078addbe655e5ae3 Mon Sep 17 00:00:00 2001 From: SuperTux Bot Date: Tue, 16 Jul 2024 01:39:21 +0000 Subject: [PATCH 23/33] Update translations --- data/locale/pt_BR.po | 254 +++++++++++++++++++++---------------------- 1 file changed, 127 insertions(+), 127 deletions(-) diff --git a/data/locale/pt_BR.po b/data/locale/pt_BR.po index ac9c59b04f6..8d50567dd9b 100644 --- a/data/locale/pt_BR.po +++ b/data/locale/pt_BR.po @@ -1348,7 +1348,7 @@ msgstr "Desvanecer partícula" #: src/object/custom_particle_system.cpp:524 msgid "Delete if off-screen" -msgstr "Removê-la fora de tela" +msgstr "Excluir se estiver fora da tela" #: src/object/custom_particle_system.cpp:525 #: src/editor/particle_editor.cpp:224 @@ -2689,15 +2689,15 @@ msgstr "Gerenciar jogadores automaticamente" msgid "" "Automatically add and remove players when controllers are plugged or " "unplugged" -msgstr "" +msgstr "Adicione e remova jogadores automaticamente quando os controladores estiverem conectados ou desconectados" #: src/supertux/menu/multiplayer_menu.cpp:33 msgid "Allow Multibind" -msgstr "" +msgstr "Permitir Multibind" #: src/supertux/menu/multiplayer_menu.cpp:34 msgid "Allow binding multiple joysticks to a single player" -msgstr "" +msgstr "Permitir vincular vários joysticks a um único jogador" #: src/supertux/menu/multiplayer_menu.cpp:36 msgid "Manage Players" @@ -2725,64 +2725,64 @@ msgstr "Cada nível deve ter pelo menos um setor." #: src/supertux/menu/editor_sectors_menu.cpp:97 msgid "Do you really want to delete this sector?" -msgstr "Você realmente quer deletar este setor?" +msgstr "Você realmente quer excluir este setor?" #: src/supertux/menu/editor_sectors_menu.cpp:100 msgid "Delete sector" -msgstr "Deletar setor" +msgstr "Excluir setor" #: src/supertux/menu/custom_menu_menu.cpp:49 #: src/supertux/menu/options_menu.cpp:191 msgid "Menu Customization" -msgstr "" +msgstr "Personalização do menu" #: src/supertux/menu/custom_menu_menu.cpp:51 msgid "Menu Back Color" -msgstr "" +msgstr "Cor de fundo do menu" #: src/supertux/menu/custom_menu_menu.cpp:52 msgid "Menu Front Color" -msgstr "" +msgstr "Cor da frente do menu" #: src/supertux/menu/custom_menu_menu.cpp:53 msgid "Menu Help Back Color" -msgstr "" +msgstr "Cor de fundo do menu de ajuda" #: src/supertux/menu/custom_menu_menu.cpp:54 msgid "Menu Help Front Color" -msgstr "" +msgstr "Cor da frente do menu de ajuda" #: src/supertux/menu/custom_menu_menu.cpp:55 msgid "Label Text Color" -msgstr "" +msgstr "Cor do texto do rótulo" #: src/supertux/menu/custom_menu_menu.cpp:56 msgid "Active Text Color" -msgstr "" +msgstr "Cor de texto ativo" #: src/supertux/menu/custom_menu_menu.cpp:57 msgid "Divider Line Color" -msgstr "" +msgstr "Cor da linha divisória" #: src/supertux/menu/custom_menu_menu.cpp:58 msgid "Menu Roundness" -msgstr "" +msgstr "Redondeza do menu" #: src/supertux/menu/custom_menu_menu.cpp:60 msgid "Editor Interface Color" -msgstr "" +msgstr "Cor da interface do editor" #: src/supertux/menu/custom_menu_menu.cpp:61 msgid "Editor Hover Color" -msgstr "" +msgstr "Cor do cursor do editor" #: src/supertux/menu/custom_menu_menu.cpp:62 msgid "Editor Grab Color" -msgstr "" +msgstr "Cor de captura do editor" #: src/supertux/menu/custom_menu_menu.cpp:64 msgid "Reset to defaults" -msgstr "" +msgstr "Resetar para os padrões" #: src/supertux/menu/editor_level_select_menu.cpp:72 msgid "Empty World" @@ -2803,7 +2803,7 @@ msgstr "Criar Mapa do Mundo" #: src/supertux/menu/editor_level_select_menu.cpp:95 #: src/supertux/menu/editor_delete_level_menu.cpp:55 msgid "Delete level" -msgstr "Deletar nível" +msgstr "Excluir nível" #: src/supertux/menu/editor_level_select_menu.cpp:97 #: src/supertux/menu/editor_levelset_menu.cpp:50 @@ -2834,14 +2834,14 @@ msgstr "Um arquivo de recuperação automático foi encontrado. Você gostaria d #: src/supertux/menu/editor_level_select_menu.cpp:186 msgid "This will delete the auto-save file. Are you sure?" -msgstr "Isso irá deletar o arquivo de recuperação. Você tem certeza?" +msgstr "Isso irá excluir o arquivo de recuperação. Você tem certeza?" #: src/supertux/menu/worldmap_cheat_apply_menu.cpp:35 #: src/supertux/menu/worldmap_cheat_apply_menu.cpp:52 #: src/supertux/menu/cheat_apply_menu.cpp:33 #: src/supertux/menu/cheat_apply_menu.cpp:51 msgid "Apply cheat to player" -msgstr "" +msgstr "Aplicar truque ao jogador" #: src/supertux/menu/worldmap_cheat_apply_menu.cpp:39 #: src/supertux/menu/worldmap_cheat_apply_menu.cpp:60 @@ -2852,13 +2852,13 @@ msgstr "" #: src/supertux/menu/multiplayer_player_menu.cpp:37 #, c++-format msgid "Player {}" -msgstr "" +msgstr "Jogador {}" #: src/supertux/menu/worldmap_cheat_apply_menu.cpp:57 #: src/supertux/menu/cheat_apply_menu.cpp:36 #: src/supertux/menu/cheat_apply_menu.cpp:56 msgid "All Players" -msgstr "" +msgstr "Todos os jogadores" #: src/supertux/menu/worldmap_cheat_menu.cpp:36 #: src/supertux/menu/cheat_menu.cpp:31 @@ -2951,9 +2951,9 @@ msgstr "Escolher Mundo" #, c++-format msgid "{} level" msgid_plural "{} levels" -msgstr[0] "" -msgstr[1] "" -msgstr[2] "" +msgstr[0] "{} nível" +msgstr[1] "{} níveis" +msgstr[2] "{} níveis" #: src/supertux/menu/editor_levelset_select_menu.cpp:112 msgid "Create World" @@ -2962,12 +2962,12 @@ msgstr "Criar Mundo" #: src/supertux/menu/editor_levelset_select_menu.cpp:113 #: src/supertux/menu/editor_delete_levelset_menu.cpp:41 msgid "Delete World" -msgstr "" +msgstr "Excluir mundo" #: src/supertux/menu/options_menu.cpp:72 #: src/supertux/menu/options_select_menu.cpp:35 msgid "Locale" -msgstr "" +msgstr "Local" #: src/supertux/menu/options_menu.cpp:76 msgid "Select Language" @@ -3016,11 +3016,11 @@ msgstr "Ajustar a resolução ao tamanho do seu navegador" #: src/supertux/menu/options_menu.cpp:116 msgid "Change Video System" -msgstr "" +msgstr "Alterar sistema de vídeo" #: src/supertux/menu/options_menu.cpp:117 msgid "Change video system used to render graphics" -msgstr "" +msgstr "Alterar sistema de vídeo usado para renderizar gráficos" #: src/supertux/menu/options_menu.cpp:124 #: src/supertux/menu/options_select_menu.cpp:38 @@ -3050,15 +3050,15 @@ msgstr "Controles" #: src/supertux/menu/options_menu.cpp:151 msgid "Enable Rumbling Controllers" -msgstr "" +msgstr "Habilitar ruído de controladores" #: src/supertux/menu/options_menu.cpp:152 msgid "Enable vibrating the game controllers." -msgstr "" +msgstr "Ativar a vibração dos controles do jogo." #: src/supertux/menu/options_menu.cpp:152 msgid "This feature is currently only used in the multiplayer options menu." -msgstr "" +msgstr "Atualmente, este recurso só é usado no menu de opções de multijogador." #: src/supertux/menu/options_menu.cpp:154 #: src/supertux/menu/keyboard_menu.cpp:34 @@ -3094,11 +3094,11 @@ msgstr "Selecione um perfil para jogar" #: src/supertux/menu/options_menu.cpp:174 msgid "Multiplayer settings" -msgstr "" +msgstr "Configurações de multijogador" #: src/supertux/menu/options_menu.cpp:175 msgid "Configure settings specific to multiplayer" -msgstr "" +msgstr "Definir configurações específicas para multijogador" #: src/supertux/menu/options_menu.cpp:178 msgid "Enable transitions" @@ -3110,11 +3110,11 @@ msgstr "Habilita transições de tela e animação suavizada de menus" #: src/supertux/menu/options_menu.cpp:181 msgid "Custom title screen levels" -msgstr "" +msgstr "Telas de título de níveis personalizados" #: src/supertux/menu/options_menu.cpp:182 msgid "Allow overriding the title screen level, when loading certain worlds" -msgstr "" +msgstr "Permite a substituição da tela de título do nível ao carregar certos mundos" #: src/supertux/menu/options_menu.cpp:185 msgid "Christmas Mode" @@ -3132,7 +3132,7 @@ msgstr "Gerencia se o SuperTux deveria exibir os níveis que você joga nos perf #: src/supertux/menu/options_menu.cpp:192 msgid "Customize the appearance of the menus" -msgstr "" +msgstr "Personalizar a aparência dos menus" #: src/supertux/menu/options_menu.cpp:199 #: src/supertux/menu/options_select_menu.cpp:41 @@ -3175,7 +3175,7 @@ msgstr "Verificar por atualizações" msgid "" "Allows the game to perform checks for new SuperTux releases on startup and " "notify if any found." -msgstr "" +msgstr "Permite que o jogo execute verificações por novos lançamentos do SuperTux ao inicializar e notifique se algum for encontrado." #: src/supertux/menu/options_menu.cpp:245 #: src/supertux/menu/options_menu.cpp:288 src/supertux/direction.cpp:76 @@ -3258,7 +3258,7 @@ msgstr "Ajustar volume de música" #: src/supertux/menu/options_menu.cpp:517 msgid "On-screen controls scale" -msgstr "" +msgstr "Escala de controles na tela" #: src/supertux/menu/options_menu.cpp:638 msgid "" @@ -3269,12 +3269,12 @@ msgstr "O jogo não conseguiu detectar a resolução do seu navegador.\nIsso pro #: src/supertux/menu/editor_delete_levelset_menu.cpp:80 msgid "You cannot delete the world that you are editing" -msgstr "" +msgstr "Você não pode excluir o mundo que está editando" #: src/supertux/menu/editor_delete_levelset_menu.cpp:83 #, c++-format msgid "You are about to delete world \"{}\". Are you sure?" -msgstr "" +msgstr "Você está prestes a excluir o mundo \"{}\". Tem certeza?" #: src/supertux/menu/addon_preview_menu.cpp:82 #, c++-format @@ -3283,15 +3283,15 @@ msgstr "{} \"{}\"" #: src/supertux/menu/addon_preview_menu.cpp:87 msgid "Some information about this add-on is not available." -msgstr "" +msgstr "Algumas informações sobre este complemento não estão disponíveis." #: src/supertux/menu/addon_preview_menu.cpp:88 msgid "Perform a \"Check Online\" to try retrieving it." -msgstr "" +msgstr "Execute uma \"Verificação online\" para tentar recuperá-lo." #: src/supertux/menu/addon_preview_menu.cpp:92 msgid "No author specified." -msgstr "" +msgstr "Nenhum autor especificado." #: src/supertux/menu/addon_preview_menu.cpp:92 #, c++-format @@ -3376,14 +3376,14 @@ msgstr "\nSeu progresso não será perdido." msgid "" "NOTE: The add-on \"{}\" is a dependency of {} other installed {}.\n" "Are you sure you wish to uninstall?" -msgstr "" +msgstr "NOTA: O complemento \"{}\" é uma dependência de {} outros {} instalados.\nTem certeza de que deseja desinstalar?" #: src/supertux/menu/addon_preview_menu.cpp:246 #, c++-format msgid "" "Cannot toggle add-on \"{}\":\n" "{}" -msgstr "" +msgstr "Não é possível alternar o complemento \"{}\":\n{}" #: src/supertux/menu/addon_preview_menu.cpp:279 msgid "Fetching screenshot previews..." @@ -3518,14 +3518,14 @@ msgstr "Resetar tudo" #: src/supertux/menu/profile_menu.cpp:113 #: src/supertux/menu/profile_menu.cpp:115 msgid "Delete all" -msgstr "Deletar tudo" +msgstr "Excluir tudo" #: src/supertux/menu/profile_menu.cpp:148 #, c++-format msgid "" "This will reset all game progress on the profile \"{}\".\n" "Are you sure?" -msgstr "" +msgstr "Isso irá resetar todo o progresso do jogo no perfil \"{}\".\nTem certeza?" #: src/supertux/menu/profile_menu.cpp:157 msgid "This will reset your game progress on all profiles. Are you sure?" @@ -3536,13 +3536,13 @@ msgstr "Isso irá reiniciar o seu progresso no jogo em todos os perfis. Você te msgid "" "This will delete the profile \"{}\",\n" "including all game progress on it. Are you sure?" -msgstr "" +msgstr "Isso excluirá o perfil \"{}\",\nincluindo todo o progresso do jogo nele. Tem certeza?" #: src/supertux/menu/profile_menu.cpp:178 msgid "" "This will delete all profiles, including all game progress on them.\n" "Are you sure?" -msgstr "" +msgstr "Isso excluirá todos os perfis, incluindo todo o progresso no jogo neles.\nTem certeza?" #: src/supertux/menu/editor_levelset_menu.cpp:53 #: src/supertux/menu/editor_new_levelset_menu.cpp:35 @@ -3551,11 +3551,11 @@ msgstr "Descrição" #: src/supertux/menu/editor_levelset_menu.cpp:55 msgid "Title Screen Level" -msgstr "" +msgstr "Tela de título do nível" #: src/supertux/menu/editor_levelset_menu.cpp:56 msgid "A level to be used for the title screen, after exiting the world." -msgstr "" +msgstr "Um nível a ser usado na tela de título, depois de sair do mundo." #: src/supertux/menu/multiplayer_players_menu.cpp:46 msgid "Add Player" @@ -3571,19 +3571,19 @@ msgid "" "remove is currently in-game.\n" "\n" "Do you wish to remove them anyways?" -msgstr "" +msgstr "Aviso: O jogador que você está tentando\nremover está atualmente no jogo.\n\nVocê deseja removê-lo mesmo assim?" #: src/supertux/menu/addon_menu.cpp:68 msgid "Installed Language Packs" -msgstr "" +msgstr "Pacotes de idiomas instalados" #: src/supertux/menu/addon_menu.cpp:68 msgid "Installed Add-ons" -msgstr "" +msgstr "Complementos instalados" #: src/supertux/menu/addon_menu.cpp:76 src/supertux/menu/addon_menu.cpp:117 msgid "No language packs installed" -msgstr "" +msgstr "Nenhum pacote de idioma instalado" #: src/supertux/menu/addon_menu.cpp:76 msgid "No Add-ons installed" @@ -3592,7 +3592,7 @@ msgstr "Não há Complementos instalados" #: src/supertux/menu/addon_menu.cpp:124 #, c++-format msgid "{} {}*UPDATE*" -msgstr "" +msgstr "{} {}*ATUALIZAÇÃO*" #: src/supertux/menu/addon_menu.cpp:130 #, c++-format @@ -3601,7 +3601,7 @@ msgstr "{}{}" #: src/supertux/menu/addon_menu.cpp:140 msgid "No updates available." -msgstr "" +msgstr "Nenhuma atualização disponível." #: src/supertux/menu/addon_menu.cpp:144 #, c++-format @@ -3610,32 +3610,32 @@ msgstr "{} {} disponível" #: src/supertux/menu/addon_menu.cpp:144 msgid "update" -msgstr "" +msgstr "atualização" #: src/supertux/menu/addon_menu.cpp:144 msgid "updates" -msgstr "" +msgstr "atualizações" #: src/supertux/menu/addon_menu.cpp:146 msgid "Check for updates" -msgstr "" +msgstr "Verificar por atualizações" #: src/supertux/menu/addon_menu.cpp:150 msgid "Browse language packs" -msgstr "" +msgstr "Navegar pelos pacotes de idiomas" #: src/supertux/menu/addon_menu.cpp:150 #: src/supertux/menu/addon_browse_menu.cpp:70 msgid "Browse Add-ons" -msgstr "" +msgstr "Navegar pelos Complementos" #: src/supertux/menu/addon_menu.cpp:151 msgid "Install from file" -msgstr "" +msgstr "Instalar do arquivo" #: src/supertux/menu/addon_menu.cpp:208 msgid "Checking for updates..." -msgstr "" +msgstr "Verificando por atualizações..." #: src/supertux/menu/editor_new_levelset_menu.cpp:31 msgid "New World" @@ -3651,7 +3651,7 @@ msgstr "Modo de História" #: src/supertux/menu/addon_browse_menu.cpp:70 msgid "Browse Language Packs" -msgstr "" +msgstr "Navegar pelos pacotes de idiomas" #: src/supertux/menu/addon_browse_menu.cpp:112 #, c++-format @@ -3660,29 +3660,29 @@ msgstr "Página {}/{}" #: src/supertux/menu/addon_browse_menu.cpp:124 msgid "No new language packs available" -msgstr "" +msgstr "Nenhum novo pacote de idiomas disponível" #: src/supertux/menu/addon_browse_menu.cpp:124 msgid "No new Add-ons available" -msgstr "" +msgstr "Nenhum Complemento novo disponível" #: src/supertux/menu/addon_browse_menu.cpp:127 msgid "No language packs available" -msgstr "" +msgstr "Nenhum pacote de idiomas disponível" #: src/supertux/menu/addon_browse_menu.cpp:127 msgid "No Add-ons available" -msgstr "" +msgstr "Nenhum Complemento disponível" #: src/supertux/menu/addon_browse_menu.cpp:135 #: src/supertux/menu/addon_browse_menu.cpp:139 msgid "Previous page" -msgstr "" +msgstr "Página anterior" #: src/supertux/menu/addon_browse_menu.cpp:143 #: src/supertux/menu/addon_browse_menu.cpp:147 msgid "Next page" -msgstr "" +msgstr "Próxima página" #: src/supertux/menu/addon_browse_menu.cpp:154 msgid "Check Online (disabled)" @@ -3694,7 +3694,7 @@ msgstr "Verificar Online" #: src/supertux/menu/addon_browse_menu.cpp:195 msgid "Downloading Add-On Repository Index" -msgstr "Baixando o Índice de Complementos do Repositório" +msgstr "Baixando o índice de complementos do repositório" #: src/supertux/menu/web_asset_menu.cpp:42 msgid "New files location" @@ -3702,11 +3702,11 @@ msgstr "Localização de novos arquivos" #: src/supertux/menu/web_asset_menu.cpp:43 msgid "Add Files" -msgstr "Adicionar Arquivos" +msgstr "Adicionar arquivos" #: src/supertux/menu/web_asset_menu.cpp:44 msgid "Download Files" -msgstr "Baixar Arquivos" +msgstr "Baixar arquivos" #: src/supertux/menu/particle_editor_open.cpp:32 msgid "Load particle file" @@ -3740,15 +3740,15 @@ msgstr "Tem certeza?" #: src/supertux/menu/profile_name_menu.cpp:36 #, c++-format msgid "Rename \"{}\"" -msgstr "" +msgstr "Renomear \"{}\"" #: src/supertux/menu/profile_name_menu.cpp:36 msgid "Add profile" -msgstr "" +msgstr "Adicionar perfil" #: src/supertux/menu/profile_name_menu.cpp:40 msgid "Profile names must have a maximum of 20 characters." -msgstr "" +msgstr "O nome do perfil deve ter no máximo 20 caracteres." #: src/supertux/menu/profile_name_menu.cpp:42 msgid "Create" @@ -3758,11 +3758,11 @@ msgstr "Criar" msgid "" "Profile names must have a maximum of 20 characters.\n" "Please choose a different name." -msgstr "" +msgstr "O nome do perfil deve ter no máximo 20 caracteres.\nPor favor, escolha um nome diferente." #: src/supertux/menu/profile_name_menu.cpp:77 msgid "An error occurred while creating the profile." -msgstr "" +msgstr "Ocorreu um erro ao criar o perfil." #: src/supertux/menu/keyboard_menu.cpp:36 #: src/supertux/menu/joystick_menu.cpp:71 @@ -3965,7 +3965,7 @@ msgstr "Abortar Download" msgid "" "Error:\n" "{}" -msgstr "" +msgstr "Erro:\n{}" #: src/supertux/menu/cheat_menu.cpp:38 msgid "Bonus: Star" @@ -3981,15 +3981,15 @@ msgstr "Matar Tux" #: src/supertux/menu/cheat_menu.cpp:55 msgid "Prevent Death" -msgstr "" +msgstr "Prevenir a morte" #: src/supertux/menu/addon_file_install_menu.cpp:32 msgid "Install Add-on from file" -msgstr "" +msgstr "Instalar Complemento do arquivo" #: src/supertux/menu/addon_file_install_menu.cpp:34 msgid "Drag and drop add-on ZIP archive" -msgstr "" +msgstr "Arraste e solte o arquivo ZIP do complemento" #: src/supertux/menu/particle_editor_menu.cpp:32 msgid "Particle Editor" @@ -4158,7 +4158,7 @@ msgstr "Mostrar Grelha" #: src/supertux/menu/editor_menu.cpp:92 msgid "Grid Snapping" -msgstr "Encaixar na Grelha" +msgstr "Encaixar na grade" #: src/supertux/menu/editor_menu.cpp:93 msgid "Render Background" @@ -4178,11 +4178,11 @@ msgstr "Ativar Ajuda do Piso Automático" #: src/supertux/menu/editor_menu.cpp:97 msgid "Enable Object Undo Tracking" -msgstr "" +msgstr "Ativar rastreamento de desfazer objetos" #: src/supertux/menu/editor_menu.cpp:100 msgid "Undo Stack Size" -msgstr "" +msgstr "Desfazer tamanho da pilha" #: src/supertux/menu/editor_menu.cpp:102 msgid "Autosave Frequency" @@ -4252,7 +4252,7 @@ msgid "" "Ctrl+D = Duplicate line\n" "Ctrl+Z = Undo\n" "Ctrl+Y = Redo" -msgstr "" +msgstr "Atalhos de Teclado:\n---------------------\nEsc = Abrir menu\nCtrl+S = Salvar\nCtrl+T = Testar\nCtrl+Z = Desfazer\nCtrl+Y = Refazer\nF6 = Renderizar luz\nF7 = Encaixar na grade\nF8 = Mostrar grades\nCtrl++ ou Ctrl+Scroll Up = Aumentar o zoom\nCtrl+- ou Ctrl+Scroll Down = Reduzir o zoom\nCtrl+D = Resetar zoom\n\nAtalhos de Script:\n ------------- \nHome = Ir para o início da linha\nEnd = Ir para o fim da linha\nSeta esquerda = Voltar no texto\nSeta direita = Avançar no texto\nBackspace = Excluir na frente do cursor de texto\nDelete = Excluir atrás do cursor de texto\nCtrl+X = Cortar linha inteira\nCtrl+C = Copiar linha inteira\nCtrl+V = Colar\nCtrl+D = Duplicar linha\nCtrl+Z = Desfazer\nCtrl+Y = Refazer" #: src/supertux/menu/editor_menu.cpp:232 msgid "Deprecated tiles are still present in the level." @@ -4268,19 +4268,19 @@ msgstr "Não há mais blocos obsoletos no nível!" #: src/supertux/menu/multiplayer_player_menu.cpp:40 msgid "Play with the keyboard" -msgstr "" +msgstr "Jogar com o teclado" #: src/supertux/menu/multiplayer_player_menu.cpp:58 msgid "Remove Player" -msgstr "" +msgstr "Remover jogador" #: src/supertux/menu/multiplayer_player_menu.cpp:82 msgid "Respawn Player" -msgstr "" +msgstr "Regerar jogador" #: src/supertux/menu/multiplayer_player_menu.cpp:108 msgid "Spawn Player" -msgstr "" +msgstr "Gerar jogador" #: src/supertux/menu/multiplayer_player_menu.cpp:136 msgid "Controllers" @@ -4290,38 +4290,38 @@ msgstr "Controladores" msgid "" "This controller does not support rumbling;\n" "please check the controllers manually." -msgstr "" +msgstr "Este controlador não possui suporte a vibrações;\nverifique os controles manualmente." #: src/supertux/menu/multiplayer_player_menu.cpp:157 msgid "" "This SuperTux build does not support rumbling\n" "controllers; please check the controllers manually." -msgstr "" +msgstr "Esta compilação do SuperTux não suporta controles\ncom vibração; verifique os controles manualmente." #: src/supertux/menu/multiplayer_player_menu.cpp:184 msgid "" "This joystick does not support rumbling;\n" "please check the joysticks manually." -msgstr "" +msgstr "Este joystick não possui suporte a vibrações;\nverifique os joysticks manualmente." #: src/supertux/menu/multiplayer_player_menu.cpp:189 msgid "" "This SuperTux build does not support rumbling\n" "joysticks; please check the joysticks manually." -msgstr "" +msgstr "Esta compilação do SuperTux não suporta joysticks\ncom vibração; verifique os joysticks manualmente." #: src/supertux/menu/editor_delete_level_menu.cpp:59 msgid "No levels available" -msgstr "" +msgstr "Nenhum nível disponível" #: src/supertux/menu/editor_delete_level_menu.cpp:79 msgid "You cannot delete the level that you are editing!" -msgstr "" +msgstr "Você não pode excluir o nível que está editando!" #: src/supertux/menu/editor_delete_level_menu.cpp:82 #, c++-format msgid "You are about to delete level \"{}\". Are you sure?" -msgstr "" +msgstr "Você está prestes a excluir o nível \"{}\". Tem certeza?" #: src/supertux/levelintro.cpp:137 #, c++-format @@ -4359,7 +4359,7 @@ msgstr "Região" #: src/supertux/main.cpp:801 #, c++-format msgid "New release: SuperTux v{}!" -msgstr "" +msgstr "Novo lançamento: SuperTux v{}!" #: src/supertux/main.cpp:804 #, c++-format @@ -4368,11 +4368,11 @@ msgid "" "For more information, you can visit the SuperTux website.\n" "\n" "Do you want to visit the website now?" -msgstr "" +msgstr "Uma nova versão do SuperTux (v{}) está disponível!\nPara mais informações, você pode visitar o site do SuperTux.\n\nVocê quer visitar o site agora?" #: src/supertux/main.cpp:815 msgid "Checking for new releases..." -msgstr "" +msgstr "Verificando por novos lançamentos..." #: src/control/joystick_config.cpp:85 msgid "Joystick Mappings" @@ -4396,7 +4396,7 @@ msgstr "Alterar ao tocar" #: src/worldmap/special_tile.hpp:36 msgid "Special Tile" -msgstr "" +msgstr "Bloco especial" #: src/worldmap/level_tile.hpp:36 src/worldmap/level_tile.cpp:161 msgid "Level" @@ -4442,7 +4442,7 @@ msgstr "Tele-transportador" msgid "" "This object's current functionality is deprecated.\n" "Updating to get its latest functionality is recommended." -msgstr "" +msgstr "A funcionalidade atual deste objeto está obsoleta.\nÉ recomendável atualizar para obter sua funcionalidade mais recente." #: src/editor/node_marker.cpp:122 msgid "Path Node" @@ -4487,15 +4487,15 @@ msgstr "Circular" #: src/editor/layers_widget.cpp:331 #, c++-format msgid "Sector: {}" -msgstr "" +msgstr "Setor: {}" #: src/editor/object_option.cpp:92 msgid "true" -msgstr "sim" +msgstr "verdadeiro" #: src/editor/object_option.cpp:92 msgid "false" -msgstr "não" +msgstr "falso" #: src/editor/object_option.cpp:308 src/editor/object_option.cpp:356 msgid "invalid" @@ -4503,19 +4503,19 @@ msgstr "inválido" #: src/editor/object_option.cpp:665 msgid "Scale X" -msgstr "" +msgstr "Escala X" #: src/editor/object_option.cpp:666 msgid "Scale Y" -msgstr "" +msgstr "Escala Y" #: src/editor/object_option.cpp:667 msgid "Offset X" -msgstr "" +msgstr "Deslocamento X" #: src/editor/object_option.cpp:668 msgid "Offset Y" -msgstr "" +msgstr "Deslocamento Y" #: src/editor/object_option.cpp:672 src/editor/object_menu.cpp:67 msgid "Remove" @@ -4531,11 +4531,11 @@ msgstr "Abrir Editor de Partículas" #: src/editor/particle_editor.cpp:114 msgid "Change texture... ->" -msgstr "" +msgstr "Alterar textura... ->" #: src/editor/particle_editor.cpp:126 msgid "Max amount" -msgstr "Quantia máxima" +msgstr "Quantidade máxima" #: src/editor/particle_editor.cpp:142 msgid "Spawn anywhere" @@ -4619,27 +4619,27 @@ msgstr "Limpar" #: src/editor/particle_editor.cpp:245 msgid "<- General settings" -msgstr "" +msgstr "<- Configurações gerais" #: src/editor/particle_editor.cpp:255 msgid "Likeliness" -msgstr "" +msgstr "Probabilidade" #: src/editor/particle_editor.cpp:266 msgid "Color (RGBA)" -msgstr "" +msgstr "Cor (RGBA)" #: src/editor/particle_editor.cpp:311 msgid "Scale (x, y)" -msgstr "" +msgstr "Escala (x, y)" #: src/editor/particle_editor.cpp:332 msgid "Hitbox scale (x, y)" -msgstr "" +msgstr "Escala de hitbox (x, y)" #: src/editor/particle_editor.cpp:353 msgid "Hitbox offset relative to scale" -msgstr "" +msgstr "Deslocamento da hitbox em relação à escala" #: src/editor/particle_editor.cpp:372 msgid "Change texture..." @@ -4680,7 +4680,7 @@ msgstr "Este nível contém alterações não salvas. Gostaria de salvá-las?" #: src/editor/editor.cpp:662 msgid "This level may contain unsaved changes, do you want to save?" -msgstr "" +msgstr "Este nível pode conter alterações não salvas. Você deseja salvá-las?" #: src/editor/editor.cpp:797 msgid "" @@ -4718,7 +4718,7 @@ msgstr "Não foi possível encontrar um ponto de começo \"principal\".\nPor fav #: src/editor/object_menu.cpp:60 msgid "Patch Notes" -msgstr "" +msgstr "Notas do Patch" #: src/editor/object_menu.cpp:84 msgid "" @@ -4727,12 +4727,12 @@ msgid "" "\n" "Keep in mind this is very likely to break the proper behaviour of the object.\n" "Make sure to re-check any behaviour, related to the object." -msgstr "" +msgstr "Isso atualizará o objeto para sua funcionalidade mais recente.\nVerifique as \"Notas do Patch\" para mais informações.\n\nLembre-se de que é muito provável que isso interrompa o comportamento adequado do objeto.\nCertifique-se de verificar novamente qualquer comportamento relacionado ao objeto." #: src/editor/object_menu.cpp:98 #, c++-format msgid "Patch notes for v{}:" -msgstr "" +msgstr "Notas de patch para v{}:" #: src/editor/overlay_widget.cpp:1062 msgid "Cannot select deprecated tiles" @@ -4832,7 +4832,7 @@ msgstr "Programação, Design de Níveis" #: data//credits.stxt:138 msgid "Graphics, Story" -msgstr "Gráficos, Estória" +msgstr "Gráficos, História" #: data//credits.stxt:144 msgid "Programming, Documentation" @@ -5166,7 +5166,7 @@ msgstr "Blocos noturnos" #: data//images/converters/data.stcd:5 msgid "For levels, created in previous Nightly builds." -msgstr "" +msgstr "Para níveis criados em versões Noturnas anteriores." #: data//images/converters/data.stcd:8 msgid "Pre-0.6.3 Crystal Tiles" From 1599e9fd04a4f8dd48e4d22070ae1522bc34a693 Mon Sep 17 00:00:00 2001 From: Vankata453 <78196474+Vankata453@users.noreply.github.com> Date: Tue, 16 Jul 2024 12:39:53 +0300 Subject: [PATCH 24/33] Add `Menu::add_item(...)` template function Used for initializing and adding a `MenuItem` to the menu. Reduces code duplication with `Menu::add_*` functions. --- src/gui/menu.cpp | 155 ++++++++++++----------------------------------- src/gui/menu.hpp | 8 +++ 2 files changed, 46 insertions(+), 117 deletions(-) diff --git a/src/gui/menu.cpp b/src/gui/menu.cpp index 86aefee9acf..8c235b05dcf 100644 --- a/src/gui/menu.cpp +++ b/src/gui/menu.cpp @@ -145,110 +145,74 @@ Menu::delete_item(int pos_) ItemHorizontalLine& Menu::add_hl() { - auto item = std::make_unique(); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(); } ItemLabel& Menu::add_label(const std::string& text) { - auto item = std::make_unique(text); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text); } ItemControlField& Menu::add_controlfield(int id, const std::string& text, const std::string& mapping) { - auto item = std::make_unique(text, mapping, id); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text, mapping, id); } ItemTextField& Menu::add_textfield(const std::string& text, std::string* input, int id) { - auto item = std::make_unique(text, input, id); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text, input, id); } ItemScript& Menu::add_script(const std::string& text, std::string* script, int id) { - auto item = std::make_unique(text, script, id); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text, script, id); } ItemScriptLine& Menu::add_script_line(std::string* input, int id) { - auto item = std::make_unique(input, id); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(input, id); } ItemIntField& Menu::add_intfield(const std::string& text, int* input, int id, bool positive) { - auto item = std::make_unique(text, input, id, positive); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text, input, id, positive); } ItemFloatField& Menu::add_floatfield(const std::string& text, float* input, int id, bool positive) { - auto item = std::make_unique(text, input, id, positive); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text, input, id, positive); } ItemAction& Menu::add_entry(int id, const std::string& text) { - auto item = std::make_unique(text, id); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text, id); } ItemAction& Menu::add_entry(const std::string& text, const std::function& callback) { - auto item = std::make_unique(text, -1, callback); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text, -1, callback); } ItemInactive& Menu::add_inactive(const std::string& text, bool default_color) { - auto item = std::make_unique(text, default_color); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text, default_color); } ItemToggle& Menu::add_toggle(int id, const std::string& text, bool* toggled, bool center_text) { - auto item = std::make_unique(text, toggled, id, center_text); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text, toggled, id, center_text); } ItemToggle& @@ -257,28 +221,19 @@ Menu::add_toggle(int id, const std::string& text, const std::function& set_func, bool center_text) { - auto item = std::make_unique(text, get_func, set_func, id, center_text); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text, get_func, set_func, id, center_text); } ItemStringSelect& Menu::add_string_select(int id, const std::string& text, int* selected, const std::vector& strings) { - auto item = std::make_unique(text, strings, selected, id); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text, strings, selected, id); } ItemStringSelect& Menu::add_string_select(int id, const std::string& text, int default_item, const std::vector& strings) { - auto item = std::make_unique(text, strings, default_item, id); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text, strings, default_item, id); } ItemAction& @@ -286,118 +241,84 @@ Menu::add_file(const std::string& text, std::string* input, const std::vector& item_processor, int id) { - auto item = std::make_unique(text, id, + return add_item(text, id, [input, extensions, basedir, path_relative_to_basedir, item_processor]() { MenuManager::instance().push_menu(std::make_unique(input, extensions, basedir, path_relative_to_basedir, nullptr, item_processor)); }); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; } ItemBack& Menu::add_back(const std::string& text, int id) { - auto item = std::make_unique(text, id); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text, id); } ItemGoTo& Menu::add_submenu(const std::string& text, int submenu, int id) { - auto item = std::make_unique(text, submenu, id); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text, submenu, id); } ItemColorChannelRGBA& -Menu::add_color_channel_rgba(float* input, Color channel, int id, bool is_linear) { - auto item = std::make_unique(input, channel, id, is_linear); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; +Menu::add_color_channel_rgba(float* input, Color channel, int id, bool is_linear) +{ + return add_item(input, channel, id, is_linear); } ItemColorChannelOKLab& -Menu::add_color_channel_oklab(Color* color, int channel) { - auto item = std::make_unique(color, channel, this); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; +Menu::add_color_channel_oklab(Color* color, int channel) +{ + return add_item(color, channel, this); } ItemPaths& -Menu::add_path_settings(const std::string& text, PathObject& target, const std::string& path_ref) { - auto item = std::make_unique(text, target, path_ref); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; +Menu::add_path_settings(const std::string& text, PathObject& target, const std::string& path_ref) +{ + return add_item(text, target, path_ref); } ItemColorDisplay& -Menu::add_color_display(Color* color, int id) { - auto item = std::make_unique(color, id); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; +Menu::add_color_display(Color* color, int id) +{ + return add_item(color, id); } ItemColor& -Menu::add_color(const std::string& text, Color* color, int id) { - auto item = std::make_unique(text, color, id); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; +Menu::add_color(const std::string& text, Color* color, int id) +{ + return add_item(text, color, id); } ItemStringArray& Menu::add_string_array(const std::string& text, std::vector& items, int id) { - auto item = std::make_unique(text, items, id); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text, items, id); } ItemImages& Menu::add_images(const std::string& image_path, int max_image_width, int max_image_height, int id) { - auto item = std::make_unique(image_path, max_image_width, max_image_height, id); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(image_path, max_image_width, max_image_height, id); } ItemImages& Menu::add_images(const std::vector& image_paths, int max_image_width, int max_image_height, int id) { - auto item = std::make_unique(image_paths, max_image_width, max_image_height, id); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(image_paths, max_image_width, max_image_height, id); } ItemList& Menu::add_list(const std::string& text, const std::vector& items, std::string* value_ptr, int id) { - auto item = std::make_unique(text, items, value_ptr, id); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(text, items, value_ptr, id); } ItemHorizontalMenu& Menu::add_horizontalmenu(int id, float height, float min_item_width) { - auto item = std::make_unique(id, height, min_item_width); - auto item_ptr = item.get(); - add_item(std::move(item)); - return *item_ptr; + return add_item(id, height, min_item_width); } void diff --git a/src/gui/menu.hpp b/src/gui/menu.hpp index 954d8f188d3..0e0a1d05053 100644 --- a/src/gui/menu.hpp +++ b/src/gui/menu.hpp @@ -133,6 +133,14 @@ class Menu protected: MenuItem& add_item(std::unique_ptr menu_item); MenuItem& add_item(std::unique_ptr menu_item, int pos_); + template + T& add_item(Args&&... args) + { + auto item = std::make_unique(std::forward(args)...); + auto item_ptr = item.get(); + add_item(std::move(item)); + return *item_ptr; + } void delete_item(int pos_); /** Recalculates the width for this menu */ From 3598a8410acdb7eb4dbd28c79ff065806dc91722 Mon Sep 17 00:00:00 2001 From: Marty <85036874+MatusGuy@users.noreply.github.com> Date: Thu, 18 Jul 2024 17:29:53 +0100 Subject: [PATCH 25/33] Fix batch file misbehaving when path has spaces (#3023) --- mk/msvc/run_supertux.bat | 2 +- mk/msvc/run_supertux_portable.bat | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mk/msvc/run_supertux.bat b/mk/msvc/run_supertux.bat index d7b3ef52143..76b1744e4fd 100644 --- a/mk/msvc/run_supertux.bat +++ b/mk/msvc/run_supertux.bat @@ -1,2 +1,2 @@ @echo off -start %~dp0\bin\supertux2.exe %* +start "" "%~dp0\bin\supertux2.exe" %* diff --git a/mk/msvc/run_supertux_portable.bat b/mk/msvc/run_supertux_portable.bat index 48ffb48fbad..2e992cb9f3e 100644 --- a/mk/msvc/run_supertux_portable.bat +++ b/mk/msvc/run_supertux_portable.bat @@ -1,3 +1,3 @@ @echo off -set SUPERTUX2_USER_DIR=%~dp0\user\ -start %~dp0\bin\supertux2.exe %* +set "SUPERTUX2_USER_DIR=%~dp0\user\" +start "" "%~dp0\bin\supertux2.exe" %* From d63d4798ea028da004bafe674b21fd5433972c9e Mon Sep 17 00:00:00 2001 From: Tobias Markus Date: Fri, 19 Jul 2024 03:57:03 +0200 Subject: [PATCH 26/33] FileSystemMenu: Pass strings as references in callback function --- src/gui/menu_filesystem.cpp | 2 +- src/gui/menu_filesystem.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/menu_filesystem.cpp b/src/gui/menu_filesystem.cpp index a8708989e11..31c1e683a91 100644 --- a/src/gui/menu_filesystem.cpp +++ b/src/gui/menu_filesystem.cpp @@ -29,7 +29,7 @@ #include "util/string_util.hpp" FileSystemMenu::FileSystemMenu(std::string* filename, const std::vector& extensions, - const std::string& basedir, bool path_relative_to_basedir, std::function callback, + const std::string& basedir, bool path_relative_to_basedir, std::function callback, const std::function& item_processor) : m_filename(filename), // when a basedir is given, 'filename' is relative to basedir, so diff --git a/src/gui/menu_filesystem.hpp b/src/gui/menu_filesystem.hpp index f05f6d0794a..5143b9ce29e 100644 --- a/src/gui/menu_filesystem.hpp +++ b/src/gui/menu_filesystem.hpp @@ -23,7 +23,7 @@ class FileSystemMenu final : public Menu { public: FileSystemMenu(std::string* filename, const std::vector& extensions, - const std::string& basedir, bool path_relative_to_basedir, const std::function callback = nullptr, + const std::string& basedir, bool path_relative_to_basedir, const std::function callback = nullptr, const std::function& item_processor = {}); ~FileSystemMenu() override; @@ -41,7 +41,7 @@ class FileSystemMenu final : public Menu std::vector m_directories; std::vector m_files; bool m_path_relative_to_basedir; - std::function m_callback; + std::function m_callback; std::function m_item_processor; private: From b366b97142044ea355d2fe4d07c049e31ce04b3e Mon Sep 17 00:00:00 2001 From: Vankata453 <78196474+Vankata453@users.noreply.github.com> Date: Sat, 20 Jul 2024 16:30:00 +0300 Subject: [PATCH 27/33] Delete markers left when deleting a trigger in editor When deleting a trigger object in the editor, its resize markers were still visible. Clicking on any of them caused a game crash. They are now flushed into the sector before being checked for. --- src/editor/overlay_widget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/editor/overlay_widget.cpp b/src/editor/overlay_widget.cpp index 7cccb9628ec..6e33179d161 100644 --- a/src/editor/overlay_widget.cpp +++ b/src/editor/overlay_widget.cpp @@ -112,6 +112,7 @@ EditorOverlayWidget::delete_markers() if (m_selected_object && m_selected_object->is_valid()) m_selected_object->editor_deselect(); + sector->flush_game_objects(); // Flush any markers queued to be added for (auto& marker : sector->get_objects_by_type()) { marker.remove_me(); From fdd3ad0c97a29334dc825f85ad36e8bc7bf4f072 Mon Sep 17 00:00:00 2001 From: MatusGuy Date: Wed, 24 Jul 2024 09:27:48 +0100 Subject: [PATCH 28/33] Fix left-facing DartTrap offsetting position when activated --- src/badguy/darttrap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/badguy/darttrap.cpp b/src/badguy/darttrap.cpp index 09a23b63417..a19c756a006 100644 --- a/src/badguy/darttrap.cpp +++ b/src/badguy/darttrap.cpp @@ -49,7 +49,7 @@ DartTrap::DartTrap(const ReaderMapping& reader) : SoundManager::current()->preload("sounds/dartfire.wav"); if (m_start_dir == Direction::AUTO) { log_warning << "Setting a DartTrap's direction to AUTO is no good idea" << std::endl; } m_state = IDLE; - set_colgroup_active(COLGROUP_DISABLED); + set_group(COLGROUP_DISABLED); if (!Editor::is_active()) { if (m_initial_delay == 0) m_initial_delay = 0.1f; From 888f451691dafded70e5dfc51bd558e8a4e12cb8 Mon Sep 17 00:00:00 2001 From: Prune Juice <118036786+tylerandari13@users.noreply.github.com> Date: Thu, 25 Jul 2024 12:34:21 -0500 Subject: [PATCH 29/33] Add "Show Tile Ids In Editor" to debug menu. (#3015) A feature I've wanted for a while, and also useful to people who work on tilesets frequently. --- src/editor/tilebox.cpp | 3 ++- src/supertux/debug.cpp | 1 + src/supertux/debug.hpp | 2 ++ src/supertux/menu/debug_menu.cpp | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/editor/tilebox.cpp b/src/editor/tilebox.cpp index a5264872918..fc63e1ba612 100644 --- a/src/editor/tilebox.cpp +++ b/src/editor/tilebox.cpp @@ -22,6 +22,7 @@ #include "editor/tile_selection.hpp" #include "editor/tip.hpp" #include "supertux/colorscheme.hpp" +#include "supertux/debug.hpp" #include "supertux/gameconfig.hpp" #include "supertux/game_object_factory.hpp" #include "supertux/globals.hpp" @@ -108,7 +109,7 @@ EditorTilebox::draw_tilegroup(DrawingContext& context) auto position = get_tile_coords(pos, false); m_editor.get_tileset()->get(tile_ID).draw(context.color(), position, LAYER_GUI - 9); - if (g_config->developer_mode && m_active_tilegroup->developers_group) + if (g_config->developer_mode && (m_active_tilegroup->developers_group || g_debug.show_toolbox_tile_ids) && tile_ID != 0) { // Display tile ID on top of tile: context.color().draw_text(Resources::console_font, std::to_string(tile_ID), diff --git a/src/supertux/debug.cpp b/src/supertux/debug.cpp index 82f33215627..14f41dc11c0 100644 --- a/src/supertux/debug.cpp +++ b/src/supertux/debug.cpp @@ -25,6 +25,7 @@ Debug::Debug() : show_collision_rects(false), show_worldmap_path(false), draw_redundant_frames(false), + show_toolbox_tile_ids(false), m_use_bitmap_fonts(false), m_game_speed_multiplier(1.0f) { diff --git a/src/supertux/debug.hpp b/src/supertux/debug.hpp index 6ef8c46e784..8d49f8a8893 100644 --- a/src/supertux/debug.hpp +++ b/src/supertux/debug.hpp @@ -39,6 +39,8 @@ class Debug // vaguely measure the impact of code changes which should increase the FPS bool draw_redundant_frames; + bool show_toolbox_tile_ids; + private: /** Use old bitmap fonts instead of TTF */ bool m_use_bitmap_fonts; diff --git a/src/supertux/menu/debug_menu.cpp b/src/supertux/menu/debug_menu.cpp index 377732871c1..1461c19bb13 100644 --- a/src/supertux/menu/debug_menu.cpp +++ b/src/supertux/menu/debug_menu.cpp @@ -71,6 +71,7 @@ DebugMenu::DebugMenu() : add_toggle(-1, _("Use Bitmap Fonts"), []{ return g_debug.get_use_bitmap_fonts(); }, [](bool value){ g_debug.set_use_bitmap_fonts(value); }); + add_toggle(-1, _("Show Tile IDs in Editor Toolbox"), &g_debug.show_toolbox_tile_ids); add_entry(_("Dump Texture Cache"), []{ TextureManager::current()->debug_print(get_logging_instance()); }); add_hl(); From d6d8b2288d9378a290a00925364b7a7dbad34dde Mon Sep 17 00:00:00 2001 From: mstoeckl Date: Fri, 26 Jul 2024 19:47:11 -0400 Subject: [PATCH 30/33] Index intermediate classes of GameObjects, try two (#3009) See #2991 for details; in short, this significantly speeds up `GameObjectManager::get_objects_by_type()` and `GameObjectManager::get_object_count()`, by no longer scanning over unrelated object types. However, the first version had an issue with disappearing objects with paths when a level was being tested from the level editor (#3008). I believe it was caused by the PathObject base class not being recorded in `GameObject::get_class_types` implementations. I've updated the code to do this (and also record the other intermediate classes, TriggerBase and CollisionListener, even though those are not currently searched for.) I was able to reproduce #3008 with the old version and no longer see it with the new. --- src/badguy/angrystone.hpp | 1 + src/badguy/badguy.hpp | 1 + src/badguy/bomb.hpp | 1 + src/badguy/boss.hpp | 1 + src/badguy/bouncing_snowball.hpp | 1 + src/badguy/captainsnowball.hpp | 1 + src/badguy/corrupted_granito.hpp | 1 + src/badguy/corrupted_granito_big.hpp | 1 + src/badguy/crusher.hpp | 2 + src/badguy/crystallo.hpp | 1 + src/badguy/dart.hpp | 1 + src/badguy/darttrap.hpp | 1 + src/badguy/dispenser.hpp | 1 + src/badguy/dive_mine.hpp | 1 + src/badguy/fish_chasing.hpp | 1 + src/badguy/fish_harmless.hpp | 1 + src/badguy/fish_jumping.hpp | 1 + src/badguy/fish_swimming.hpp | 1 + src/badguy/flame.hpp | 1 + src/badguy/flyingsnowball.hpp | 1 + src/badguy/ghosttree.hpp | 1 + src/badguy/ghoul.hpp | 1 + src/badguy/goldbomb.hpp | 1 + src/badguy/granito.hpp | 1 + src/badguy/granito_big.hpp | 1 + src/badguy/granito_giant.hpp | 1 + src/badguy/haywire.hpp | 1 + src/badguy/igel.hpp | 1 + src/badguy/jumpy.hpp | 1 + src/badguy/kamikazesnowball.hpp | 2 + src/badguy/kugelblitz.hpp | 1 + src/badguy/livefire.hpp | 3 ++ src/badguy/mole.hpp | 1 + src/badguy/mole_rock.hpp | 1 + src/badguy/mrbomb.hpp | 1 + src/badguy/mriceblock.hpp | 1 + src/badguy/mrtree.hpp | 1 + src/badguy/owl.hpp | 1 + src/badguy/plant.hpp | 1 + src/badguy/rcrystallo.hpp | 1 + src/badguy/root.hpp | 1 + src/badguy/root_sapling.hpp | 1 + src/badguy/scrystallo.hpp | 1 + src/badguy/short_fuse.hpp | 1 + src/badguy/skydive.hpp | 1 + src/badguy/smartball.hpp | 1 + src/badguy/smartblock.hpp | 1 + src/badguy/snail.hpp | 1 + src/badguy/snowball.hpp | 1 + src/badguy/snowman.hpp | 1 + src/badguy/spiky.hpp | 1 + src/badguy/sspiky.hpp | 1 + src/badguy/stalactite.hpp | 1 + src/badguy/stumpy.hpp | 1 + src/badguy/tarantula.hpp | 1 + src/badguy/toad.hpp | 1 + src/badguy/totem.hpp | 1 + src/badguy/treewillowisp.hpp | 1 + src/badguy/viciousivy.hpp | 1 + src/badguy/walking_badguy.hpp | 1 + src/badguy/walking_candle.hpp | 1 + src/badguy/walkingleaf.hpp | 1 + src/badguy/willowisp.hpp | 1 + src/badguy/yeti.hpp | 2 + src/badguy/yeti_stalactite.hpp | 1 + src/badguy/zeekling.hpp | 1 + src/editor/bezier_marker.hpp | 1 + src/editor/marker_object.hpp | 1 + src/editor/node_marker.hpp | 1 + src/editor/resize_marker.hpp | 1 + src/object/ambient_light.hpp | 1 + src/object/ambient_sound.hpp | 1 + src/object/background.hpp | 1 + src/object/bicycle_platform.hpp | 2 + src/object/bigsnowball.hpp | 1 + src/object/block.hpp | 2 + src/object/bonus_block.hpp | 1 + src/object/bouncy_coin.hpp | 1 + src/object/brick.hpp | 2 + src/object/bullet.hpp | 2 + src/object/bumper.hpp | 1 + src/object/camera.hpp | 1 + src/object/candle.hpp | 1 + src/object/circleplatform.hpp | 1 + src/object/cloud_particle_system.hpp | 1 + src/object/coin.hpp | 2 + src/object/coin_explode.hpp | 1 + src/object/coin_rain.hpp | 1 + src/object/conveyor_belt.hpp | 1 + src/object/custom_particle_system.hpp | 1 + src/object/custom_particle_system_file.hpp | 1 + src/object/decal.hpp | 1 + src/object/display_effect.hpp | 1 + src/object/electrifier.hpp | 1 + src/object/endsequence.hpp | 1 + src/object/endsequence_fireworks.hpp | 1 + src/object/endsequence_walk.hpp | 1 + src/object/explosion.hpp | 1 + src/object/fallblock.hpp | 1 + src/object/falling_coin.hpp | 1 + src/object/firefly.hpp | 1 + src/object/fireworks.hpp | 1 + src/object/floating_image.hpp | 1 + src/object/floating_text.hpp | 2 + src/object/flower.hpp | 1 + src/object/ghost_particle_system.hpp | 1 + src/object/gradient.hpp | 1 + src/object/growup.hpp | 1 + src/object/hurting_platform.hpp | 1 + src/object/infoblock.hpp | 1 + src/object/invisible_block.hpp | 1 + src/object/invisible_wall.hpp | 1 + src/object/ispy.hpp | 1 + src/object/key.hpp | 1 + src/object/lantern.hpp | 1 + src/object/level_time.hpp | 1 + src/object/light.hpp | 2 + src/object/lit_object.hpp | 1 + src/object/magicblock.hpp | 1 + src/object/moving_sprite.hpp | 1 + src/object/music_object.hpp | 1 + src/object/oneup.hpp | 1 + src/object/particle_zone.hpp | 1 + src/object/particles.hpp | 1 + src/object/particlesystem.hpp | 1 + src/object/particlesystem_interactive.hpp | 1 + src/object/path_gameobject.hpp | 1 + src/object/platform.hpp | 1 + src/object/player.hpp | 1 + src/object/pneumatic_platform.hpp | 2 + src/object/powerup.hpp | 1 + src/object/pulsing_light.hpp | 1 + src/object/pushbutton.hpp | 1 + src/object/rain_particle_system.hpp | 1 + src/object/rainsplash.hpp | 1 + src/object/rock.hpp | 1 + src/object/rublight.hpp | 1 + src/object/rusty_trampoline.hpp | 1 + src/object/scripted_object.hpp | 1 + src/object/shard.hpp | 1 + src/object/smoke_cloud.hpp | 1 + src/object/snow_particle_system.hpp | 1 + src/object/sound_object.hpp | 1 + src/object/spawnpoint.hpp | 1 + src/object/specialriser.hpp | 1 + src/object/spotlight.hpp | 1 + src/object/sprite_particle.hpp | 1 + src/object/star.hpp | 1 + src/object/sticky_object.hpp | 2 + src/object/text_array_object.hpp | 1 + src/object/text_object.hpp | 1 + src/object/textscroller.hpp | 1 + src/object/thunderstorm.hpp | 1 + src/object/tilemap.hpp | 1 + src/object/torch.hpp | 1 + src/object/trampoline.hpp | 1 + src/object/unstable_tile.hpp | 1 + src/object/vertical_stripes.hpp | 2 + src/object/water_drop.hpp | 2 + src/object/weak_block.hpp | 1 + src/object/wind.hpp | 1 + src/supertux/game_object.cpp | 9 +++++ src/supertux/game_object.hpp | 22 +++++++++++ src/supertux/game_object_iterator.hpp | 44 ++++++++-------------- src/supertux/game_object_manager.cpp | 16 +++++--- src/supertux/game_object_manager.hpp | 4 +- src/supertux/moving_object.hpp | 1 + src/supertux/player_status_hud.hpp | 1 + src/trigger/climbable.hpp | 1 + src/trigger/door.hpp | 1 + src/trigger/scripttrigger.hpp | 1 + src/trigger/secretarea_trigger.hpp | 1 + src/trigger/sequence_trigger.hpp | 1 + src/trigger/switch.hpp | 1 + src/trigger/text_area.hpp | 1 + src/trigger/trigger_base.hpp | 3 ++ src/worldmap/level_tile.hpp | 1 + src/worldmap/spawn_point.hpp | 1 + src/worldmap/special_tile.hpp | 1 + src/worldmap/sprite_change.hpp | 1 + src/worldmap/teleporter.hpp | 1 + src/worldmap/tux.hpp | 1 + src/worldmap/worldmap_object.hpp | 1 + 183 files changed, 256 insertions(+), 35 deletions(-) diff --git a/src/badguy/angrystone.hpp b/src/badguy/angrystone.hpp index f5470e0aab1..fec61367164 100644 --- a/src/badguy/angrystone.hpp +++ b/src/badguy/angrystone.hpp @@ -38,6 +38,7 @@ class AngryStone final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Angry Stone"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(AngryStone)); } protected: virtual std::vector get_allowed_directions() const override; diff --git a/src/badguy/badguy.hpp b/src/badguy/badguy.hpp index 438a22ee07c..9973086c8be 100644 --- a/src/badguy/badguy.hpp +++ b/src/badguy/badguy.hpp @@ -68,6 +68,7 @@ class BadGuy : public MovingSprite, virtual std::string get_exposed_class_name() const override { return "BadGuy"; } static std::string display_name() { return _("Badguy"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Portable)).add(typeid(BadGuy)); } virtual std::string get_overlay_size() const { return "1x1"; } diff --git a/src/badguy/bomb.hpp b/src/badguy/bomb.hpp index 5b4b9e24e91..642914d57f7 100644 --- a/src/badguy/bomb.hpp +++ b/src/badguy/bomb.hpp @@ -25,6 +25,7 @@ class Bomb final : public BadGuy { public: Bomb(const Vector& pos, Direction dir, const std::string& custom_sprite = "images/creatures/mr_bomb/bomb.sprite" ); + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Bomb)); } virtual bool is_saveable() const override { return false; } diff --git a/src/badguy/boss.hpp b/src/badguy/boss.hpp index 7fa942174b8..2a891de106f 100644 --- a/src/badguy/boss.hpp +++ b/src/badguy/boss.hpp @@ -30,6 +30,7 @@ class Boss : public BadGuy virtual void draw(DrawingContext& context) override; void draw_hit_points(DrawingContext& context); virtual ObjectSettings get_settings() override; + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Boss)); } virtual bool is_flammable() const override { return false; } virtual bool is_freezable() const override { return false; } diff --git a/src/badguy/bouncing_snowball.hpp b/src/badguy/bouncing_snowball.hpp index e5cd1b9d641..fa7d44eaeac 100644 --- a/src/badguy/bouncing_snowball.hpp +++ b/src/badguy/bouncing_snowball.hpp @@ -39,6 +39,7 @@ class BouncingSnowball final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Bouncing Snowball"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(BouncingSnowball)); } virtual GameObjectTypes get_types() const override; virtual std::string get_default_sprite_name() const override; diff --git a/src/badguy/captainsnowball.hpp b/src/badguy/captainsnowball.hpp index 9a295ef56aa..70cde6961e5 100644 --- a/src/badguy/captainsnowball.hpp +++ b/src/badguy/captainsnowball.hpp @@ -31,6 +31,7 @@ class CaptainSnowball final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Captain Snowball"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(CaptainSnowball)); } virtual bool is_snipable() const override { return true; } bool might_climb(int width, int height) const; diff --git a/src/badguy/corrupted_granito.hpp b/src/badguy/corrupted_granito.hpp index fcd266f901b..977caa7848a 100644 --- a/src/badguy/corrupted_granito.hpp +++ b/src/badguy/corrupted_granito.hpp @@ -43,6 +43,7 @@ class CorruptedGranito final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Corrupted Granito"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(CorruptedGranito)); } virtual bool is_snipable() const override { return true; } virtual bool is_flammable() const override { return m_type != GRANITO; } diff --git a/src/badguy/corrupted_granito_big.hpp b/src/badguy/corrupted_granito_big.hpp index e007e35d8a4..c1723a54fd4 100644 --- a/src/badguy/corrupted_granito_big.hpp +++ b/src/badguy/corrupted_granito_big.hpp @@ -34,6 +34,7 @@ class CorruptedGranitoBig final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Corrupted Big Granito"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(CorruptedGranitoBig)); } virtual bool is_snipable() const override { return false; } virtual bool is_freezable() const override { return false; } diff --git a/src/badguy/crusher.hpp b/src/badguy/crusher.hpp index ad186509d29..a0dd52a3c91 100644 --- a/src/badguy/crusher.hpp +++ b/src/badguy/crusher.hpp @@ -70,6 +70,7 @@ class Crusher final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Crusher"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Crusher)); } virtual ObjectSettings get_settings() override; GameObjectTypes get_types() const override; @@ -115,6 +116,7 @@ class CrusherRoot : public MovingSprite { public: CrusherRoot(Vector position, Crusher::Direction direction, float delay, int layer); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(CrusherRoot)); } virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; virtual void update(float dt_sec) override; diff --git a/src/badguy/crystallo.hpp b/src/badguy/crystallo.hpp index 7389f646060..00913e7362e 100644 --- a/src/badguy/crystallo.hpp +++ b/src/badguy/crystallo.hpp @@ -32,6 +32,7 @@ class Crystallo final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Crystallo"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Crystallo)); } virtual void active_update(float dt_sec) override; virtual bool is_flammable() const override; diff --git a/src/badguy/dart.hpp b/src/badguy/dart.hpp index ae3ba35d909..e5cfc99bb58 100644 --- a/src/badguy/dart.hpp +++ b/src/badguy/dart.hpp @@ -43,6 +43,7 @@ class Dart final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Dart"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Dart)); } virtual bool is_flammable() const override; diff --git a/src/badguy/darttrap.hpp b/src/badguy/darttrap.hpp index 42bab088aa4..69ffb1aaca9 100644 --- a/src/badguy/darttrap.hpp +++ b/src/badguy/darttrap.hpp @@ -34,6 +34,7 @@ class DartTrap final : public StickyBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Dart Trap"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return StickyBadguy::get_class_types().add(typeid(DartTrap)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; diff --git a/src/badguy/dispenser.hpp b/src/badguy/dispenser.hpp index f057484e863..b5d6dedb4ca 100644 --- a/src/badguy/dispenser.hpp +++ b/src/badguy/dispenser.hpp @@ -67,6 +67,7 @@ class Dispenser final : public BadGuy virtual std::string get_exposed_class_name() const override { return "Dispenser"; } static std::string display_name() { return _("Dispenser"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Dispenser)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; diff --git a/src/badguy/dive_mine.hpp b/src/badguy/dive_mine.hpp index 7e71dec6cb1..bb4c122d583 100644 --- a/src/badguy/dive_mine.hpp +++ b/src/badguy/dive_mine.hpp @@ -49,6 +49,7 @@ class DiveMine final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Dive Mine"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(DiveMine)); } protected: virtual std::vector get_allowed_directions() const override; diff --git a/src/badguy/fish_chasing.hpp b/src/badguy/fish_chasing.hpp index a7ce8661e9c..0dcfbe7d310 100644 --- a/src/badguy/fish_chasing.hpp +++ b/src/badguy/fish_chasing.hpp @@ -33,6 +33,7 @@ class FishChasing final : public FishSwimming static std::string display_name() { return _("Chasing Fish"); } virtual std::string get_display_name() const override { return display_name(); } virtual std::string get_overlay_size() const override { return "2x2"; } + virtual GameObjectClasses get_class_types() const override { return FishSwimming::get_class_types().add(typeid(FishChasing)); } virtual ObjectSettings get_settings() override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/fish_harmless.hpp b/src/badguy/fish_harmless.hpp index 58895c3954e..fd1f777cede 100644 --- a/src/badguy/fish_harmless.hpp +++ b/src/badguy/fish_harmless.hpp @@ -29,6 +29,7 @@ class FishHarmless final : public FishSwimming virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Harmless Fish"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return FishSwimming::get_class_types().add(typeid(FishHarmless)); } virtual std::string get_overlay_size() const override { return "1x1"; } GameObjectTypes get_types() const override { return {}; } diff --git a/src/badguy/fish_jumping.hpp b/src/badguy/fish_jumping.hpp index ed97fe28182..99cf62ea851 100644 --- a/src/badguy/fish_jumping.hpp +++ b/src/badguy/fish_jumping.hpp @@ -40,6 +40,7 @@ class FishJumping final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Jumping Fish"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(FishJumping)); } protected: virtual std::vector get_allowed_directions() const override; diff --git a/src/badguy/fish_swimming.hpp b/src/badguy/fish_swimming.hpp index 5b9efe76c41..cecce233060 100644 --- a/src/badguy/fish_swimming.hpp +++ b/src/badguy/fish_swimming.hpp @@ -40,6 +40,7 @@ class FishSwimming : public BadGuy static std::string display_name() { return _("Swimming Fish"); } virtual std::string get_display_name() const override { return display_name(); } virtual std::string get_overlay_size() const override { return "2x1"; } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(FishSwimming)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; diff --git a/src/badguy/flame.hpp b/src/badguy/flame.hpp index f1dcce809c0..0b4f10aab0e 100644 --- a/src/badguy/flame.hpp +++ b/src/badguy/flame.hpp @@ -46,6 +46,7 @@ class Flame final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Flame"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Flame)); } virtual void stop_looping_sounds() override; virtual void play_looping_sounds() override; diff --git a/src/badguy/flyingsnowball.hpp b/src/badguy/flyingsnowball.hpp index 6665ce29ab6..206b9084f73 100644 --- a/src/badguy/flyingsnowball.hpp +++ b/src/badguy/flyingsnowball.hpp @@ -32,6 +32,7 @@ class FlyingSnowBall final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Flying Snowball"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(FlyingSnowBall)); } virtual bool is_snipable() const override { return true; } protected: diff --git a/src/badguy/ghosttree.hpp b/src/badguy/ghosttree.hpp index 19fac6ddf62..cd900f1de69 100644 --- a/src/badguy/ghosttree.hpp +++ b/src/badguy/ghosttree.hpp @@ -40,6 +40,7 @@ class GhostTree final : public Boss virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Ghost Tree"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Boss::get_class_types().add(typeid(GhostTree)); } virtual void on_flip(float height) override; diff --git a/src/badguy/ghoul.hpp b/src/badguy/ghoul.hpp index 4227a902d57..65d01c1af9a 100644 --- a/src/badguy/ghoul.hpp +++ b/src/badguy/ghoul.hpp @@ -30,6 +30,7 @@ class Ghoul final : public BadGuy, static std::string display_name() { return _("Ghoul"); } std::string get_class_name() const override { return class_name(); } std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(PathObject)).add(typeid(Ghoul)); } bool is_freezable() const override; bool is_flammable() const override; virtual bool is_snipable() const override { return true; } diff --git a/src/badguy/goldbomb.hpp b/src/badguy/goldbomb.hpp index c9e56f0d2a2..f33ef1bfa29 100644 --- a/src/badguy/goldbomb.hpp +++ b/src/badguy/goldbomb.hpp @@ -49,6 +49,7 @@ class GoldBomb final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Gold Bomb"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(GoldBomb)); } virtual bool is_snipable() const override { return true; } virtual void stop_looping_sounds() override; diff --git a/src/badguy/granito.hpp b/src/badguy/granito.hpp index ae4b360249b..a009a959ad8 100644 --- a/src/badguy/granito.hpp +++ b/src/badguy/granito.hpp @@ -51,6 +51,7 @@ class Granito : public WalkingBadguy virtual std::string get_exposed_class_name() const override { return "Granito"; } static std::string display_name() { return _("Granito"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Granito)); } virtual bool is_snipable() const override { return false; } virtual bool is_freezable() const override { return false; } diff --git a/src/badguy/granito_big.hpp b/src/badguy/granito_big.hpp index 44e8749b86a..7d6f6467e16 100644 --- a/src/badguy/granito_big.hpp +++ b/src/badguy/granito_big.hpp @@ -43,6 +43,7 @@ class GranitoBig final : public Granito virtual std::string get_exposed_class_name() const override { return "GranitoBig"; } static std::string display_name() { return _("Big Granito"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Granito::get_class_types().add(typeid(GranitoBig)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; diff --git a/src/badguy/granito_giant.hpp b/src/badguy/granito_giant.hpp index a3df651eab2..aebe7c34658 100644 --- a/src/badguy/granito_giant.hpp +++ b/src/badguy/granito_giant.hpp @@ -31,6 +31,7 @@ class GranitoGiant final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Giant Granito"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(GranitoGiant)); } virtual void kill_fall() override; diff --git a/src/badguy/haywire.hpp b/src/badguy/haywire.hpp index bca973206a4..e0280b8db7a 100644 --- a/src/badguy/haywire.hpp +++ b/src/badguy/haywire.hpp @@ -45,6 +45,7 @@ class Haywire final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Haywire"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Haywire)); } virtual bool is_snipable() const override { return true; } inline bool is_exploding() const { return m_is_exploding; } diff --git a/src/badguy/igel.hpp b/src/badguy/igel.hpp index 0aef788a590..70039c4f4d8 100644 --- a/src/badguy/igel.hpp +++ b/src/badguy/igel.hpp @@ -38,6 +38,7 @@ class Igel final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Igel"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Igel)); } virtual bool is_freezable() const override { return true; } virtual void unfreeze(bool melt = true) override; diff --git a/src/badguy/jumpy.hpp b/src/badguy/jumpy.hpp index 07bf84a9771..f8378833679 100644 --- a/src/badguy/jumpy.hpp +++ b/src/badguy/jumpy.hpp @@ -39,6 +39,7 @@ class Jumpy final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Jumpy"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Jumpy)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/kamikazesnowball.hpp b/src/badguy/kamikazesnowball.hpp index fdcb5da4149..1c279813740 100644 --- a/src/badguy/kamikazesnowball.hpp +++ b/src/badguy/kamikazesnowball.hpp @@ -33,6 +33,7 @@ class KamikazeSnowball : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Kamikaze Snowball"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(KamikazeSnowball)); } virtual bool is_snipable() const override { return true; } protected: @@ -63,6 +64,7 @@ class LeafShot final : public KamikazeSnowball virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Leafshot"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return KamikazeSnowball::get_class_types().add(typeid(LeafShot)); } virtual bool is_snipable() const override { return true; } diff --git a/src/badguy/kugelblitz.hpp b/src/badguy/kugelblitz.hpp index a3fee55dc97..6dea704955d 100644 --- a/src/badguy/kugelblitz.hpp +++ b/src/badguy/kugelblitz.hpp @@ -39,6 +39,7 @@ class Kugelblitz final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Kugelblitz"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Kugelblitz)); } void explode(); diff --git a/src/badguy/livefire.hpp b/src/badguy/livefire.hpp index 3eae46303c5..29331628c1f 100644 --- a/src/badguy/livefire.hpp +++ b/src/badguy/livefire.hpp @@ -37,6 +37,7 @@ class LiveFire : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Walking Flame"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(LiveFire)); } private: std::string death_sound; @@ -70,6 +71,7 @@ class LiveFireAsleep final : public LiveFire virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Sleeping Flame"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return LiveFire::get_class_types().add(typeid(LiveFireAsleep)); } private: LiveFireAsleep(const LiveFireAsleep&) = delete; @@ -88,6 +90,7 @@ class LiveFireDormant final : public LiveFire virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Dormant Flame"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return LiveFire::get_class_types().add(typeid(LiveFireDormant)); } private: LiveFireDormant(const LiveFireDormant&) = delete; diff --git a/src/badguy/mole.hpp b/src/badguy/mole.hpp index 30a8de7c5d8..07d808cf692 100644 --- a/src/badguy/mole.hpp +++ b/src/badguy/mole.hpp @@ -37,6 +37,7 @@ class Mole final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mole"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Mole)); } virtual bool is_snipable() const override { return true; } diff --git a/src/badguy/mole_rock.hpp b/src/badguy/mole_rock.hpp index b472e05bd4e..e9c378aa700 100644 --- a/src/badguy/mole_rock.hpp +++ b/src/badguy/mole_rock.hpp @@ -43,6 +43,7 @@ class MoleRock final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mole's rock"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(MoleRock)); } protected: const BadGuy* parent; /**< collisions with this BadGuy will be ignored */ diff --git a/src/badguy/mrbomb.hpp b/src/badguy/mrbomb.hpp index b4f6c221cdd..914251e92f9 100644 --- a/src/badguy/mrbomb.hpp +++ b/src/badguy/mrbomb.hpp @@ -39,6 +39,7 @@ class MrBomb final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mr. Bomb"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(MrBomb)); } virtual bool is_snipable() const override { return true; } GameObjectTypes get_types() const override; diff --git a/src/badguy/mriceblock.hpp b/src/badguy/mriceblock.hpp index b8f5ce8ee43..7b84e4ba1b5 100644 --- a/src/badguy/mriceblock.hpp +++ b/src/badguy/mriceblock.hpp @@ -48,6 +48,7 @@ class MrIceBlock : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mr. Iceblock"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(MrIceBlock)); } virtual bool is_snipable() const override { return ice_state != ICESTATE_KICKED; } virtual bool is_freezable() const override; diff --git a/src/badguy/mrtree.hpp b/src/badguy/mrtree.hpp index 24250aa09fc..21856013658 100644 --- a/src/badguy/mrtree.hpp +++ b/src/badguy/mrtree.hpp @@ -31,6 +31,7 @@ class MrTree final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mr. Tree"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(MrTree)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/owl.hpp b/src/badguy/owl.hpp index 3571d6248fd..4ec6e31584e 100644 --- a/src/badguy/owl.hpp +++ b/src/badguy/owl.hpp @@ -44,6 +44,7 @@ class Owl final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Owl"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Owl)); } virtual ObjectSettings get_settings() override; virtual bool is_snipable() const override { return true; } diff --git a/src/badguy/plant.hpp b/src/badguy/plant.hpp index 8f8136d474d..2478a12b30b 100644 --- a/src/badguy/plant.hpp +++ b/src/badguy/plant.hpp @@ -33,6 +33,7 @@ class Plant final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Plant"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Plant)); } protected: enum PlantState { diff --git a/src/badguy/rcrystallo.hpp b/src/badguy/rcrystallo.hpp index 0c6f2faedc8..b47ea645463 100644 --- a/src/badguy/rcrystallo.hpp +++ b/src/badguy/rcrystallo.hpp @@ -32,6 +32,7 @@ class RCrystallo final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Roof Crystallo"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(RCrystallo)); } virtual void active_update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/badguy/root.hpp b/src/badguy/root.hpp index c2a8903480a..ec727246773 100644 --- a/src/badguy/root.hpp +++ b/src/badguy/root.hpp @@ -38,6 +38,7 @@ class Root final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Root"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Root)); } virtual bool is_flammable() const override { return false; } virtual bool is_freezable() const override { return false; } diff --git a/src/badguy/root_sapling.hpp b/src/badguy/root_sapling.hpp index 6d30bea8c66..2de801170f8 100644 --- a/src/badguy/root_sapling.hpp +++ b/src/badguy/root_sapling.hpp @@ -40,6 +40,7 @@ class RootSapling final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Root Sapling"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(RootSapling)); } virtual void on_flip(float height) override; diff --git a/src/badguy/scrystallo.hpp b/src/badguy/scrystallo.hpp index 5761bc35667..2ac8a59cc95 100644 --- a/src/badguy/scrystallo.hpp +++ b/src/badguy/scrystallo.hpp @@ -30,6 +30,7 @@ class SCrystallo final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Sleeping Crystallo"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(SCrystallo)); } virtual void collision_solid(const CollisionHit& hit) override; virtual HitResponse collision_badguy(BadGuy& badguy, const CollisionHit& hit) override; diff --git a/src/badguy/short_fuse.hpp b/src/badguy/short_fuse.hpp index 74c80754eac..bac740e5b1c 100644 --- a/src/badguy/short_fuse.hpp +++ b/src/badguy/short_fuse.hpp @@ -29,6 +29,7 @@ class ShortFuse final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Short Fuse"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(ShortFuse)); } protected: virtual HitResponse collision_player (Player& player, const CollisionHit& hit) override; diff --git a/src/badguy/skydive.hpp b/src/badguy/skydive.hpp index dfb2b37efb9..88b1c1f441a 100644 --- a/src/badguy/skydive.hpp +++ b/src/badguy/skydive.hpp @@ -42,6 +42,7 @@ class SkyDive final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Skydive"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(SkyDive)); } virtual bool is_snipable() const override { return true; } protected: diff --git a/src/badguy/smartball.hpp b/src/badguy/smartball.hpp index 044b8564eb6..a4b5ed8ecef 100644 --- a/src/badguy/smartball.hpp +++ b/src/badguy/smartball.hpp @@ -31,6 +31,7 @@ class SmartBall final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mrs. Snowball"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(SmartBall)); } virtual bool is_snipable() const override { return true; } virtual bool is_freezable() const override; diff --git a/src/badguy/smartblock.hpp b/src/badguy/smartblock.hpp index 0b060b27e5b..6564227c8aa 100644 --- a/src/badguy/smartblock.hpp +++ b/src/badguy/smartblock.hpp @@ -29,6 +29,7 @@ class SmartBlock final : public MrIceBlock virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mrs. Iceblock"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MrIceBlock::get_class_types().add(typeid(SmartBlock)); } GameObjectTypes get_types() const override { return {}; } diff --git a/src/badguy/snail.hpp b/src/badguy/snail.hpp index a08a6040103..e77b41b2d31 100644 --- a/src/badguy/snail.hpp +++ b/src/badguy/snail.hpp @@ -42,6 +42,7 @@ class Snail final : virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Snail"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Snail)); } virtual GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/snowball.hpp b/src/badguy/snowball.hpp index 65e1a06dc29..ed0fe2433c3 100644 --- a/src/badguy/snowball.hpp +++ b/src/badguy/snowball.hpp @@ -29,6 +29,7 @@ class SnowBall final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Mr. Snowball"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(SnowBall)); } virtual bool is_snipable() const override { return true; } virtual bool is_freezable() const override; diff --git a/src/badguy/snowman.hpp b/src/badguy/snowman.hpp index 82b8b2060e9..f241643f23c 100644 --- a/src/badguy/snowman.hpp +++ b/src/badguy/snowman.hpp @@ -28,6 +28,7 @@ class Snowman final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Snowman"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Snowman)); } protected: void loose_head(); diff --git a/src/badguy/spiky.hpp b/src/badguy/spiky.hpp index 8a48a26209e..c3f95eb9e27 100644 --- a/src/badguy/spiky.hpp +++ b/src/badguy/spiky.hpp @@ -30,6 +30,7 @@ class Spiky final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Spiky"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Spiky)); } private: Spiky(const Spiky&) = delete; diff --git a/src/badguy/sspiky.hpp b/src/badguy/sspiky.hpp index 551e1b12fd8..c09f713941c 100644 --- a/src/badguy/sspiky.hpp +++ b/src/badguy/sspiky.hpp @@ -36,6 +36,7 @@ class SSpiky final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Sleeping Spiky"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(SSpiky)); } virtual void after_editor_set() override; protected: diff --git a/src/badguy/stalactite.hpp b/src/badguy/stalactite.hpp index 10f928325ed..39ad7ebb60c 100644 --- a/src/badguy/stalactite.hpp +++ b/src/badguy/stalactite.hpp @@ -41,6 +41,7 @@ class Stalactite : public StickyBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Stalactite"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return StickyBadguy::get_class_types().add(typeid(Stalactite)); } virtual ObjectSettings get_settings() override; diff --git a/src/badguy/stumpy.hpp b/src/badguy/stumpy.hpp index bfee886a51b..a46c7ff4eb2 100644 --- a/src/badguy/stumpy.hpp +++ b/src/badguy/stumpy.hpp @@ -37,6 +37,7 @@ class Stumpy final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Stumpy"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Stumpy)); } protected: enum MyState { diff --git a/src/badguy/tarantula.hpp b/src/badguy/tarantula.hpp index 5c454ab5862..52b25d40af7 100644 --- a/src/badguy/tarantula.hpp +++ b/src/badguy/tarantula.hpp @@ -38,6 +38,7 @@ class Tarantula final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Tarantula"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Tarantula)); } virtual bool is_snipable() const override; virtual GameObjectTypes get_types() const override; diff --git a/src/badguy/toad.hpp b/src/badguy/toad.hpp index e2ff16d447d..330b2c6d1b1 100644 --- a/src/badguy/toad.hpp +++ b/src/badguy/toad.hpp @@ -37,6 +37,7 @@ class Toad final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Toad"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Toad)); } virtual bool is_snipable() const override { return true; } protected: diff --git a/src/badguy/totem.hpp b/src/badguy/totem.hpp index a4fb02769cc..d7188fba479 100644 --- a/src/badguy/totem.hpp +++ b/src/badguy/totem.hpp @@ -36,6 +36,7 @@ class Totem final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Totem"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Totem)); } virtual bool is_snipable() const override { return true; } protected: diff --git a/src/badguy/treewillowisp.hpp b/src/badguy/treewillowisp.hpp index c69ab63c705..a03c9a8dc93 100644 --- a/src/badguy/treewillowisp.hpp +++ b/src/badguy/treewillowisp.hpp @@ -27,6 +27,7 @@ class TreeWillOWisp final : public BadGuy public: TreeWillOWisp(GhostTree* tree, const Vector& pos, float radius, float speed); ~TreeWillOWisp() override; + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(TreeWillOWisp)); } virtual void activate() override; virtual void active_update(float dt_sec) override; diff --git a/src/badguy/viciousivy.hpp b/src/badguy/viciousivy.hpp index 99d566eb770..b9fa837d434 100644 --- a/src/badguy/viciousivy.hpp +++ b/src/badguy/viciousivy.hpp @@ -32,6 +32,7 @@ class ViciousIvy final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Vicious Ivy"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(ViciousIvy)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/walking_badguy.hpp b/src/badguy/walking_badguy.hpp index b65537f2e0a..4e43ed62235 100644 --- a/src/badguy/walking_badguy.hpp +++ b/src/badguy/walking_badguy.hpp @@ -52,6 +52,7 @@ class WalkingBadguy : public BadGuy const std::string& walk_right_action, int layer = LAYER_OBJECTS, const std::string& light_sprite_name = "images/objects/lightmap_light/lightmap_light-medium.sprite"); + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(WalkingBadguy)); } virtual void initialize() override; virtual void active_update(float dt_sec) override; diff --git a/src/badguy/walking_candle.hpp b/src/badguy/walking_candle.hpp index d621c46b833..3dd92d626ed 100644 --- a/src/badguy/walking_candle.hpp +++ b/src/badguy/walking_candle.hpp @@ -40,6 +40,7 @@ class WalkingCandle final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Walking Candle"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(WalkingCandle)); } private: Color lightcolor; diff --git a/src/badguy/walkingleaf.hpp b/src/badguy/walkingleaf.hpp index d2204841f00..7b4cdb15958 100644 --- a/src/badguy/walkingleaf.hpp +++ b/src/badguy/walkingleaf.hpp @@ -32,6 +32,7 @@ class WalkingLeaf final : public WalkingBadguy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Walking Leaf"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(WalkingLeaf)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/badguy/willowisp.hpp b/src/badguy/willowisp.hpp index cac9ae4e368..91436301b3a 100644 --- a/src/badguy/willowisp.hpp +++ b/src/badguy/willowisp.hpp @@ -68,6 +68,7 @@ class WillOWisp final : public BadGuy, virtual std::string get_exposed_class_name() const override { return "WillOWisp"; } static std::string display_name() { return _("Will o' Wisp"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(PathObject)).add(typeid(WillOWisp)); } virtual ObjectSettings get_settings() override; virtual void move_to(const Vector& pos) override; diff --git a/src/badguy/yeti.hpp b/src/badguy/yeti.hpp index 8b98b2e9132..a3b1211ad1c 100644 --- a/src/badguy/yeti.hpp +++ b/src/badguy/yeti.hpp @@ -37,6 +37,7 @@ class Yeti final : public Boss virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Yeti"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Boss::get_class_types().add(typeid(Yeti)); } virtual ObjectSettings get_settings() override; @@ -93,6 +94,7 @@ class Yeti final : public Boss { public: SnowExplosionParticle(const Vector& pos, const Vector& velocity); + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Yeti::SnowExplosionParticle)); } }; private: diff --git a/src/badguy/yeti_stalactite.hpp b/src/badguy/yeti_stalactite.hpp index 70a4bd01460..01904f07b39 100644 --- a/src/badguy/yeti_stalactite.hpp +++ b/src/badguy/yeti_stalactite.hpp @@ -33,6 +33,7 @@ class YetiStalactite final : public Stalactite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Yeti's Stalactite"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Stalactite::get_class_types().add(typeid(YetiStalactite)); } void start_shaking(); bool is_hanging() const; diff --git a/src/badguy/zeekling.hpp b/src/badguy/zeekling.hpp index 73577595821..28efb11f88d 100644 --- a/src/badguy/zeekling.hpp +++ b/src/badguy/zeekling.hpp @@ -38,6 +38,7 @@ class Zeekling final : public BadGuy virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Zeekling"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Zeekling)); } virtual bool is_snipable() const override { return true; } private: diff --git a/src/editor/bezier_marker.hpp b/src/editor/bezier_marker.hpp index 383416bba6e..daf2e038a57 100644 --- a/src/editor/bezier_marker.hpp +++ b/src/editor/bezier_marker.hpp @@ -26,6 +26,7 @@ class BezierMarker final : public MarkerObject { public: BezierMarker(Path::Node* node, Vector* bezier_pos); + virtual GameObjectClasses get_class_types() const override { return MarkerObject::get_class_types().add(typeid(BezierMarker)); } virtual void move_to(const Vector& pos) override; virtual Vector get_point_vector() const override; diff --git a/src/editor/marker_object.hpp b/src/editor/marker_object.hpp index 03cb561d128..8341d182b79 100644 --- a/src/editor/marker_object.hpp +++ b/src/editor/marker_object.hpp @@ -28,6 +28,7 @@ class MarkerObject : public MovingObject public: MarkerObject(const Vector& pos); MarkerObject(); + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(MarkerObject)); } virtual void update(float dt_sec) override {} virtual void draw(DrawingContext& context) override; diff --git a/src/editor/node_marker.hpp b/src/editor/node_marker.hpp index 1a0f1e964bf..1014a960d35 100644 --- a/src/editor/node_marker.hpp +++ b/src/editor/node_marker.hpp @@ -25,6 +25,7 @@ class NodeMarker final : public MarkerObject { public: NodeMarker(std::vector::iterator node_iterator, size_t id_, UID before, UID after); + virtual GameObjectClasses get_class_types() const override { return MarkerObject::get_class_types().add(typeid(NodeMarker)); } virtual void move_to(const Vector& pos) override; virtual void editor_delete() override; diff --git a/src/editor/resize_marker.hpp b/src/editor/resize_marker.hpp index 5a832ae6269..ba0f16d623b 100644 --- a/src/editor/resize_marker.hpp +++ b/src/editor/resize_marker.hpp @@ -32,6 +32,7 @@ class ResizeMarker final : public MarkerObject public: ResizeMarker(MovingObject* obj, Side vert, Side horz); + virtual GameObjectClasses get_class_types() const override { return MarkerObject::get_class_types().add(typeid(ResizeMarker)); } void move_to(const Vector& pos) override; Vector get_point_vector() const override; diff --git a/src/object/ambient_light.hpp b/src/object/ambient_light.hpp index 34c4cead95e..43311a21ac2 100644 --- a/src/object/ambient_light.hpp +++ b/src/object/ambient_light.hpp @@ -37,6 +37,7 @@ class AmbientLight : public GameObject static std::string display_name() { return _("Ambient Light"); } virtual std::string get_display_name() const override { return display_name(); } virtual const std::string get_icon_path() const override { return "images/engine/editor/ambient_light.png"; } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(AmbientLight)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/ambient_sound.hpp b/src/object/ambient_sound.hpp index 43a868cf6ba..e37403f7f68 100644 --- a/src/object/ambient_sound.hpp +++ b/src/object/ambient_sound.hpp @@ -50,6 +50,7 @@ class AmbientSound final : public MovingObject static std::string display_name() { return _("Ambient Sound"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(AmbientSound)); } virtual void draw(DrawingContext& context) override; diff --git a/src/object/background.hpp b/src/object/background.hpp index d5f15247901..94bbbee5784 100644 --- a/src/object/background.hpp +++ b/src/object/background.hpp @@ -50,6 +50,7 @@ class Background final : public GameObject virtual std::string get_exposed_class_name() const override { return "Background"; } static std::string display_name() { return _("Background"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Background)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/background.png"; diff --git a/src/object/bicycle_platform.hpp b/src/object/bicycle_platform.hpp index 9df28d6c09f..fcec2c931a9 100644 --- a/src/object/bicycle_platform.hpp +++ b/src/object/bicycle_platform.hpp @@ -28,6 +28,7 @@ class BicyclePlatformChild : public MovingSprite public: BicyclePlatformChild(const ReaderMapping& reader, float angle_offset, BicyclePlatform& parent); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(BicyclePlatformChild)); } virtual void update(float dt_sec) override; virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; @@ -66,6 +67,7 @@ class BicyclePlatform final : public GameObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Bicycle Platform"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(BicyclePlatform)); } virtual ObjectSettings get_settings() override; virtual void editor_delete() override; diff --git a/src/object/bigsnowball.hpp b/src/object/bigsnowball.hpp index f22c2e5dcfe..757056f45f1 100644 --- a/src/object/bigsnowball.hpp +++ b/src/object/bigsnowball.hpp @@ -38,6 +38,7 @@ class BigSnowball final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Big Snowball"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(BigSnowball)); } private: void spawn_particles(); diff --git a/src/object/block.hpp b/src/object/block.hpp index 8e647bf4852..50345044f89 100644 --- a/src/object/block.hpp +++ b/src/object/block.hpp @@ -30,6 +30,8 @@ class Block : public MovingSprite Block(const Vector& pos, const std::string& sprite_file); Block(const ReaderMapping& mapping, const std::string& sprite_file); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Block)); } + virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/bonus_block.hpp b/src/object/bonus_block.hpp index 9b7ec20239d..924f59bc0ad 100644 --- a/src/object/bonus_block.hpp +++ b/src/object/bonus_block.hpp @@ -61,6 +61,7 @@ class BonusBlock final : public Block virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Bonus Block"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Block::get_class_types().add(typeid(BonusBlock)); } virtual ObjectSettings get_settings() override; GameObjectTypes get_types() const override; diff --git a/src/object/bouncy_coin.hpp b/src/object/bouncy_coin.hpp index 79c8099a65d..67f2a8de3c6 100644 --- a/src/object/bouncy_coin.hpp +++ b/src/object/bouncy_coin.hpp @@ -27,6 +27,7 @@ class BouncyCoin final : public GameObject public: BouncyCoin(const Vector& pos, bool emerge = false, const std::string& sprite_path = "images/objects/coin/coin.sprite"); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(BouncyCoin)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; virtual bool is_saveable() const override { diff --git a/src/object/brick.hpp b/src/object/brick.hpp index ffe8f0432c1..21803d4de37 100644 --- a/src/object/brick.hpp +++ b/src/object/brick.hpp @@ -33,6 +33,7 @@ class Brick : public Block virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Brick"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Block::get_class_types().add(typeid(Brick)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; @@ -69,6 +70,7 @@ class HeavyBrick : public Brick virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Heavy Brick"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Brick::get_class_types().add(typeid(HeavyBrick)); } GameObjectTypes get_types() const override { return {}; } diff --git a/src/object/bullet.hpp b/src/object/bullet.hpp index aefdbbbf8c4..601c35b1d0a 100644 --- a/src/object/bullet.hpp +++ b/src/object/bullet.hpp @@ -31,6 +31,8 @@ class Bullet final : public MovingObject public: Bullet(const Vector& pos, const Vector& xm, Direction dir, BonusType type, Player& player); + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Bullet)); } + virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; virtual void collision_solid(const CollisionHit& hit) override; diff --git a/src/object/bumper.hpp b/src/object/bumper.hpp index d4b6a3aab3a..536427122ac 100644 --- a/src/object/bumper.hpp +++ b/src/object/bumper.hpp @@ -37,6 +37,7 @@ class Bumper final : public StickyObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Bumper"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return StickyObject::get_class_types().add(typeid(Bumper)); } virtual void after_editor_set() override; virtual void on_flip(float height) override; diff --git a/src/object/camera.hpp b/src/object/camera.hpp index 912f40e4126..f91a9d34b32 100644 --- a/src/object/camera.hpp +++ b/src/object/camera.hpp @@ -67,6 +67,7 @@ class Camera final : public GameObject, virtual std::string get_exposed_class_name() const override { return "Camera"; } static std::string display_name() { return _("Camera"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(PathObject)).add(typeid(Camera)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/candle.hpp b/src/object/candle.hpp index 34be1323caa..cc3a4e0a833 100644 --- a/src/object/candle.hpp +++ b/src/object/candle.hpp @@ -42,6 +42,7 @@ class Candle final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "Candle"; } static std::string display_name() { return _("Candle"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Candle)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/circleplatform.hpp b/src/object/circleplatform.hpp index 11892f4b274..4da7c150726 100644 --- a/src/object/circleplatform.hpp +++ b/src/object/circleplatform.hpp @@ -34,6 +34,7 @@ class CirclePlatform : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Circular Platform"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(CirclePlatform)); } private: virtual void initialize(); diff --git a/src/object/cloud_particle_system.hpp b/src/object/cloud_particle_system.hpp index 20c1cee322d..81b49cc6c46 100644 --- a/src/object/cloud_particle_system.hpp +++ b/src/object/cloud_particle_system.hpp @@ -49,6 +49,7 @@ class CloudParticleSystem final : public ParticleSystem virtual std::string get_exposed_class_name() const override { return "CloudParticleSystem"; } static std::string display_name() { return _("Cloud Particles"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return ParticleSystem::get_class_types().add(typeid(CloudParticleSystem)); } virtual ObjectSettings get_settings() override; virtual const std::string get_icon_path() const override { diff --git a/src/object/coin.hpp b/src/object/coin.hpp index 194be61b99b..8b8bdc22967 100644 --- a/src/object/coin.hpp +++ b/src/object/coin.hpp @@ -43,6 +43,7 @@ class Coin : public MovingSprite, virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Coin"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(PathObject)).add(typeid(Coin)); } virtual ObjectSettings get_settings() override; GameObjectTypes get_types() const override; @@ -96,6 +97,7 @@ class HeavyCoin final : public Coin virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Heavy Coin"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Coin::get_class_types().add(typeid(HeavyCoin)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/coin_explode.hpp b/src/object/coin_explode.hpp index b8ec2233e8d..e7a316d4e77 100644 --- a/src/object/coin_explode.hpp +++ b/src/object/coin_explode.hpp @@ -25,6 +25,7 @@ class CoinExplode final : public GameObject public: CoinExplode(const Vector& pos, bool count_stats = true, const std::string& sprite_path = "images/objects/coin/coin.sprite"); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(CoinExplode)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; virtual bool is_saveable() const override { diff --git a/src/object/coin_rain.hpp b/src/object/coin_rain.hpp index 55a8ce5b222..df5c8ea3e5e 100644 --- a/src/object/coin_rain.hpp +++ b/src/object/coin_rain.hpp @@ -27,6 +27,7 @@ class CoinRain final : public GameObject public: CoinRain(const Vector& pos, bool emerge=false, bool count_stats = true, const std::string& sprite_path = "images/objects/coin/coin.sprite"); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(CoinRain)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; virtual bool is_saveable() const override { diff --git a/src/object/conveyor_belt.hpp b/src/object/conveyor_belt.hpp index 80eff3dec91..eb45c47e656 100644 --- a/src/object/conveyor_belt.hpp +++ b/src/object/conveyor_belt.hpp @@ -46,6 +46,7 @@ class ConveyorBelt final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "ConveyorBelt"; } static std::string display_name() { return _("Conveyor Belt"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(ConveyorBelt)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/custom_particle_system.hpp b/src/object/custom_particle_system.hpp index 427970374a6..2076a0b1716 100644 --- a/src/object/custom_particle_system.hpp +++ b/src/object/custom_particle_system.hpp @@ -53,6 +53,7 @@ class CustomParticleSystem : public ParticleSystem_Interactive virtual std::string get_exposed_class_name() const override { return "CustomParticleSystem"; } static std::string display_name() { return _("Custom Particles"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return ParticleSystem_Interactive::get_class_types().add(typeid(CustomParticleSystem)); } virtual void save(Writer& writer) override; virtual ObjectSettings get_settings() override; diff --git a/src/object/custom_particle_system_file.hpp b/src/object/custom_particle_system_file.hpp index b37a4c4cded..728852e5443 100644 --- a/src/object/custom_particle_system_file.hpp +++ b/src/object/custom_particle_system_file.hpp @@ -38,6 +38,7 @@ class CustomParticleSystemFile final : public CustomParticleSystem virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Custom Particles from file"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return CustomParticleSystem::get_class_types().add(typeid(CustomParticleSystemFile)); } virtual ObjectSettings get_settings() override; virtual const std::string get_icon_path() const override { diff --git a/src/object/decal.hpp b/src/object/decal.hpp index c8913305bad..edff1bd404a 100644 --- a/src/object/decal.hpp +++ b/src/object/decal.hpp @@ -48,6 +48,7 @@ class Decal final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "Decal"; } static std::string display_name() { return _("Decal"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Decal)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/display_effect.hpp b/src/object/display_effect.hpp index 33ef9533565..3822438cf94 100644 --- a/src/object/display_effect.hpp +++ b/src/object/display_effect.hpp @@ -34,6 +34,7 @@ class DisplayEffect final : public GameObject public: DisplayEffect(const std::string& name = ""); ~DisplayEffect() override; + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(DisplayEffect)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/electrifier.hpp b/src/object/electrifier.hpp index 9bf3dd26f2f..574e253a70f 100644 --- a/src/object/electrifier.hpp +++ b/src/object/electrifier.hpp @@ -35,6 +35,7 @@ class Electrifier final : public GameObject public: Electrifier(TileChangeMap replacements, float seconds); Electrifier(uint32_t oldtile, uint32_t newtile, float seconds); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Electrifier)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/endsequence.hpp b/src/object/endsequence.hpp index 5ccb154d6c4..2ccfbd99ba4 100644 --- a/src/object/endsequence.hpp +++ b/src/object/endsequence.hpp @@ -27,6 +27,7 @@ class EndSequence : public GameObject public: EndSequence(); ~EndSequence() override; + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(EndSequence)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/endsequence_fireworks.hpp b/src/object/endsequence_fireworks.hpp index c459e791738..7e052277b3e 100644 --- a/src/object/endsequence_fireworks.hpp +++ b/src/object/endsequence_fireworks.hpp @@ -25,6 +25,7 @@ class EndSequenceFireworks final : public EndSequence public: EndSequenceFireworks(); ~EndSequenceFireworks() override; + virtual GameObjectClasses get_class_types() const override { return EndSequence::get_class_types().add(typeid(EndSequenceFireworks)); } virtual void draw(DrawingContext& context) override; protected: diff --git a/src/object/endsequence_walk.hpp b/src/object/endsequence_walk.hpp index 8f4836cbaff..ef22d244e5b 100644 --- a/src/object/endsequence_walk.hpp +++ b/src/object/endsequence_walk.hpp @@ -25,6 +25,7 @@ class EndSequenceWalk final : public EndSequence public: EndSequenceWalk(); ~EndSequenceWalk() override; + virtual GameObjectClasses get_class_types() const override { return EndSequence::get_class_types().add(typeid(EndSequenceWalk)); } virtual void draw(DrawingContext& context) override; protected: diff --git a/src/object/explosion.hpp b/src/object/explosion.hpp index 0b7146fef81..070d3b654c2 100644 --- a/src/object/explosion.hpp +++ b/src/object/explosion.hpp @@ -34,6 +34,7 @@ class Explosion final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Explosion"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Explosion)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/fallblock.hpp b/src/object/fallblock.hpp index e6f627f2c34..202b56e5d1e 100644 --- a/src/object/fallblock.hpp +++ b/src/object/fallblock.hpp @@ -40,6 +40,7 @@ class FallBlock : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Falling Platform"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(FallBlock)); } virtual void on_flip(float height) override; diff --git a/src/object/falling_coin.hpp b/src/object/falling_coin.hpp index 5f942a33ee4..55ef3b3d3b8 100644 --- a/src/object/falling_coin.hpp +++ b/src/object/falling_coin.hpp @@ -26,6 +26,7 @@ class FallingCoin final : public GameObject { public: FallingCoin(const Vector& start_position, float x_vel); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(FallingCoin)); } virtual void draw(DrawingContext& context) override; virtual void update(float dt_sec) override; diff --git a/src/object/firefly.hpp b/src/object/firefly.hpp index 147cdb68195..55c820d6a1e 100644 --- a/src/object/firefly.hpp +++ b/src/object/firefly.hpp @@ -37,6 +37,7 @@ class Firefly final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Checkpoint"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Firefly)); } virtual ObjectSettings get_settings() override; virtual void on_flip(float height) override; diff --git a/src/object/fireworks.hpp b/src/object/fireworks.hpp index 23f45bf4263..e54bacb3ccf 100644 --- a/src/object/fireworks.hpp +++ b/src/object/fireworks.hpp @@ -26,6 +26,7 @@ class Fireworks final : public GameObject { public: Fireworks(); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Fireworks)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/floating_image.hpp b/src/object/floating_image.hpp index 59774cdc45d..a4fbec4a997 100644 --- a/src/object/floating_image.hpp +++ b/src/object/floating_image.hpp @@ -39,6 +39,7 @@ class FloatingImage final : public GameObject ~FloatingImage() override; virtual bool is_saveable() const override { return false; } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(FloatingImage)); } virtual std::string get_exposed_class_name() const override { return "FloatingImage"; } virtual void update(float dt_sec) override; diff --git a/src/object/floating_text.hpp b/src/object/floating_text.hpp index ca3c671a427..7b7d3214b13 100644 --- a/src/object/floating_text.hpp +++ b/src/object/floating_text.hpp @@ -28,6 +28,8 @@ class FloatingText final : public GameObject public: FloatingText(const Vector& pos, const std::string& text_); FloatingText(const Vector& pos, int s); // use this for score, for instance + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(FloatingText)); } + virtual bool is_saveable() const override { return false; } diff --git a/src/object/flower.hpp b/src/object/flower.hpp index 173a8d0c1e8..11427005be7 100644 --- a/src/object/flower.hpp +++ b/src/object/flower.hpp @@ -30,6 +30,7 @@ class Flower final : public MovingObject public: Flower(BonusType type, const std::string& custom_sprite = ""); + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Flower)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/ghost_particle_system.hpp b/src/object/ghost_particle_system.hpp index 8610b5b8e1f..2bedbf2d2ec 100644 --- a/src/object/ghost_particle_system.hpp +++ b/src/object/ghost_particle_system.hpp @@ -36,6 +36,7 @@ class GhostParticleSystem final : public ParticleSystem virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Ghost Particles"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return ParticleSystem::get_class_types().add(typeid(GhostParticleSystem)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/ghostparticles.png"; diff --git a/src/object/gradient.hpp b/src/object/gradient.hpp index 0c57c2a5e95..7259b25ae88 100644 --- a/src/object/gradient.hpp +++ b/src/object/gradient.hpp @@ -48,6 +48,7 @@ class Gradient final : public GameObject virtual std::string get_exposed_class_name() const override { return "Gradient"; } static std::string display_name() { return _("Gradient"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Gradient)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/gradient.png"; diff --git a/src/object/growup.hpp b/src/object/growup.hpp index 8c743cd1cd4..d779a01132f 100644 --- a/src/object/growup.hpp +++ b/src/object/growup.hpp @@ -25,6 +25,7 @@ class GrowUp final : public MovingSprite { public: GrowUp(const Vector& pos, Direction direction = Direction::RIGHT, const std::string& custom_sprite = ""); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(GrowUp)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/hurting_platform.hpp b/src/object/hurting_platform.hpp index db034f4bb66..d1fc19b8db9 100644 --- a/src/object/hurting_platform.hpp +++ b/src/object/hurting_platform.hpp @@ -30,6 +30,7 @@ class HurtingPlatform final : public Platform virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Hurting Platform"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Platform::get_class_types().add(typeid(HurtingPlatform)); } private: HurtingPlatform(const HurtingPlatform&) = delete; diff --git a/src/object/infoblock.hpp b/src/object/infoblock.hpp index a5351bfba72..9df49d85751 100644 --- a/src/object/infoblock.hpp +++ b/src/object/infoblock.hpp @@ -36,6 +36,7 @@ class InfoBlock final : public Block virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Info Block"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Block::get_class_types().add(typeid(InfoBlock)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/invisible_block.hpp b/src/object/invisible_block.hpp index ad2b63a169f..3d3ccb6c8bc 100644 --- a/src/object/invisible_block.hpp +++ b/src/object/invisible_block.hpp @@ -29,6 +29,7 @@ class InvisibleBlock final : public Block virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Invisible Block"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Block::get_class_types().add(typeid(InvisibleBlock)); } virtual void draw(DrawingContext& context) override; virtual bool collides(GameObject& other, const CollisionHit& hit) const override; diff --git a/src/object/invisible_wall.hpp b/src/object/invisible_wall.hpp index 02bddb90440..3b5ba67cec8 100644 --- a/src/object/invisible_wall.hpp +++ b/src/object/invisible_wall.hpp @@ -36,6 +36,7 @@ class InvisibleWall final : public MovingObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Invisible Wall"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(InvisibleWall)); } virtual bool has_variable_size() const override { return true; } diff --git a/src/object/ispy.hpp b/src/object/ispy.hpp index 681b005a14e..dea8674b2ce 100644 --- a/src/object/ispy.hpp +++ b/src/object/ispy.hpp @@ -34,6 +34,7 @@ class Ispy final : public StickyObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Ispy"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return StickyObject::get_class_types().add(typeid(Ispy)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/key.hpp b/src/object/key.hpp index d709020384b..81097fe9999 100644 --- a/src/object/key.hpp +++ b/src/object/key.hpp @@ -37,6 +37,7 @@ class Key final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Key"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Key)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/lantern.hpp b/src/object/lantern.hpp index 68d053cc5d4..435a1feaa02 100644 --- a/src/object/lantern.hpp +++ b/src/object/lantern.hpp @@ -37,6 +37,7 @@ class Lantern final : public Rock virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Lantern"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Rock::get_class_types().add(typeid(Lantern)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override { return {}; } diff --git a/src/object/level_time.hpp b/src/object/level_time.hpp index ee752a1a8a6..f592bdea360 100644 --- a/src/object/level_time.hpp +++ b/src/object/level_time.hpp @@ -74,6 +74,7 @@ class LevelTime final : public GameObject virtual std::string get_exposed_class_name() const override { return "LevelTime"; } static std::string display_name() { return _("Time Limit"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(LevelTime)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/light.hpp b/src/object/light.hpp index ce03309b56a..88ee82425f5 100644 --- a/src/object/light.hpp +++ b/src/object/light.hpp @@ -31,6 +31,8 @@ class Light : public GameObject return false; } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Light)); } + virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/lit_object.hpp b/src/object/lit_object.hpp index 4c326d38d9c..adddfe9d2c3 100644 --- a/src/object/lit_object.hpp +++ b/src/object/lit_object.hpp @@ -45,6 +45,7 @@ class LitObject final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "LitObject"; } static std::string display_name() { return _("Lit object"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(LitObject)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/magicblock.hpp b/src/object/magicblock.hpp index 21b1ef87d8c..91261eec774 100644 --- a/src/object/magicblock.hpp +++ b/src/object/magicblock.hpp @@ -41,6 +41,7 @@ class MagicBlock final: public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Magic Tile"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(MagicBlock)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/moving_sprite.hpp b/src/object/moving_sprite.hpp index 1f1c26323e9..b251e127587 100644 --- a/src/object/moving_sprite.hpp +++ b/src/object/moving_sprite.hpp @@ -57,6 +57,7 @@ class MovingSprite : public MovingObject static std::string class_name() { return "moving-sprite"; } virtual std::string get_class_name() const override { return class_name(); } virtual std::string get_exposed_class_name() const override { return "MovingSprite"; } + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(MovingSprite)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/music_object.hpp b/src/object/music_object.hpp index aecd6ee4305..b9c6e4c0448 100644 --- a/src/object/music_object.hpp +++ b/src/object/music_object.hpp @@ -41,6 +41,7 @@ class MusicObject : public GameObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Music"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(MusicObject)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/music.png"; } virtual ObjectSettings get_settings() override; diff --git a/src/object/oneup.hpp b/src/object/oneup.hpp index 373168fc49c..51efe40a3cc 100644 --- a/src/object/oneup.hpp +++ b/src/object/oneup.hpp @@ -25,6 +25,7 @@ class OneUp final : public MovingSprite { public: OneUp(const Vector& pos, Direction direction = Direction::RIGHT); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(OneUp)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/particle_zone.hpp b/src/object/particle_zone.hpp index dd59e6858e0..7504f30bd1c 100644 --- a/src/object/particle_zone.hpp +++ b/src/object/particle_zone.hpp @@ -37,6 +37,7 @@ class ParticleZone final : public MovingObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Particle zone"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(ParticleZone)); } virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; virtual ObjectSettings get_settings() override; diff --git a/src/object/particles.hpp b/src/object/particles.hpp index c92a2996326..1b090e82ff9 100644 --- a/src/object/particles.hpp +++ b/src/object/particles.hpp @@ -35,6 +35,7 @@ class Particles final : public GameObject const float min_initial_velocity, const float max_initial_velocity, const Vector& acceleration, int number, Color color, int size, float life_time, int drawing_layer); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Particles)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/particlesystem.hpp b/src/object/particlesystem.hpp index 239dd519d69..7f61f42c575 100644 --- a/src/object/particlesystem.hpp +++ b/src/object/particlesystem.hpp @@ -63,6 +63,7 @@ class ParticleSystem : public GameObject virtual std::string get_exposed_class_name() const override { return "ParticleSystem"; } static std::string display_name() { return _("Particle system"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(ParticleSystem)); } virtual ObjectSettings get_settings() override; /** diff --git a/src/object/particlesystem_interactive.hpp b/src/object/particlesystem_interactive.hpp index abf37cfb843..c0233f796cf 100644 --- a/src/object/particlesystem_interactive.hpp +++ b/src/object/particlesystem_interactive.hpp @@ -47,6 +47,7 @@ class ParticleSystem_Interactive : public ParticleSystem virtual std::string get_display_name() const override { return _("Interactive particle system"); } + virtual GameObjectClasses get_class_types() const override { return ParticleSystem::get_class_types().add(typeid(ParticleSystem_Interactive)); } protected: virtual int collision(Particle* particle, const Vector& movement); diff --git a/src/object/path_gameobject.hpp b/src/object/path_gameobject.hpp index 732c6f0d933..cbb7c7984cb 100644 --- a/src/object/path_gameobject.hpp +++ b/src/object/path_gameobject.hpp @@ -44,6 +44,7 @@ class PathGameObject : public GameObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Path"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(PathGameObject)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/path.png"; diff --git a/src/object/platform.hpp b/src/object/platform.hpp index 8308de5c763..7c852bc2008 100644 --- a/src/object/platform.hpp +++ b/src/object/platform.hpp @@ -53,6 +53,7 @@ class Platform : public MovingSprite, virtual std::string get_exposed_class_name() const override { return "Platform"; } static std::string display_name() { return _("Platform"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(PathObject)).add(typeid(Platform)); } virtual void editor_update() override; diff --git a/src/object/player.hpp b/src/object/player.hpp index 984dbaa5c4d..a0d901dd454 100644 --- a/src/object/player.hpp +++ b/src/object/player.hpp @@ -89,6 +89,7 @@ class Player final : public MovingObject virtual bool has_object_manager_priority() const override { return true; } virtual std::string get_exposed_class_name() const override { return "Player"; } virtual void remove_me() override; + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Player)); } int get_id() const { return m_id; } void set_id(int id); diff --git a/src/object/pneumatic_platform.hpp b/src/object/pneumatic_platform.hpp index e5859ec53e1..6af88c99d83 100644 --- a/src/object/pneumatic_platform.hpp +++ b/src/object/pneumatic_platform.hpp @@ -28,6 +28,7 @@ class PneumaticPlatformChild final : public MovingSprite public: PneumaticPlatformChild(const ReaderMapping& reader, bool left, PneumaticPlatform& parent); ~PneumaticPlatformChild() override; + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(PneumaticPlatformChild)); } virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override; virtual void update(float dt_sec) override; @@ -64,6 +65,7 @@ class PneumaticPlatform final : public GameObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Pneumatic Platform"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(PneumaticPlatform)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/powerup.hpp b/src/object/powerup.hpp index b0b9b5f8f12..b9ad6d2fd58 100644 --- a/src/object/powerup.hpp +++ b/src/object/powerup.hpp @@ -39,6 +39,7 @@ class PowerUp final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Powerup"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(PowerUp)); } std::vector get_patches() const override; virtual ObjectSettings get_settings() override; diff --git a/src/object/pulsing_light.hpp b/src/object/pulsing_light.hpp index 8e9d60cf3e3..f453aa94313 100644 --- a/src/object/pulsing_light.hpp +++ b/src/object/pulsing_light.hpp @@ -27,6 +27,7 @@ class PulsingLight final : public Light public: PulsingLight(const Vector& center, float cycle_len = 5.0, float min_alpha = 0.0, float max_alpha = 1.0, const Color& color = Color(1.0, 1.0, 1.0, 1.0)); ~PulsingLight() override; + virtual GameObjectClasses get_class_types() const override { return Light::get_class_types().add(typeid(PulsingLight)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/pushbutton.hpp b/src/object/pushbutton.hpp index dfc49e3d640..253a44a58e5 100644 --- a/src/object/pushbutton.hpp +++ b/src/object/pushbutton.hpp @@ -31,6 +31,7 @@ class PushButton final : public StickyObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Button"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return StickyObject::get_class_types().add(typeid(PushButton)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/rain_particle_system.hpp b/src/object/rain_particle_system.hpp index 5b2acd9cae4..4a6b263858c 100644 --- a/src/object/rain_particle_system.hpp +++ b/src/object/rain_particle_system.hpp @@ -48,6 +48,7 @@ class RainParticleSystem final : public ParticleSystem_Interactive virtual std::string get_exposed_class_name() const override { return "RainParticleSystem"; } static std::string display_name() { return _("Rain Particles"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return ParticleSystem_Interactive::get_class_types().add(typeid(RainParticleSystem)); } virtual ObjectSettings get_settings() override; /** diff --git a/src/object/rainsplash.hpp b/src/object/rainsplash.hpp index 86ca688d3dd..3b06bf4db6a 100644 --- a/src/object/rainsplash.hpp +++ b/src/object/rainsplash.hpp @@ -28,6 +28,7 @@ class RainSplash final : public GameObject public: RainSplash(const Vector& pos, bool vertical); ~RainSplash() override; + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(RainSplash)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/rock.hpp b/src/object/rock.hpp index c50f8ff45fb..f38b9cd7c90 100644 --- a/src/object/rock.hpp +++ b/src/object/rock.hpp @@ -39,6 +39,7 @@ class Rock : public MovingSprite, virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Rock"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Portable)).add(typeid(Rock)); } virtual ObjectSettings get_settings() override; virtual GameObjectTypes get_types() const override; diff --git a/src/object/rublight.hpp b/src/object/rublight.hpp index 0a218585745..9772dd2eda2 100644 --- a/src/object/rublight.hpp +++ b/src/object/rublight.hpp @@ -33,6 +33,7 @@ class RubLight final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Rublight"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(RubLight)); } virtual ObjectSettings get_settings() override; virtual void on_flip(float height) override; diff --git a/src/object/rusty_trampoline.hpp b/src/object/rusty_trampoline.hpp index 86e4ac4b074..590fc0d6a09 100644 --- a/src/object/rusty_trampoline.hpp +++ b/src/object/rusty_trampoline.hpp @@ -39,6 +39,7 @@ class RustyTrampoline final : public Rock virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Rusty Trampoline"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Rock::get_class_types().add(typeid(RustyTrampoline)); } virtual ObjectSettings get_settings() override; GameObjectTypes get_types() const override { return {}; } diff --git a/src/object/scripted_object.hpp b/src/object/scripted_object.hpp index 5465f78d210..920a09d9874 100644 --- a/src/object/scripted_object.hpp +++ b/src/object/scripted_object.hpp @@ -45,6 +45,7 @@ class ScriptedObject final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "ScriptedObject"; } static std::string display_name() { return _("Scripted Object"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(ScriptedObject)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/shard.hpp b/src/object/shard.hpp index 7d3c89579ff..57c461ae7a5 100644 --- a/src/object/shard.hpp +++ b/src/object/shard.hpp @@ -34,6 +34,7 @@ class Shard final : public StickyObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Shard"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return StickyObject::get_class_types().add(typeid(Shard)); } protected: Physic m_physic; diff --git a/src/object/smoke_cloud.hpp b/src/object/smoke_cloud.hpp index 6c3b1ef47ea..4eedf2a7955 100644 --- a/src/object/smoke_cloud.hpp +++ b/src/object/smoke_cloud.hpp @@ -26,6 +26,7 @@ class SmokeCloud final : public GameObject { public: SmokeCloud(const Vector& pos); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(SmokeCloud)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/snow_particle_system.hpp b/src/object/snow_particle_system.hpp index 6b608ab27fe..854962b8fd2 100644 --- a/src/object/snow_particle_system.hpp +++ b/src/object/snow_particle_system.hpp @@ -36,6 +36,7 @@ class SnowParticleSystem final : public ParticleSystem virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Snow Particles"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return ParticleSystem::get_class_types().add(typeid(SnowParticleSystem)); } virtual ObjectSettings get_settings() override; virtual const std::string get_icon_path() const override diff --git a/src/object/sound_object.hpp b/src/object/sound_object.hpp index c2ef56791ee..b636843a03a 100644 --- a/src/object/sound_object.hpp +++ b/src/object/sound_object.hpp @@ -40,6 +40,7 @@ class SoundObject final : public GameObject virtual std::string get_exposed_class_name() const override { return "SoundObject"; } static std::string display_name() { return _("Sound"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(SoundObject)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/sound.png"; } virtual ObjectSettings get_settings() override; diff --git a/src/object/spawnpoint.hpp b/src/object/spawnpoint.hpp index 6a6c22185d3..a2e12ba57a0 100644 --- a/src/object/spawnpoint.hpp +++ b/src/object/spawnpoint.hpp @@ -47,6 +47,7 @@ class SpawnPointMarker final : public MovingObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Spawnpoint"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(SpawnPointMarker)); } virtual ObjectSettings get_settings() override; virtual int get_layer() const override { return LAYER_FOREGROUND1; } diff --git a/src/object/specialriser.hpp b/src/object/specialriser.hpp index 2e4248708f7..7eb546f66b7 100644 --- a/src/object/specialriser.hpp +++ b/src/object/specialriser.hpp @@ -27,6 +27,7 @@ class SpecialRiser final : public MovingObject { public: SpecialRiser(const Vector& pos, std::unique_ptr child, bool is_solid = false); + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(SpecialRiser)); } virtual bool is_saveable() const override { return false; } diff --git a/src/object/spotlight.hpp b/src/object/spotlight.hpp index 1f2c9422542..c214080c4b5 100644 --- a/src/object/spotlight.hpp +++ b/src/object/spotlight.hpp @@ -58,6 +58,7 @@ class Spotlight final : public MovingObject virtual std::string get_exposed_class_name() const override { return "Spotlight"; } static std::string display_name() { return _("Spotlight"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Spotlight)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/sprite_particle.hpp b/src/object/sprite_particle.hpp index 44bd77c841b..ae5dad30dfc 100644 --- a/src/object/sprite_particle.hpp +++ b/src/object/sprite_particle.hpp @@ -37,6 +37,7 @@ class SpriteParticle final : public GameObject const Vector& position, AnchorPoint anchor, const Vector& velocity, const Vector& acceleration, int drawing_layer = LAYER_OBJECTS-1, bool notimeout = false, Color color = Color::WHITE); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(SpriteParticle)); } ~SpriteParticle() override; protected: diff --git a/src/object/star.hpp b/src/object/star.hpp index 808ddf8052a..f019757707b 100644 --- a/src/object/star.hpp +++ b/src/object/star.hpp @@ -26,6 +26,7 @@ class Star final : public MovingSprite { public: Star(const Vector& pos, Direction direction = Direction::RIGHT, const std::string& custom_sprite = ""); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Star)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/object/sticky_object.hpp b/src/object/sticky_object.hpp index b276dfa5a36..13c7ed61316 100644 --- a/src/object/sticky_object.hpp +++ b/src/object/sticky_object.hpp @@ -31,6 +31,7 @@ class StickyObject : public MovingSprite int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); StickyObject(const ReaderMapping& reader, const std::string& sprite_name, int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(StickyObject)); } virtual void update(float dt_sec) override; @@ -80,6 +81,7 @@ class StickyBadguy : public BadGuy int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); StickyBadguy(const ReaderMapping& reader, const std::string& sprite_name, int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); + virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(StickyBadguy)); } virtual void sticky_update(float dt_sec); diff --git a/src/object/text_array_object.hpp b/src/object/text_array_object.hpp index bfbd8320ea6..81f49a68750 100644 --- a/src/object/text_array_object.hpp +++ b/src/object/text_array_object.hpp @@ -56,6 +56,7 @@ class TextArrayObject final : public GameObject virtual std::string get_exposed_class_name() const override { return "TextArrayObject"; } static std::string display_name() { return _("Text array"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(TextArrayObject)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/textarray.png"; diff --git a/src/object/text_object.hpp b/src/object/text_object.hpp index 33396c4cc33..70184ea3a56 100644 --- a/src/object/text_object.hpp +++ b/src/object/text_object.hpp @@ -51,6 +51,7 @@ class TextObject final : public GameObject virtual std::string get_exposed_class_name() const override { return "TextObject"; } static std::string display_name() { return _("Text"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(TextObject)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/textarray.png"; } diff --git a/src/object/textscroller.hpp b/src/object/textscroller.hpp index 1a15e5ae30c..d484c4fe78b 100644 --- a/src/object/textscroller.hpp +++ b/src/object/textscroller.hpp @@ -44,6 +44,7 @@ class TextScroller : public GameObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Text Scroller"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(TextScroller)); } virtual const std::string get_icon_path() const override { return "images/engine/editor/textscroller.png"; } void set_default_speed(float default_speed); diff --git a/src/object/thunderstorm.hpp b/src/object/thunderstorm.hpp index 0c888df48e1..50b71184a71 100644 --- a/src/object/thunderstorm.hpp +++ b/src/object/thunderstorm.hpp @@ -51,6 +51,7 @@ class Thunderstorm final : public GameObject virtual std::string get_exposed_class_name() const override { return "Thunderstorm"; } static std::string display_name() { return _("Thunderstorm"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Thunderstorm)); } virtual ObjectSettings get_settings() override; diff --git a/src/object/tilemap.hpp b/src/object/tilemap.hpp index 332b52c3ec2..29e000c3b14 100644 --- a/src/object/tilemap.hpp +++ b/src/object/tilemap.hpp @@ -65,6 +65,7 @@ class TileMap final : public GameObject, virtual const std::string get_icon_path() const override { return "images/engine/editor/tilemap.png"; } static std::string display_name() { return _("Tilemap"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(PathObject)).add(typeid(TileMap)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/torch.hpp b/src/object/torch.hpp index ea24ad4ac41..377f5ae6d38 100644 --- a/src/object/torch.hpp +++ b/src/object/torch.hpp @@ -46,6 +46,7 @@ class Torch final : public MovingSprite virtual std::string get_exposed_class_name() const override { return "Torch"; } static std::string display_name() { return _("Torch"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Torch)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/object/trampoline.hpp b/src/object/trampoline.hpp index 910fa118258..29b6cfebfb5 100644 --- a/src/object/trampoline.hpp +++ b/src/object/trampoline.hpp @@ -36,6 +36,7 @@ class Trampoline final : public Rock virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Trampoline"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return Rock::get_class_types().add(typeid(Trampoline)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/object/unstable_tile.hpp b/src/object/unstable_tile.hpp index b5af23dd308..313a226ece1 100644 --- a/src/object/unstable_tile.hpp +++ b/src/object/unstable_tile.hpp @@ -41,6 +41,7 @@ class UnstableTile final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Unstable Tile"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(UnstableTile)); } GameObjectTypes get_types() const override; std::string get_default_sprite_name() const override; diff --git a/src/object/vertical_stripes.hpp b/src/object/vertical_stripes.hpp index 79535fda9ac..b789d754af3 100644 --- a/src/object/vertical_stripes.hpp +++ b/src/object/vertical_stripes.hpp @@ -28,6 +28,8 @@ class VerticalStripes final : public GameObject VerticalStripes(); ~VerticalStripes() override; + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(VerticalStripes)); } + virtual bool is_singleton() const override { return true; } virtual bool is_saveable() const override { return false; } virtual void update(float dt_sec) override; diff --git a/src/object/water_drop.hpp b/src/object/water_drop.hpp index 5f7cd70eedd..0949b7f83fd 100644 --- a/src/object/water_drop.hpp +++ b/src/object/water_drop.hpp @@ -27,6 +27,8 @@ class WaterDrop final : public MovingSprite public: WaterDrop(const Vector& pos, const std::string& sprite_path_, const Vector& velocity); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(WaterDrop)); } + virtual void update(float dt_sec) override; virtual void collision_solid(const CollisionHit& hit) override; virtual HitResponse collision(GameObject& other, const CollisionHit& ) override; diff --git a/src/object/weak_block.hpp b/src/object/weak_block.hpp index 865c97e9a99..8c9f5724f54 100644 --- a/src/object/weak_block.hpp +++ b/src/object/weak_block.hpp @@ -35,6 +35,7 @@ class WeakBlock final : public MovingSprite virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Weak Tile"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(WeakBlock)); } std::vector get_patches() const override; void update_version() override; diff --git a/src/object/wind.hpp b/src/object/wind.hpp index cfc7fe53220..787850a70cb 100644 --- a/src/object/wind.hpp +++ b/src/object/wind.hpp @@ -42,6 +42,7 @@ class Wind final : public MovingObject virtual std::string get_exposed_class_name() const override { return "Wind"; } static std::string display_name() { return _("Wind"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(Wind)); } virtual ObjectSettings get_settings() override; diff --git a/src/supertux/game_object.cpp b/src/supertux/game_object.cpp index 187ba06b4d2..6b5761a87e9 100644 --- a/src/supertux/game_object.cpp +++ b/src/supertux/game_object.cpp @@ -109,6 +109,15 @@ GameObject::save() return save_stream.str(); } +GameObjectClasses +GameObject::get_class_types() const +{ + GameObjectClasses g; + // All class types except GameObject, since everything implements GameObject + // g.add(typeid(GameObject)); + return g; +} + ObjectSettings GameObject::get_settings() { diff --git a/src/supertux/game_object.hpp b/src/supertux/game_object.hpp index c8202d6f1a8..ff0434129f7 100644 --- a/src/supertux/game_object.hpp +++ b/src/supertux/game_object.hpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "editor/object_settings.hpp" #include "supertux/game_object_component.hpp" @@ -47,6 +48,24 @@ struct GameObjectType }; typedef std::vector GameObjectTypes; +/** + A helper structure to list all the type_indexes of the classes in the + type hierarchy of a given class. This makes it easier to register e.g. + a MrIceblock in lists for MrIceBlock, WalkingBadguy, Badguy, Portable, + MovingSprite, MovingObject, and GameObject. +*/ +struct GameObjectClasses +{ + std::vector types; + + GameObjectClasses& add(const std::type_info& info) + { + std::type_index idx(info); + types.push_back(idx); + return *this; + } +}; + /** This class is responsible for: * Updating and drawing the object. This should happen in the update() and @@ -102,6 +121,9 @@ class GameObject : public ExposableClass * @description Returns the display name of the object, translated to the user's locale. */ virtual std::string get_display_name() const { return _("Unknown object"); } + /** List notable classes in inheritance hierarchy of class. This makes it possible + to efficiently look up all objects deriving from a particular intermediate class */ + virtual GameObjectClasses get_class_types() const; /** Version checking/updating, patch information */ virtual std::vector get_patches() const; diff --git a/src/supertux/game_object_iterator.hpp b/src/supertux/game_object_iterator.hpp index d16757434f0..1bef5e52390 100644 --- a/src/supertux/game_object_iterator.hpp +++ b/src/supertux/game_object_iterator.hpp @@ -25,7 +25,7 @@ template class GameObjectIterator { public: - typedef std::vector >::const_iterator Iterator; + typedef std::vector::const_iterator Iterator; public: GameObjectIterator(Iterator it, Iterator end) : @@ -35,24 +35,28 @@ class GameObjectIterator { if (m_it != m_end) { - m_object = dynamic_cast(m_it->get()); - if (!m_object) - { - skip_to_next(); - } + // A dynamic_cast is needed to perform sidecasts (a.k.a. crosscasts) + // T may be one of multiple base classes of the object and need not inherit GameObject + m_object = dynamic_cast(*m_it); + assert(m_object); } } GameObjectIterator& operator++() { - skip_to_next(); + ++m_it; + if (m_it != m_end) + { + m_object = dynamic_cast(*m_it); + assert(m_object); + } return *this; } GameObjectIterator operator++(int) { GameObjectIterator tmp(*this); - skip_to_next(); + operator++(); return tmp; } @@ -82,24 +86,6 @@ class GameObjectIterator return !(*this == other); } -private: - void skip_to_next() - { - do - { - ++m_it; - if (m_it == m_end) - { - break; - } - else - { - m_object = dynamic_cast(m_it->get()); - } - } - while (!m_object); - } - private: Iterator m_it; Iterator m_end; @@ -115,11 +101,13 @@ class GameObjectRange {} GameObjectIterator begin() const { - return GameObjectIterator(m_manager.get_objects().begin(), m_manager.get_objects().end()); + auto& objects = m_manager.get_objects_by_type_index(typeid(T)); + return GameObjectIterator(objects.begin(), objects.end()); } GameObjectIterator end() const { - return GameObjectIterator(m_manager.get_objects().end(), m_manager.get_objects().end()); + auto& objects = m_manager.get_objects_by_type_index(typeid(T)); + return GameObjectIterator(objects.end(), objects.end()); } private: diff --git a/src/supertux/game_object_manager.cpp b/src/supertux/game_object_manager.cpp index f272a9f75a7..52d33a26af7 100644 --- a/src/supertux/game_object_manager.cpp +++ b/src/supertux/game_object_manager.cpp @@ -483,7 +483,10 @@ GameObjectManager::this_before_object_add(GameObject& object) } { // By type index: - m_objects_by_type_index[std::type_index(typeid(object))].push_back(&object); + for (const std::type_index& type : object.get_class_types().types) + { + m_objects_by_type_index[type].push_back(&object); + } } save_object_change(object, true); @@ -507,10 +510,13 @@ GameObjectManager::this_before_object_remove(GameObject& object) } { // By type index: - auto& vec = m_objects_by_type_index[std::type_index(typeid(object))]; - auto it = std::find(vec.begin(), vec.end(), &object); - assert(it != vec.end()); - vec.erase(it); + for (const std::type_index& type : object.get_class_types().types) + { + auto& vec = m_objects_by_type_index[type]; + auto it = std::find(vec.begin(), vec.end(), &object); + assert(it != vec.end()); + vec.erase(it); + } } } diff --git a/src/supertux/game_object_manager.hpp b/src/supertux/game_object_manager.hpp index 601918b85fc..07a79f77dba 100644 --- a/src/supertux/game_object_manager.hpp +++ b/src/supertux/game_object_manager.hpp @@ -243,8 +243,8 @@ class GameObjectManager : public ExposableClass int get_object_count(std::function predicate = nullptr) const { int total = 0; - for (const auto& obj : m_gameobjects) { - auto object = dynamic_cast(obj.get()); + for (const auto& obj : get_objects_by_type_index(typeid(T))) { + auto object = static_cast(obj); if (object && (predicate == nullptr || predicate(*object))) { total += 1; diff --git a/src/supertux/moving_object.hpp b/src/supertux/moving_object.hpp index bc5e8a1cbe5..873533a5644 100644 --- a/src/supertux/moving_object.hpp +++ b/src/supertux/moving_object.hpp @@ -46,6 +46,7 @@ class MovingObject : public GameObject, MovingObject(); MovingObject(const ReaderMapping& reader); ~MovingObject() override; + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(CollisionListener)).add(typeid(MovingObject)); } virtual void collision_solid(const CollisionHit& /*hit*/) override { diff --git a/src/supertux/player_status_hud.hpp b/src/supertux/player_status_hud.hpp index 0315f532001..3bcc649eef0 100644 --- a/src/supertux/player_status_hud.hpp +++ b/src/supertux/player_status_hud.hpp @@ -34,6 +34,7 @@ class PlayerStatusHUD : public GameObject public: PlayerStatusHUD(PlayerStatus& player_status); + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(PlayerStatusHUD)); } virtual void update(float dt_sec) override; virtual void draw(DrawingContext& context) override; diff --git a/src/trigger/climbable.hpp b/src/trigger/climbable.hpp index c3214b61d4f..6ef3bffcaa9 100644 --- a/src/trigger/climbable.hpp +++ b/src/trigger/climbable.hpp @@ -46,6 +46,7 @@ class Climbable final : public Trigger static std::string display_name() { return _("Climbable"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } + virtual GameObjectClasses get_class_types() const override { return Trigger::get_class_types().add(typeid(Climbable)); } virtual ObjectSettings get_settings() override; diff --git a/src/trigger/door.hpp b/src/trigger/door.hpp index fe363954944..7b095c33157 100644 --- a/src/trigger/door.hpp +++ b/src/trigger/door.hpp @@ -30,6 +30,7 @@ class Door final : public SpritedTrigger virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Door"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return SpritedTrigger::get_class_types().add(typeid(Door)); } virtual ObjectSettings get_settings() override; virtual void after_editor_set() override; diff --git a/src/trigger/scripttrigger.hpp b/src/trigger/scripttrigger.hpp index 538990e8752..6b3276346b7 100644 --- a/src/trigger/scripttrigger.hpp +++ b/src/trigger/scripttrigger.hpp @@ -29,6 +29,7 @@ class ScriptTrigger final : public Trigger static std::string display_name() { return _("Script Trigger"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } + virtual GameObjectClasses get_class_types() const override { return Trigger::get_class_types().add(typeid(ScriptTrigger)); } virtual ObjectSettings get_settings() override; diff --git a/src/trigger/secretarea_trigger.hpp b/src/trigger/secretarea_trigger.hpp index a32a237b5bb..8473b06da0f 100644 --- a/src/trigger/secretarea_trigger.hpp +++ b/src/trigger/secretarea_trigger.hpp @@ -36,6 +36,7 @@ class SecretAreaTrigger final : public Trigger static std::string display_name() { return _("Secret Area"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } + virtual GameObjectClasses get_class_types() const override { return Trigger::get_class_types().add(typeid(SecretAreaTrigger)); } virtual ObjectSettings get_settings() override; diff --git a/src/trigger/sequence_trigger.hpp b/src/trigger/sequence_trigger.hpp index 4de2fcb446b..fdbd44cb04b 100644 --- a/src/trigger/sequence_trigger.hpp +++ b/src/trigger/sequence_trigger.hpp @@ -31,6 +31,7 @@ class SequenceTrigger final : public Trigger static std::string display_name() { return _("Sequence Trigger"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } + virtual GameObjectClasses get_class_types() const override { return Trigger::get_class_types().add(typeid(SequenceTrigger)); } virtual ObjectSettings get_settings() override; diff --git a/src/trigger/switch.hpp b/src/trigger/switch.hpp index 0a09d06eb73..a83e267d799 100644 --- a/src/trigger/switch.hpp +++ b/src/trigger/switch.hpp @@ -29,6 +29,7 @@ class Switch final : public StickyTrigger virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Switch"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return StickyTrigger::get_class_types().add(typeid(Switch)); } virtual ObjectSettings get_settings() override; diff --git a/src/trigger/text_area.hpp b/src/trigger/text_area.hpp index 0c0b3d9df31..e652afd2bc8 100644 --- a/src/trigger/text_area.hpp +++ b/src/trigger/text_area.hpp @@ -47,6 +47,7 @@ class TextArea final : public Trigger static std::string display_name() { return _("Text Area"); } virtual std::string get_display_name() const override { return display_name(); } virtual bool has_variable_size() const override { return true; } + virtual GameObjectClasses get_class_types() const override { return Trigger::get_class_types().add(typeid(TextArea)); } private: bool m_once; diff --git a/src/trigger/trigger_base.hpp b/src/trigger/trigger_base.hpp index 211df6fdc28..f532d1a4cae 100644 --- a/src/trigger/trigger_base.hpp +++ b/src/trigger/trigger_base.hpp @@ -68,6 +68,7 @@ class Trigger : public MovingObject, { public: Trigger(const ReaderMapping& reader); + virtual GameObjectClasses get_class_types() const override { return MovingObject::get_class_types().add(typeid(TriggerBase)).add(typeid(Trigger)); } virtual void update(float) override { @@ -91,6 +92,7 @@ class SpritedTrigger : public MovingSprite, { public: SpritedTrigger(const ReaderMapping& reader, const std::string& sprite_name); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(TriggerBase)).add(typeid(SpritedTrigger)); } virtual void update(float) override { @@ -112,6 +114,7 @@ class StickyTrigger : public StickyObject, { public: StickyTrigger(const ReaderMapping& reader, const std::string& sprite_name); + virtual GameObjectClasses get_class_types() const override { return StickyObject::get_class_types().add(typeid(TriggerBase)).add(typeid(StickyTrigger)); } virtual void update(float dt_sec) override { diff --git a/src/worldmap/level_tile.hpp b/src/worldmap/level_tile.hpp index 66e20c1337f..59cc80a7539 100644 --- a/src/worldmap/level_tile.hpp +++ b/src/worldmap/level_tile.hpp @@ -35,6 +35,7 @@ class LevelTile final : public WorldMapObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Level"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(LevelTile)); } virtual ObjectSettings get_settings() override; diff --git a/src/worldmap/spawn_point.hpp b/src/worldmap/spawn_point.hpp index 3a664a1a48a..108eaa915d7 100644 --- a/src/worldmap/spawn_point.hpp +++ b/src/worldmap/spawn_point.hpp @@ -57,6 +57,7 @@ class SpawnPointObject final : public WorldMapObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Spawn point"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(SpawnPointObject)); } virtual ObjectSettings get_settings() override; diff --git a/src/worldmap/special_tile.hpp b/src/worldmap/special_tile.hpp index fab8de59fca..902d37c835c 100644 --- a/src/worldmap/special_tile.hpp +++ b/src/worldmap/special_tile.hpp @@ -35,6 +35,7 @@ class SpecialTile final : public WorldMapObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Special Tile"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(SpecialTile)); } virtual void draw_worldmap(DrawingContext& context) override; diff --git a/src/worldmap/sprite_change.hpp b/src/worldmap/sprite_change.hpp index e889b681066..4fa4fda3292 100644 --- a/src/worldmap/sprite_change.hpp +++ b/src/worldmap/sprite_change.hpp @@ -34,6 +34,7 @@ class SpriteChange final : public WorldMapObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Sprite Change"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(SpriteChange)); } virtual void draw_worldmap(DrawingContext& context) override; diff --git a/src/worldmap/teleporter.hpp b/src/worldmap/teleporter.hpp index b35b43e6aa4..39c7ec8253e 100644 --- a/src/worldmap/teleporter.hpp +++ b/src/worldmap/teleporter.hpp @@ -33,6 +33,7 @@ class Teleporter final : public WorldMapObject virtual std::string get_class_name() const override { return class_name(); } static std::string display_name() { return _("Teleporter"); } virtual std::string get_display_name() const override { return display_name(); } + virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(Teleporter)); } virtual ObjectSettings get_settings() override; diff --git a/src/worldmap/tux.hpp b/src/worldmap/tux.hpp index 60031875974..4347fd3d1ac 100644 --- a/src/worldmap/tux.hpp +++ b/src/worldmap/tux.hpp @@ -39,6 +39,7 @@ class Tux final : public GameObject virtual void draw(DrawingContext& context) override; virtual void update(float dt_sec) override; virtual bool is_singleton() const override { return true; } + virtual GameObjectClasses get_class_types() const override { return GameObject::get_class_types().add(typeid(Tux)); } void setup(); /**< called prior to first update */ diff --git a/src/worldmap/worldmap_object.hpp b/src/worldmap/worldmap_object.hpp index 7d60963f188..9803e576d0a 100644 --- a/src/worldmap/worldmap_object.hpp +++ b/src/worldmap/worldmap_object.hpp @@ -36,6 +36,7 @@ class WorldMapObject : public MovingSprite WorldMapObject(const ReaderMapping& mapping, const std::string& default_sprite); WorldMapObject(const ReaderMapping& mapping); WorldMapObject(const Vector& pos, const std::string& default_sprite); + virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(WorldMapObject)); } static std::string class_name() { return "worldmap-object"; } virtual std::string get_class_name() const override { return class_name(); } From 00d6f67b9a09a044c1ac4351128487e1cde5c6c2 Mon Sep 17 00:00:00 2001 From: SuperTux Bot Date: Sat, 27 Jul 2024 01:36:29 +0000 Subject: [PATCH 31/33] Update translations --- data/levels/community2016/es.po | 11 +++--- data/locale/es.po | 65 +++++++++++++++++---------------- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/data/levels/community2016/es.po b/data/levels/community2016/es.po index f37f9312d09..07fe28b7277 100644 --- a/data/levels/community2016/es.po +++ b/data/levels/community2016/es.po @@ -5,6 +5,7 @@ # # Translators: # Diego Enmanuel Rosales Santander, 2024 +# Unknown, 2024 # #, fuzzy msgid "" @@ -13,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2019-11-24 01:44+0100\n" "PO-Revision-Date: 2019-11-24 00:59+0000\n" -"Last-Translator: Diego Enmanuel Rosales Santander, 2024\n" +"Last-Translator: Unknown, 2024\n" "Language-Team: Spanish (https://app.transifex.com/arctic-games/teams/95/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -31,11 +32,11 @@ msgstr "Problemas Dobles" #: data/levels/community2016/Double_Problems (herobrine).stl:82 msgid "-Concentrate! Tux! It's not Mario!" -msgstr "" +msgstr "-¡Concentráte! Tux! ¡No es Mario!" #: data/levels/community2016/Double_Problems (herobrine).stl:142 msgid "You found a secret area!" -msgstr "" +msgstr "¡Has encontrado un área secreta!" #: data/levels/community2016/Entrance_To_Cave (gelada).stl:3 msgid "The Entrance To The Cave" @@ -51,7 +52,7 @@ msgstr "¡Bola de Nieve HMS a la Vista!" #: data/levels/community2016/Into_The_Palace (ThomyW).stl:3 msgid "Into The Palace" -msgstr "" +msgstr "En el palacio" #: data/levels/community2016/Is_The_Biggest_Fish (cookie monster).stl:3 msgid "Is The Biggest Fish" @@ -87,4 +88,4 @@ msgstr "" #: data/levels/community2016/worldmap.stwm:3 msgid "Community Island 2016" -msgstr "" +msgstr "Isla de comunidad 2016" diff --git a/data/locale/es.po b/data/locale/es.po index 8875f8dea17..4388a4601de 100644 --- a/data/locale/es.po +++ b/data/locale/es.po @@ -20,6 +20,7 @@ # Swyter , 2018,2021-2022,2024 # Tam Ezquerra , 2019 # Tam Ezquerra , 2019 +# Unknown, 2024 # William Beltrán , 2016 # William Beltrán , 2015-2016 msgid "" @@ -28,7 +29,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/SuperTux/supertux/issues\n" "POT-Creation-Date: 2024-05-30 16:19+0200\n" "PO-Revision-Date: 2013-08-10 22:56+0000\n" -"Last-Translator: Swyter , 2018,2021-2022,2024\n" +"Last-Translator: Unknown, 2024\n" "Language-Team: Spanish (http://app.transifex.com/arctic-games/supertux/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -97,11 +98,11 @@ msgstr "Anclado" #: src/trigger/text_area.cpp:148 msgid "Anchor offset X" -msgstr "" +msgstr "Desplazarse de anclaje X" #: src/trigger/text_area.cpp:149 msgid "Anchor offset Y" -msgstr "" +msgstr "Desplazarse de anclaje Y" #: src/trigger/text_area.cpp:150 msgid "Texts" @@ -122,7 +123,7 @@ msgstr "¿Bloqueado?" #: src/trigger/door.cpp:83 msgid "Lock Color" -msgstr "" +msgstr "Bloquear Color" #: src/trigger/switch.cpp:62 src/object/ispy.cpp:54 src/object/bumper.cpp:53 #: src/object/spotlight.cpp:106 src/object/pushbutton.cpp:61 @@ -189,7 +190,7 @@ msgstr "Se puede escalar" #: src/trigger/text_area.hpp:47 msgid "Text Area" -msgstr "" +msgstr "Àrea de texto" #: src/trigger/door.hpp:31 msgid "Door" @@ -334,7 +335,7 @@ msgstr "Normal" #: src/object/brick.cpp:60 src/object/bonus_block.cpp:175 #: src/object/coin.cpp:70 src/object/invisible_block.cpp:38 msgid "Retro" -msgstr "" +msgstr "Retro" #: src/object/brick.cpp:166 msgid "Breakable" @@ -418,7 +419,7 @@ msgstr "" #: src/object/bonus_block.cpp:172 msgid "Blue" -msgstr "" +msgstr "Azul" #: src/object/bonus_block.cpp:173 msgid "Orange" @@ -792,23 +793,23 @@ msgstr "Huevo" #: src/object/powerup.cpp:62 msgid "Fire Flower" -msgstr "" +msgstr "Flor de Fuego" #: src/object/powerup.cpp:63 msgid "Ice Flower" -msgstr "" +msgstr "Flor de Hielo" #: src/object/powerup.cpp:64 msgid "Air Flower" -msgstr "" +msgstr "Flor de Aire" #: src/object/powerup.cpp:65 msgid "Earth Flower" -msgstr "" +msgstr "Flor de Tierra" #: src/object/powerup.cpp:67 msgid "Tux Doll" -msgstr "" +msgstr "Muñeco de Tux" #: src/object/powerup.cpp:68 msgid "Flip Potion" @@ -816,7 +817,7 @@ msgstr "" #: src/object/powerup.cpp:69 msgid "Mints" -msgstr "" +msgstr "Mentas" #: src/object/powerup.cpp:70 msgid "Coffee" @@ -1810,7 +1811,7 @@ msgstr "Cristalio" #: src/badguy/kamikazesnowball.cpp:118 src/badguy/walkingleaf.cpp:36 #: src/badguy/jumpy.cpp:46 src/badguy/igel.cpp:189 src/badguy/mrtree.cpp:51 msgid "Corrupted" -msgstr "" +msgstr "Corrupto" #: src/badguy/totem.hpp:37 msgid "Totem" @@ -1870,7 +1871,7 @@ msgstr "" #: src/badguy/mriceblock.hpp:49 msgid "Mr. Iceblock" -msgstr "" +msgstr "Sr. Cubo de Hielo" #: src/badguy/granito.hpp:39 src/badguy/darttrap.cpp:163 #: src/badguy/corrupted_granito.cpp:175 src/badguy/dispenser.cpp:438 @@ -1894,7 +1895,7 @@ msgstr "" #: src/badguy/flame.cpp:84 msgid "Fire" -msgstr "" +msgstr "Fuego" #: src/badguy/flame.cpp:85 msgid "Ghost" @@ -1902,7 +1903,7 @@ msgstr "" #: src/badguy/corrupted_granito_big.hpp:35 msgid "Corrupted Big Granito" -msgstr "" +msgstr "Corrupto Granito Grande" #: src/badguy/scrystallo.cpp:57 msgid "Walk Radius" @@ -2006,7 +2007,7 @@ msgstr "" #: src/badguy/snowball.hpp:30 msgid "Mr. Snowball" -msgstr "" +msgstr "Bola de Nieve" #: src/badguy/smartblock.hpp:30 msgid "Mrs. Iceblock" @@ -2030,7 +2031,7 @@ msgstr "" #: src/badguy/mrbomb.cpp:48 msgid "Classic" -msgstr "" +msgstr "Clasico" #: src/badguy/flyingsnowball.hpp:33 msgid "Flying Snowball" @@ -2038,23 +2039,23 @@ msgstr "Bola de nieve voladora" #: src/badguy/crusher.cpp:75 msgid "Ice (normal)" -msgstr "" +msgstr "Hielo (normal)" #: src/badguy/crusher.cpp:76 msgid "Ice (big)" -msgstr "" +msgstr "Hielo (grande)" #: src/badguy/crusher.cpp:77 msgid "Rock (normal)" -msgstr "" +msgstr "Roca (normal)" #: src/badguy/crusher.cpp:78 msgid "Rock (big)" -msgstr "" +msgstr "Roca (grande)" #: src/badguy/crusher.cpp:79 msgid "Corrupted (normal)" -msgstr "" +msgstr "Corrupto (normal)" #: src/badguy/crusher.cpp:80 msgid "Corrupted (big)" @@ -2066,7 +2067,7 @@ msgstr "De lado" #: src/badguy/kamikazesnowball.hpp:34 msgid "Kamikaze Snowball" -msgstr "" +msgstr "Bola de nieve kamikaze" #: src/badguy/kamikazesnowball.hpp:64 msgid "Leafshot" @@ -2194,7 +2195,7 @@ msgstr "" #: src/badguy/stalactite.cpp:156 msgid "ice" -msgstr "" +msgstr "hielo" #: src/badguy/stalactite.cpp:157 msgid "rock" @@ -2268,7 +2269,7 @@ msgstr "" #: src/badguy/granito_big.cpp:54 src/badguy/granito.cpp:265 msgid "Walking" -msgstr "" +msgstr "Caminando" #: src/badguy/mriceblock.cpp:63 msgid "Laptop" @@ -2598,17 +2599,17 @@ msgstr "Niveles aportados" #: src/supertux/menu/contrib_menu.cpp:98 #: src/supertux/menu/contrib_menu.cpp:112 msgid "Official Contrib Levels" -msgstr "" +msgstr "Niveles oficiales de contribución" #: src/supertux/menu/contrib_menu.cpp:99 #: src/supertux/menu/contrib_menu.cpp:118 msgid "Community Contrib Levels" -msgstr "" +msgstr "Niveles de contribución por la Comunidad" #: src/supertux/menu/contrib_menu.cpp:100 #: src/supertux/menu/contrib_menu.cpp:124 msgid "User Contrib Levels" -msgstr "" +msgstr "Niveles de contribución por Usuarios" #: src/supertux/menu/contrib_menu.cpp:113 msgid "How is this possible? There are no Official Contrib Levels!" @@ -3291,7 +3292,7 @@ msgstr "A este mod le falta información." #: src/supertux/menu/addon_preview_menu.cpp:88 msgid "Perform a \"Check Online\" to try retrieving it." -msgstr "" +msgstr "Realice una \"Verificar en línea\" para intentar recuperarlo." #: src/supertux/menu/addon_preview_menu.cpp:92 msgid "No author specified." @@ -4272,7 +4273,7 @@ msgstr "" #: src/supertux/menu/multiplayer_player_menu.cpp:40 msgid "Play with the keyboard" -msgstr "" +msgstr "Jugar con el teclado" #: src/supertux/menu/multiplayer_player_menu.cpp:58 msgid "Remove Player" From d70028891752b2eba4093425c6a0fcb9a1d9eaa0 Mon Sep 17 00:00:00 2001 From: Tobias Markus Date: Sat, 27 Jul 2024 13:42:44 +0200 Subject: [PATCH 32/33] Make GameObject::get_name() return value `const std::string&` --- src/supertux/game_object.cpp | 2 +- src/supertux/game_object.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/supertux/game_object.cpp b/src/supertux/game_object.cpp index 6b5761a87e9..d52bb6d5e20 100644 --- a/src/supertux/game_object.cpp +++ b/src/supertux/game_object.cpp @@ -144,7 +144,7 @@ GameObject::get_settings() return result; } -std::string +const std::string& GameObject::get_name() const { return m_name; diff --git a/src/supertux/game_object.hpp b/src/supertux/game_object.hpp index ff0434129f7..e576d653c2d 100644 --- a/src/supertux/game_object.hpp +++ b/src/supertux/game_object.hpp @@ -200,7 +200,7 @@ class GameObject : public ExposableClass * @scripting * @description Returns the name of the object. */ - std::string get_name() const; + const std::string& get_name() const; virtual const std::string get_icon_path() const { return "images/tiles/auxiliary/notile.png"; From 5a5057859a145dc78fdeae6d934654dbcda20daf Mon Sep 17 00:00:00 2001 From: Hume2 Date: Sat, 27 Jul 2024 21:22:30 +0200 Subject: [PATCH 33/33] Scale parallax layers perspectively-correctly (#2954) I implemented it for both tilemaps and backgrounds. DEMO: https://www.youtube.com/watch?v=GnFArTYBL4E Scaling now works so that it imitates a perspective camera. The layers scale differently based on their scrolling speed. Also note that the z-position based on which the scaling is calculated, does not depend on the "z-pos" value at all, so it is nicely compatible with the old levels. It also fixes the bug which allows players to see around paralax layers when the viewport is scaled down. If the layer is large enough to cover the level in the default scale, it now works in all scales. --- src/object/background.cpp | 31 ++++++++++++++++++------------- src/object/tilemap.cpp | 13 ++++++++++--- src/video/drawing_context.cpp | 23 +++++++++++++++++++++++ src/video/drawing_context.hpp | 3 +++ 4 files changed, 54 insertions(+), 16 deletions(-) diff --git a/src/object/background.cpp b/src/object/background.cpp index 1808274671d..7008e00cb4d 100644 --- a/src/object/background.cpp +++ b/src/object/background.cpp @@ -316,8 +316,7 @@ void Background::draw_image(DrawingContext& context, const Vector& pos_) { const Sizef level(d_gameobject_manager->get_width(), d_gameobject_manager->get_height()); - const Sizef screen(context.get_width(), - context.get_height()); + const Sizef screen = context.get_viewport().get_size(); const Sizef parallax_image_size((1.0f - m_parallax_speed.x) * screen.width + level.width * m_parallax_speed.x, (1.0f - m_parallax_speed.y) * screen.height + level.height * m_parallax_speed.y); @@ -334,7 +333,6 @@ Background::draw_image(DrawingContext& context, const Vector& pos_) const int end_y = static_cast(ceilf((cliprect.get_bottom() - (pos_.y + img_h/2.0f)) / img_h)) + 1; Canvas& canvas = context.get_canvas(m_target); - context.set_flip(context.get_flip() ^ m_flip); if (m_fill) { @@ -407,7 +405,6 @@ Background::draw_image(DrawingContext& context, const Vector& pos_) break; } } - context.set_flip(context.get_flip() ^ m_flip); } void @@ -418,19 +415,27 @@ Background::draw(DrawingContext& context) if (!m_image) return; + + context.push_transform(); + if (!context.perspective_scale(m_parallax_speed.x, m_parallax_speed.y)) { + //The background is placed behind the camera. + context.pop_transform(); + return; + } + context.set_flip(context.get_flip() ^ m_flip); - Sizef level_size(d_gameobject_manager->get_width(), + const Sizef level_size(d_gameobject_manager->get_width(), d_gameobject_manager->get_height()); - Sizef screen(context.get_width(), - context.get_height()); - Sizef translation_range = level_size - screen; - Vector center_offset(context.get_translation().x - translation_range.width / 2.0f, - context.get_translation().y - translation_range.height / 2.0f); - - Vector pos(level_size.width / 2, - level_size.height / 2); + const Sizef screen = context.get_viewport().get_size(); + const Sizef translation_range = level_size - screen; + const Vector center_offset(context.get_translation().x - translation_range.width / 2.0f, + context.get_translation().y - translation_range.height / 2.0f); + + const Vector pos(level_size.width / 2, + level_size.height / 2); draw_image(context, pos + m_scroll_offset + Vector(center_offset.x * (1.0f - m_parallax_speed.x), center_offset.y * (1.0f - m_parallax_speed.y))); + context.pop_transform(); } namespace { diff --git a/src/object/tilemap.cpp b/src/object/tilemap.cpp index 422474fc05e..1c457abc4f0 100644 --- a/src/object/tilemap.cpp +++ b/src/object/tilemap.cpp @@ -442,6 +442,15 @@ TileMap::draw(DrawingContext& context) context.push_transform(); + const bool normal_speed = m_editor_active && Editor::is_active(); + const float speed_x = normal_speed ? 1.0f : m_speed_x; + const float speed_y = normal_speed ? 1.0f : m_speed_y; + if (!context.perspective_scale(speed_x, speed_y)) { + //The tilemap is placed behind the camera. + context.pop_transform(); + return; + } + if (m_flip != NO_FLIP) context.set_flip(m_flip); if (m_editor_active) { @@ -454,9 +463,7 @@ TileMap::draw(DrawingContext& context) const float trans_x = context.get_translation().x; const float trans_y = context.get_translation().y; - const bool normal_speed = m_editor_active && Editor::is_active(); - context.set_translation(Vector(trans_x * (normal_speed ? 1.0f : m_speed_x), - trans_y * (normal_speed ? 1.0f : m_speed_y))); + context.set_translation(Vector(trans_x * speed_x, trans_y * speed_y)); Rectf draw_rect = context.get_cliprect(); Rect t_draw_rect = get_tiles_overlapping(draw_rect); diff --git a/src/video/drawing_context.cpp b/src/video/drawing_context.cpp index c33a6d6570f..66bbd62b9fc 100644 --- a/src/video/drawing_context.cpp +++ b/src/video/drawing_context.cpp @@ -133,4 +133,27 @@ DrawingContext::get_size() const return Vector(get_width(), get_height()) * transform().scale; } +bool +DrawingContext::perspective_scale(float speed_x, float speed_y) +{ + DrawingTransform& tfm = transform(); + if (tfm.scale == 1 || speed_x < 0 || speed_y < 0) { + //Trivial or unreal situation: Do not apply perspective. + return true; + } + const float speed = sqrt(speed_x * speed_y); + if (speed == 0) { + //Special case: The object appears to be infinitely far. + tfm.scale = 1.0; + return true; + } + const float t = tfm.scale * (1 / speed - 1) + 1; + if (t <= 0) { + //The object will appear behind the camera, therefore we shall not see it. + return false; + } + tfm.scale /= speed * t; + return true; +} + /* EOF */ diff --git a/src/video/drawing_context.hpp b/src/video/drawing_context.hpp index ad250db5756..737e7b8d16d 100644 --- a/src/video/drawing_context.hpp +++ b/src/video/drawing_context.hpp @@ -77,6 +77,9 @@ class DrawingContext final float get_scale() const { return transform().scale; } void scale(float scale) { transform().scale *= scale; } + + /** Recalculates the scaling factor for parallax layers.*/ + bool perspective_scale(float speed_x, float speed_y); /** Apply that flip in the next draws (flips are listed on surface.h). */ void set_flip(Flip flip);