git repos / blockattack-game

blame: source/code/mainVars.hpp

normal view · raw

89c4a3a6 sago007 2008-08-29 14:32 1
/*
c53e6443 sago007 2012-04-17 11:04 2
===========================================================================
c53e6443 sago007 2012-04-17 11:04 3
blockattack - Block Attack - Rise of the Blocks
c53e6443 sago007 2012-04-17 11:04 4
Copyright (C) 2005-2012 Poul Sander
c53e6443 sago007 2012-04-17 11:04 5
c53e6443 sago007 2012-04-17 11:04 6
This program is free software: you can redistribute it and/or modify
c53e6443 sago007 2012-04-17 11:04 7
it under the terms of the GNU General Public License as published by
c53e6443 sago007 2012-04-17 11:04 8
the Free Software Foundation, either version 2 of the License, or
c53e6443 sago007 2012-04-17 11:04 9
(at your option) any later version.
c53e6443 sago007 2012-04-17 11:04 10
c53e6443 sago007 2012-04-17 11:04 11
This program is distributed in the hope that it will be useful,
c53e6443 sago007 2012-04-17 11:04 12
but WITHOUT ANY WARRANTY; without even the implied warranty of
c53e6443 sago007 2012-04-17 11:04 13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
c53e6443 sago007 2012-04-17 11:04 14
GNU General Public License for more details.
c53e6443 sago007 2012-04-17 11:04 15
c53e6443 sago007 2012-04-17 11:04 16
You should have received a copy of the GNU General Public License
c53e6443 sago007 2012-04-17 11:04 17
along with this program.  If not, see http://www.gnu.org/licenses/
c53e6443 sago007 2012-04-17 11:04 18
c53e6443 sago007 2012-04-17 11:04 19
Source information and contacts persons can be found at
c53e6443 sago007 2012-04-17 11:04 20
http://blockattack.sf.net
c53e6443 sago007 2012-04-17 11:04 21
===========================================================================
89c4a3a6 sago007 2008-08-29 14:32 22
*/
89c4a3a6 sago007 2008-08-29 14:32 23
6d48320c sago007 2009-03-28 17:06 24
//Make sure it is only included once
6d48320c sago007 2009-03-28 17:06 25
#ifndef _MAINVARS_HPP
6d48320c sago007 2009-03-28 17:06 26
#define	_MAINVARS_HPP
6d48320c sago007 2009-03-28 17:06 27
89c4a3a6 sago007 2008-08-29 14:32 28
//main variables and constants
89c4a3a6 sago007 2008-08-29 14:32 29
89c4a3a6 sago007 2008-08-29 14:32 30
89c4a3a6 sago007 2008-08-29 14:32 31
//Animation lengths:
89c4a3a6 sago007 2008-08-29 14:32 32
#define READYTIME 500
89c4a3a6 sago007 2008-08-29 14:32 33
#define BOMBTIME 200
89c4a3a6 sago007 2008-08-29 14:32 34
#define CURSORTIME 200
89c4a3a6 sago007 2008-08-29 14:32 35
89c4a3a6 sago007 2008-08-29 14:32 36
89c4a3a6 sago007 2008-08-29 14:32 37
using namespace std;	//remove it if you dare...
56241205 sago007 2012-08-05 11:15 38
const char sharedir[] = SHAREDIR;
89c4a3a6 sago007 2008-08-29 14:32 39
89c4a3a6 sago007 2008-08-29 14:32 40
//All graphic in the game (as pointers):
30f910dd sago007 2010-11-10 21:02 41
static SDL_Surface *background;    //Stores background
b7590374 sago007 2011-05-19 16:15 42
SDL_Surface *backgroundImage; //Stores the background image
30f910dd sago007 2010-11-10 21:02 43
static SDL_Surface *backBoard;     //Stores the background to the board
69d650b4 sago007 2011-07-20 15:24 44
//static SDL_Surface *b1player;
69d650b4 sago007 2011-07-20 15:24 45
//static SDL_Surface *b2players;
69d650b4 sago007 2011-07-20 15:24 46
//static SDL_Surface *bVsMode;
69d650b4 sago007 2011-07-20 15:24 47
//static SDL_Surface *bVsModeConfig; //Added in 1.4.0
69d650b4 sago007 2011-07-20 15:24 48
//static SDL_Surface *bStageClear;
69d650b4 sago007 2011-07-20 15:24 49
//static SDL_Surface *bPuzzle;
43611709 sago007 2011-04-23 17:18 50
static CppSdl::CppSdlImageHolder bNewGame;      //The New Game botton
69d650b4 sago007 2011-07-20 15:24 51
//static SDL_Surface *bEndless;      //Endless button (sub to new)
69d650b4 sago007 2011-07-20 15:24 52
//static SDL_Surface *bTimeTrial;    //Time trial button (sub to new)
30f910dd sago007 2010-11-10 21:02 53
static SDL_Surface *bOptions;      //The Options botton
89c4a3a6 sago007 2008-08-29 14:32 54
//new in 1.1.1
30f910dd sago007 2010-11-10 21:02 55
static SDL_Surface *bConfigure;    //The configure button
30f910dd sago007 2010-11-10 21:02 56
static SDL_Surface *bSelectPuzzle; //The Select Puzzle Button
30f910dd sago007 2010-11-10 21:02 57
static SDL_Surface *bBack;         //The "Back" button
30f910dd sago007 2010-11-10 21:02 58
static SDL_Surface *bForward;      //The "forward" button
89c4a3a6 sago007 2008-08-29 14:32 59
//new in 1.1.1 end
89c4a3a6 sago007 2008-08-29 14:32 60
//new in 1.1.2
30f910dd sago007 2010-11-10 21:02 61
static SDL_Surface *iChainBack;
89c4a3a6 sago007 2008-08-29 14:32 62
//new in 1.1.2 end (nota that iSmallFont has also been added)
89c4a3a6 sago007 2008-08-29 14:32 63
//new in 1.2.0
69d650b4 sago007 2011-07-20 15:24 64
//static SDL_Surface *bReplay;
69d650b4 sago007 2011-07-20 15:24 65
//static SDL_Surface *bSave;
69d650b4 sago007 2011-07-20 15:24 66
//static SDL_Surface *bLoad;
2f30c381 sago007 2008-09-14 13:08 67
#if NETWORK
69d650b4 sago007 2011-07-20 15:24 68
//static SDL_Surface *bNetwork;
69d650b4 sago007 2011-07-20 15:24 69
//static SDL_Surface *bConnect;
69d650b4 sago007 2011-07-20 15:24 70
//static SDL_Surface *bHost;
89c4a3a6 sago007 2008-08-29 14:32 71
#endif
89c4a3a6 sago007 2008-08-29 14:32 72
//new in 1.2.0 end
30f910dd sago007 2010-11-10 21:02 73
static SDL_Surface *bHighScore;    //The High Score botton
69d650b4 sago007 2011-07-20 15:24 74
//static SDL_Surface *bExit;         //The Exit botton
30f910dd sago007 2010-11-10 21:02 75
static SDL_Surface *blackLine;		//The seperator in stage clear
30f910dd sago007 2010-11-10 21:02 76
static SDL_Surface *stageBobble;	//The bobble instage clear
26ddb424 sago007 2011-06-09 20:06 77
SDL_Surface *screen;        //The whole screen;
30f910dd sago007 2010-11-10 21:02 78
static SDL_Surface *iGameOver;     //The gameOver image
30f910dd sago007 2010-11-10 21:02 79
static SDL_Surface *iWinner;		//the "winner" image
30f910dd sago007 2010-11-10 21:02 80
static SDL_Surface *iDraw;			//the "draw" image
30f910dd sago007 2010-11-10 21:02 81
static SDL_Surface *iLoser;		//the "loser" image
89c4a3a6 sago007 2008-08-29 14:32 82
//Animations:
30f910dd sago007 2010-11-10 21:02 83
static SDL_Surface *cursor[2];    //The animated cursor
30f910dd sago007 2010-11-10 21:02 84
static SDL_Surface *bomb[2];       //Bomb then the bricks should blow
30f910dd sago007 2010-11-10 21:02 85
static SDL_Surface *ready[2];      //Before the blocks fall
30f910dd sago007 2010-11-10 21:02 86
static SDL_Surface *explosion[4];   //Then a block explodes
89c4a3a6 sago007 2008-08-29 14:32 87
//Animations end
30f910dd sago007 2010-11-10 21:02 88
static SDL_Surface *counter[3];    //Counts down from 3
30f910dd sago007 2010-11-10 21:02 89
static SDL_Surface *bricks[7];     //The bricks, saved in an array of pointers
30f910dd sago007 2010-11-10 21:02 90
static SDL_Surface *crossover;     //Cross the bricks that will be cleared soon
30f910dd sago007 2010-11-10 21:02 91
static SDL_Surface *balls[7];      //The balls (the small ones that jump around)
925b7e58 sago007 2011-04-25 16:35 92
//static SDL_Surface *iBlueFont;      //Contains the blue font used
925b7e58 sago007 2011-04-25 16:35 93
//static SDL_Surface *iSmallFont;	//Small font used for the chain text
14e13624 sago007 2011-07-20 17:14 94
//static SDL_Surface *optionsBack;
30f910dd sago007 2010-11-10 21:02 95
static SDL_Surface *changeButtonsBack;
30f910dd sago007 2010-11-10 21:02 96
static SDL_Surface *dialogBox;
89c4a3a6 sago007 2008-08-29 14:32 97
//SDL_Surface *fileDialogBox;  //Manual entering of filename, new in 1.1.1, obsolute in 1.1.2
30f910dd sago007 2010-11-10 21:02 98
static SDL_Surface *bOn;
30f910dd sago007 2010-11-10 21:02 99
static SDL_Surface *bOff;
14e13624 sago007 2011-07-20 17:14 100
//static SDL_Surface *bChange;
30f910dd sago007 2010-11-10 21:02 101
static SDL_Surface *b1024;
30f910dd sago007 2010-11-10 21:02 102
static SDL_Surface *iLevelCheck;		//To the level select screen
30f910dd sago007 2010-11-10 21:02 103
static SDL_Surface *iLevelCheckBox;
cc6724c9 sago007 2012-04-16 21:11 104
static SDL_Surface *iLevelCheckBoxMarked;
30f910dd sago007 2010-11-10 21:02 105
static SDL_Surface *iCheckBoxArea;
30f910dd sago007 2010-11-10 21:02 106
static SDL_Surface *boardBackBack;
30f910dd sago007 2010-11-10 21:02 107
static SDL_Surface *garbageTL;			//the Garbage Blocks
30f910dd sago007 2010-11-10 21:02 108
static SDL_Surface *garbageT;
30f910dd sago007 2010-11-10 21:02 109
static SDL_Surface *garbageTR;
30f910dd sago007 2010-11-10 21:02 110
static SDL_Surface *garbageR;
30f910dd sago007 2010-11-10 21:02 111
static SDL_Surface *garbageBR;
30f910dd sago007 2010-11-10 21:02 112
static SDL_Surface *garbageB;
30f910dd sago007 2010-11-10 21:02 113
static SDL_Surface *garbageBL;
30f910dd sago007 2010-11-10 21:02 114
static SDL_Surface *garbageL;
30f910dd sago007 2010-11-10 21:02 115
static SDL_Surface *garbageFill;
30f910dd sago007 2010-11-10 21:02 116
static SDL_Surface *garbageM;
30f910dd sago007 2010-11-10 21:02 117
static SDL_Surface *garbageML;
30f910dd sago007 2010-11-10 21:02 118
static SDL_Surface *garbageMR;
30f910dd sago007 2010-11-10 21:02 119
static SDL_Surface *smiley[4];
30f910dd sago007 2010-11-10 21:02 120
static SDL_Surface *garbageGM;
30f910dd sago007 2010-11-10 21:02 121
static SDL_Surface *garbageGML;
30f910dd sago007 2010-11-10 21:02 122
static SDL_Surface *garbageGMR;
30f910dd sago007 2010-11-10 21:02 123
static SDL_Surface *transCover;        //The transperant block, covers the upcomming
1572de2b sago007 2008-09-11 18:15 124
#if LEVELEDITOR
30f910dd sago007 2010-11-10 21:02 125
static SDL_Surface *bCreateFile;
30f910dd sago007 2010-11-10 21:02 126
static SDL_Surface *bDeletePuzzle;
30f910dd sago007 2010-11-10 21:02 127
static SDL_Surface *bLoadFile;
30f910dd sago007 2010-11-10 21:02 128
static SDL_Surface *bMoveBack;
30f910dd sago007 2010-11-10 21:02 129
static SDL_Surface *bMoveDown;
30f910dd sago007 2010-11-10 21:02 130
static SDL_Surface *bMoveForward;
30f910dd sago007 2010-11-10 21:02 131
static SDL_Surface *bMoveLeft;
30f910dd sago007 2010-11-10 21:02 132
static SDL_Surface *bMoveRight;
30f910dd sago007 2010-11-10 21:02 133
static SDL_Surface *bMoveUp;
30f910dd sago007 2010-11-10 21:02 134
static SDL_Surface *bNewPuzzle;
30f910dd sago007 2010-11-10 21:02 135
static SDL_Surface *bSaveFileAs;
30f910dd sago007 2010-11-10 21:02 136
static SDL_Surface *bSavePuzzle;
30f910dd sago007 2010-11-10 21:02 137
static SDL_Surface *bSaveToFile;
30f910dd sago007 2010-11-10 21:02 138
static SDL_Surface *bTestPuzzle;
1572de2b sago007 2008-09-11 18:15 139
#endif
30f910dd sago007 2010-11-10 21:02 140
static SDL_Surface *bSkip;
30f910dd sago007 2010-11-10 21:02 141
static SDL_Surface *bRetry;
30f910dd sago007 2010-11-10 21:02 142
static SDL_Surface *bNext;
78d03b38 sago007 2008-11-13 19:56 143
b7590374 sago007 2011-05-19 16:15 144
CppSdl::CppSdlImageHolder menuMarked;
b7590374 sago007 2011-05-19 16:15 145
CppSdl::CppSdlImageHolder menuUnmarked;
89c4a3a6 sago007 2008-08-29 14:32 146
//end new in 1.4.0
8d488d32 sago007 2011-04-17 13:02 147
//static SDL_Surface *mouse;				//The mouse cursor
b7590374 sago007 2011-05-19 16:15 148
CppSdl::CppSdlImageHolder mouse;
89c4a3a6 sago007 2008-08-29 14:32 149
89c4a3a6 sago007 2008-08-29 14:32 150
30f910dd sago007 2010-11-10 21:02 151
static SDL_Surface *tmp;				//a temporary surface to use DisplayFormat
89c4a3a6 sago007 2008-08-29 14:32 152
89c4a3a6 sago007 2008-08-29 14:32 153
925b7e58 sago007 2011-04-25 16:35 154
//static SFont_Font *fBlueFont;      //Stores the blue font (SFont)
925b7e58 sago007 2011-04-25 16:35 155
//static SFont_Font *fSmallFont;		//Stores the small font (SFont)
89c4a3a6 sago007 2008-08-29 14:32 156
//TTFont ttfont;           //Stores the TTF font (TTFSDL)
925b7e58 sago007 2011-04-25 16:35 157
static NFont nf_button_font;        //Font used for buttons!
26ddb424 sago007 2011-06-09 20:06 158
NFont nf_scoreboard_font;
925b7e58 sago007 2011-04-25 16:35 159
static NFont nf_standard_blue_font;      //Font used instead of the old blue SFont
925b7e58 sago007 2011-04-25 16:35 160
static NFont nf_standard_small_font;
89c4a3a6 sago007 2008-08-29 14:32 161
30f910dd sago007 2010-11-10 21:02 162
static Mix_Music *bgMusic;         //backgroundMusic
30f910dd sago007 2010-11-10 21:02 163
static Mix_Music *highbeatMusic;   //Background music with higher beat
30f910dd sago007 2010-11-10 21:02 164
static Mix_Chunk *boing;           //boing sound when clearing
30f910dd sago007 2010-11-10 21:02 165
static Mix_Chunk *applause;        //Applause, then the player is good
30f910dd sago007 2010-11-10 21:02 166
static Mix_Chunk *photoClick;      //clickSound
30f910dd sago007 2010-11-10 21:02 167
static Mix_Chunk *typingChunk;          //When writing
30f910dd sago007 2010-11-10 21:02 168
static Mix_Chunk *counterChunk;         //When counting down
30f910dd sago007 2010-11-10 21:02 169
static Mix_Chunk *counterFinalChunk;
89c4a3a6 sago007 2008-08-29 14:32 170
89c4a3a6 sago007 2008-08-29 14:32 171
Highscore theTopScoresEndless;      //Stores highscores for endless
89c4a3a6 sago007 2008-08-29 14:32 172
Highscore theTopScoresTimeTrial;    //Stores highscores for timetrial
89c4a3a6 sago007 2008-08-29 14:32 173
30f910dd sago007 2010-11-10 21:02 174
static bool bMouseUp;              //true if the mouse(1) is unpressed
30f910dd sago007 2010-11-10 21:02 175
static bool bMouseUp2;             //true if the mouse(2) is unpressed
2f30c381 sago007 2008-09-14 13:08 176
#if NETWORK
30f910dd sago007 2010-11-10 21:02 177
static bool bNetworkOpen;			//Show the network menu
89c4a3a6 sago007 2008-08-29 14:32 178
#endif
30f910dd sago007 2010-11-10 21:02 179
static bool bScreenLocked;			//Don't take input or allow any mouse interaction! Used for dialogbox and warningbox
30f910dd sago007 2010-11-10 21:02 180
static bool showDialog;
30f910dd sago007 2010-11-10 21:02 181
static bool NoSound;				//if true, absolutely no sound will be played, can be set from the commandline
89c4a3a6 sago007 2008-08-29 14:32 182
//prevents crash on systems without a soundcard
26ddb424 sago007 2011-06-09 20:06 183
bool MusicEnabled;			//true if background music is enabled
26ddb424 sago007 2011-06-09 20:06 184
bool SoundEnabled;			//true if sound effects is enabled
30f910dd sago007 2010-11-10 21:02 185
static bool bNearDeathPrev;                    //Near death status last time checked.
26ddb424 sago007 2011-06-09 20:06 186
bool bFullscreen;			//true if game is running fullscreen
30f910dd sago007 2010-11-10 21:02 187
static bool puzzleLoaded;          //true if the puzzle levels have been loaded
30f910dd sago007 2010-11-10 21:02 188
static bool drawBalls;             //if true balls are drawed to the screen, this might lower framerate too much
30f910dd sago007 2010-11-10 21:02 189
static bool standardBackground;
b7590374 sago007 2011-05-19 16:15 190
bool highPriority;
30f910dd sago007 2010-11-10 21:02 191
30f910dd sago007 2010-11-10 21:02 192
static bool editorMode = false;
30f910dd sago007 2010-11-10 21:02 193
static bool editorModeTest = false;
89c4a3a6 sago007 2008-08-29 14:32 194
89c4a3a6 sago007 2008-08-29 14:32 195
//Things for network play:
2f30c381 sago007 2008-09-14 13:08 196
#if NETWORK
30f910dd sago007 2010-11-10 21:02 197
static bool networkPlay;
30f910dd sago007 2010-11-10 21:02 198
static bool networkActive;
89c4a3a6 sago007 2008-08-29 14:32 199
//sockets here
89c4a3a6 sago007 2008-08-29 14:32 200
#define SERVERPORT 41780
89c4a3a6 sago007 2008-08-29 14:32 201
#define CLIENTPORT 41781
89c4a3a6 sago007 2008-08-29 14:32 202
2f30c381 sago007 2008-09-14 13:08 203
30f910dd sago007 2010-11-10 21:02 204
static char serverAddress[30];
89c4a3a6 sago007 2008-08-29 14:32 205
#endif
89c4a3a6 sago007 2008-08-29 14:32 206
89c4a3a6 sago007 2008-08-29 14:32 207
//should be automatically disabled if framerate to low (isn't implemented and wont be soon/ever):
1572de2b sago007 2008-09-11 18:15 208
//const int ballsFpsEnable = 30;     //If framerate higher -> enable balls
1572de2b sago007 2008-09-11 18:15 209
//const int ballsFpsDisable = 10;    //If framerate lower -> disable balls
89c4a3a6 sago007 2008-08-29 14:32 210
89c4a3a6 sago007 2008-08-29 14:32 211
//other ball constants:
30f910dd sago007 2010-11-10 21:02 212
static const double gravity = 200.8; //acceleration
30f910dd sago007 2010-11-10 21:02 213
static const double startVelocityY = 50.0;
30f910dd sago007 2010-11-10 21:02 214
static const double VelocityX = 50.0;
30f910dd sago007 2010-11-10 21:02 215
static const int ballSize = 16;
30f910dd sago007 2010-11-10 21:02 216
static const double minVelocity = 200.0;
89c4a3a6 sago007 2008-08-29 14:32 217
89c4a3a6 sago007 2008-08-29 14:32 218
//global settings (reset everytime the game starts)
30f910dd sago007 2010-11-10 21:02 219
static Uint8 player1Speed=0;
30f910dd sago007 2010-11-10 21:02 220
static Uint8 player2Speed=0;
30f910dd sago007 2010-11-10 21:02 221
static bool player1AI=false;		//Is AI enabled?
30f910dd sago007 2010-11-10 21:02 222
static bool player2AI=false;		//Is AI enabled for player 2 (opponent in single player)
30f910dd sago007 2010-11-10 21:02 223
static Uint8 player1AIlevel=3;		//What level is AI? 0 min, 6 max
30f910dd sago007 2010-11-10 21:02 224
static Uint8 player2AIlevel=3;
30f910dd sago007 2010-11-10 21:02 225
static const Uint8 AIlevels=7;		//7 possible levels: 0..6
30f910dd sago007 2010-11-10 21:02 226
static Uint8 player1handicap=0;
30f910dd sago007 2010-11-10 21:02 227
static Uint8 player2handicap=0;
89c4a3a6 sago007 2008-08-29 14:32 228
89c4a3a6 sago007 2008-08-29 14:32 229
unsigned long int currentTime;      //contains the current time, so we don't call SDL_GetTickets() too often...
89c4a3a6 sago007 2008-08-29 14:32 230
30f910dd sago007 2010-11-10 21:02 231
static int xsize = 1024;
30f910dd sago007 2010-11-10 21:02 232
static int ysize = 768;
30f910dd sago007 2010-11-10 21:02 233
static int bsize = 50;
89c4a3a6 sago007 2008-08-29 14:32 234
89c4a3a6 sago007 2008-08-29 14:32 235
//Stores the players names (way to long, but at least no buffer overflows (max length is 16 for display reasons))
26ddb424 sago007 2011-06-09 20:06 236
char player1name[30];
26ddb424 sago007 2011-06-09 20:06 237
char player2name[30];
89c4a3a6 sago007 2008-08-29 14:32 238
89c4a3a6 sago007 2008-08-29 14:32 239
//paths
30f910dd sago007 2010-11-10 21:02 240
static string stageClearSavePath;
30f910dd sago007 2010-11-10 21:02 241
static string puzzleSavePath;
30f910dd sago007 2010-11-10 21:02 242
static string puzzleName;              //The filename of
89c4a3a6 sago007 2008-08-29 14:32 243
30f910dd sago007 2010-11-10 21:02 244
static const int nrOfStageLevels = 50;		//number of stages in stage Clear
30f910dd sago007 2010-11-10 21:02 245
static const int maxNrOfPuzzleStages = 50; //Maximum number of puzzle stages
89c4a3a6 sago007 2008-08-29 14:32 246
vector<bool> stageCleared(nrOfStageLevels);		//vector that tells if a stage is cleared
89c4a3a6 sago007 2008-08-29 14:32 247
vector<Uint32> stageTimes(nrOfStageLevels);             //For statistical puposes
89c4a3a6 sago007 2008-08-29 14:32 248
vector<Uint32> stageScores(nrOfStageLevels);            //--||--
89c4a3a6 sago007 2008-08-29 14:32 249
vector<bool> puzzleCleared(maxNrOfPuzzleStages); //vector that tells if puzzle cleared
89c4a3a6 sago007 2008-08-29 14:32 250
vector<int> nrOfMovesAllowed(maxNrOfPuzzleStages);  //Moves to clear
89c4a3a6 sago007 2008-08-29 14:32 251
int puzzleLevels[maxNrOfPuzzleStages][6][12]; //Contains board layout;
89c4a3a6 sago007 2008-08-29 14:32 252
int nrOfPuzzles;    //How many are there actually?
f72abf8b sago007 2010-01-16 20:00 253
bool twoPlayers;    //True if two players are playing
89c4a3a6 sago007 2008-08-29 14:32 254
89c4a3a6 sago007 2008-08-29 14:32 255
//Old mouse position:
30f910dd sago007 2010-11-10 21:02 256
static int oldMousex, oldMousey;
89c4a3a6 sago007 2008-08-29 14:32 257
//Old Stage Clear Buble
30f910dd sago007 2010-11-10 21:02 258
static int oldBubleX, oldBubleY;
89c4a3a6 sago007 2008-08-29 14:32 259
89c4a3a6 sago007 2008-08-29 14:32 260
//bool doublebuf = false; //if true, screen is double buffered
30f910dd sago007 2010-11-10 21:02 261
static char forceredraw; //If 1: always redraw, if 2: rarely redraw
89c4a3a6 sago007 2008-08-29 14:32 262
30f910dd sago007 2010-11-10 21:02 263
static bool singlePuzzle = false; //if true we are just in a little 300x600 window
30f910dd sago007 2010-11-10 21:02 264
static int singlePuzzleNr = 0;
30f910dd sago007 2010-11-10 21:02 265
static string singlePuzzleFile;
89c4a3a6 sago007 2008-08-29 14:32 266
1572de2b sago007 2008-09-11 18:15 267
#if DEBUG
89c4a3a6 sago007 2008-08-29 14:32 268
//frame counter (fps)
89c4a3a6 sago007 2008-08-29 14:32 269
unsigned long int Frames, Ticks;
89c4a3a6 sago007 2008-08-29 14:32 270
char FPS[10];
89c4a3a6 sago007 2008-08-29 14:32 271
#endif
89c4a3a6 sago007 2008-08-29 14:32 272
56241205 sago007 2012-08-05 11:15 273
int verboseLevel = 0;
56241205 sago007 2012-08-05 11:15 274
89c4a3a6 sago007 2008-08-29 14:32 275
//keySetup
89c4a3a6 sago007 2008-08-29 14:32 276
int player1keys, player2keys;
89c4a3a6 sago007 2008-08-29 14:32 277
bool mouseplay1=false;  //The mouse works on the play field
89c4a3a6 sago007 2008-08-29 14:32 278
bool mouseplay2=false;  //Same for player2
89c4a3a6 sago007 2008-08-29 14:32 279
bool joyplay1=false;    //Player one uses the joypad
89c4a3a6 sago007 2008-08-29 14:32 280
bool joyplay2=false;    //Player two uses the joypad
89c4a3a6 sago007 2008-08-29 14:32 281
89c4a3a6 sago007 2008-08-29 14:32 282
//Stores the controls
89c4a3a6 sago007 2008-08-29 14:32 283
struct control
89c4a3a6 sago007 2008-08-29 14:32 284
{
c53e6443 sago007 2012-04-17 11:04 285
	SDLKey up;
c53e6443 sago007 2012-04-17 11:04 286
	SDLKey down;
c53e6443 sago007 2012-04-17 11:04 287
	SDLKey left;
c53e6443 sago007 2012-04-17 11:04 288
	SDLKey right;
c53e6443 sago007 2012-04-17 11:04 289
	SDLKey change;
c53e6443 sago007 2012-04-17 11:04 290
	SDLKey push;
89c4a3a6 sago007 2008-08-29 14:32 291
};
89c4a3a6 sago007 2008-08-29 14:32 292
593aeae4 sago007 2011-06-25 22:42 293
control keySettings[3];	//array to hold the controls (default and two custom)
89c4a3a6 sago007 2008-08-29 14:32 294
95bc02ff sago007 2009-03-15 02:46 295
#define KEYMENU_MAXWITH 4
95bc02ff sago007 2009-03-15 02:46 296
#define KEYMENU_MAXDEPTH 7
95bc02ff sago007 2009-03-15 02:46 297
c53e6443 sago007 2012-04-17 11:04 298
//The following struct holds variables relevant to selecting menu items with
95bc02ff sago007 2009-03-15 02:46 299
//keyboard/joypad.
b7590374 sago007 2011-05-19 16:15 300
/*struct KeyMenu_t
95bc02ff sago007 2009-03-15 02:46 301
{
95bc02ff sago007 2009-03-15 02:46 302
    unsigned long canBeActivatedTime; //Time that the KeyMenu can be activated by pressing a button
95bc02ff sago007 2009-03-15 02:46 303
    bool activated; //The keymenu is activated
95bc02ff sago007 2009-03-15 02:46 304
    //Here comes the coordinates to the key we are howering.
95bc02ff sago007 2009-03-15 02:46 305
    int x;
95bc02ff sago007 2009-03-15 02:46 306
    int y;
95bc02ff sago007 2009-03-15 02:46 307
    bool menumap[KEYMENU_MAXWITH][KEYMENU_MAXDEPTH];
95bc02ff sago007 2009-03-15 02:46 308
};
95bc02ff sago007 2009-03-15 02:46 309
b7590374 sago007 2011-05-19 16:15 310
static KeyMenu_t keymenu;*/
95bc02ff sago007 2009-03-15 02:46 311
89c4a3a6 sago007 2008-08-29 14:32 312
enum stageButton {SBdontShow, SBstageClear, SBpuzzleMode};
89c4a3a6 sago007 2008-08-29 14:32 313
30f910dd sago007 2010-11-10 21:02 314
static stageButton stageButtonStatus = SBdontShow;
89c4a3a6 sago007 2008-08-29 14:32 315
30f910dd sago007 2010-11-10 21:02 316
static const int buttonXsize = 120;
30f910dd sago007 2010-11-10 21:02 317
static const int buttonYsize = 40;
9050a50a sago007 2008-12-09 13:35 318
89c4a3a6 sago007 2008-08-29 14:32 319
struct ButtonCords
89c4a3a6 sago007 2008-08-29 14:32 320
{
c53e6443 sago007 2012-04-17 11:04 321
	int x;
c53e6443 sago007 2012-04-17 11:04 322
	int y;
c53e6443 sago007 2012-04-17 11:04 323
	int xsize;
c53e6443 sago007 2012-04-17 11:04 324
	int ysize;
89c4a3a6 sago007 2008-08-29 14:32 325
};
89c4a3a6 sago007 2008-08-29 14:32 326
c53e6443 sago007 2012-04-17 11:04 327
ButtonCords cordNextButton =
c53e6443 sago007 2012-04-17 11:04 328
{
c53e6443 sago007 2012-04-17 11:04 329
	cordNextButton.x = 3*bsize+(3*bsize-buttonXsize)/2,
c53e6443 sago007 2012-04-17 11:04 330
	cordNextButton.y = 10*bsize,
c53e6443 sago007 2012-04-17 11:04 331
	cordNextButton.xsize = buttonXsize,
c53e6443 sago007 2012-04-17 11:04 332
	cordNextButton.ysize = buttonYsize
6d48320c sago007 2009-03-28 17:06 333
};
89c4a3a6 sago007 2008-08-29 14:32 334
c53e6443 sago007 2012-04-17 11:04 335
ButtonCords cordRetryButton =
c53e6443 sago007 2012-04-17 11:04 336
{
c53e6443 sago007 2012-04-17 11:04 337
	cordRetryButton.x = (3*bsize-buttonXsize)/2,
c53e6443 sago007 2012-04-17 11:04 338
	cordRetryButton.y = 10*bsize,
c53e6443 sago007 2012-04-17 11:04 339
	cordRetryButton.xsize = buttonXsize,
c53e6443 sago007 2012-04-17 11:04 340
	cordRetryButton.ysize = buttonYsize
89c4a3a6 sago007 2008-08-29 14:32 341
};
6d48320c sago007 2009-03-28 17:06 342
eec83b7d sago007 2009-03-29 15:46 343
#endif
1970-01-01 00:00 344