Re-add gl_render_msg_post().

This commit is contained in:
Themaister 2012-05-27 14:27:17 +02:00
parent 65b78348f0
commit 86295bf057
4 changed files with 12 additions and 13 deletions

View File

@ -220,18 +220,10 @@ static void calculate_font_coords(gl_t *gl,
font_tex_coords[7] = hy;
}
static void gl_render_msg_pre(gl_t *gl)
{
gl_shader_use(0);
gl_set_viewport(gl, gl->win_width, gl->win_height, false, false);
glEnable(GL_BLEND);
(void)gl;
}
extern const GLfloat vertexes_flipped[];
extern const GLfloat white_color[];
static void gl_render_msg_post(gl_t *gl)
void gl_render_msg_post(gl_t *gl)
{
// Go back to old rendering path.
glTexCoordPointer(2, GL_FLOAT, 0, gl->tex_coords);
@ -250,7 +242,9 @@ void gl_render_msg(gl_t *gl, const char *msg)
if (!gl->font)
return;
gl_render_msg_pre(gl);
gl_shader_use(0);
gl_set_viewport(gl, gl->win_width, gl->win_height, false, false);
glEnable(GL_BLEND);
GLfloat font_vertex[8];
GLfloat font_vertex_dark[8];
@ -286,12 +280,9 @@ void gl_render_msg(gl_t *gl, const char *msg)
glVertexPointer(2, GL_FLOAT, 0, font_vertex);
glColorPointer(4, GL_FLOAT, 0, gl->font_color);
glDrawArrays(GL_QUADS, 0, 4);
gl_render_msg_post(gl);
#else
(void)gl;
(void)msg;
#endif
}

View File

@ -40,6 +40,10 @@ void gl_render_msg(gl_t *gl, const char *msg)
{
cellDbgFontPrintf(g_settings.video.msg_pos_x, g_settings.video.msg_pos_y, 1.11f, BLUE, msg);
cellDbgFontPrintf(g_settings.video.msg_pos_x, g_settings.video.msg_pos_y, 1.10f, WHITE, msg);
}
void gl_render_msg_post(gl_t *gl)
{
cellDbgFontDraw();
}

View File

@ -891,7 +891,10 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
gl_next_texture_index(gl, &tex_info);
if (msg)
{
gl_render_msg(gl, msg);
gl_render_msg_post(gl);
}
gfx_ctx_update_window_title(false);
gfx_ctx_swap_buffers();

View File

@ -22,6 +22,7 @@ void gl_init_font(gl_t *gl, const char *font_path, unsigned font_size);
void gl_deinit_font(gl_t *gl);
void gl_render_msg(gl_t *gl, const char *msg);
void gl_render_msg_post(gl_t *gl);
#endif