From 8e631df6c482014a05add4b8ecc8e2e93ce2e686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Jos=C3=A9=20Garc=C3=ADa=20Garc=C3=ADa?= Date: Sun, 16 Oct 2016 17:42:02 +0200 Subject: [PATCH] (VITA) Temporal fix for clear screen --- deps/libvita2d/include/vita2d.h | 2 ++ deps/libvita2d/source/vita2d.c | 6 ++++++ gfx/drivers/vita2d_gfx.c | 5 +++-- menu/drivers_display/menu_display_vita2d.c | 6 +++++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/deps/libvita2d/include/vita2d.h b/deps/libvita2d/include/vita2d.h index 28776d0f90..9072949390 100644 --- a/deps/libvita2d/include/vita2d.h +++ b/deps/libvita2d/include/vita2d.h @@ -54,6 +54,8 @@ void vita2d_end_drawing(); int vita2d_common_dialog_update(); void vita2d_set_clear_color(unsigned int color); +unsigned int vita2d_get_clear_color(); + void vita2d_set_vblank_wait(int enable); void *vita2d_get_current_fb(); diff --git a/deps/libvita2d/source/vita2d.c b/deps/libvita2d/source/vita2d.c index c9242580fb..aeb2605cdb 100644 --- a/deps/libvita2d/source/vita2d.c +++ b/deps/libvita2d/source/vita2d.c @@ -56,6 +56,7 @@ static const SceGxmProgram *const textureTintFragmentProgramGxp = &texture_tint_ static int vita2d_initialized = 0; static float clear_color[4] = {0.0f, 0.0f, 0.0f, 1.0f}; +static unsigned int clear_color_u = 0xff000000; static int vblank_wait = 1; static SceUID vdmRingBufferUid; @@ -765,6 +766,11 @@ void vita2d_set_clear_color(unsigned int color) clear_color[1] = ((color >> 8*1) & 0xFF)/255.0f; clear_color[2] = ((color >> 8*2) & 0xFF)/255.0f; clear_color[3] = ((color >> 8*3) & 0xFF)/255.0f; + clear_color_u = color; +} + +unsigned int vita2d_get_clear_color(){ + return clear_color_u; } void vita2d_set_vblank_wait(int enable) diff --git a/gfx/drivers/vita2d_gfx.c b/gfx/drivers/vita2d_gfx.c index 6cc509cdcf..1b2cd19636 100644 --- a/gfx/drivers/vita2d_gfx.c +++ b/gfx/drivers/vita2d_gfx.c @@ -188,7 +188,8 @@ static bool vita2d_gfx_frame(void *data, const void *frame, vita2d_gfx_update_viewport(vita); vita2d_start_drawing(); - vita2d_clear_screen(); + + vita2d_draw_rectangle(0,0,PSP_FB_WIDTH,PSP_FB_HEIGHT,vita2d_get_clear_color()); if (vita->texture) { @@ -224,6 +225,7 @@ static bool vita2d_gfx_frame(void *data, const void *frame, if (vita->menu.active) { + menu_driver_ctl(RARCH_MENU_CTL_FRAME, NULL); if(vita->menu.texture){ if (vita->fullscreen) @@ -252,7 +254,6 @@ static bool vita2d_gfx_frame(void *data, const void *frame, } } - menu_driver_ctl(RARCH_MENU_CTL_FRAME, NULL); } diff --git a/menu/drivers_display/menu_display_vita2d.c b/menu/drivers_display/menu_display_vita2d.c index 66cb4ed1da..870b67d7cc 100644 --- a/menu/drivers_display/menu_display_vita2d.c +++ b/menu/drivers_display/menu_display_vita2d.c @@ -29,6 +29,7 @@ #include "../../gfx/video_context_driver.h" #include "../../gfx/video_shader_driver.h" #include "../../gfx/common/vita2d_common.h" +#include "../../defines/psp_defines.h" static const float vita2d_vertexes[] = { 0, 0, @@ -218,7 +219,10 @@ static void menu_display_vita2d_clear_color(menu_display_ctx_clearcolor_t *clear (int)(clearcolor->g*255.f), (int)(clearcolor->b*255.f), (int)(clearcolor->a*255.f))); - vita2d_clear_screen(); + vita2d_draw_rectangle(0,0,PSP_FB_WIDTH,PSP_FB_HEIGHT,RGBA8((int)(clearcolor->r*255.f), + (int)(clearcolor->g*255.f), + (int)(clearcolor->b*255.f), + (int)(clearcolor->a*255.f))); } static bool menu_display_vita2d_font_init_first(