Cleaned Up AppPlatform & Input Classes

* Cleaned up AppPlatform classes
* Documented & improved Keyboard & Mouse classes
* Improved input-handling code in the Windows & SDL main.cpp files
This commit is contained in:
Brent Da Mage
2023-08-19 06:26:50 -05:00
committed by iProgramInCpp
parent e731fefbea
commit d5ee7bfc08
21 changed files with 422 additions and 375 deletions

View File

@@ -130,6 +130,7 @@ static const char* g_panoramaList[] =
};
static float g_panoramaAngle = 0.0f;
// TODO: This should be inside of an initialized "Minecraft" instance rather than the global namespace
bool g_bIsMenuBackgroundAvailable = false;
void Screen::renderMenuBackground(float f)
@@ -328,9 +329,9 @@ void Screen::mouseEvent()
if (pAction->isButton())
{
if (Mouse::getEventButtonState())
mouseClicked (m_width * pAction->field_8 / Minecraft::width, m_height * pAction->field_C / Minecraft::height - 1, Mouse::getEventButton());
mouseClicked (m_width * pAction->_posX / Minecraft::width, m_height * pAction->_posY / Minecraft::height - 1, Mouse::getEventButton());
else
mouseReleased(m_width * pAction->field_8 / Minecraft::width, m_height * pAction->field_C / Minecraft::height - 1, Mouse::getEventButton());
mouseReleased(m_width * pAction->_posX / Minecraft::width, m_height * pAction->_posY / Minecraft::height - 1, Mouse::getEventButton());
}
}