mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-01-31 00:09:19 +01:00
SDL_bmp.c: restore most of the original formatting.
This commit is contained in:
parent
847bd8d983
commit
b21338eb54
@ -390,8 +390,9 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Create a compatible surface, note that the colors are RGB ordered */
|
/* Create a compatible surface, note that the colors are RGB ordered */
|
||||||
surface = SDL_CreateRGBSurface(0,
|
surface =
|
||||||
biWidth, biHeight, biBitCount, Rmask, Gmask, Bmask, Amask);
|
SDL_CreateRGBSurface(0, biWidth, biHeight, biBitCount, Rmask, Gmask,
|
||||||
|
Bmask, Amask);
|
||||||
if (surface == NULL) {
|
if (surface == NULL) {
|
||||||
was_error = SDL_TRUE;
|
was_error = SDL_TRUE;
|
||||||
goto done;
|
goto done;
|
||||||
@ -460,8 +461,7 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
|
|||||||
pad = (((bmpPitch) % 4) ? (4 - ((bmpPitch) % 4)) : 0);
|
pad = (((bmpPitch) % 4) ? (4 - ((bmpPitch) % 4)) : 0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
pad = ((surface->pitch%4) ?
|
pad = ((surface->pitch % 4) ? (4 - (surface->pitch % 4)) : 0);
|
||||||
(4-(surface->pitch%4)) : 0);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (topDown) {
|
if (topDown) {
|
||||||
@ -500,7 +500,7 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
|
|||||||
was_error = SDL_TRUE;
|
was_error = SDL_TRUE;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (biBitCount == 8 && palette && biClrUsed < (1 << biBitCount)) {
|
if (biBitCount == 8 && palette && biClrUsed < (1u << biBitCount)) {
|
||||||
for (i = 0; i < surface->w; ++i) {
|
for (i = 0; i < surface->w; ++i) {
|
||||||
if (bits[i] >= biClrUsed) {
|
if (bits[i] >= biClrUsed) {
|
||||||
SDL_SetError("A BMP image contains a pixel with a color out of the palette");
|
SDL_SetError("A BMP image contains a pixel with a color out of the palette");
|
||||||
|
Loading…
Reference in New Issue
Block a user