]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/bombs/game.cpp
Use TAbs in debian/rules, not spaces, as it's a makefile.
[wxWidgets.git] / demos / bombs / game.cpp
index 6a76fea09b6f8d2358e99aa6c2de4f41ea88f503..ae07b7dac09f19db8eba06bdba4aff8f5b0a8734 100644 (file)
@@ -9,10 +9,6 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#   pragma implementation
-#endif
-
 #include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
@@ -99,6 +95,7 @@ bool BombsGame::Init(int aWidth, int aHeight, bool easyCorner)
             }
 
     m_numRemainingCells = m_height*m_width-m_numBombCells;
+    m_numMarkedCells = 0;
 
     return true;
 }
@@ -106,15 +103,22 @@ bool BombsGame::Init(int aWidth, int aHeight, bool easyCorner)
 void BombsGame::Mark(int x, int y)
 {
     m_field[x+y*m_width] ^= BG_MARKED;
+    if (IsMarked(x, y))
+        m_numMarkedCells++;
+    else
+        m_numMarkedCells--;
 }
 
-void BombsGame::Unhide(int x, int y)
+void BombsGame::Unhide(int x, int y, bool b_selected)
 {
     if (!IsHidden(x,y))
     {
         return;
     }
 
+    if (b_selected)
+        m_field[x+y*m_width] |= BG_SELECTED;
+
     m_field[x+y*m_width] &= ~BG_HIDDEN;
 
     if (!IsBomb(x,y))