Add PS2 compatibility fixes (report these)

This commit is contained in:
Fierelier 2024-09-12 19:41:45 +02:00
parent f5adfe0495
commit efc1241511

View File

@ -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) { unigi_type_error unigi_window_create(unigi_type_resolution resolution, char * title) {
#ifndef __PS2__
SDL_SetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION,"0"); 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); unigi_platform_window = SDL_CreateWindow(title,SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,resolution.width,resolution.height,0);
if (unigi_platform_window == NULL) { if (unigi_platform_window == NULL) {
printf("[unigi] Could not initialize window: SDL -> %s\n",SDL_GetError()); 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; color = 0;
while (color < 4096) { while (color < 4096) {
unigi_platform_color_16_to_32(color,&r,&r,&g,&b); 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); 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; unigi_type_resolution_depth i;
for (i = 0; i < unigi_platform_info_depth_bytes; i++) { for (i = 0; i < unigi_platform_info_depth_bytes; i++) {
unigi_platform_palette1[(color * unigi_platform_info_depth_bytes) + i] = color_platform8[i]; unigi_platform_palette1[(color * unigi_platform_info_depth_bytes) + i] = color_platform8[i];