git repos / blockattack-game

blame: source/code/global.hpp

normal view · raw

c53e6443 sago007 2012-04-17 11:04 1
/*
c53e6443 sago007 2012-04-17 11:04 2
===========================================================================
c53e6443 sago007 2012-04-17 11:04 3
blockattack - Block Attack - Rise of the Blocks
c4baf4ba sago007 2017-03-25 15:37 4
Copyright (C) 2005-2017 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
de81e07d sago007 2016-07-10 20:22 20
http://www.blockattack.net
c53e6443 sago007 2012-04-17 11:04 21
===========================================================================
c53e6443 sago007 2012-04-17 11:04 22
*/
099916fc sago007 2011-06-10 17:39 23
099916fc sago007 2011-06-10 17:39 24
#ifndef _GLOBAL_HPP
099916fc sago007 2011-06-10 17:39 25
#define	_GLOBAL_HPP
099916fc sago007 2011-06-10 17:39 26
099916fc sago007 2011-06-10 17:39 27
#include "Libs/NFont.h"
f3a1637d sago007 2015-11-14 21:32 28
#include <memory>
1d2e2129 sago007 2015-12-23 15:41 29
#include "sago/SagoSpriteHolder.hpp"
c3b697c6 sago007 2016-02-07 17:30 30
#include "highscore.h"
59dcb571 sago007 2016-02-14 15:34 31
#include "sago/GameStateInterface.hpp"
4c5ca03b sago007 2017-11-27 13:55 32
#include "FontWrapper.hpp"
c310f8a5 sago007 2017-03-25 16:05 33
#include "TextManager.hpp"
d450da8b sago007 2017-03-25 17:03 34
#include "ExplosionManager.hpp"
099916fc sago007 2011-06-10 17:39 35
099916fc sago007 2011-06-10 17:39 36
void MainMenu();
099916fc sago007 2011-06-10 17:39 37
void ResetFullscreen();
59dcb571 sago007 2016-02-14 15:34 38
void RunGameState(sago::GameStateInterface& state );
de81e07d sago007 2016-07-10 20:22 39
092bdebe sago007 2017-03-19 14:39 40
enum class Gametype { SinglePlayerEndless=0, SinglePlayerTimeTrial=1, StageClear=2, Puzzle=3, SinglePlayerVs=4, TwoPlayerTimeTrial=10, TwoPlayerVs=11, Replay=100  };
de81e07d sago007 2016-07-10 20:22 41
de81e07d sago007 2016-07-10 20:22 42
int runGame(Gametype gametype,int level);
96e759d9 sago007 2016-04-17 18:45 43
bool OpenDialogbox(int x, int y, std::string& name, const std::string& header);
f1708e5e sago007 2016-09-28 17:09 44
void DrawBackground(SDL_Renderer* target);
6e6e44b7 sago007 2016-10-18 15:30 45
void UpdateMouseCoordinates(const SDL_Event& event, int& mousex, int& mousey);
c4baf4ba sago007 2017-03-25 15:37 46
void DrawIMG(const sago::SagoSprite& sprite, SDL_Renderer* target, int x, int y);
c4baf4ba sago007 2017-03-25 15:37 47
void DrawIMG_Bounded(const sago::SagoSprite& sprite, SDL_Renderer* target, int x, int y, int minx, int miny, int maxx, int maxy);
099916fc sago007 2011-06-10 17:39 48
72383a9e sago007 2016-10-30 11:56 49
struct GlobalData {
72383a9e sago007 2016-10-30 11:56 50
	sago::SagoSprite bHighScore;
72383a9e sago007 2016-10-30 11:56 51
	sago::SagoSprite bBack;
72383a9e sago007 2016-10-30 11:56 52
	sago::SagoSprite bNext;
c6c637cc sago007 2016-11-12 17:35 53
	sago::SagoSprite iLevelCheck;		//To the level select screen
c6c637cc sago007 2016-11-12 17:35 54
	sago::SagoSprite iLevelCheckBox;
c6c637cc sago007 2016-11-12 17:35 55
	sago::SagoSprite iLevelCheckBoxMarked;
c6c637cc sago007 2016-11-12 17:35 56
	sago::SagoSprite iCheckBoxArea;
72383a9e sago007 2016-10-30 11:56 57
	NFont nf_scoreboard_font;
72383a9e sago007 2016-10-30 11:56 58
	NFont nf_standard_blue_font;
4c5ca03b sago007 2017-11-27 13:55 59
	FontWrapper button_font;
72383a9e sago007 2016-10-30 11:56 60
	bool MusicEnabled;			//true if background music is enabled
72383a9e sago007 2016-10-30 11:56 61
	bool SoundEnabled;			//true if sound effects is enabled
72383a9e sago007 2016-10-30 11:56 62
	bool bFullscreen;			//true if game is running fullscreen
092bdebe sago007 2017-03-19 14:39 63
	std::string replayArgument; //Name of the replay to play (if given as a commandline argument)
72383a9e sago007 2016-10-30 11:56 64
	std::string player1name;
72383a9e sago007 2016-10-30 11:56 65
	std::string player2name;
72383a9e sago007 2016-10-30 11:56 66
	SDL_Renderer *screen = nullptr;        //The whole screen;
524f188c sago007 2017-04-22 09:01 67
	sago::SoundHandler typingChunk;
72383a9e sago007 2016-10-30 11:56 68
	sago::SagoSprite mouse;
72383a9e sago007 2016-10-30 11:56 69
	bool highPriority = false;
72383a9e sago007 2016-10-30 11:56 70
	bool NoSound = false;	
72383a9e sago007 2016-10-30 11:56 71
	int verboseLevel = 0;
72383a9e sago007 2016-10-30 11:56 72
	Highscore theTopScoresEndless;      //Stores highscores for endless
72383a9e sago007 2016-10-30 11:56 73
	Highscore theTopScoresTimeTrial;    //Stores highscores for timetrial
72383a9e sago007 2016-10-30 11:56 74
	std::unique_ptr<sago::SagoSpriteHolder> spriteHolder;
c310f8a5 sago007 2017-03-25 16:05 75
	
c310f8a5 sago007 2017-03-25 16:05 76
	TextManager theTextManager;
099916fc sago007 2011-06-10 17:39 77
72383a9e sago007 2016-10-30 11:56 78
	//The xsize and ysize are updated everytime the background is drawn
72383a9e sago007 2016-10-30 11:56 79
	int xsize = 1024;
72383a9e sago007 2016-10-30 11:56 80
	int ysize = 768;
20d77c6e sago007 2016-11-12 16:28 81
	int mousex = 0;
20d77c6e sago007 2016-11-12 16:28 82
	int mousey = 0;
72383a9e sago007 2016-10-30 11:56 83
};
72383a9e sago007 2016-10-30 11:56 84
d450da8b sago007 2017-03-25 17:03 85
#include "BallManager.hpp"
d450da8b sago007 2017-03-25 17:03 86
72383a9e sago007 2016-10-30 11:56 87
extern GlobalData globalData;
a1072daf sago007 2016-02-20 12:47 88
099916fc sago007 2011-06-10 17:39 89
#endif	/* _GLOBAL_HPP */
099916fc sago007 2011-06-10 17:39 90
1970-01-01 00:00 91