Mercurial > hg > dmlib
comparison src/dmimage.c @ 1102:e06abfde6c39
Cosmetics pass: Remove excess whitespace.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 03 Mar 2015 23:22:36 +0200 |
parents | 76b7d1d20545 |
children | 73808dce89e6 |
comparison
equal
deleted
inserted
replaced
1101:0577f10dc3de | 1102:e06abfde6c39 |
---|---|
55 result = SDL_ConvertSurface(tmp, pixtmp->format, SDL_SWSURFACE | SDL_SRCALPHA); | 55 result = SDL_ConvertSurface(tmp, pixtmp->format, SDL_SWSURFACE | SDL_SRCALPHA); |
56 SDL_FreeSurface(tmp); | 56 SDL_FreeSurface(tmp); |
57 } | 57 } |
58 if (pixtmp != NULL) | 58 if (pixtmp != NULL) |
59 SDL_FreeSurface(pixtmp); | 59 SDL_FreeSurface(pixtmp); |
60 | 60 |
61 return result; | 61 return result; |
62 } | 62 } |
63 | 63 |
64 | 64 |
65 SDL_Surface *dmCreatePaletteSurfaceFrom(void *data, const int width, const int height, const int pitch) | 65 SDL_Surface *dmCreatePaletteSurfaceFrom(void *data, const int width, const int height, const int pitch) |
68 Uint8 *dst, *src; | 68 Uint8 *dst, *src; |
69 SDL_Surface *result; | 69 SDL_Surface *result; |
70 result = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 8, 0,0,0,0); | 70 result = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 8, 0,0,0,0); |
71 if (result == NULL) | 71 if (result == NULL) |
72 return NULL; | 72 return NULL; |
73 | 73 |
74 dst = result->pixels; | 74 dst = result->pixels; |
75 src = data; | 75 src = data; |
76 for (yc = 0; yc < height; yc++) | 76 for (yc = 0; yc < height; yc++) |
77 { | 77 { |
78 memcpy(dst, src, width * sizeof(Uint8)); | 78 memcpy(dst, src, width * sizeof(Uint8)); |
166 | 166 |
167 case 1: | 167 case 1: |
168 result = dmCreatePaletteSurfaceFrom(data, width, height, width * comp); | 168 result = dmCreatePaletteSurfaceFrom(data, width, height, width * comp); |
169 break; | 169 break; |
170 } | 170 } |
171 | 171 |
172 stbi_image_free(data); | 172 stbi_image_free(data); |
173 | 173 |
174 if (result == NULL) | 174 if (result == NULL) |
175 { | 175 { |
176 dmErrorDBGMsg( | 176 dmErrorDBGMsg( |