Feature #903 ยป 0057-sdl3-Update-get_smaller_surface_rect-to-sdl3-changes.patch
client/gui-sdl3/graphics.c | ||
---|---|---|
Uint16 minX, maxX, minY, maxY;
|
||
Uint32 colorkey;
|
||
Uint32 mask;
|
||
const struct SDL_PixelFormatDetails *details
|
||
= SDL_GetPixelFormatDetails(surf->format);
|
||
fc_assert(surf != NULL);
|
||
fc_assert(rect != NULL);
|
||
... | ... | |
if (!SDL_GetSurfaceColorKey(surf, &colorkey)) {
|
||
/* Use alpha instead of colorkey */
|
||
mask = surf->format->Amask;
|
||
mask = details->Amask;
|
||
colorkey = 0;
|
||
} else {
|
||
mask = 0xffffffff;
|
||
... | ... | |
lock_surf(surf);
|
||
switch (surf->format->bytes_per_pixel) {
|
||
switch (details->bytes_per_pixel) {
|
||
case 1:
|
||
{
|
||
Uint8 *pixel = (Uint8 *)surf->pixels;
|