stratagus-cvs
[Top][All Lists]
Advanced

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

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


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src map/map_fog.c video/linedraw.c
Date: 15 Jan 2004 06:48:22 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       04/01/15 06:48:21

Modified files:
        src/map        : map_fog.c 
        src/video      : linedraw.c 

Log message:
        Optimize VideoFillTransRectangle clip too.

Patches:
Index: stratagus/src/map/map_fog.c
diff -u stratagus/src/map/map_fog.c:1.138 stratagus/src/map/map_fog.c:1.139
--- stratagus/src/map/map_fog.c:1.138   Thu Jan 15 06:34:54 2004
+++ stratagus/src/map/map_fog.c Thu Jan 15 06:48:19 2004
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: map_fog.c,v 1.138 2004/01/14 19:34:54 jsalmon3 Exp $
+//      $Id: map_fog.c,v 1.139 2004/01/14 19:48:19 nobody_ Exp $
 
 //@{
 
@@ -1952,20 +1952,20 @@
                unsigned char r;
                unsigned char g;
                unsigned char b;
-               Uint32 color;

+               Uint32 color;
                SDL_Surface* s;
 
                s = SDL_CreateRGBSurface(SDL_SWSURFACE, TileSizeX, TileSizeY,
-                       32, RMASK, GMASK, BMASK, AMASK);

-

+                       32, RMASK, GMASK, BMASK, AMASK);
+
                // FIXME: Make the color configurable
                SDL_GetRGB(ColorBlack, TheScreen->format, &r, &g, &b);
                color = SDL_MapRGB(s->format, r, g, b);
 
                SDL_FillRect(s, NULL, color);
-               OnlyFogSurface = SDL_DisplayFormat(s);

-               SDL_SetAlpha(OnlyFogSurface, SDL_SRCALPHA | SDL_RLEACCEL, 
FogOfWarOpacity);

-               SDL_FreeSurface(s);

+               OnlyFogSurface = SDL_DisplayFormat(s);
+               SDL_SetAlpha(OnlyFogSurface, SDL_SRCALPHA | SDL_RLEACCEL, 
FogOfWarOpacity);
+               SDL_FreeSurface(s);
        }
        VideoDrawUnexplored = VideoDrawUnexploredSDL;
        VideoDrawFog = VideoDrawFogSDL;
Index: stratagus/src/video/linedraw.c
diff -u stratagus/src/video/linedraw.c:1.65 stratagus/src/video/linedraw.c:1.66
--- stratagus/src/video/linedraw.c:1.65 Sat Jan 10 08:38:28 2004
+++ stratagus/src/video/linedraw.c      Thu Jan 15 06:48:20 2004
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: linedraw.c,v 1.65 2004/01/09 21:38:28 jsalmon3 Exp $
+//      $Id: linedraw.c,v 1.66 2004/01/14 19:48:20 nobody_ Exp $
 
 //@{
 
@@ -1026,16 +1026,17 @@
 
        // FIXME: optimize
        s = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h,
-               32, RMASK, GMASK, BMASK, AMASK);
+               24, RMASK, GMASK, BMASK, 0);
 
        SDL_GetRGB(color, TheScreen->format, &r, &g, &b);
-       color = SDL_MapRGBA(s->format, r, g, b, alpha);
+       color = SDL_MapRGB(s->format, r, g, b);
 
        SDL_FillRect(s, NULL, color);
 
        drect.x = x;
        drect.y = y;
 
+       SDL_SetAlpha(s, SDL_SRCALPHA | SDL_RLEACCEL, alpha);
        SDL_BlitSurface(s, NULL, TheScreen, &drect);
        SDL_FreeSurface(s);
 }




reply via email to

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