Mercurial > sdl-ios-xcode
comparison src/video/nanox/SDL_nximage.c @ 1338:604d73db6802
Removed uses of stdlib.h and string.h
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 07 Feb 2006 09:29:18 +0000 |
parents | b8d311d90021 |
children | c71e05b4dc2e |
comparison
equal
deleted
inserted
replaced
1337:c687f06c7473 | 1338:604d73db6802 |
---|---|
23 | 23 |
24 Hsieh-Fu Tsai | 24 Hsieh-Fu Tsai |
25 clare@setabox.com | 25 clare@setabox.com |
26 */ | 26 */ |
27 | 27 |
28 #include <stdlib.h> | 28 #include "SDL_stdlib.h" |
29 #include <string.h> | 29 #include "SDL_string.h" |
30 | |
31 #include "SDL_error.h" | 30 #include "SDL_error.h" |
32 | 31 |
33 #include "SDL_nximage_c.h" | 32 #include "SDL_nximage_c.h" |
34 | 33 |
35 void NX_NormalUpdate (_THIS, int numrects, SDL_Rect * rects) | 34 void NX_NormalUpdate (_THIS, int numrects, SDL_Rect * rects) |
104 } | 103 } |
105 #endif | 104 #endif |
106 else | 105 else |
107 { | 106 { |
108 for (j = h; j > 0; -- j, src += yinc, dest += destinc) | 107 for (j = h; j > 0; -- j, src += yinc, dest += destinc) |
109 memcpy (dest, src, rowinc) ; | 108 SDL_memcpy (dest, src, rowinc) ; |
110 } | 109 } |
111 if (!Clientfb) { | 110 if (!Clientfb) { |
112 if (currently_fullscreen) { | 111 if (currently_fullscreen) { |
113 GrArea (FSwindow, SDL_GC, x + OffsetX, y + OffsetY, w, h, Image_buff, | 112 GrArea (FSwindow, SDL_GC, x + OffsetX, y + OffsetY, w, h, Image_buff, |
114 pixel_type) ; | 113 pixel_type) ; |
126 { | 125 { |
127 int size = screen -> h * screen -> pitch ; | 126 int size = screen -> h * screen -> pitch ; |
128 | 127 |
129 Dprintf ("enter NX_SetupImage\n") ; | 128 Dprintf ("enter NX_SetupImage\n") ; |
130 | 129 |
131 screen -> pixels = (void *) malloc (size) ; | 130 screen -> pixels = (void *) SDL_malloc (size) ; |
132 | 131 |
133 if (!Clientfb) { | 132 if (!Clientfb) { |
134 Image_buff = (unsigned char *) malloc (size) ; | 133 Image_buff = (unsigned char *) SDL_malloc (size) ; |
135 if (screen -> pixels == NULL || Image_buff == NULL) { | 134 if (screen -> pixels == NULL || Image_buff == NULL) { |
136 free (screen -> pixels) ; | 135 SDL_free (screen -> pixels) ; |
137 free (Image_buff) ; | 136 SDL_free (Image_buff) ; |
138 SDL_OutOfMemory () ; | 137 SDL_OutOfMemory () ; |
139 return -1 ; | 138 return -1 ; |
140 } | 139 } |
141 } | 140 } |
142 | 141 |
150 | 149 |
151 void NX_DestroyImage (_THIS, SDL_Surface * screen) | 150 void NX_DestroyImage (_THIS, SDL_Surface * screen) |
152 { | 151 { |
153 Dprintf ("enter NX_DestroyImage\n") ; | 152 Dprintf ("enter NX_DestroyImage\n") ; |
154 | 153 |
155 if (SDL_Image) free (SDL_Image) ; | 154 if (SDL_Image) SDL_free (SDL_Image) ; |
156 if (Image_buff) free (Image_buff) ; | 155 if (Image_buff) SDL_free (Image_buff) ; |
157 if (screen) screen -> pixels = NULL ; | 156 if (screen) screen -> pixels = NULL ; |
158 | 157 |
159 Dprintf ("leave NX_DestroyImage\n") ; | 158 Dprintf ("leave NX_DestroyImage\n") ; |
160 } | 159 } |
161 | 160 |
213 else | 212 else |
214 dest = fbinfo.winpixels; | 213 dest = fbinfo.winpixels; |
215 rowinc = xinc * this -> screen -> w; | 214 rowinc = xinc * this -> screen -> w; |
216 | 215 |
217 for (j = this -> screen -> h; j > 0; -- j, src += yinc, dest += fbinfo.pitch) | 216 for (j = this -> screen -> h; j > 0; -- j, src += yinc, dest += fbinfo.pitch) |
218 memcpy (dest, src, rowinc) ; | 217 SDL_memcpy (dest, src, rowinc) ; |
219 } | 218 } |
220 else | 219 else |
221 #endif | 220 #endif |
222 { | 221 { |
223 if (currently_fullscreen) { | 222 if (currently_fullscreen) { |