stratagus-cvs
[Top][All Lists]
Advanced

[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: Thu, 27 Nov 2003 05:27:09 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Nehal Mistry <address@hidden>   03/11/27 05:27:09

Modified files:
        src/video      : sprite.c 

Log message:
        fix VideoDrawClip - should work this time

Patches:
Index: stratagus/src/video/sprite.c
diff -u stratagus/src/video/sprite.c:1.45 stratagus/src/video/sprite.c:1.46
--- stratagus/src/video/sprite.c:1.45   Thu Nov 27 01:56:29 2003
+++ stratagus/src/video/sprite.c        Thu Nov 27 05:27:08 2003
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: sprite.c,v 1.45 2003/11/27 06:56:29 nehalmistry Exp $
+//     $Id: sprite.c,v 1.46 2003/11/27 10:27:08 nehalmistry Exp $
 
 //@{
 
@@ -92,16 +92,22 @@
 {
     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;
 
-    CLIP_RECTANGLE(x, y, srect.w, srect.h);
-
     drect.x = x;
     drect.y = y;
+
+    oldx = drect.x;
+    oldy = drect.y;
+    CLIP_RECTANGLE(x, y, srect.w, srect.h);
+    drect.x += x - oldx;
+    drect.y += y - oldy;
 
     SDL_BlitSurface(sprite->Surface, &srect, TheScreen, &drect);
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]