#include "../sdlpp/sdlpp.hpp" #include "gui/gui.hpp" #include "sprites.hpp" #include #ifdef _WIN32 #include "../sdlpp/SDL2/SDL2_framerate.h" #include #include #include #else #include #endif // UNIX #include #include #include #include "global_vars.hpp" #include "objectids.hpp" #include "blocks.hpp" #include "maploader.hpp" #include "../sdlpp/sdlpp_mouse.hpp" #include "edit_box.hpp" #include "editor_visitor.hpp" #include "tool_box.hpp" #include "blocks/coineditorblock.hpp" #define MAP_WIDTH 24 #define MAP_HEIGHT 16 #define QUIT_FLAG 0x00000001 #define UPDATE_FLAG 0x00000002 #define MAP_LEFT_ENABLED_FLAG 0x00000004 #define MAP_RIGHT_ENABLED_FLAG 0x00000008 #define TOOL_LEFT_ENABLED_FLAG 0x00000010 #define TOOL_RIGHT_ENABLED_FLAG 0x00000020 #define MOD_LEFT_ENABLED_FLAG 0x00000040 #define MOD_RIGHT_ENABLED_FLAG 0x00000080 #define CHARACTER_LEFT_ENABLED_FLAG 0x00000100 #define CHARACTER_RIGHT_ENABLED_FLAG 0x00000200 #define TOOLS_WIDTH 4 #define CHARACTER_WIDTH 3 #define MOD_WIDTH 2 #define OVERWORLD_WIDTH 2 struct ToolType { enum Value { BLOCK, MOD, CHARACTER, WORLD, }; }; struct MouseInfo { uint64_t cur_flags{}; uint64_t prev_flags{}; SDLPP::Vec2D edit_box; SDLPP::Vec2D tool_box; ToolType::Value tool_type{}; uint64_t cur_button_index{}; }; struct MapInfo { int cur_page; int max_page; }; struct ToolInfo { ToolType::Value type; uint64_t index; SDL_Rect texture_src; int cur_page_tools; int max_page_tools; int cur_page_mods; int max_page_mods; int cur_page_characters; int max_page_characters; std::shared_ptr