mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 14:41:49 +01:00
Rework Tile detection system
This commit is contained in:
@@ -757,11 +757,8 @@ int utils::randRange(int min, int max) {
|
||||
}
|
||||
bool utils::isKeyDown(int keycode) {
|
||||
const Uint8* pStates = SDL_GetKeyboardState(nullptr);
|
||||
if (pStates != nullptr)
|
||||
{
|
||||
if(pStates[keycode]) {
|
||||
return true;
|
||||
}
|
||||
if (pStates != nullptr) {
|
||||
return pStates[keycode];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -771,8 +768,10 @@ bool utils::isKeyPressed(int keycode) {
|
||||
if (pStates != nullptr) {
|
||||
if(pStates[keycode] && !s_KeyStates[keycode]) {
|
||||
s_KeyStates[keycode] = true;
|
||||
return s_KeyStates[keycode];
|
||||
}else {
|
||||
s_KeyStates[keycode] = false;
|
||||
}
|
||||
return s_KeyStates[keycode];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user