feat: players interpolation & add hud.set_allow_pause(...)
This commit is contained in:
+11
-7
@@ -18,8 +18,8 @@ uint Events::currentFrame = 0;
|
||||
int Events::scroll = 0;
|
||||
glm::vec2 Events::delta = {};
|
||||
glm::vec2 Events::cursor = {};
|
||||
bool Events::cursor_drag = false;
|
||||
bool Events::_cursor_locked = false;
|
||||
bool Events::cursorDrag = false;
|
||||
bool Events::cursorLocked = false;
|
||||
std::vector<uint> Events::codepoints;
|
||||
std::vector<keycode> Events::pressedKeys;
|
||||
std::unordered_map<std::string, Binding> Events::bindings;
|
||||
@@ -61,10 +61,10 @@ bool Events::jclicked(int button) {
|
||||
}
|
||||
|
||||
void Events::toggleCursor() {
|
||||
cursor_drag = false;
|
||||
_cursor_locked = !_cursor_locked;
|
||||
cursorDrag = false;
|
||||
cursorLocked = !cursorLocked;
|
||||
Window::setCursorMode(
|
||||
_cursor_locked ? GLFW_CURSOR_DISABLED : GLFW_CURSOR_NORMAL
|
||||
cursorLocked ? GLFW_CURSOR_DISABLED : GLFW_CURSOR_NORMAL
|
||||
);
|
||||
}
|
||||
|
||||
@@ -170,11 +170,11 @@ void Events::setButton(int button, bool b) {
|
||||
}
|
||||
|
||||
void Events::setPosition(float xpos, float ypos) {
|
||||
if (Events::cursor_drag) {
|
||||
if (Events::cursorDrag) {
|
||||
Events::delta.x += xpos - Events::cursor.x;
|
||||
Events::delta.y += ypos - Events::cursor.y;
|
||||
} else {
|
||||
Events::cursor_drag = true;
|
||||
Events::cursorDrag = true;
|
||||
}
|
||||
Events::cursor.x = xpos;
|
||||
Events::cursor.y = ypos;
|
||||
@@ -249,3 +249,7 @@ void Events::enableBindings() {
|
||||
binding.enable = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool Events::isCursorLocked() {
|
||||
return cursorLocked;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user