From efc12415111b10b460aa729c7bb5c0fdf730e7c1 Mon Sep 17 00:00:00 2001 From: Fierelier Date: Thu, 12 Sep 2024 19:41:45 +0200 Subject: [PATCH] Add PS2 compatibility fixes (report these) --- graphics.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/graphics.c b/graphics.c index d876291..d6ba5c1 100644 --- a/graphics.c +++ b/graphics.c @@ -22,7 +22,9 @@ static inline void unigi_platform_color_16_to_32(unigi_type_color color, uint8_t } unigi_type_error unigi_window_create(unigi_type_resolution resolution, char * title) { + #ifndef __PS2__ SDL_SetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION,"0"); + #endif unigi_platform_window = SDL_CreateWindow(title,SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,resolution.width,resolution.height,0); if (unigi_platform_window == NULL) { printf("[unigi] Could not initialize window: SDL -> %s\n",SDL_GetError()); @@ -49,7 +51,11 @@ unigi_type_error unigi_window_create(unigi_type_resolution resolution, char * ti color = 0; while (color < 4096) { unigi_platform_color_16_to_32(color,&r,&r,&g,&b); + #ifndef __PS2__ color_platform = SDL_MapRGBA(unigi_platform_surface->format,r,g,b,255); + #else + color_platform = SDL_MapRGBA(unigi_platform_surface->format,r/2,g/2,b/2,255); + #endif unigi_type_resolution_depth i; for (i = 0; i < unigi_platform_info_depth_bytes; i++) { unigi_platform_palette1[(color * unigi_platform_info_depth_bytes) + i] = color_platform8[i];