samples/Blokus: Work-around for Flash() lockups when running with timers on Windows
authorJerome St-Louis <jerome@ecere.com>
Sat, 4 Feb 2012 18:16:01 +0000 (01:16 +0700)
committerJerome St-Louis <jerome@ecere.com>
Sat, 4 Feb 2012 18:16:01 +0000 (01:16 +0700)
samples/games/blokus/blokus.ec

index 9929d25..9dd52f5 100644 (file)
@@ -518,6 +518,27 @@ class Blokus : Window
    gotMove = true;
 #endif
 
+#ifdef __WIN32__
+   // To work around Flash() lockups on Windows...
+   bool flash;
+   Timer flashTimer
+   {
+      this, delay = 0.2, true;
+
+      bool DelayExpired()
+      {
+         if(flash)
+            Window::Flash();
+         return true;
+      }
+   };
+
+   void Flash()
+   {
+      flash = true;
+   }
+#endif
+
    void NextColorPlayed()
    {
       if(gameState.numPlayers == 1)