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: Sun, 30 Nov 2003 15:39:45 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Nehal Mistry <address@hidden>   03/11/30 15:39:45

Modified files:
        src/video      : sprite.c 

Log message:
        fix shadow alpha

Patches:
Index: stratagus/src/video/sprite.c
diff -u stratagus/src/video/sprite.c:1.51 stratagus/src/video/sprite.c:1.52
--- stratagus/src/video/sprite.c:1.51   Sat Nov 29 13:16:47 2003
+++ stratagus/src/video/sprite.c        Sun Nov 30 15:39:44 2003
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: sprite.c,v 1.51 2003/11/29 18:16:47 nehalmistry Exp $
+//     $Id: sprite.c,v 1.52 2003/11/30 20:39:44 nehalmistry Exp $
 
 //@{
 
@@ -161,6 +161,7 @@
     SDL_Rect drect;
     int oldx;
     int oldy;
+    unsigned char alpha;
 
     srect.x = (frame % (sprite->Surface->w / sprite->Width)) * sprite->Width;
     srect.y = (frame / (sprite->Surface->w / sprite->Width)) * sprite->Height;
@@ -176,8 +177,10 @@
     drect.x = x;
     drect.y = y;
 
+    alpha = sprite->Surface->format->alpha;
+    SDL_SetAlpha(sprite->Surface, SDL_SRCALPHA | SDL_RLEACCEL, 128);
     SDL_BlitSurface(sprite->Surface, &srect, TheScreen, &drect);
-
+    SDL_SetAlpha(sprite->Surface, SDL_SRCALPHA | SDL_RLEACCEL, alpha);
 }
 
 local void VideoDrawShadowClipX(const Graphic* sprite, unsigned frame,
@@ -187,6 +190,7 @@
     SDL_Rect drect;
     int oldx;
     int oldy;
+    unsigned char alpha;
 
     srect.x = (sprite->SurfaceFlip->w - (frame % (sprite->SurfaceFlip->w / 
            sprite->Width)) * sprite->Width) - sprite->Width;
@@ -203,7 +207,10 @@
     drect.x = x;
     drect.y = y;
 
+    alpha = sprite->Surface->format->alpha;
+    SDL_SetAlpha(sprite->Surface, SDL_SRCALPHA | SDL_RLEACCEL, 128);
     SDL_BlitSurface(sprite->SurfaceFlip, &srect, TheScreen, &drect);
+    SDL_SetAlpha(sprite->Surface, SDL_SRCALPHA | SDL_RLEACCEL, alpha);
 }
 #else
 //




reply via email to

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