comparison src/video/macrom/SDL_romvideo.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
118 return(1); 118 return(1);
119 } 119 }
120 120
121 static void ROM_DeleteDevice(SDL_VideoDevice *device) 121 static void ROM_DeleteDevice(SDL_VideoDevice *device)
122 { 122 {
123 free(device->hidden); 123 SDL_free(device->hidden);
124 free(device); 124 SDL_free(device);
125 } 125 }
126 126
127 static SDL_VideoDevice *ROM_CreateDevice(int devindex) 127 static SDL_VideoDevice *ROM_CreateDevice(int devindex)
128 { 128 {
129 SDL_VideoDevice *device; 129 SDL_VideoDevice *device;
130 130
131 /* Initialize all variables that we clean on shutdown */ 131 /* Initialize all variables that we clean on shutdown */
132 device = (SDL_VideoDevice *)malloc(sizeof(SDL_VideoDevice)); 132 device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
133 if ( device ) { 133 if ( device ) {
134 memset(device, 0, (sizeof *device)); 134 SDL_memset(device, 0, (sizeof *device));
135 device->hidden = (struct SDL_PrivateVideoData *) 135 device->hidden = (struct SDL_PrivateVideoData *)
136 malloc((sizeof *device->hidden)); 136 SDL_malloc((sizeof *device->hidden));
137 } 137 }
138 if ( (device == NULL) || (device->hidden == NULL) ) { 138 if ( (device == NULL) || (device->hidden == NULL) ) {
139 SDL_OutOfMemory(); 139 SDL_OutOfMemory();
140 if ( device ) { 140 if ( device ) {
141 free(device); 141 SDL_free(device);
142 } 142 }
143 return(0); 143 return(0);
144 } 144 }
145 memset(device->hidden, 0, (sizeof *device->hidden)); 145 SDL_memset(device->hidden, 0, (sizeof *device->hidden));
146 146
147 /* Set the function pointers */ 147 /* Set the function pointers */
148 device->VideoInit = ROM_VideoInit; 148 device->VideoInit = ROM_VideoInit;
149 device->ListModes = ROM_ListModes; 149 device->ListModes = ROM_ListModes;
150 device->SetVideoMode = ROM_SetVideoMode; 150 device->SetVideoMode = ROM_SetVideoMode;
229 (**SDL_CTab).ctSize = 255; 229 (**SDL_CTab).ctSize = 255;
230 CTabChanged(SDL_CTab); 230 CTabChanged(SDL_CTab);
231 SDL_CPal = NewPalette(256, SDL_CTab, pmExplicit+pmTolerant, 0); 231 SDL_CPal = NewPalette(256, SDL_CTab, pmExplicit+pmTolerant, 0);
232 232
233 /* Get a list of available fullscreen modes */ 233 /* Get a list of available fullscreen modes */
234 SDL_modelist = (SDL_Rect **)malloc((1+1)*sizeof(SDL_Rect *)); 234 SDL_modelist = (SDL_Rect **)SDL_malloc((1+1)*sizeof(SDL_Rect *));
235 if ( SDL_modelist ) { 235 if ( SDL_modelist ) {
236 SDL_modelist[0] = (SDL_Rect *)malloc(sizeof(SDL_Rect)); 236 SDL_modelist[0] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
237 if ( SDL_modelist[0] ) { 237 if ( SDL_modelist[0] ) {
238 SDL_modelist[0]->x = 0; 238 SDL_modelist[0]->x = 0;
239 SDL_modelist[0]->y = 0; 239 SDL_modelist[0]->y = 0;
240 SDL_modelist[0]->w = (**SDL_Display).gdRect.right; 240 SDL_modelist[0]->w = (**SDL_Display).gdRect.right;
241 SDL_modelist[0]->h = (**SDL_Display).gdRect.bottom; 241 SDL_modelist[0]->h = (**SDL_Display).gdRect.bottom;
721 RestoreDeviceClut(GetMainDevice()); 721 RestoreDeviceClut(GetMainDevice());
722 722
723 /* Free list of video modes */ 723 /* Free list of video modes */
724 if ( SDL_modelist != NULL ) { 724 if ( SDL_modelist != NULL ) {
725 for ( i=0; SDL_modelist[i]; ++i ) { 725 for ( i=0; SDL_modelist[i]; ++i ) {
726 free(SDL_modelist[i]); 726 SDL_free(SDL_modelist[i]);
727 } 727 }
728 free(SDL_modelist); 728 SDL_free(SDL_modelist);
729 SDL_modelist = NULL; 729 SDL_modelist = NULL;
730 } 730 }
731 } 731 }
732 732