diff --git a/gfx/video_driver.c b/gfx/video_driver.c index d77f82091d..f9742a987d 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -1489,6 +1489,7 @@ void video_driver_set_rgba(void) { video_driver_lock(); video_driver_use_rgba = true; + video_texture_image_set_rgba(); video_driver_unlock(); } @@ -1496,6 +1497,7 @@ void video_driver_unset_rgba(void) { video_driver_lock(); video_driver_use_rgba = false; + video_texture_image_unset_rgba(); video_driver_unlock(); } diff --git a/gfx/video_texture_image.c b/gfx/video_texture_image.c index 5762e9b5da..bc632de5f7 100644 --- a/gfx/video_texture_image.c +++ b/gfx/video_texture_image.c @@ -27,8 +27,6 @@ #include #include -#include "video_driver.h" - enum video_image_format { IMAGE_FORMAT_NONE = 0, @@ -38,6 +36,18 @@ enum video_image_format IMAGE_FORMAT_BMP }; +static bool video_texture_image_supports_rgba = false; + +void video_texture_image_set_rgba(void) +{ + video_texture_image_supports_rgba = true; +} + +void video_texture_image_unset_rgba(void) +{ + video_texture_image_supports_rgba = false; +} + bool video_texture_image_set_color_shifts( unsigned *r_shift, unsigned *g_shift, unsigned *b_shift, unsigned *a_shift) @@ -47,7 +57,7 @@ bool video_texture_image_set_color_shifts( *g_shift = 8; *b_shift = 0; - if (video_driver_supports_rgba()) + if (video_texture_image_supports_rgba) { *r_shift = 0; *b_shift = 16; @@ -120,10 +130,7 @@ static bool video_texture_image_internal_gx_convert_texture32( * image->height * sizeof(uint32_t)); if (!tmp) - { - RARCH_ERR("Failed to create temp buffer for conversion.\n"); return false; - } memcpy(tmp, image->pixels, image->width * image->height * sizeof(uint32_t)); diff --git a/libretro-common/include/formats/image.h b/libretro-common/include/formats/image.h index 437af0a373..8f9d0e091f 100644 --- a/libretro-common/include/formats/image.h +++ b/libretro-common/include/formats/image.h @@ -58,6 +58,8 @@ bool video_texture_image_color_convert(unsigned r_shift, bool video_texture_image_load(struct texture_image *img, const char *path); void video_texture_image_free(struct texture_image *img); +void video_texture_image_set_rgba(void); +void video_texture_image_unset_rgba(void); /* Image transfer */