EmilBoussard/Tower_Defence — Issue #1: Grid update is shown if windows is hidden when grid is drawn.
Author: PerBoussard
Created: 2011-10-26 14:40:51+00:00
State: open

Board and Scoreboard should be drawn outside of the click processing, like so.

diff --git a/src/TowerDefence.cpp b/src/TowerDefence.cpp
index 29a33b0..344b21d 100644
--- a/src/TowerDefence.cpp
+++ b/src/TowerDefence.cpp
@@ -208,12 +208,6 @@ int main()
al_set_window_title (lowResDisplay, "Low resolution display @ 1280 * 720"
al_set_target_bitmap (al_get_backbuffer (lowResDisplay));

- if (lowResDisplay != NULL)
- {
- board.lowResDraw();
- scoreboard.lowResDraw();
- }
-

@@ -257,12 +251,6 @@ int main()
al_set_window_title (highResDisplay, "High resolution display @ 1920 * 10
al_set_target_bitmap (al_get_backbuffer (highResDisplay));

- if (highResDisplay != NULL)
- {
- board.highResDraw();
- scoreboard.highResDraw();
- }
-

@@ -283,6 +271,18 @@ int main()
}
}

+ if (lowResDisplay != NULL)
+ {
+ board.lowResDraw();
+ scoreboard.lowResDraw();
+ }
+
+ if (highResDisplay != NULL)
+ {
+ board.highResDraw();
+ scoreboard.highResDraw();
+ }
+

al_flip_display();
}