Improvements regarding the ps2 font driver

This commit is contained in:
Francisco Javier Trujillo Mata 2019-02-26 21:02:29 +01:00
parent 20aae8a3b7
commit 0e7d5ed32b
2 changed files with 6 additions and 1 deletions

View File

@ -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;
}

View File

@ -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);