comparison src/video/photon/SDL_ph_image.c @ 283:3d8b6b9f1e18

Date: Mon, 18 Feb 2002 16:46:59 +1200 From: Julian Kinraid <jkinraid@clear.net.nz> Subject: Patches for photon port of SDL Hi, A couple more patches for photon and the nto audio. Adds mouse grabbing support, fixed cursor images, unicode keyboard events (though no unicode data on kye release, is that a problem?), hopefully fixing some audio lag problems, and a few other fixes. Thanks, Julian Kinraid
author Sam Lantinga <slouken@libsdl.org>
date Wed, 20 Feb 2002 01:05:51 +0000
parents c6abdda2f666
children 68a8a8237c09
comparison
equal deleted inserted replaced
282:b42d80e73896 283:3d8b6b9f1e18
173 } 173 }
174 174
175 175
176 void ph_DestroyImage(_THIS, SDL_Surface *screen) 176 void ph_DestroyImage(_THIS, SDL_Surface *screen)
177 { 177 {
178 #if 0
178 if(SDL_Image == NULL) 179 if(SDL_Image == NULL)
179 return; 180 return;
181 #endif
180 182
181 if (OCImage.offscreen_context != NULL) 183 if (OCImage.offscreen_context != NULL)
182 { 184 {
183 PhDCRelease(OCImage.offscreen_context); 185 PhDCRelease(OCImage.offscreen_context);
184 OCImage.offscreen_context = NULL; 186 OCImage.offscreen_context = NULL;
186 OCImage.FrameData0 = NULL; 188 OCImage.FrameData0 = NULL;
187 free(OCImage.FrameData1); 189 free(OCImage.FrameData1);
188 OCImage.FrameData1 = NULL; 190 OCImage.FrameData1 = NULL;
189 } 191 }
190 192
191 if (SDL_Image->image) 193 if (SDL_Image)
192 { 194 {
193 // SDL_Image->flags=Ph_RELEASE_IMAGE; 195 // SDL_Image->flags=Ph_RELEASE_IMAGE;
194 // PhReleaseImage(SDL_Image); 196 // PhReleaseImage(SDL_Image);
195 PgShmemDestroy(SDL_Image->image); // Use this if you using shared memory, or uncomment 197 if (SDL_Image->image)
198 PgShmemDestroy(SDL_Image->image); // Use this if you using shared memory, or uncomment
196 // lines above if not (and comment this line ;-) 199 // lines above if not (and comment this line ;-)
197 free(SDL_Image); 200 free(SDL_Image);
201 SDL_Image = NULL;
198 } 202 }
199 203
200 if ( screen ) 204 if ( screen )
201 { 205 {
202 screen->pixels = NULL; 206 screen->pixels = NULL;
203 } 207 }
204
205 SDL_Image = NULL;
206 } 208 }
207 209
208 int ph_ResizeImage(_THIS, SDL_Surface *screen, Uint32 flags) 210 int ph_ResizeImage(_THIS, SDL_Surface *screen, Uint32 flags)
209 { 211 {
210 ph_DestroyImage(this, screen); 212 ph_DestroyImage(this, screen);