comparison src/video/SDL_surface.c @ 130:14af14ff7c19

The rectangle argument to SDL_SetClipRect is really const
author Sam Lantinga <slouken@libsdl.org>
date Tue, 31 Jul 2001 05:36:10 +0000
parents 74212992fb08
children e8157fcb3114
comparison
equal deleted inserted replaced
129:db0bee1c5845 130:14af14ff7c19
273 /* 273 /*
274 * A function to calculate the intersection of two rectangles: 274 * A function to calculate the intersection of two rectangles:
275 * return true if the rectangles intersect, false otherwise 275 * return true if the rectangles intersect, false otherwise
276 */ 276 */
277 static __inline__ 277 static __inline__
278 SDL_bool SDL_IntersectRect(SDL_Rect *A, SDL_Rect *B, SDL_Rect *intersection) 278 SDL_bool SDL_IntersectRect(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *intersection)
279 { 279 {
280 int Amin, Amax, Bmin, Bmax; 280 int Amin, Amax, Bmin, Bmax;
281 281
282 /* Horizontal intersection */ 282 /* Horizontal intersection */
283 Amin = A->x; 283 Amin = A->x;
306 return (intersection->w && intersection->h); 306 return (intersection->w && intersection->h);
307 } 307 }
308 /* 308 /*
309 * Set the clipping rectangle for a blittable surface 309 * Set the clipping rectangle for a blittable surface
310 */ 310 */
311 SDL_bool SDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect) 311 SDL_bool SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect)
312 { 312 {
313 SDL_Rect full_rect; 313 SDL_Rect full_rect;
314 314
315 /* Don't do anything if there's no surface to act on */ 315 /* Don't do anything if there's no surface to act on */
316 if ( ! surface ) { 316 if ( ! surface ) {