mirror of https://github.com/skeeto/pixelcity.git
Fix of mysterious "black text" bug.
This commit is contained in:
parent
2436ad8d61
commit
1e8027f1cd
11
Render.cpp
11
Render.cpp
|
@ -220,7 +220,6 @@ static void do_effects (int type)
|
||||||
if (!TextureReady ())
|
if (!TextureReady ())
|
||||||
return;
|
return;
|
||||||
//Now change projection modes so we can render full-screen effects
|
//Now change projection modes so we can render full-screen effects
|
||||||
glDisable(GL_DEPTH_TEST);
|
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
glPushMatrix ();
|
glPushMatrix ();
|
||||||
glLoadIdentity ();
|
glLoadIdentity ();
|
||||||
|
@ -235,6 +234,8 @@ static void do_effects (int type)
|
||||||
//Render full-screen effects
|
//Render full-screen effects
|
||||||
glBlendFunc (GL_ONE, GL_ONE);
|
glBlendFunc (GL_ONE, GL_ONE);
|
||||||
glEnable (GL_TEXTURE_2D);
|
glEnable (GL_TEXTURE_2D);
|
||||||
|
glDisable(GL_DEPTH_TEST);
|
||||||
|
glDepthMask (false);
|
||||||
glBindTexture(GL_TEXTURE_2D, TextureId (TEXTURE_BLOOM));
|
glBindTexture(GL_TEXTURE_2D, TextureId (TEXTURE_BLOOM));
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case EFFECT_DEBUG:
|
case EFFECT_DEBUG:
|
||||||
|
@ -410,19 +411,20 @@ void RenderPrint (int line, const char *fmt, ...)
|
||||||
va_start (ap, fmt);
|
va_start (ap, fmt);
|
||||||
vsprintf (text, fmt, ap);
|
vsprintf (text, fmt, ap);
|
||||||
va_end (ap);
|
va_end (ap);
|
||||||
glDepthMask (false);
|
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
glPushMatrix ();
|
glPushMatrix ();
|
||||||
glLoadIdentity ();
|
glLoadIdentity ();
|
||||||
glOrtho (0, render_width, render_height, 0, 0.1f, 2048);
|
glOrtho (0, render_width, render_height, 0, 0.1f, 2048);
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
|
glDepthMask (false);
|
||||||
glMatrixMode (GL_MODELVIEW);
|
glMatrixMode (GL_MODELVIEW);
|
||||||
glPushMatrix ();
|
glPushMatrix ();
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
glTranslatef(0, 0, -1.0f);
|
glTranslatef(0, 0, -1.0f);
|
||||||
glEnable (GL_BLEND);
|
glDisable (GL_BLEND);
|
||||||
|
glDisable (GL_FOG);
|
||||||
|
glDisable (GL_TEXTURE_2D);
|
||||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
glDisable (GL_DEPTH_TEST);
|
|
||||||
RenderPrint (0, line * FONT_SIZE - 2, 0, glRgba (0.0f), text);
|
RenderPrint (0, line * FONT_SIZE - 2, 0, glRgba (0.0f), text);
|
||||||
RenderPrint (4, line * FONT_SIZE + 2, 0, glRgba (0.0f), text);
|
RenderPrint (4, line * FONT_SIZE + 2, 0, glRgba (0.0f), text);
|
||||||
RenderPrint (2, line * FONT_SIZE, 0, glRgba (1.0f), text);
|
RenderPrint (2, line * FONT_SIZE, 0, glRgba (1.0f), text);
|
||||||
|
@ -810,7 +812,6 @@ void RenderUpdate (void)
|
||||||
glDisable (GL_BLEND);
|
glDisable (GL_BLEND);
|
||||||
}
|
}
|
||||||
EntityRender ();
|
EntityRender ();
|
||||||
|
|
||||||
if (!LOADING_SCREEN) {
|
if (!LOADING_SCREEN) {
|
||||||
elapsed = 3000 - WorldSceneElapsed ();
|
elapsed = 3000 - WorldSceneElapsed ();
|
||||||
if (elapsed >= 0 && elapsed <= 3000) {
|
if (elapsed >= 0 && elapsed <= 3000) {
|
||||||
|
|
Loading…
Reference in New Issue