git repos / blockattack-game

commit 22c9836e

sago007 · 2015-12-23 19:35
22c9836e8a7386f3b9591c0367a243b2fd4298df patch · browse files
parent 546803fdb0f98661cbaec02d2aee6b9b8890aacc

Removed some unused code

Changed files

M source/code/main.cpp before
M source/code/mainVars.hpp before
diff --git a/source/code/main.cpp b/source/code/main.cpp index 493081e..39240f4 100644 --- a/source/code/main.cpp +++ b/source/code/main.cpp
@@ -92,16 +92,11 @@ http://blockattack.sf.net
using namespace std;
-static void UnloadImages();
static int InitImages(sago::SagoSpriteHolder& holder);
static string oldThemePath = "default";
-static bool loaded = false;
void loadTheme(sago::SagoSpriteHolder& holder, const string& themeName) {
- if (loaded) {
- UnloadImages();
- }
#if defined(__unix__)
string home = (string)getenv("HOME")+(string)"/.gamesaves/blockattack";
#elif defined(_WIN32)
@@ -123,7 +118,6 @@ void loadTheme(sago::SagoSpriteHolder& holder, const string& themeName) {
}
if (themeName.compare("default")==0 || (themeName.compare("start")==0)) {
InitImages(holder);
- loaded =true;
return; //Nothing more to do
}
oldThemePath = "themes/"+themeName;
@@ -132,7 +126,6 @@ void loadTheme(sago::SagoSpriteHolder& holder, const string& themeName) {
PHYSFS_addToSearchPath((home+(string)"/"+oldThemePath).c_str(), 0);
#endif
InitImages(holder);
- loaded = true;
}
@@ -245,14 +238,6 @@ static int InitImages(sago::SagoSpriteHolder& holder) {
} //InitImages()
-//Unload images and fonts and sounds
-void UnloadImages() {
- if (verboseLevel) {
- cout << "Unloading data..." << endl;
- }
-}
-
-
static stringstream converter;
//Function to convert numbers to string (2 diget)
@@ -2272,10 +2257,6 @@ int main(int argc, char* argv[]) {
Config::getInstance()->save();
- //Frees memory from music and fonts
- //This is done after writing of configurations and stats since it often crashes the program :(
- UnloadImages();
-
//Close file system Apstraction layer!
PHYSFS_deinit();
return 0;
@@ -2283,7 +2264,6 @@ int main(int argc, char* argv[]) {
int runGame(int gametype, int level) {
- const Uint8* keys;
int mousex, mousey; //Mouse coordinates
bScreenLocked = false;
theTopScoresEndless = Highscore(1);
diff --git a/source/code/mainVars.hpp b/source/code/mainVars.hpp index 8d4756b..f8bacb8 100644 --- a/source/code/mainVars.hpp +++ b/source/code/mainVars.hpp
@@ -208,9 +208,6 @@ static int oldMousex, oldMousey;
//Old Stage Clear Buble
static int oldBubleX, oldBubleY;
-//bool doublebuf = false; //if true, screen is double buffered
-static char forceredraw = 1; //If 1: always redraw, if 2: rarely redraw
-
static bool singlePuzzle = false; //if true we are just in a little 300x600 window
static int singlePuzzleNr = 0;
static std::string singlePuzzleFile;