fixed the null pointer exception related to font colors while chatting in the menu

setting version to 3.3.4-dev
This commit is contained in:
Titus Tscharntke
2010-04-11 00:45:09 +00:00
parent a2ffe0c7e7
commit ac6deedd93
3 changed files with 15 additions and 8 deletions

View File

@@ -4,7 +4,7 @@
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
AC_PREREQ([2.54]) AC_PREREQ([2.54])
AC_INIT([megaglest], [3.3.3], [matze@braunis.de]) AC_INIT([megaglest], [3.3.4-dev], [matze@braunis.de])
AC_CONFIG_SRCDIR([mk/jam/build.jam]) AC_CONFIG_SRCDIR([mk/jam/build.jam])
AC_CONFIG_AUX_DIR([mk/autoconf]) AC_CONFIG_AUX_DIR([mk/autoconf])

View File

@@ -25,7 +25,7 @@ using namespace Shared::Platform;
namespace Glest{ namespace Game{ namespace Glest{ namespace Game{
const string mailString= "contact_game@glest.org"; const string mailString= "contact_game@glest.org";
const string glestVersionString= "v3.3.3"; const string glestVersionString= "v3.3.4-dev";
string getCrashDumpFileName(){ string getCrashDumpFileName(){
return "glest"+glestVersionString+".dmp"; return "glest"+glestVersionString+".dmp";

View File

@@ -689,18 +689,26 @@ void Renderer::renderTextureQuad(int x, int y, int w, int h, const Texture2D *te
} }
void Renderer::renderConsole(const Console *console){ void Renderer::renderConsole(const Console *console){
const Gui *gui= game->getGui();
glPushAttrib(GL_ENABLE_BIT); glPushAttrib(GL_ENABLE_BIT);
glEnable(GL_BLEND); glEnable(GL_BLEND);
Vec4f fontColor;
if(game!=NULL){
fontColor=game->getGui()->getDisplay()->getColor();
}
else {
// white shadowed is default ( in the menu for example )
fontColor=Vec4f(1.f, 1.f, 1.f, 0.0f);
}
for(int i=0; i<console->getLineCount(); ++i){ for(int i=0; i<console->getLineCount(); ++i){
renderTextShadow( renderTextShadow(
console->getLine(i), console->getLine(i),
CoreData::getInstance().getConsoleFont(), CoreData::getInstance().getConsoleFont(),
gui->getDisplay()->getColor(), fontColor,
20, i*20+20); 20, i*20+20);
} }
glPopAttrib(); glPopAttrib();
} }
@@ -728,10 +736,9 @@ void Renderer::renderChatManager(const ChatManager *chatManager){
void Renderer::renderResourceStatus(){ void Renderer::renderResourceStatus(){
const Metrics &metrics= Metrics::getInstance(); const Metrics &metrics= Metrics::getInstance();
const Gui *gui= game->getGui();
const World *world= game->getWorld(); const World *world= game->getWorld();
const Faction *thisFaction= world->getFaction(world->getThisFactionIndex()); const Faction *thisFaction= world->getFaction(world->getThisFactionIndex());
const Vec4f fontColor=game->getGui()->getDisplay()->getColor();
assertGl(); assertGl();
glPushAttrib(GL_ENABLE_BIT); glPushAttrib(GL_ENABLE_BIT);
@@ -777,7 +784,7 @@ void Renderer::renderResourceStatus(){
renderTextShadow( renderTextShadow(
str, CoreData::getInstance().getDisplayFontSmall(), str, CoreData::getInstance().getDisplayFontSmall(),
gui->getDisplay()->getColor(), fontColor,
j*100+220, metrics.getVirtualH()-30, false); j*100+220, metrics.getVirtualH()-30, false);
++j; ++j;
} }