Patch update - merge end

This commit is contained in:
2024-04-25 10:55:50 +02:00
15 changed files with 658 additions and 3858 deletions

View File

@@ -138,7 +138,7 @@ void InputClass::KeyUp(unsigned int input)
}
bool InputClass::IsKeyDown(unsigned int key)
bool InputClass::IsKeyDown(unsigned int key) const
{
// Return what state the key is in (pressed/not pressed).
return m_keys[key];
@@ -267,7 +267,7 @@ void InputClass::ProcessInput()
return;
}
bool InputClass::IsEscapePressed()
bool InputClass::IsEscapePressed() const
{
// Do a bitwise and on the keyboard state to check if the escape key is currently being pressed.
if (m_keyboardState[DIK_ESCAPE] & 0x80)
@@ -278,7 +278,7 @@ bool InputClass::IsEscapePressed()
return false;
}
bool InputClass::IsLeftArrowPressed()
bool InputClass::IsLeftArrowPressed() const
{
if (m_keyboardState[DIK_LEFT] & 0x80)
{
@@ -290,7 +290,7 @@ bool InputClass::IsLeftArrowPressed()
}
bool InputClass::IsRightArrowPressed()
bool InputClass::IsRightArrowPressed() const
{
if (m_keyboardState[DIK_RIGHT] & 0x80)
{
@@ -301,11 +301,32 @@ bool InputClass::IsRightArrowPressed()
return false;
}
bool InputClass::IsUpArrowPressed() const
{
if (m_keyboardState[DIK_UP] & 0x80)
{
return true;
}
return false;
}
bool InputClass::IsDownArrowPressed() const
{
if (m_keyboardState[DIK_DOWN] & 0x80)
{
return true;
}
return false;
}
///////////////////////////////////////////////////
// Les touches correspondent aux claviers QWERTY //
///////////////////////////////////////////////////
bool InputClass::IsAPressed()
bool InputClass::IsAPressed() const
{
// Touche A sur QWERTY, Q sur AZERTY
if (m_keyboardState[DIK_A] & 0x80)
@@ -317,7 +338,7 @@ bool InputClass::IsAPressed()
return false;
}
bool InputClass::IsDPressed()
bool InputClass::IsDPressed() const
{
if (m_keyboardState[DIK_D] & 0x80)
{
@@ -328,7 +349,7 @@ bool InputClass::IsDPressed()
return false;
}
bool InputClass::IsWPressed()
bool InputClass::IsWPressed() const
{
// Touche W sur QWERTY, Z sur AZERTY
if (m_keyboardState[DIK_W] & 0x80)
@@ -340,7 +361,7 @@ bool InputClass::IsWPressed()
return false;
}
bool InputClass::IsSPressed()
bool InputClass::IsSPressed() const
{
if (m_keyboardState[DIK_S] & 0x80)
{
@@ -351,7 +372,7 @@ bool InputClass::IsSPressed()
return false;
}
bool InputClass::IsQPressed()
bool InputClass::IsQPressed() const
{
// Touche Q sur QWERTY, A sur AZERTY
if (m_keyboardState[DIK_Q] & 0x80)
@@ -363,7 +384,7 @@ bool InputClass::IsQPressed()
return false;
}
bool InputClass::IsEPressed()
bool InputClass::IsEPressed() const
{
if (m_keyboardState[DIK_E] & 0x80)
{
@@ -374,14 +395,14 @@ bool InputClass::IsEPressed()
return false;
}
void InputClass::GetMouseLocation(int& mouseX, int& mouseY)
void InputClass::GetMouseLocation(int& mouseX, int& mouseY) const
{
mouseX = m_mouseX;
mouseY = m_mouseY;
return;
}
bool InputClass::IsLeftMousePressed()
bool InputClass::IsLeftMousePressed() const
{
// Check the left mouse button state.
if (m_mouseState.rgbButtons[0] & 0x80)
@@ -393,7 +414,7 @@ bool InputClass::IsLeftMousePressed()
return false;
}
bool InputClass::IsRightMousePressed()
bool InputClass::IsRightMousePressed() const
{
// Check the left mouse button state.
if (m_mouseState.rgbButtons[1] & 0x80)
@@ -404,3 +425,23 @@ bool InputClass::IsRightMousePressed()
return false;
}
bool InputClass::IsScrollUp() const
{
if (m_mouseState.lZ > 0)
{
return true;
}
return false;
}
bool InputClass::IsScrollDown() const
{
if (m_mouseState.lZ < 0)
{
return true;
}
return false;
}