diff --git a/game/minecraftcpp.exe b/game/minecraftcpp.exe deleted file mode 100644 index 50b9c6f..0000000 Binary files a/game/minecraftcpp.exe and /dev/null differ diff --git a/platforms/sdl/AppPlatform_sdlbase.cpp b/platforms/sdl/AppPlatform_sdlbase.cpp index 54b36b1..64ad06e 100644 --- a/platforms/sdl/AppPlatform_sdlbase.cpp +++ b/platforms/sdl/AppPlatform_sdlbase.cpp @@ -154,50 +154,46 @@ int AppPlatform_sdlbase::getUserInputStatus() return -1; } -Mouse::ButtonType AppPlatform_sdlbase::GetMouseButtonType(SDL_Event event) +MouseButtonType AppPlatform_sdlbase::GetMouseButtonType(SDL_Event event) { switch (event.button.button) { case SDL_BUTTON_LEFT: - return Mouse::LEFT; + return BUTTON_LEFT; case SDL_BUTTON_RIGHT: - return Mouse::RIGHT; + return BUTTON_RIGHT; case SDL_BUTTON_MIDDLE: - return Mouse::MIDDLE; + return BUTTON_MIDDLE; default: - return Mouse::NONE; + return BUTTON_NONE; } } -Mouse::ButtonState AppPlatform_sdlbase::GetMouseButtonState(SDL_Event event) +bool AppPlatform_sdlbase::GetMouseButtonState(SDL_Event event) { - Mouse::ButtonState result; + bool result; switch (event.type) { case SDL_MOUSEBUTTONDOWN: - result = Mouse::DOWN; + result = true; break; case SDL_MOUSEBUTTONUP: - result = Mouse::UP; + result = false; break; case SDL_MOUSEWHEEL: { short wheelDelta = event.wheel.y; if (wheelDelta > 0) - { // "A positive value indicates that the wheel was rotated forward, away from the user." - result = Mouse::UP; - } + result = false; else - { // "A negative value indicates that the wheel was rotated backward, toward the user." - result = Mouse::DOWN; - } + result = true; break; } default: - result = Mouse::UP; + result = false; break; } diff --git a/platforms/sdl/AppPlatform_sdlbase.hpp b/platforms/sdl/AppPlatform_sdlbase.hpp index dd83a6d..1d6423e 100644 --- a/platforms/sdl/AppPlatform_sdlbase.hpp +++ b/platforms/sdl/AppPlatform_sdlbase.hpp @@ -39,8 +39,8 @@ public: bool shiftPressed() override; void setShiftPressed(bool b, bool isLeft); - static Mouse::ButtonType GetMouseButtonType(SDL_Event event); - static Mouse::ButtonState GetMouseButtonState(SDL_Event event); + static MouseButtonType GetMouseButtonType(SDL_Event event); + static bool GetMouseButtonState(SDL_Event event); static Keyboard::KeyState GetKeyState(SDL_Event event); private: SDL_Window *_window; diff --git a/platforms/sdl/main.cpp b/platforms/sdl/main.cpp index 7c40bf4..1099339 100644 --- a/platforms/sdl/main.cpp +++ b/platforms/sdl/main.cpp @@ -107,13 +107,13 @@ static void handle_events() float scale = g_fPointToPixelScale; float x = event.motion.x * scale; float y = event.motion.y * scale; - Mouse::feed(Mouse::NONE, Mouse::UP, x, y); + Mouse::feed(BUTTON_NONE, false, x, y); g_pAppPlatform->setMouseDiff(event.motion.xrel * scale, event.motion.yrel * scale); break; } case SDL_MOUSEWHEEL: { - Mouse::feed(Mouse::SCROLLWHEEL, AppPlatform_sdlbase::GetMouseButtonState(event), Mouse::getX(), Mouse::getY()); + Mouse::feed(BUTTON_SCROLLWHEEL, AppPlatform_sdlbase::GetMouseButtonState(event), Mouse::getX(), Mouse::getY()); break; } case SDL_TEXTINPUT: diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 391872e..3f3c970 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -11,6 +11,7 @@ add_library(reminecraftpe-core STATIC common/CThread.cpp common/Util.cpp common/Logger.cpp + common/SmoothFloat.cpp client/app/App.cpp client/app/AppPlatform.cpp client/app/Minecraft.cpp @@ -89,6 +90,21 @@ add_library(reminecraftpe-core STATIC client/player/input/MouseTurnInput.cpp client/player/input/KeyboardInput.cpp client/player/input/ITurnInput.cpp + client/player/input/IBuildInput.cpp + client/player/input/IncludeExcludeArea.cpp + client/player/input/MouseHandler.cpp + client/player/input/PolygonArea.cpp + client/player/input/RectangleArea.cpp + client/player/input/MouseDevice.cpp + client/player/input/Multitouch.cpp + client/player/input/CustomInputHolder.cpp + client/player/input/IInputHolder.cpp + client/player/input/IMoveInput.cpp + client/player/input/ITouchScreenModel.cpp + client/player/input/TouchAreaModel.cpp + client/player/input/TouchInputHolder.cpp + client/player/input/TouchscreenInput_TestFps.cpp + client/player/input/UnifiedTurnBuild.cpp client/network/ClientSideNetworkHandler.cpp network/packets/UpdateBlockPacket.cpp network/packets/RequestChunkPacket.cpp diff --git a/source/client/player/input/IArea.hpp b/source/client/player/input/IArea.hpp index 07d3abe..3b9b3e1 100644 --- a/source/client/player/input/IArea.hpp +++ b/source/client/player/input/IArea.hpp @@ -12,6 +12,7 @@ class IArea { public: IArea() : field_4(true) {} + virtual ~IArea() {} virtual bool isInside(float, float) = 0; public: