From a2867ff6ea6b2c8e1d7d9c2baec18b81bf469e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Sun, 29 Jan 2017 16:17:05 +0100 Subject: [PATCH] Cleanup --- src/window.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/window.c b/src/window.c index fbcc0884..957b5fd0 100644 --- a/src/window.c +++ b/src/window.c @@ -40,28 +40,23 @@ void _glfwInputWindowFocus(_GLFWwindow* window, GLFWbool focused) { - if (focused) - { - if (window->callbacks.focus) - window->callbacks.focus((GLFWwindow*) window, focused); - } - else - { - int i; + if (window->callbacks.focus) + window->callbacks.focus((GLFWwindow*) window, focused); - if (window->callbacks.focus) - window->callbacks.focus((GLFWwindow*) window, focused); + if (!focused) + { + int key, button; - for (i = 0; i <= GLFW_KEY_LAST; i++) + for (key = 0; key <= GLFW_KEY_LAST; key++) { - if (window->keys[i] == GLFW_PRESS) - _glfwInputKey(window, i, 0, GLFW_RELEASE, 0); + if (window->keys[key] == GLFW_PRESS) + _glfwInputKey(window, key, 0, GLFW_RELEASE, 0); } - for (i = 0; i <= GLFW_MOUSE_BUTTON_LAST; i++) + for (button = 0; button <= GLFW_MOUSE_BUTTON_LAST; button++) { - if (window->mouseButtons[i] == GLFW_PRESS) - _glfwInputMouseClick(window, i, GLFW_RELEASE, 0); + if (window->mouseButtons[button] == GLFW_PRESS) + _glfwInputMouseClick(window, button, GLFW_RELEASE, 0); } } }