comparison src/video/SDL_gamma.c @ 1336:3692456e7b0f

Use SDL_ prefixed versions of C library functions. FIXME: Change #include <stdlib.h> to #include "SDL_stdlib.h" Change #include <string.h> to #include "SDL_string.h" Make sure nothing else broke because of this...
author Sam Lantinga <slouken@libsdl.org>
date Tue, 07 Feb 2006 06:59:48 +0000
parents 37d43bd654d7
children 604d73db6802
comparison
equal deleted inserted replaced
1335:c39265384763 1336:3692456e7b0f
163 SDL_GetGammaRamp(0, 0, 0); 163 SDL_GetGammaRamp(0, 0, 0);
164 } 164 }
165 165
166 /* Fill the gamma table with the new values */ 166 /* Fill the gamma table with the new values */
167 if ( red ) { 167 if ( red ) {
168 memcpy(&video->gamma[0*256], red, 256*sizeof(*video->gamma)); 168 SDL_memcpy(&video->gamma[0*256], red, 256*sizeof(*video->gamma));
169 } 169 }
170 if ( green ) { 170 if ( green ) {
171 memcpy(&video->gamma[1*256], green, 256*sizeof(*video->gamma)); 171 SDL_memcpy(&video->gamma[1*256], green, 256*sizeof(*video->gamma));
172 } 172 }
173 if ( blue ) { 173 if ( blue ) {
174 memcpy(&video->gamma[2*256], blue, 256*sizeof(*video->gamma)); 174 SDL_memcpy(&video->gamma[2*256], blue, 256*sizeof(*video->gamma));
175 } 175 }
176 176
177 /* Gamma correction always possible on split palettes */ 177 /* Gamma correction always possible on split palettes */
178 if ( (screen->flags & SDL_HWPALETTE) == SDL_HWPALETTE ) { 178 if ( (screen->flags & SDL_HWPALETTE) == SDL_HWPALETTE ) {
179 SDL_Palette *pal = screen->format->palette; 179 SDL_Palette *pal = screen->format->palette;
202 SDL_VideoDevice *video = current_video; 202 SDL_VideoDevice *video = current_video;
203 SDL_VideoDevice *this = current_video; 203 SDL_VideoDevice *this = current_video;
204 204
205 /* Lazily allocate the gamma table */ 205 /* Lazily allocate the gamma table */
206 if ( ! video->gamma ) { 206 if ( ! video->gamma ) {
207 video->gamma = malloc(3*256*sizeof(*video->gamma)); 207 video->gamma = SDL_malloc(3*256*sizeof(*video->gamma));
208 if ( ! video->gamma ) { 208 if ( ! video->gamma ) {
209 SDL_OutOfMemory(); 209 SDL_OutOfMemory();
210 return -1; 210 return -1;
211 } 211 }
212 if ( video->GetGammaRamp ) { 212 if ( video->GetGammaRamp ) {
223 } 223 }
224 } 224 }
225 225
226 /* Just copy from our internal table */ 226 /* Just copy from our internal table */
227 if ( red ) { 227 if ( red ) {
228 memcpy(red, &video->gamma[0*256], 256*sizeof(*red)); 228 SDL_memcpy(red, &video->gamma[0*256], 256*sizeof(*red));
229 } 229 }
230 if ( green ) { 230 if ( green ) {
231 memcpy(green, &video->gamma[1*256], 256*sizeof(*green)); 231 SDL_memcpy(green, &video->gamma[1*256], 256*sizeof(*green));
232 } 232 }
233 if ( blue ) { 233 if ( blue ) {
234 memcpy(blue, &video->gamma[2*256], 256*sizeof(*blue)); 234 SDL_memcpy(blue, &video->gamma[2*256], 256*sizeof(*blue));
235 } 235 }
236 return 0; 236 return 0;
237 } 237 }