Integrate touch related development. (#90)

* * Add BuildActionIntention crap

* * Set Client and World projects to use MP compilation

* asd

* * Use the new BuildActionIntention to break and place blocks.

* * Reverse engineer the IArea system.

* * Copy break logic from survival into creative conditionally

* * Reverse IBuildInput and MouseHandler
* Replace the new relative paths in the client project with $(MC_ROOT) again

* * Reverse Multitouch, MouseDevice

* * Reverse a bunch of auxiliary classes for input.

* * Use CustomInputHolder instead of holding inputs manually.

* * Reverse a whole BUNCH of things!

* * Add feedback textures to the gitignore.

* * D-pad now renders! Also loads of other work.

* * More Stuff

* * Finish touch control bug fixing.

* * Finalize work.

* * One last thing..

* * Add a "cramped" mode to the options screen and start menu.

* * Oh, forgot to do something
This commit is contained in:
iProgramInCpp
2023-11-02 00:49:11 +02:00
committed by GitHub
parent 98d6b4e5e8
commit 60b21356a1
87 changed files with 3439 additions and 916 deletions

View File

@@ -11,6 +11,8 @@
#include <sstream>
#include <shlobj.h>
#include "GameMods.hpp"
#include "AppPlatform_win32.hpp"
#include "LoggerWin32.hpp"
@@ -190,6 +192,11 @@ Texture AppPlatform_win32::loadTexture(const std::string& str, bool b)
return Texture(width, height, img2, 1, 0);
}
bool AppPlatform_win32::isTouchscreen()
{
return false;
}
bool AppPlatform_win32::hasFileSystemAccess()
{
return true;
@@ -317,36 +324,36 @@ void AppPlatform_win32::updateFocused(bool focused)
setMouseGrabbed(m_bGrabbedMouse);
}
Mouse::ButtonType AppPlatform_win32::GetMouseButtonType(UINT iMsg)
MouseButtonType AppPlatform_win32::GetMouseButtonType(UINT iMsg)
{
switch (iMsg)
{
case WM_LBUTTONUP:
case WM_LBUTTONDOWN:
return Mouse::ButtonType::LEFT;
return BUTTON_LEFT;
case WM_RBUTTONUP:
case WM_RBUTTONDOWN:
return Mouse::ButtonType::RIGHT;
return BUTTON_RIGHT;
case WM_MBUTTONUP:
case WM_MBUTTONDOWN:
return Mouse::ButtonType::MIDDLE;
return BUTTON_MIDDLE;
case WM_MOUSEWHEEL:
return Mouse::ButtonType::SCROLLWHEEL;
return BUTTON_SCROLLWHEEL;
default:
return Mouse::ButtonType::NONE;
return BUTTON_NONE;
}
}
Mouse::ButtonState AppPlatform_win32::GetMouseButtonState(UINT iMsg, WPARAM wParam)
bool AppPlatform_win32::GetMouseButtonState(UINT iMsg, WPARAM wParam)
{
Mouse::ButtonState result;
bool result;
switch (iMsg)
{
case WM_LBUTTONDOWN:
case WM_RBUTTONDOWN:
case WM_MBUTTONDOWN:
result = Mouse::ButtonState::DOWN;
result = true;
break;
case WM_MOUSEWHEEL:
{
@@ -354,17 +361,17 @@ Mouse::ButtonState AppPlatform_win32::GetMouseButtonState(UINT iMsg, WPARAM wPar
if (wheelDelta > 0)
{
// "A positive value indicates that the wheel was rotated forward, away from the user."
result = Mouse::ButtonState::UP;
result = false;
}
else
{
// "A negative value indicates that the wheel was rotated backward, toward the user."
result = Mouse::ButtonState::DOWN;
result = true;
}
break;
}
default:
result = Mouse::ButtonState::UP;
result = false;
break;
}