From 0e7d5ed32b1bb975f18db7a86b675c242ab21c67 Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Tue, 26 Feb 2019 21:02:29 +0100 Subject: [PATCH] Improvements regarding the ps2 font driver --- gfx/drivers/ps2_gfx.c | 4 ++++ gfx/drivers_font/ps2_font.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gfx/drivers/ps2_gfx.c b/gfx/drivers/ps2_gfx.c index 6eae3f35e2..3cf2fc5c4f 100644 --- a/gfx/drivers/ps2_gfx.c +++ b/gfx/drivers/ps2_gfx.c @@ -35,6 +35,7 @@ typedef struct ps2_video GSTEXTURE *menuTexture; GSTEXTURE *coreTexture; bool clearVRAM; + bool clearVRAM_font; /* I need to create this additional field to be used in the font driver*/ struct retro_hw_render_interface_gskit_ps2 iface; /* Palette in the cores */ bool menuVisible; @@ -184,6 +185,7 @@ static void clearVRAMIfNeeded(ps2_video_t *ps2, void *frame, int width, int heig if (ps2->clearVRAM) { gsKit_vram_clear(ps2->gsGlobal); ps2->iface.updatedPalette = true; + ps2->clearVRAM_font = true; /* we need to upload also palette in the font driver */ } } @@ -194,6 +196,8 @@ static void refreshScreen(ps2_video_t *ps2) } gsKit_queue_exec(ps2->gsGlobal); + /* Here we are just puting in false the ps2->clearVRAM field + however, the ps2->clearVRAM_font should be done in the ps2_font driver */ ps2->clearVRAM = false; } diff --git a/gfx/drivers_font/ps2_font.c b/gfx/drivers_font/ps2_font.c index 663b364c0c..a6897adcd4 100644 --- a/gfx/drivers_font/ps2_font.c +++ b/gfx/drivers_font/ps2_font.c @@ -108,8 +108,9 @@ static void ps2_font_render_msg( if (ps2) { int x = FONTM_TEXTURE_LEFT_MARGIN; int y = ps2->ps2_video->gsGlobal->Height - FONTM_TEXTURE_BOTTOM_MARGIN; - if (ps2->ps2_video->clearVRAM) { + if (ps2->ps2_video->clearVRAM_font) { ps2_upload_font(ps2->ps2_video->gsGlobal, ps2->gsFontM); + ps2->ps2_video->clearVRAM_font = false; } gsKit_fontm_print_scaled(ps2->ps2_video->gsGlobal, ps2->gsFontM, x, y, FONTM_TEXTURE_ZPOSITION, FONTM_TEXTURE_SCALED , FONTM_TEXTURE_COLOR, msg);