|
From: Lasse Kärkkäi. <tr...@us...> - 2010-01-18 03:30:28
|
Module: performous
Branch: master
Commit: d26cf5062b29ba14cd32ffc4d4dc95fe284438f7
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Jan 18 05:30:15 2010 +0200
Fix screen switching
---
docs/TODO.txt | 1 -
game/main.cc | 5 ++++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/TODO.txt b/docs/TODO.txt
index c29d0ee..02612ab 100644
--- a/docs/TODO.txt
+++ b/docs/TODO.txt
@@ -59,5 +59,4 @@ SS Ripper:
Bugs:
- Segfault when browsing songs in song browser while loading (segfaults before loading finishes), quite rare
-- Players screen displays shit
diff --git a/game/main.cc b/game/main.cc
index 26ff4e1..81c20ae 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -167,9 +167,10 @@ void mainLoop(std::string const& songlist) {
}
sm.updateScreen(); // exit/enter, any exception is fatal error
try {
- checkEvents_SDL(sm, window);
+ // Draw
window.blank();
sm.getCurrentScreen()->draw();
+ // Display (and wait until next frame)
window.swap();
if (config["graphic/fps"].b()) {
++frames;
@@ -183,6 +184,8 @@ void mainLoop(std::string const& songlist) {
time = now();
frames = 0;
}
+ // Process events for the next frame
+ checkEvents_SDL(sm, window);
} catch (std::runtime_error& e) {
std::cerr << "ERROR: " << e.what() << std::endl;
}
|