SDL_bmp.c: restore most of the original formatting.

Ozkan Sezer 2019-09-02 12:35:00 +03:00
parent 847bd8d983
commit b21338eb54
1 changed files with 156 additions and 156 deletions

View File

@ -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");