comparison src/video/SDL_bmp.c @ 2918:bd518fc76f28

Updated to build on Windows
author Sam Lantinga <slouken@libsdl.org>
date Thu, 25 Dec 2008 05:11:29 +0000
parents 99210400e8b9
children cdb01906cb7e
comparison
equal deleted inserted replaced
2917:4cecb110195d 2918:bd518fc76f28
216 palette = (surface->format)->palette; 216 palette = (surface->format)->palette;
217 if (palette) { 217 if (palette) {
218 if (biClrUsed == 0) { 218 if (biClrUsed == 0) {
219 biClrUsed = 1 << biBitCount; 219 biClrUsed = 1 << biBitCount;
220 } 220 }
221 if (biClrUsed > palette->ncolors) { 221 if ((int)biClrUsed > palette->ncolors) {
222 palette->ncolors = biClrUsed; 222 palette->ncolors = biClrUsed;
223 palette->colors = 223 palette->colors =
224 (SDL_Color *) SDL_realloc(palette->colors, 224 (SDL_Color *) SDL_realloc(palette->colors,
225 palette->ncolors * 225 palette->ncolors *
226 sizeof(*palette->colors)); 226 sizeof(*palette->colors));
227 if (!palette->colors) { 227 if (!palette->colors) {
228 SDL_OutOfMemory(); 228 SDL_OutOfMemory();
229 was_error = 1; 229 was_error = 1;
230 goto done; 230 goto done;
231 } 231 }
232 } else if (biClrUsed < palette->ncolors) { 232 } else if ((int)biClrUsed < palette->ncolors) {
233 palette->ncolors = biClrUsed; 233 palette->ncolors = biClrUsed;
234 } 234 }
235 if (biSize == 12) { 235 if (biSize == 12) {
236 for (i = 0; i < (int) biClrUsed; ++i) { 236 for (i = 0; i < (int) biClrUsed; ++i) {
237 SDL_RWread(src, &palette->colors[i].b, 1, 1); 237 SDL_RWread(src, &palette->colors[i].b, 1, 1);