chatmanager is rendered with colored and shadowed console font.

Fixed font problems while switching display colors ingame
(+ little fix for last checkin  )
This commit is contained in:
Titus Tscharntke 2010-06-22 20:53:54 +00:00
parent b869f6bda0
commit e0b9089eeb
2 changed files with 20 additions and 5 deletions

View File

@ -4,7 +4,7 @@ if ! $(top_builddir)
}
top_srcdir = $(TOP) ;
MGFLAGS = -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -msse2
MGFLAGS = -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -msse2 ;
JAMCONFIG ?= $(top_builddir)/Jamconfig ;
include $(JAMCONFIG) ;

View File

@ -771,6 +771,7 @@ void Renderer::renderConsole(const Console *console,const bool showFullConsole,c
}
void Renderer::renderChatManager(const ChatManager *chatManager){
Vec4f fontColor;
Lang &lang= Lang::getInstance();
if(chatManager->getEditEnabled()){
@ -785,9 +786,23 @@ void Renderer::renderChatManager(const ChatManager *chatManager){
}
text+= ": " + chatManager->getText() + "_";
textRenderer->begin(CoreData::getInstance().getConsoleFont());
textRenderer->render(text, 300, 150);
textRenderer->end();
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);
}
renderTextShadow(
text,
CoreData::getInstance().getConsoleFont(),
fontColor,
300, 150);
//textRenderer->begin(CoreData::getInstance().getConsoleFont());
//textRenderer->render(text, 300, 150);
//textRenderer->end();
}
}
@ -924,8 +939,8 @@ void Renderer::renderTextShadow(const string &text, const Font2D *font,const Vec
Vec2i pos= centered? computeCenteredPos(text, font, x, y): Vec2i(x, y);
textRenderer->begin(font);
if(color.w<0.5) {
textRenderer->begin(font);
glColor3f(0.0f, 0.0f, 0.0f);
textRenderer->render(text, pos.x-1.0f, pos.y-1.0f);
}