[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src/video sprite.c
From: |
Nehal Mistry |
Subject: |
[Stratagus-CVS] stratagus/src/video sprite.c |
Date: |
Sat, 29 Nov 2003 13:16:48 -0500 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Nehal Mistry <address@hidden> 03/11/29 13:16:48
Modified files:
src/video : sprite.c
Log message:
clip shadows
Patches:
Index: stratagus/src/video/sprite.c
diff -u stratagus/src/video/sprite.c:1.50 stratagus/src/video/sprite.c:1.51
--- stratagus/src/video/sprite.c:1.50 Sat Nov 29 13:08:12 2003
+++ stratagus/src/video/sprite.c Sat Nov 29 13:16:47 2003
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: sprite.c,v 1.50 2003/11/29 18:08:12 nehalmistry Exp $
+// $Id: sprite.c,v 1.51 2003/11/29 18:16:47 nehalmistry Exp $
//@{
@@ -117,8 +117,6 @@
SDL_Rect srect;
SDL_Rect drect;
- DebugCheck(!sprite->SurfaceFlip);
-
srect.x = (sprite->SurfaceFlip->w - (frame % (sprite->SurfaceFlip->w /
sprite->Width)) * sprite->Width) - sprite->Width;
srect.y = (frame / (sprite->SurfaceFlip->w / sprite->Width)) *
sprite->Height;
@@ -161,16 +159,25 @@
{
SDL_Rect srect;
SDL_Rect drect;
+ int oldx;
+ int oldy;
srect.x = (frame % (sprite->Surface->w / sprite->Width)) * sprite->Width;
srect.y = (frame / (sprite->Surface->w / sprite->Width)) * sprite->Height;
srect.w = sprite->Width;
srect.h = sprite->Height;
+ oldx = x;
+ oldy = y;
+ CLIP_RECTANGLE(x, y, srect.w, srect.h);
+ srect.x += x - oldx;
+ srect.y += y - oldy;
+
drect.x = x;
drect.y = y;
SDL_BlitSurface(sprite->Surface, &srect, TheScreen, &drect);
+
}
local void VideoDrawShadowClipX(const Graphic* sprite, unsigned frame,
@@ -178,11 +185,20 @@
{
SDL_Rect srect;
SDL_Rect drect;
+ int oldx;
+ int oldy;
- srect.x = (frame % (sprite->Surface->w / sprite->Width)) * sprite->Width;
- srect.y = (frame / (sprite->Surface->w / sprite->Width)) * sprite->Height;
+ srect.x = (sprite->SurfaceFlip->w - (frame % (sprite->SurfaceFlip->w /
+ sprite->Width)) * sprite->Width) - sprite->Width;
+ srect.y = (frame / (sprite->SurfaceFlip->w / sprite->Width)) *
sprite->Height;
srect.w = sprite->Width;
srect.h = sprite->Height;
+
+ oldx = x;
+ oldy = y;
+ CLIP_RECTANGLE(x, y, srect.w, srect.h);
+ srect.x += x - oldx;
+ srect.y += y - oldy;
drect.x = x;
drect.y = y;
- [Stratagus-CVS] stratagus/src/video sprite.c, Nehal Mistry, 2003/11/17
- [Stratagus-CVS] stratagus/src/video sprite.c, Nehal Mistry, 2003/11/22
- [Stratagus-CVS] stratagus/src/video sprite.c, Nehal Mistry, 2003/11/22
- [Stratagus-CVS] stratagus/src/video sprite.c, Nehal Mistry, 2003/11/27
- [Stratagus-CVS] stratagus/src/video sprite.c, Nehal Mistry, 2003/11/27
- [Stratagus-CVS] stratagus/src/video sprite.c, Nehal Mistry, 2003/11/27
- [Stratagus-CVS] stratagus/src/video sprite.c, Nehal Mistry, 2003/11/27
- [Stratagus-CVS] stratagus/src/video sprite.c, Nehal Mistry, 2003/11/27
- [Stratagus-CVS] stratagus/src/video sprite.c,
Nehal Mistry <=
- [Stratagus-CVS] stratagus/src/video sprite.c, Nehal Mistry, 2003/11/30