|
@@ -148,8 +148,8 @@ void OpenRaider::frame() {
|
148
|
148
|
// Calculate FPS display value
|
149
|
149
|
fpsCount++;
|
150
|
150
|
fpsSum += (systemTimerGet() - startTime);
|
151
|
|
- if (fpsSum >= 500) {
|
152
|
|
- // Update every 500ms
|
|
151
|
+ if (fpsSum >= 250) {
|
|
152
|
+ // Update every 250ms
|
153
|
153
|
fps = (int)((float)fpsCount * (1000.0f / (float)fpsSum));
|
154
|
154
|
fpsCount = fpsSum = 0;
|
155
|
155
|
}
|
|
@@ -177,9 +177,9 @@ void OpenRaider::handleKeyboard(KeyboardButton key, bool pressed) {
|
177
|
177
|
getMenu().handleKeyboard(key, pressed);
|
178
|
178
|
}
|
179
|
179
|
|
180
|
|
- //! \fixme Menu/Console visibility could also change in other ways,
|
181
|
|
- // that should still result in the correct mousegrab state
|
182
|
|
- getWindow().setMousegrab(!(getMenu().isVisible() || getConsole().isVisible()));
|
|
180
|
+ bool mousegrab = !(getMenu().isVisible() || getConsole().isVisible());
|
|
181
|
+ if (mousegrab != getWindow().getMousegrab())
|
|
182
|
+ getWindow().setMousegrab(mousegrab);
|
183
|
183
|
}
|
184
|
184
|
|
185
|
185
|
void OpenRaider::handleText(char *text, bool notFinished) {
|
|
@@ -190,6 +190,10 @@ void OpenRaider::handleText(char *text, bool notFinished) {
|
190
|
190
|
if ((getConsole().isVisible()) && (!getMenu().isVisible())) {
|
191
|
191
|
getConsole().handleText(text, notFinished);
|
192
|
192
|
}
|
|
193
|
+
|
|
194
|
+ bool mousegrab = !(getMenu().isVisible() || getConsole().isVisible());
|
|
195
|
+ if (mousegrab != getWindow().getMousegrab())
|
|
196
|
+ getWindow().setMousegrab(mousegrab);
|
193
|
197
|
}
|
194
|
198
|
|
195
|
199
|
void OpenRaider::handleMouseClick(unsigned int x, unsigned int y, KeyboardButton button, bool released) {
|
|
@@ -205,6 +209,10 @@ void OpenRaider::handleMouseClick(unsigned int x, unsigned int y, KeyboardButton
|
205
|
209
|
}
|
206
|
210
|
}
|
207
|
211
|
}
|
|
212
|
+
|
|
213
|
+ bool mousegrab = !(getMenu().isVisible() || getConsole().isVisible());
|
|
214
|
+ if (mousegrab != getWindow().getMousegrab())
|
|
215
|
+ getWindow().setMousegrab(mousegrab);
|
208
|
216
|
}
|
209
|
217
|
|
210
|
218
|
void OpenRaider::handleMouseMotion(int xrel, int yrel) {
|
|
@@ -214,6 +222,10 @@ void OpenRaider::handleMouseMotion(int xrel, int yrel) {
|
214
|
222
|
if ((!getConsole().isVisible()) && (!getMenu().isVisible())) {
|
215
|
223
|
getGame().handleMouseMotion(xrel, yrel);
|
216
|
224
|
}
|
|
225
|
+
|
|
226
|
+ bool mousegrab = !(getMenu().isVisible() || getConsole().isVisible());
|
|
227
|
+ if (mousegrab != getWindow().getMousegrab())
|
|
228
|
+ getWindow().setMousegrab(mousegrab);
|
217
|
229
|
}
|
218
|
230
|
|
219
|
231
|
void OpenRaider::handleMouseScroll(int xrel, int yrel) {
|
|
@@ -223,5 +235,9 @@ void OpenRaider::handleMouseScroll(int xrel, int yrel) {
|
223
|
235
|
if ((getConsole().isVisible()) && (!getMenu().isVisible())) {
|
224
|
236
|
getConsole().handleMouseScroll(xrel, yrel);
|
225
|
237
|
}
|
|
238
|
+
|
|
239
|
+ bool mousegrab = !(getMenu().isVisible() || getConsole().isVisible());
|
|
240
|
+ if (mousegrab != getWindow().getMousegrab())
|
|
241
|
+ getWindow().setMousegrab(mousegrab);
|
226
|
242
|
}
|
227
|
243
|
|