Feature #861 ยป 0032-sdl3-Update-SDL_MapRGBA-calls.patch
client/gui-sdl3/canvas.c | ||
---|---|---|
SDL_Rect dst = {canvas_x, canvas_y, width, height};
|
||
SDL_FillSurfaceRect(pcanvas->surf, &dst,
|
||
SDL_MapRGBA(pcanvas->surf->format,
|
||
SDL_MapRGBA(SDL_GetPixelFormatDetails(pcanvas->surf->format),
|
||
NULL,
|
||
pcolor->color->r,
|
||
pcolor->color->g,
|
||
pcolor->color->b,
|
||
... | ... | |
GET_SURF(psprite)->h};
|
||
SDL_FillSurfaceRect(pcanvas->surf, &dst,
|
||
SDL_MapRGBA(pcanvas->surf->format,
|
||
SDL_MapRGBA(SDL_GetPixelFormatDetails(pcanvas->surf->format),
|
||
NULL,
|
||
pcolor->color->r,
|
||
pcolor->color->g,
|
||
pcolor->color->b,
|
client/gui-sdl3/graphics.c | ||
---|---|---|
}
|
||
SDL_FillSurfaceRect(new_surf, NULL,
|
||
SDL_MapRGBA(new_surf->format,
|
||
SDL_MapRGBA(SDL_GetPixelFormatDetails(new_surf->format),
|
||
NULL,
|
||
pcolor->r, pcolor->g, pcolor->b,
|
||
pcolor->a));
|
||
... | ... | |
SDL_Rect _dstrect = *dstrect;
|
||
return SDL_FillSurfaceRect(surf, &_dstrect,
|
||
SDL_MapRGBA(surf->format, 0, 0, 0, 0));
|
||
SDL_MapRGBA(SDL_GetPixelFormatDetails(surf->format),
|
||
NULL, 0, 0, 0, 0));
|
||
} else {
|
||
return SDL_FillSurfaceRect(surf, NULL,
|
||
SDL_MapRGBA(surf->format, 0, 0, 0, 0));
|
||
SDL_MapRGBA(SDL_GetPixelFormatDetails(surf->format),
|
||
NULL, 0, 0, 0, 0));
|
||
}
|
||
}
|
||
client/gui-sdl3/graphics.h | ||
---|---|---|
void get_smaller_surface_rect(SDL_Surface *surf, SDL_Rect *rect);
|
||
#define map_rgba(format, color) \
|
||
SDL_MapRGBA(format, (color).r, (color).g, (color).b, (color).a)
|
||
SDL_MapRGBA(SDL_GetPixelFormatDetails(format), NULL, (color).r, (color).g, (color).b, (color).a)
|
||
#define crop_rect_from_screen(rect) \
|
||
crop_rect_from_surface(main_data.screen, &rect)
|
client/gui-sdl3/gui_string.c | ||
---|---|---|
/* Create and fill surface */
|
||
if (SDL_GetSurfaceColorKey(tmp[0], &color) < 0) {
|
||
color = SDL_MapRGBA(tmp[0]->format, 0, 0, 0, 0);
|
||
color = SDL_MapRGBA(SDL_GetPixelFormatDetails(tmp[0]->format), NULL,
|
||
0, 0, 0, 0);
|
||
}
|
||
switch (pstr->render) {
|
client/gui-sdl3/sprite.c | ||
---|---|---|
mypixbuf = SDL_CreateSurface(width, height, SDL_PIXELFORMAT_RGBA8888);
|
||
SDL_FillSurfaceRect(mypixbuf, NULL,
|
||
SDL_MapRGBA(mypixbuf->format,
|
||
SDL_MapRGBA(SDL_GetPixelFormatDetails(mypixbuf->format),
|
||
NULL,
|
||
pcolor->color->r,
|
||
pcolor->color->g,
|
||
pcolor->color->b,
|
client/gui-sdl3/widget_label.c | ||
---|---|---|
ptheme = create_surf(label->size.w, label->size.h * 2);
|
||
colorkey = SDL_MapRGBA(ptheme->format, pstr->bgcol.r,
|
||
pstr->bgcol.g, pstr->bgcol.b, pstr->bgcol.a);
|
||
colorkey = SDL_MapRGBA(SDL_GetPixelFormatDetails(ptheme->format),
|
||
NULL, pstr->bgcol.r, pstr->bgcol.g, pstr->bgcol.b,
|
||
pstr->bgcol.a);
|
||
SDL_FillSurfaceRect(ptheme, NULL, colorkey);
|
||
label->size.x = 0;
|
||
... | ... | |
SDL_Surface *ptheme = create_surf(icon_label->size.w,
|
||
icon_label->size.h * 2);
|
||
colorkey = SDL_MapRGBA(ptheme->format,
|
||
colorkey = SDL_MapRGBA(SDL_GetPixelFormatDetails(ptheme->format),
|
||
NULL,
|
||
icon_label->string_utf8->bgcol.r,
|
||
icon_label->string_utf8->bgcol.g,
|
||
icon_label->string_utf8->bgcol.b,
|