git repos / blockattack-game

commit 69862ef6

sago007 · 2015-08-22 17:24
69862ef6c8a573dcd4881d513dd6c89f4d3b9e86 patch · browse files
parent 229e212d1bc42fefe5656739832b654fdbc5800a

Removed the unused variable showGame. It was a legacy variable from the old menu

Changed files

M source/code/BlockGame.cpp before
M source/code/BlockGame.hpp before
M source/code/main.cpp before
M source/code/mainVars.hpp before
diff --git a/source/code/BlockGame.cpp b/source/code/BlockGame.cpp index e01172a..04ad395 100644 --- a/source/code/BlockGame.cpp +++ b/source/code/BlockGame.cpp
@@ -28,8 +28,6 @@ http://blockattack.sf.net
#define FALLTIME 20
//Don't change the following, they are fundamental and later some functions are hardcoded
#define BLOCKFALL 10000
-#define BLOCKWAIT 100000
-#define BLOCKHANG 1000
#define GARBAGE 1000000
#define CHAINPLACE 10000000
@@ -117,7 +115,6 @@ BlockGame::BlockGame()
chainSize[i] = 0;
}
theReplay = Replay();
- showGame = true; //The game is now active
lastCounter = -1; //To prevent the final chunk to be played when stating the program
} //Constructor
@@ -360,7 +357,6 @@ void BlockGame::NewGame( unsigned int ticks)
chainSize[i] = 0;
}
lastAImove = ticks+3000;
- showGame = true;
theReplay = Replay();
ActionPerformed(ACTION_NEW,"");
} //NewGame
@@ -546,7 +542,6 @@ void BlockGame::setPlayerWon()
}
}
hasWonTheGame = true;
- showGame = false;
}
//void SetGameOver();
@@ -571,7 +566,6 @@ void BlockGame::setDraw()
}
hasWonTheGame = false;
bDraw = true;
- showGame = false;
Mix_HaltChannel(1);
if(!AI_Enabled && !bReplaying)
Stats::getInstance()->addOne("totalDraws");
@@ -1274,7 +1268,6 @@ void BlockGame::SetGameOver()
theReplay.setName(name);
}
bGameOver = true;
- showGame = false;
if(stageClear)
stageButtonStatus = SBstageClear;
}
@@ -1450,7 +1443,6 @@ void BlockGame::PushLineInternal()
}
score=0;
bGameOver=false;
- showGame = true;
}
if ((TowerHeight>12) && (!puzzleMode)&&(!bGameOver)&&(chain==0))
diff --git a/source/code/BlockGame.hpp b/source/code/BlockGame.hpp index d74228d..5696af2 100644 --- a/source/code/BlockGame.hpp +++ b/source/code/BlockGame.hpp
@@ -29,6 +29,8 @@ http://blockattack.sf.net
#include "replay.h"
#define NUMBEROFCHAINS 100
+#define BLOCKWAIT 100000
+#define BLOCKHANG 1000
#define ACTION_UPDATE 0
#define ACTION_MOVECURSOR 1
diff --git a/source/code/main.cpp b/source/code/main.cpp index ab83280..1d1fddf 100644 --- a/source/code/main.cpp +++ b/source/code/main.cpp
@@ -3070,7 +3070,6 @@ static void StartSinglePlayerEndless()
b1playerOpen = false;
twoPlayers =false;
player2->SetGameOver();
- showGame = true;
player1->name = player1name;
player2->name = player2name;
}
@@ -3081,7 +3080,6 @@ static void StartSinglePlayerTimeTrial()
closeAllMenus();
twoPlayers =false;
player2->SetGameOver();
- showGame = true;
//vsMode = false;
player1->name = player1name;
player2->name = player2name;
@@ -3098,7 +3096,6 @@ static int StartSinglePlayerPuzzle(int level)
closeAllMenus();
twoPlayers = false;
player2->SetGameOver();
- showGame = true;
//vsMode = true;
player1->name = player1name;
player2->name = player2name;
@@ -3553,11 +3550,9 @@ int main(int argc, char *argv[])
nt.setBGpointers(&theGame,&theGame2);
#endif
- if (singlePuzzle)
- {
+ if (singlePuzzle) {
LoadPuzzleStages();
theGame.NewPuzzleGame(singlePuzzleNr, SDL_GetTicks());
- showGame = true;
}
//Draws everything to screen
if (!editorMode)
@@ -3695,7 +3690,6 @@ int runGame(int gametype, int level)
{
LoadPuzzleStages();
theGame.NewPuzzleGame(singlePuzzleNr, SDL_GetTicks());
- showGame = true;
}
//Draws everything to screen
if (!editorMode)
@@ -3733,7 +3727,6 @@ int runGame(int gametype, int level)
closeAllMenus();
twoPlayers =false;
theGame2.SetGameOver();
- showGame = true;
theGame.name = player1name;
theGame2.name = player2name;
}
@@ -3753,7 +3746,6 @@ int runGame(int gametype, int level)
MakeBackground(xsize,ysize,&theGame,&theGame2);
DrawIMG(background, screen, 0, 0);
twoPlayers = true; //Single player, but AI plays
- showGame = true;
theGame2.setAIlevel((Uint8)theAIlevel);
int theTime = time(0);
theGame.putStartBlocks(theTime);
@@ -3877,14 +3869,14 @@ int runGame(int gametype, int level)
timeHeldP1S=SDL_GetTicks();
timesRepeatedP1S=0;
}
- if ( (event.key.keysym.sym == keySettings[player1keys].left) && (showGame) )
+ if ( (event.key.keysym.sym == keySettings[player1keys].left) )
{
theGame.MoveCursor('W');
repeatingW[0]=true;
timeHeldP1W=SDL_GetTicks();
timesRepeatedP1W=0;
}
- if ( (event.key.keysym.sym == keySettings[player1keys].right) && (showGame) )
+ if ( (event.key.keysym.sym == keySettings[player1keys].right) )
{
theGame.MoveCursor('E');
repeatingE[0]=true;
@@ -3917,14 +3909,14 @@ int runGame(int gametype, int level)
timeHeldP2S=SDL_GetTicks();
timesRepeatedP2S=0;
}
- if ( (event.key.keysym.sym == keySettings[player2keys].left) && (showGame) )
+ if ( (event.key.keysym.sym == keySettings[player2keys].left) )
{
theGame2.MoveCursor('W');
repeatingW[1]=true;
timeHeldP2W=SDL_GetTicks();
timesRepeatedP2W=0;
}
- if ( (event.key.keysym.sym == keySettings[player2keys].right) && (showGame) )
+ if ( (event.key.keysym.sym == keySettings[player2keys].right) )
{
theGame2.MoveCursor('E');
repeatingE[1]=true;
diff --git a/source/code/mainVars.hpp b/source/code/mainVars.hpp index b6fd116..c0a1488 100644 --- a/source/code/mainVars.hpp +++ b/source/code/mainVars.hpp
@@ -181,7 +181,6 @@ static bool bReplayOpen; //Show replay menu
#if NETWORK
static bool bNetworkOpen; //Show the network menu
#endif
-static bool showGame; //the game is active don't show highscores/options
static bool showOptions; //true if options is open
static bool bScreenLocked; //Don't take input or allow any mouse interaction! Used for dialogbox and warningbox
static bool showDialog;