diff --git a/source/glest_game/facilities/logger.cpp b/source/glest_game/facilities/logger.cpp index de05eaca..bd9eb277 100644 --- a/source/glest_game/facilities/logger.cpp +++ b/source/glest_game/facilities/logger.cpp @@ -129,7 +129,7 @@ void Logger::loadLoadingScreen(string filepath){ // ==================== PRIVATE ==================== -void Logger::renderLoadingScreen(){ +void Logger::renderLoadingScreen() { Renderer &renderer= Renderer::getInstance(); CoreData &coreData= CoreData::getInstance(); @@ -152,6 +152,14 @@ void Logger::renderLoadingScreen(){ metrics.getVirtualW()/4, 62*metrics.getVirtualH()/100, false); + renderer.renderProgressBar( + progress, + metrics.getVirtualW()/4, + 59*metrics.getVirtualH()/100, + coreData.getDisplayFontSmall(), + 350,"loading progress "); + + renderer.swapBuffers(); } diff --git a/source/glest_game/facilities/logger.h b/source/glest_game/facilities/logger.h index 0ef87484..1f977f9d 100644 --- a/source/glest_game/facilities/logger.h +++ b/source/glest_game/facilities/logger.h @@ -3,9 +3,9 @@ // // Copyright (C) 2001-2008 Marti�o Figueroa // -// You can redistribute this code and/or modify it under -// the terms of the GNU General Public License as published -// by the Free Software Foundation; either version 2 of the +// You can redistribute this code and/or modify it under +// the terms of the GNU General Public License as published +// by the Free Software Foundation; either version 2 of the // License, or (at your option) any later version // ============================================================== @@ -25,7 +25,7 @@ using Shared::Graphics::Texture2D; namespace Glest{ namespace Game{ // ===================================================== -// class Logger +// class Logger // /// Interface to write log files // ===================================================== @@ -42,7 +42,8 @@ private: string state; string subtitle; string current; - Texture2D *loadingTexture; + Texture2D *loadingTexture; + int progress; private: Logger(); @@ -52,10 +53,11 @@ private: public: static Logger & getInstance(); - + void setFile(const string &fileName) {this->fileName= fileName;} void setState(const string &state) {this->state= state;} - void setSubtitle(const string &subtitle) {this->subtitle= subtitle;} + void setSubtitle(const string &subtitle) {this->subtitle= subtitle;} + void setProgress(int value) { this->progress = value; } void add(const string &str, bool renderScreen= false); void loadLoadingScreen(string filepath); diff --git a/source/glest_game/types/tech_tree.cpp b/source/glest_game/types/tech_tree.cpp index d2dca1fa..7bb4f9f6 100644 --- a/source/glest_game/types/tech_tree.cpp +++ b/source/glest_game/types/tech_tree.cpp @@ -19,7 +19,7 @@ #include "logger.h" #include "xml_parser.h" #include "platform_util.h" -#include "game_util.h" +#include "game_util.h" #include "leak_dumper.h" using namespace Shared::Util; @@ -147,7 +147,8 @@ void TechTree::load(const string &dir, set &factions, Checksum* checksum char szBuf[1024]=""; sprintf(szBuf,"%s %s [%d / %d] - %s",Lang::getInstance().get("Loading").c_str(),Lang::getInstance().get("Faction").c_str(),i+1,(int)factions.size(),factionName.c_str()); Logger &logger= Logger::getInstance(); - logger.setState(szBuf); + logger.setState(szBuf); + logger.setProgress((int)((((double)i + 1.0) / (double)factions.size()) * 100.0)); str=dir+"/factions/" + factionName; factionTypes[i++].load(str, this, checksum,&checksumValue);