comparison src/video/cybergfx/SDL_cgxmodes.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 c9b51268668f
children 604d73db6802
comparison
equal deleted inserted replaced
1335:c39265384763 1336:3692456e7b0f
135 135
136 if(!ok) 136 if(!ok)
137 { 137 {
138 nmodes++; 138 nmodes++;
139 139
140 SDL_modelist = (SDL_Rect **)realloc(SDL_modelist,(nmodes+1)*sizeof(SDL_Rect *)); 140 SDL_modelist = (SDL_Rect **)SDL_realloc(SDL_modelist,(nmodes+1)*sizeof(SDL_Rect *));
141 SDL_modelist[nmodes]=NULL; 141 SDL_modelist[nmodes]=NULL;
142 142
143 if ( SDL_modelist ) 143 if ( SDL_modelist )
144 { 144 {
145 SDL_modelist[nmodes-1] = (SDL_Rect *)malloc(sizeof(SDL_Rect)); 145 SDL_modelist[nmodes-1] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
146 146
147 if ( SDL_modelist[nmodes-1] == NULL ) 147 if ( SDL_modelist[nmodes-1] == NULL )
148 break; 148 break;
149 149
150 SDL_modelist[nmodes-1]->x = 0; 150 SDL_modelist[nmodes-1]->x = 0;
173 SDL_SetError("Found no sufficiently capable CGX visuals"); 173 SDL_SetError("Found no sufficiently capable CGX visuals");
174 return -1; 174 return -1;
175 } 175 }
176 176
177 if ( SDL_modelist == NULL ) { 177 if ( SDL_modelist == NULL ) {
178 SDL_modelist = (SDL_Rect **)malloc((1+1)*sizeof(SDL_Rect *)); 178 SDL_modelist = (SDL_Rect **)SDL_malloc((1+1)*sizeof(SDL_Rect *));
179 i = 0; 179 i = 0;
180 if ( SDL_modelist ) { 180 if ( SDL_modelist ) {
181 SDL_modelist[i] = (SDL_Rect *)malloc(sizeof(SDL_Rect)); 181 SDL_modelist[i] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
182 if ( SDL_modelist[i] ) { 182 if ( SDL_modelist[i] ) {
183 SDL_modelist[i]->x = 0; 183 SDL_modelist[i]->x = 0;
184 SDL_modelist[i]->y = 0; 184 SDL_modelist[i]->y = 0;
185 SDL_modelist[i]->w = SDL_Display->Width; 185 SDL_modelist[i]->w = SDL_Display->Width;
186 SDL_modelist[i]->h = SDL_Display->Height; 186 SDL_modelist[i]->h = SDL_Display->Height;
236 { 236 {
237 int i; 237 int i;
238 238
239 if ( SDL_modelist ) { 239 if ( SDL_modelist ) {
240 for ( i=0; SDL_modelist[i]; ++i ) { 240 for ( i=0; SDL_modelist[i]; ++i ) {
241 free(SDL_modelist[i]); 241 SDL_free(SDL_modelist[i]);
242 } 242 }
243 free(SDL_modelist); 243 SDL_free(SDL_modelist);
244 SDL_modelist = NULL; 244 SDL_modelist = NULL;
245 } 245 }
246 } 246 }
247 247
248 int CGX_ResizeFullScreen(_THIS) 248 int CGX_ResizeFullScreen(_THIS)