remove redundant static_cast by changing Events::pressedKeys template parameter from int to keycode

This commit is contained in:
A-lex-Ra
2024-02-23 20:15:02 +06:00
parent 659a2610aa
commit 77b36f45f2
4 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -27,13 +27,13 @@ void key_callback(GLFWwindow*, int key, int scancode, int action, int /*mode*/)
if (key == GLFW_KEY_UNKNOWN) return;
if (action == GLFW_PRESS) {
Events::setKey(key, true);
Events::pressedKeys.push_back(key);
Events::pressedKeys.push_back(static_cast<keycode>(key));
}
else if (action == GLFW_RELEASE) {
Events::setKey(key, false);
}
else if (action == GLFW_REPEAT) {
Events::pressedKeys.push_back(key);
Events::pressedKeys.push_back(static_cast<keycode>(key));
}
}