[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src/video intern_video.h
From: |
Jimmy Salmon |
Subject: |
[Stratagus-CVS] stratagus/src/video intern_video.h |
Date: |
Sun, 28 Sep 2003 15:19:55 -0400 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Jimmy Salmon <address@hidden> 03/09/28 15:19:55
Modified files:
src/video : intern_video.h
Log message:
Cleanup
Patches:
Index: stratagus/src/video/intern_video.h
diff -u stratagus/src/video/intern_video.h:1.10
stratagus/src/video/intern_video.h:1.11
--- stratagus/src/video/intern_video.h:1.10 Fri Jul 11 10:35:34 2003
+++ stratagus/src/video/intern_video.h Sun Sep 28 15:19:55 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: intern_video.h,v 1.10 2003/07/11 14:35:34 n0body Exp $
+// $Id: intern_video.h,v 1.11 2003/09/28 19:19:55 jsalmon3 Exp $
#ifndef __INTERN_VIDEO_H__
#define __INTERN_VIDEO_H__
@@ -92,36 +92,36 @@
** @param height unsigned int height to display
** (return value of width and height can be made smaller)
*/
-#define CLIP_RECTANGLE(x,y,width,height) { \
- int f; \
- if( x<ClipX1 ) { \
- f=ClipX1-x; \
- if( width<=f ) { \
- return; \
- } \
- width-=f; \
- x=ClipX1; \
- } \
- if( (x+width)>ClipX2+1 ) { \
- if( x>ClipX2 ) { \
- return; \
- } \
- width=ClipX2-x+1; \
- } \
- if( y<ClipY1 ) { \
- f=ClipY1-y; \
- if( height<=f ) { \
- return; \
- } \
- height-=f; \
- y=ClipY1; \
- } \
- if( (y+height)>ClipY2+1 ) { \
- if( y>ClipY2 ) { \
- return; \
- } \
- height=ClipY2-y+1; \
- } \
+#define CLIP_RECTANGLE(x, y, width, height) { \
+ int f; \
+ if (x < ClipX1) { \
+ f = ClipX1 - x; \
+ if (width <= f) { \
+ return; \
+ } \
+ width -= f; \
+ x = ClipX1; \
+ } \
+ if ((x + width) > ClipX2 + 1) { \
+ if (x > ClipX2) { \
+ return; \
+ } \
+ width = ClipX2 - x + 1; \
+ } \
+ if (y < ClipY1) { \
+ f = ClipY1 - y; \
+ if (height <= f) { \
+ return; \
+ } \
+ height -= f; \
+ y = ClipY1; \
+ } \
+ if ((y + height) > ClipY2 + 1) { \
+ if (y > ClipY2) { \
+ return; \
+ } \
+ height = ClipY2 - y + 1; \
+ } \
}
/**
@@ -147,39 +147,42 @@
**
** @note there was no need for 'endy', as it isn't used to draw sprites..
*/
-#define CLIP_RECTANGLE_OFS(x,y,width,height,ofsx,ofsy,endx) { \
- if( y<ClipY1 ) { \
- ofsy=ClipY1-y; \
- if( height<=ofsy ) { \
- return; \
- } \
- height-=ofsy; \
- y=ClipY1; \
- } \
- else ofsy=0; \
- if( (y+height)>ClipY2+1 ) { \
- if( y>ClipY2 ) { \
- return; \
- } \
- height=ClipY2-y+1; \
- } \
- if( x<ClipX1 ) { \
- ofsx=ClipX1-x; \
- if( width<=ofsx ) { \
- return; \
- } \
- width-=ofsx; \
- x=ClipX1; \
- } \
- else ofsx=0; \
- if( (x+width)>ClipX2+1 ) { \
- if( x>ClipX2 ) { \
- return; \
- } \
- endx=(x+width)-(ClipX2+1); \
- width=ClipX2-x+1; \
- } \
- else endx=0; \
+#define CLIP_RECTANGLE_OFS(x, y, width, height, ofsx, ofsy, endx) { \
+ if (y < ClipY1) { \
+ ofsy = ClipY1 - y; \
+ if (height <= ofsy) { \
+ return; \
+ } \
+ height -= ofsy; \
+ y = ClipY1; \
+ } else { \
+ ofsy = 0; \
+ } \
+ if ((y + height) > ClipY2 + 1) { \
+ if (y > ClipY2) { \
+ return; \
+ } \
+ height = ClipY2 - y + 1; \
+ } \
+ if (x < ClipX1) { \
+ ofsx = ClipX1 - x; \
+ if (width <= ofsx) { \
+ return; \
+ } \
+ width -= ofsx; \
+ x = ClipX1; \
+ } else { \
+ ofsx = 0; \
+ } \
+ if ((x + width) > ClipX2 + 1) { \
+ if (x > ClipX2) { \
+ return; \
+ } \
+ endx = (x + width) - (ClipX2 + 1); \
+ width = ClipX2 - x + 1; \
+ } else { \
+ endx = 0; \
+ } \
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus/src/video intern_video.h,
Jimmy Salmon <=