From 663badee5c884c9aebcd745e70891831ac658878 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20BERNIGAUD?= Date: Fri, 13 May 2011 18:33:39 +0200 Subject: [PATCH] Some cleans, fullscreen is back if "--windowed" isn't passed as option. --- Source/Account.cpp | 8 +------- Source/Account.h | 12 +++++++++--- Source/Game.h | 4 ++-- Source/GameDraw.cpp | 4 ++-- Source/GameInitDispose.cpp | 2 +- Source/OpenGL_Windows.cpp | 8 ++++---- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Source/Account.cpp b/Source/Account.cpp index 662c0d3..7eba588 100644 --- a/Source/Account.cpp +++ b/Source/Account.cpp @@ -46,12 +46,6 @@ Account::Account(string n) : campaignProgress() { void Account::setCurrentCampaign(string name) { currentCampaign = name; - if(campaignProgress.find(name)==campaignProgress.end()) { - campaignProgress[name].highscore = 0; - campaignProgress[name].fasttime = 0; - campaignProgress[name].score = 0; - campaignProgress[name].time = 0; - } } Account* Account::add(string name) { @@ -218,7 +212,7 @@ void Account::saveFile(string filename, Account* accountactive) { fpackf(tfile, "Bi", a->progress); fpackf(tfile, "Bi", a->campaignProgress.size()); - map::const_iterator it; + map::const_iterator it; for( it=a->campaignProgress.begin(); it!= a->campaignProgress.end(); ++it) { fpackf(tfile, "Bi", it->first.size()); for(j=0;jfirst.size();j++) diff --git a/Source/Account.h b/Source/Account.h index 599384c..7d550e8 100644 --- a/Source/Account.h +++ b/Source/Account.h @@ -28,13 +28,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -typedef struct { +struct CampaignProgress { float highscore; float fasttime; float score; float time; std::vector choices; -} campaign_progress_t; + CampaignProgress() { + highscore = 0; + fasttime = 0; + score = 0; + time = 0; + } +}; class Account { public: @@ -88,7 +94,7 @@ class Account { std::string name; std::string currentCampaign; - std::map campaignProgress; + std::map campaignProgress; //statics static std::vector accounts; diff --git a/Source/Game.h b/Source/Game.h index 00dfb53..32d1489 100644 --- a/Source/Game.h +++ b/Source/Game.h @@ -300,7 +300,7 @@ class Game //keeps track of which textures are loaded //TODO: delete them properly -struct TextureInfo{ +struct TextureInfo { bool isLoaded; bool isSkin; const char* fileName; @@ -310,7 +310,7 @@ struct TextureInfo{ GLubyte* array; int* skinsize; - void load(){ + void load() { if(isSkin) Game::LoadTextureSaveData(fileName,ptextureid,mipmap,array,skinsize,isLoaded); else diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index f925078..c1fb553 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -2692,12 +2692,12 @@ void Game::DrawMenu() for(i=0;istartx[i]&&(mousecoordh/screenwidth*640)starty[i]&&480-(mousecoordv/screenheight*480)0) && (i!=NB_CAMPAIGN_MENU_ITEM) ) selected=i; } } - for(i=0;i1) selectedlong[i]=1; diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index 10ead71..b9d5913 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -850,7 +850,7 @@ void Game::InitGame() } -void Game::LoadScreenTexture(){ +void Game::LoadScreenTexture() { glPixelStorei( GL_UNPACK_ALIGNMENT, 1 ); if(!screentexture) diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index cc8103c..b25b0cb 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -248,7 +248,7 @@ static void toggleFullscreen(){ exit(1); //reload opengl state initGL(); - for(std::vector::iterator it=Game::textures.begin(); it!=Game::textures.end(); it++){ + for(std::vector::iterator it=Game::textures.begin(); it!=Game::textures.end(); it++) { it->load(); } pgame->text.BuildFont(); @@ -362,9 +362,9 @@ Boolean SetUp (Game & game) } Uint32 sdlflags = SDL_OPENGL; - //TODO: commented out temporarily - //if (!cmdline("windowed")) - //sdlflags |= SDL_FULLSCREEN; + + if (!cmdline("windowed")) + sdlflags |= SDL_FULLSCREEN; SDL_WM_SetCaption("Lugaru", "Lugaru"); -- 2.39.5