stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus/src/video linedraw.c


From: Nehal Mistry
Subject: [Stratagus-CVS] stratagus/src/video linedraw.c
Date: Tue, 02 Dec 2003 00:44:43 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Nehal Mistry <address@hidden>   03/12/02 00:44:43

Modified files:
        src/video      : linedraw.c 

Log message:
        fix fill trans rectangle function

Patches:
Index: stratagus/src/video/linedraw.c
diff -u stratagus/src/video/linedraw.c:1.61 stratagus/src/video/linedraw.c:1.62
--- stratagus/src/video/linedraw.c:1.61 Tue Dec  2 00:31:58 2003
+++ stratagus/src/video/linedraw.c      Tue Dec  2 00:44:42 2003
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: linedraw.c,v 1.61 2003/12/02 05:31:58 nehalmistry Exp $
+//     $Id: linedraw.c,v 1.62 2003/12/02 05:44:42 nehalmistry Exp $
 
 //@{
 
@@ -868,11 +868,18 @@
 global void VideoFillTransRectangle(Uint32 color, int x, int y,
     int w, int h, unsigned char alpha)
 {
+    // FIXME: optimize
     SDL_Rect drect;
     SDL_Surface* s;
+    unsigned char r;
+    unsigned char g;
+    unsigned char b;
 
     s = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h,
        32, RMASK, GMASK, BMASK, AMASK);
+
+    SDL_GetRGB(color, TheScreen->format, &r, &g, &b);
+    color = SDL_MapRGBA(s->format, r, g, b, alpha);
 
     SDL_FillRect(s, NULL, color);
 




reply via email to

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