stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src clone/clone.c clone/mainloop.c cl...


From: Nehal Mistry
Subject: [Stratagus-CVS] stratagus/src clone/clone.c clone/mainloop.c cl...
Date: Mon, 01 Dec 2003 23:00:17 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Nehal Mistry <address@hidden>   03/12/01 23:00:16

Modified files:
        src/clone      : clone.c mainloop.c player.c unit_draw.c 
        src/editor     : editloop.c 
        src/game       : intro.c 
        src/include    : player.h ui.h unit.h video.h 
        src/map        : minimap.c 
        src/ui         : icons.c mainscr.c ui.c 
        src/video      : cursor.c font.c linedraw.c sdl.c video.c 

Log message:
        use Uint32 instead of SDL_Color

Patches:
Index: stratagus/src/clone/clone.c
diff -u stratagus/src/clone/clone.c:1.232 stratagus/src/clone/clone.c:1.233
--- stratagus/src/clone/clone.c:1.232   Mon Dec  1 13:09:50 2003
+++ stratagus/src/clone/clone.c Mon Dec  1 23:00:10 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: clone.c,v 1.232 2003/12/01 18:09:50 jsalmon3 Exp $
+//     $Id: clone.c,v 1.233 2003/12/02 04:00:10 nehalmistry Exp $
 
 //@{
 
@@ -1004,9 +1004,7 @@
     va_end(va);
 
     if (VideoDepth && IsFontLoaded(GameFont)) {
-#ifdef USE_SDL_SURFACE
-       SDL_Color color = { 0, 0, 0, 0 };
-#else
+#ifndef USE_SDL_SURFACE
        VideoLockScreen();
 #endif
        for (s = temp; *s; ++s) {       // Remove non printable chars
@@ -1014,12 +1012,7 @@
                *s = ' ';
            }
        }
-#ifdef USE_SDL_SURFACE
-       VideoFillRectangle(color, 5, VideoHeight - 18, VideoWidth - 10, 18);
-#else
        VideoFillRectangle(ColorBlack, 5, VideoHeight - 18, VideoWidth - 10, 
18);
-#endif
-       VideoDrawTextCentered(VideoWidth / 2, VideoHeight - 16, GameFont, temp);
 #ifndef USE_SDL_SURFACE
        VideoUnlockScreen();
 #endif
Index: stratagus/src/clone/mainloop.c
diff -u stratagus/src/clone/mainloop.c:1.166 
stratagus/src/clone/mainloop.c:1.167
--- stratagus/src/clone/mainloop.c:1.166        Sun Nov 30 15:03:32 2003
+++ stratagus/src/clone/mainloop.c      Mon Dec  1 23:00:12 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: mainloop.c,v 1.166 2003/11/30 20:03:32 jsalmon3 Exp $
+//     $Id: mainloop.c,v 1.167 2003/12/02 04:00:12 nehalmistry Exp $
 
 //@{
 
@@ -519,7 +519,7 @@
     //
     for (vp = TheUI.Viewports; vp < evp; ++vp) {
 #ifdef USE_SDL_SURFACE
-       SDL_Color color;
+       Uint32 color;
 #else
        VMemType color;
 #endif
Index: stratagus/src/clone/player.c
diff -u stratagus/src/clone/player.c:1.103 stratagus/src/clone/player.c:1.104
--- stratagus/src/clone/player.c:1.103  Tue Nov 25 14:59:49 2003
+++ stratagus/src/clone/player.c        Mon Dec  1 23:00:12 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: player.c,v 1.103 2003/11/25 19:59:49 mr-russ Exp $
+//     $Id: player.c,v 1.104 2003/12/02 04:00:12 nehalmistry Exp $
 
 //@{
 
@@ -67,8 +67,8 @@
 **     Colors used for minimap.        FIXME: make this configurable
 */
 #ifdef USE_SDL_SURFACE
-global SDL_Color PlayerColorsRGB[PlayerMax];
-global SDL_Color PlayerColors[PlayerMax];
+local SDL_Color PlayerColorsRGB[PlayerMax];
+global Uint32 PlayerColors[PlayerMax];
 #else
 global VMemType PlayerColorsRGB[PlayerMax];
 global VMemType PlayerColors[PlayerMax];
@@ -167,7 +167,7 @@
            Players[p].Type = PlayerNobody;
        }
 #ifdef USE_SDL_SURFACE
-       PlayerColors[p] = VideoMapRGB(PlayerColorsRGB[p].r,
+       PlayerColors[p] = SDL_MapRGB(TheScreen->format, PlayerColorsRGB[p].r,
            PlayerColorsRGB[p].g, PlayerColorsRGB[p].b);
 #else
        PlayerColors[p] = VideoMapRGB(PlayerColorsRGB[p].D24.a,
@@ -220,7 +220,7 @@
     int j;
 
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: players $Id: player.c,v 1.103 2003/11/25 
19:59:49 mr-russ Exp $\n\n");
+    CLprintf(file, ";;; MODULE: players $Id: player.c,v 1.104 2003/12/02 
04:00:12 nehalmistry Exp $\n\n");
 
     //
     // Dump table wc2 race numbers -> internal symbol.
Index: stratagus/src/clone/unit_draw.c
diff -u stratagus/src/clone/unit_draw.c:1.193 
stratagus/src/clone/unit_draw.c:1.194
--- stratagus/src/clone/unit_draw.c:1.193       Mon Dec  1 15:02:46 2003
+++ stratagus/src/clone/unit_draw.c     Mon Dec  1 23:00:12 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: unit_draw.c,v 1.193 2003/12/01 20:02:46 nehalmistry Exp $
+//     $Id: unit_draw.c,v 1.194 2003/12/02 04:00:12 nehalmistry Exp $
 
 //@{
 
@@ -93,7 +93,7 @@
 **     @param x2,y2    Coordinates of the bottom right corner.
 */
 #ifdef USE_SDL_SURFACE
-global void (*DrawSelection)(SDL_Color color, int x1, int y1,
+global void (*DrawSelection)(Uint32 color, int x1, int y1,
     int x2, int y2) = DrawSelectionNone;
 #else
 global void (*DrawSelection)(VMemType color, int x1, int y1,
@@ -119,11 +119,11 @@
 **     @return         Color for selection, or NULL if not selected.
 */
 #ifdef USE_SDL_SURFACE
-local SDL_Color* SelectionColor(const Unit* unit)
+local Uint32* SelectionColor(const Unit* unit)
 {
-    SDL_Color *color;
+    Uint32 *color;
 
-    color = malloc(sizeof(SDL_Color));
+    color = malloc(sizeof(Uint32));
 
     // FIXME: make these colors customizable via CVS
 
@@ -197,7 +197,7 @@
 global void DrawUnitSelection(const Unit* unit)
 {
 #ifdef USE_SDL_SURFACE
-    SDL_Color* color;
+    Uint32* color;
 #else
     VMemType* color;
 #endif
@@ -228,7 +228,7 @@
 **     @param x2,y2    Coordinates of the bottom right corner.
 */
 #ifdef USE_SDL_SURFACE
-global void DrawSelectionNone(SDL_Color color, int x1, int y1,
+global void DrawSelectionNone(Uint32 color, int x1, int y1,
     int x2, int y2)
 {
 }
@@ -247,7 +247,7 @@
 **     @param x2,y2    Coordinates of the bottom right corner.
 */
 #ifdef USE_SDL_SURFACE
-global void DrawSelectionCircle(SDL_Color color, int x1, int x2,
+global void DrawSelectionCircle(Uint32 color, int x1, int x2,
     int y1, int y2)
 #else
 global void DrawSelectionCircle(VMemType color, int x1, int x2,
@@ -268,7 +268,7 @@
 **     @param x2,y2    Coordinates of the bottom right corner.
 */
 #ifdef USE_SDL_SURFACE
-global void DrawSelectionCircleWithTrans(SDL_Color color, int x1, int y1,
+global void DrawSelectionCircleWithTrans(Uint32 color, int x1, int y1,
     int x2, int y2)
 #else
 global void DrawSelectionCircleWithTrans(VMemType color, int x1, int y1,
@@ -294,7 +294,7 @@
 **     @param x2,y2    Coordinates of the bottom right corner.
 */
 #ifdef USE_SDL_SURFACE
-global void DrawSelectionRectangle(SDL_Color color, int x1, int y1,
+global void DrawSelectionRectangle(Uint32 color, int x1, int y1,
     int x2, int y2)
 #else
 global void DrawSelectionRectangle(VMemType color, int x1, int y1,
@@ -312,7 +312,7 @@
 **     @param x2,y2    Coordinates of the bottom right corner.
 */
 #ifdef USE_SDL_SURFACE
-global void DrawSelectionRectangleWithTrans(SDL_Color color, int x1, int y1,
+global void DrawSelectionRectangleWithTrans(Uint32 color, int x1, int y1,
     int x2, int y2)
 #else
 global void DrawSelectionRectangleWithTrans(VMemType color, int x1, int y1,
@@ -337,7 +337,7 @@
 **     @param x2,y2    Coordinates of the bottom right corner.
 */
 #ifdef USE_SDL_SURFACE
-global void DrawSelectionCorners(SDL_Color color, int x1, int y1,
+global void DrawSelectionCorners(Uint32 color, int x1, int y1,
     int x2, int y2)
 #else
 global void DrawSelectionCorners(VMemType color, int x1, int y1,
@@ -943,7 +943,7 @@
 global void SaveDecorations(CLFile* file)
 {
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.193 
2003/12/01 20:02:46 nehalmistry Exp $\n\n");
+    CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.194 
2003/12/02 04:00:12 nehalmistry Exp $\n\n");
 
     CLprintf(file, "(mana-sprite \"%s\"  %d %d  %d %d)\n",
        ManaSprite.File, ManaSprite.HotX, ManaSprite.HotY,
@@ -1139,7 +1139,7 @@
 {
     int f;
 #ifdef USE_SDL_SURFACE
-    SDL_Color color;
+    Uint32 color;
 #else
     VMemType color;
 #endif
@@ -1748,8 +1748,8 @@
     int x2;
     int y2;
 #ifdef USE_SDL_SURFACE
-    SDL_Color color;
-    SDL_Color e_color;
+    Uint32 color;
+    Uint32 e_color;
 #else
     VMemType color;
     VMemType e_color;
Index: stratagus/src/editor/editloop.c
diff -u stratagus/src/editor/editloop.c:1.146 
stratagus/src/editor/editloop.c:1.147
--- stratagus/src/editor/editloop.c:1.146       Fri Nov 28 17:34:48 2003
+++ stratagus/src/editor/editloop.c     Mon Dec  1 23:00:12 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: editloop.c,v 1.146 2003/11/28 22:34:48 nehalmistry Exp $
+//     $Id: editloop.c,v 1.147 2003/12/02 04:00:12 nehalmistry Exp $
 
 //@{
 
@@ -666,7 +666,7 @@
 local void DrawTileIcon(unsigned tilenum,unsigned x,unsigned y,unsigned flags)
 {
 #ifdef USE_SDL_SURFACE
-    SDL_Color color;
+    Uint32 color;
 #else
     VMemType color;
 #endif
Index: stratagus/src/game/intro.c
diff -u stratagus/src/game/intro.c:1.109 stratagus/src/game/intro.c:1.110
--- stratagus/src/game/intro.c:1.109    Sat Nov 22 17:50:50 2003
+++ stratagus/src/game/intro.c  Mon Dec  1 23:00:12 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: intro.c,v 1.109 2003/11/22 22:50:50 nehalmistry Exp $
+//     $Id: intro.c,v 1.110 2003/12/02 04:00:12 nehalmistry Exp $
 
 //@{
 
@@ -934,7 +934,7 @@
 **     Draw a box with the text inside
 */
 #ifdef USE_SDL_SURFACE
-local void DrawStatBox(int x, int y, char* text, SDL_Color color, int percent)
+local void DrawStatBox(int x, int y, char* text, Uint32 color, int percent)
 #else
 local void DrawStatBox(int x, int y, char* text, VMemType color, int percent)
 #endif
Index: stratagus/src/include/player.h
diff -u stratagus/src/include/player.h:1.78 stratagus/src/include/player.h:1.79
--- stratagus/src/include/player.h:1.78 Mon Nov 17 14:14:32 2003
+++ stratagus/src/include/player.h      Mon Dec  1 23:00:14 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: player.h,v 1.78 2003/11/17 19:14:32 nehalmistry Exp $
+//     $Id: player.h,v 1.79 2003/12/02 04:00:14 nehalmistry Exp $
 
 #ifndef __PLAYER_H__
 #define __PLAYER_H__
@@ -344,7 +344,7 @@
 
 // Display video
 #ifdef USE_SDL_SURFACE
-    SDL_Color  Color;                  /// color of units on minimap
+    Uint32     Color;                  /// color of units on minimap
 #else
     VMemType   Color;                  /// color of units on minimap
 #endif
@@ -458,7 +458,7 @@
 extern Player* ThisPlayer;             /// Player on local computer
 extern int NoRescueCheck;              /// Disable rescue check
 #ifdef USE_SDL_SURFACE
-extern SDL_Color PlayerColors[PlayerMax];
+extern Uint32 PlayerColors[PlayerMax];
 #else
 extern VMemType PlayerColors[PlayerMax];       /// Player colors
 #endif
Index: stratagus/src/include/ui.h
diff -u stratagus/src/include/ui.h:1.80 stratagus/src/include/ui.h:1.81
--- stratagus/src/include/ui.h:1.80     Thu Nov 20 12:43:05 2003
+++ stratagus/src/include/ui.h  Mon Dec  1 23:00:14 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ui.h,v 1.80 2003/11/20 17:43:05 pludov Exp $
+//     $Id: ui.h,v 1.81 2003/12/02 04:00:14 nehalmistry Exp $
 
 #ifndef __UI_H__
 #define __UI_H__
@@ -233,7 +233,7 @@
     // Completed bar
 #ifdef USE_SDL_SURFACE
     SDL_Color  CompletedBarColorRGB;   /// color for completed bar
-    SDL_Color  CompletedBarColor;      /// color for completed bar
+    Uint32     CompletedBarColor;      /// color for completed bar
 #else
     VMemType   CompletedBarColorRGB;   /// color for completed bar
     VMemType   CompletedBarColor;      /// color for completed bar
@@ -290,7 +290,7 @@
     int                MinimapPosY;            /// minimap screen Y position
     int                MinimapTransparent;     /// unexplored areas are 
transparent
 #ifdef USE_SDL_SURFACE
-    SDL_Color  ViewportCursorColor;    /// minimap cursor color
+    Uint32     ViewportCursorColor;    /// minimap cursor color
 #else
     VMemType   ViewportCursorColor;    /// minimap cursor color
 #endif
Index: stratagus/src/include/unit.h
diff -u stratagus/src/include/unit.h:1.239 stratagus/src/include/unit.h:1.240
--- stratagus/src/include/unit.h:1.239  Sun Nov 30 15:03:33 2003
+++ stratagus/src/include/unit.h        Mon Dec  1 23:00:14 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: unit.h,v 1.239 2003/11/30 20:03:33 jsalmon3 Exp $
+//     $Id: unit.h,v 1.240 2003/12/02 04:00:14 nehalmistry Exp $
 
 #ifndef __UNIT_H__
 #define __UNIT_H__
@@ -718,7 +718,7 @@
 extern const Viewport* CurrentViewport; /// CurrentViewport
 extern void DrawUnitSelection(const Unit*);
 #ifdef USE_SDL_SURFACE
-extern void (*DrawSelection)(SDL_Color, int, int, int, int);
+extern void (*DrawSelection)(Uint32, int, int, int, int);
 #else
 extern void (*DrawSelection)(VMemType, int, int, int, int);
 #endif
@@ -909,17 +909,17 @@
 //--------------------
 #ifdef USE_SDL_SURFACE
     /// Draw nothing around unit
-extern void DrawSelectionNone(SDL_Color, int, int, int, int);
+extern void DrawSelectionNone(Uint32, int, int, int, int);
     /// Draw circle around unit
-extern void DrawSelectionCircle(SDL_Color, int, int, int, int);
+extern void DrawSelectionCircle(Uint32, int, int, int, int);
     /// Draw circle filled with alpha around unit
-extern void DrawSelectionCircleWithTrans(SDL_Color, int, int, int, int);
+extern void DrawSelectionCircleWithTrans(Uint32, int, int, int, int);
     /// Draw rectangle around unit
-extern void DrawSelectionRectangle(SDL_Color, int, int, int, int);
+extern void DrawSelectionRectangle(Uint32, int, int, int, int);
     /// Draw rectangle filled with alpha around unit
-extern void DrawSelectionRectangleWithTrans(SDL_Color, int, int, int, int);
+extern void DrawSelectionRectangleWithTrans(Uint32, int, int, int, int);
     /// Draw corners around unit
-extern void DrawSelectionCorners(SDL_Color, int, int, int, int);
+extern void DrawSelectionCorners(Uint32, int, int, int, int);
 #else
     /// Draw nothing around unit
 extern void DrawSelectionNone(VMemType, int, int, int, int);
Index: stratagus/src/include/video.h
diff -u stratagus/src/include/video.h:1.100 stratagus/src/include/video.h:1.101
--- stratagus/src/include/video.h:1.100 Sat Nov 29 13:08:10 2003
+++ stratagus/src/include/video.h       Mon Dec  1 23:00:14 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: video.h,v 1.100 2003/11/29 18:08:10 nehalmistry Exp $
+//     $Id: video.h,v 1.101 2003/12/02 04:00:14 nehalmistry Exp $
 
 #ifndef __VIDEO_H__
 #define __VIDEO_H__
@@ -333,18 +333,15 @@
 extern EventCallback GameCallbacks;    /// Game callbacks
 extern EventCallback MenuCallbacks;    /// Menu callbacks
 
-    ///        Maps RGB to a hardware dependent pixel.
-extern SDL_Color VideoMapRGB(int r, int g, int b);
-
-extern SDL_Color ColorBlack;
-extern SDL_Color ColorDarkGreen;
-extern SDL_Color ColorBlue;
-extern SDL_Color ColorOrange;
-extern SDL_Color ColorWhite;
-extern SDL_Color ColorGray;
-extern SDL_Color ColorRed;
-extern SDL_Color ColorGreen;
-extern SDL_Color ColorYellow;
+extern Uint32 ColorBlack;
+extern Uint32 ColorDarkGreen;
+extern Uint32 ColorBlue;
+extern Uint32 ColorOrange;
+extern Uint32 ColorWhite;
+extern Uint32 ColorGray;
+extern Uint32 ColorRed;
+extern Uint32 ColorGreen;
+extern Uint32 ColorYellow;
 
 extern int ColorWaterCycleStart;       /// color # start for color cycling
 extern int ColorWaterCycleEnd;         /// color # end   for color cycling
@@ -356,80 +353,81 @@
 // FIXME: check these out, clean up if we can
 // FIXME: check these out, clean up if we can
 // FIXME: check these out, clean up if we can
+
     ///        Draw pixel unclipped.
-extern void VideoDrawPixel(SDL_Color color, int x, int y);
+extern void (*VideoDrawPixel)(Uint32 color, int x, int y);
 
     ///        Draw translucent pixel unclipped.
-extern void VideoDrawTransPixel(SDL_Color color, int x, int y,
+extern void (*VideoDrawTransPixel)(Uint32 color, int x, int y,
     unsigned char alpha);
 
     ///        Draw pixel clipped to current clip setting.
-extern void VideoDrawPixelClip(SDL_Color color, int x, int y);
+extern void VideoDrawPixelClip(Uint32 color, int x, int y);
 
     ///        Draw translucent pixel clipped to current clip setting.
-extern void VideoDrawTransPixelClip(SDL_Color color, int x, int y,
+extern void VideoDrawTransPixelClip(Uint32 color, int x, int y,
     unsigned char alpha);
 
     ///        Draw vertical line unclipped.
-extern void VideoDrawVLine(SDL_Color color, int x, int y,
+extern void VideoDrawVLine(Uint32 color, int x, int y,
     int height);
 
     ///        Draw translucent vertical line unclipped.
-extern void VideoDrawTransVLine(SDL_Color color, int x, int y,
+extern void VideoDrawTransVLine(Uint32 color, int x, int y,
     int height, unsigned char alpha);
 
     ///        Draw vertical line clipped to current clip setting
-extern void VideoDrawVLineClip(SDL_Color color, int x, int y,
+extern void VideoDrawVLineClip(Uint32 color, int x, int y,
     int height);
 
     ///        Draw translucent vertical line clipped to current clip setting
-extern void VideoDrawTransVLineClip(SDL_Color color, int x, int y,
+extern void VideoDrawTransVLineClip(Uint32 color, int x, int y,
     int height, unsigned char alpha);
 
     ///        Draw horizontal line unclipped.
-extern void VideoDrawHLine(SDL_Color color, int x, int y,
+extern void VideoDrawHLine(Uint32 color, int x, int y,
     int width);
 
     ///        Draw translucent horizontal line unclipped.
-extern void VideoDrawTransHLine(SDL_Color color, int x, int y,
+extern void VideoDrawTransHLine(Uint32 color, int x, int y,
     int width, unsigned char alpha);
 
     ///        Draw horizontal line clipped to current clip setting
-extern void VideoDrawHLineClip(SDL_Color color, int x, int y,
+extern void VideoDrawHLineClip(Uint32 color, int x, int y,
     int width);
 
     ///        Draw translucent horizontal line clipped to current clip setting
-extern void VideoDrawTransHLineClip(SDL_Color color, int x, int y,
+extern void VideoDrawTransHLineClip(Uint32 color, int x, int y,
     int width, unsigned char alpha);
 
     ///        Draw line unclipped.
-extern void VideoDrawLine(SDL_Color color, int sx, int sy, int dx, int dy);
+extern void VideoDrawLine(Uint32 color, int sx, int sy, int dx, int dy);
 
     ///        Draw translucent line unclipped.
-extern void VideoDrawTransLine(SDL_Color color, int sx, int sy, int dx, int dy,
+extern void VideoDrawTransLine(Uint32 color, int sx, int sy, int dx, int dy,
     unsigned char alpha);
 
     ///        Draw line clipped to current clip setting
-extern void VideoDrawLineClip(SDL_Color color, int sx, int sy, int dx, int dy);
+extern void VideoDrawLineClip(Uint32 color, int sx, int sy, int dx, int dy);
 
     ///        Draw translucent line clipped to current clip setting
-extern void VideoDrawTransLineClip(SDL_Color color, int sx, int sy,
+extern void VideoDrawTransLineClip(Uint32 color, int sx, int sy,
     int dx, int dy, unsigned char alpha);
 
     ///        Draw rectangle.
-extern void VideoDrawRectangle(SDL_Color color, int x, int y,
+extern void VideoDrawRectangle(Uint32 color, int x, int y,
     int w, int h);
 
     ///        Draw translucent rectangle.
-extern void VideoDrawTransRectangle(SDL_Color color, int x, int y,
+extern void VideoDrawTransRectangle(Uint32 color, int x, int y,
     int w, int h, unsigned char alpha);
 
     ///        Draw rectangle clipped.
-extern void VideoDrawRectangleClip(SDL_Color color, int x, int y,
+extern void VideoDrawRectangleClip(Uint32 color, int x, int y,
     int w, int h);
 
     ///        Draw translucent rectangle clipped.
-extern void VideoDrawTransRectangleClip(SDL_Color color, int x, int y,
+extern void VideoDrawTransRectangleClip(Uint32 color, int x, int y,
     int w, int h, unsigned char alpha);
 
     ///        Draw 8bit raw graphic data clipped, using given pixel pallette
@@ -443,47 +441,47 @@
     int w, int h, int x, int y, unsigned char fade);
 
     ///        Draw circle.
-extern void VideoDrawCircle(SDL_Color color, int x, int y, int r);
+extern void VideoDrawCircle(Uint32 color, int x, int y, int r);
 
     ///        Draw translucent circle.
-extern void VideoDrawTransCircle(SDL_Color color, int x, int y, int r,
+extern void VideoDrawTransCircle(Uint32 color, int x, int y, int r,
     unsigned char alpha);
 
     ///        Draw circle clipped.
-extern void VideoDrawCircleClip(SDL_Color color, int x, int y, int r);
+extern void VideoDrawCircleClip(Uint32 color, int x, int y, int r);
 
     ///        Draw translucent circle clipped.
-extern void VideoDrawTransCircleClip(SDL_Color color, int x, int y, int r,
+extern void VideoDrawTransCircleClip(Uint32 color, int x, int y, int r,
     unsigned char alpha);
 
     ///        Fill rectangle.
-extern void VideoFillRectangle(SDL_Color color, int x, int y,
+extern void VideoFillRectangle(Uint32 color, int x, int y,
     int w, int h);
 
     ///        Fill translucent rectangle.
-extern void VideoFillTransRectangle(SDL_Color color, int x, int y,
+extern void VideoFillTransRectangle(Uint32 color, int x, int y,
     int w, int h, unsigned char alpha);
 
     ///        Fill rectangle clipped.
-extern void VideoFillRectangleClip(SDL_Color color, int x, int y,
+extern void VideoFillRectangleClip(Uint32 color, int x, int y,
     int w, int h);
 
     ///        Fill translucent rectangle clipped.
-extern void VideoFillTransRectangleClip(SDL_Color color, int x, int y,
+extern void VideoFillTransRectangleClip(Uint32 color, int x, int y,
     int w, int h, unsigned char alpha);
 
     ///        Fill circle.
-extern void VideoFillCircle(SDL_Color color, int x, int y, int r);
+extern void VideoFillCircle(Uint32 color, int x, int y, int r);
 
     ///        Fill translucent circle.
-extern void VideoFillTransCircle(SDL_Color color, int x, int y, int r,
+extern void VideoFillTransCircle(Uint32 color, int x, int y, int r,
     unsigned char alpha);
 
     ///        Fill circle clipped.
-extern void VideoFillCircleClip(SDL_Color color, int x, int y, int r);
+extern void VideoFillCircleClip(Uint32 color, int x, int y, int r);
 
     ///        Fill translucent circle clipped.
-extern void VideoFillTransCircleClip(SDL_Color color, int x, int y, int r,
+extern void VideoFillTransCircleClip(Uint32 color, int x, int y, int r,
     unsigned char alpha);
 
     ///        Draw a graphic object unclipped.
Index: stratagus/src/map/minimap.c
diff -u stratagus/src/map/minimap.c:1.82 stratagus/src/map/minimap.c:1.83
--- stratagus/src/map/minimap.c:1.82    Sun Nov 30 15:03:34 2003
+++ stratagus/src/map/minimap.c Mon Dec  1 23:00:14 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: minimap.c,v 1.82 2003/11/30 20:03:34 jsalmon3 Exp $
+//     $Id: minimap.c,v 1.83 2003/12/02 04:00:14 nehalmistry Exp $
 
 //@{
 
@@ -283,7 +283,8 @@
     int h;
     int h0;
     int visiontype; // 0 unexplored, 1 explored, >1 visible.
-    SDL_Color color;
+    SDL_Color c;
+    Uint32 color;
 
     red_phase_changed = red_phase != (int)((FrameCounter / FRAMES_PER_SECOND) 
& 1);
     if (red_phase_changed) {
@@ -333,7 +334,10 @@
        if (!BuildingVisibleOnMap(*table) && (*table)->SeenState != 3
                && !(*table)->SeenDestroyed && (type = (*table)->SeenType) ) {
            if( (*table)->Player->Player == PlayerNumNeutral ) {
-               color = (*table)->Type->NeutralMinimapColorRGB;
+               color = SDL_MapRGB(TheScreen->format,
+                   (*table)->Type->NeutralMinimapColorRGB.r,
+                   (*table)->Type->NeutralMinimapColorRGB.g,
+                   (*table)->Type->NeutralMinimapColorRGB.b);
            } else {
                color = (*table)->Player->Color;
            }
@@ -351,8 +355,9 @@
            while (w-- >= 0) {
                h = h0;
                while (h-- >= 0) {
+                   SDL_GetRGB(color, TheScreen->format, &c.r, &c.g, &c.b);
                    ((Uint8*)MinimapSurface)[mx + w + (my + h) * 
TheUI.MinimapW] = 
-                       SDL_MapRGB(MinimapSurface->format, color.r, color.g, 
color.b);
+                       SDL_MapRGB(MinimapSurface->format, c.r, c.g, c.b);
                }
            }
        }
@@ -384,7 +389,10 @@
        //  FIXME: We should force unittypes to have a certain color on the 
minimap.
        //
        if (unit->Player->Player == PlayerNumNeutral) {
-           color = (*table)->Type->NeutralMinimapColorRGB;
+           color = SDL_MapRGB(TheScreen->format,
+               (*table)->Type->NeutralMinimapColorRGB.r,
+               (*table)->Type->NeutralMinimapColorRGB.g,
+               (*table)->Type->NeutralMinimapColorRGB.b);
        } else if (unit->Player == ThisPlayer) {
            if (unit->Attacked && unit->Attacked + ATTACK_BLINK_DURATION > 
GameCycle &&
                    (red_phase || unit->Attacked + ATTACK_RED_DURATION > 
GameCycle)) {
@@ -411,8 +419,9 @@
        while (w-- >= 0) {
            h = h0;
            while (h-- >= 0) {
+               SDL_GetRGB(color, TheScreen->format, &c.r, &c.g, &c.b);
                ((Uint8*)MinimapSurface->pixels)[mx + w + (my + h) * 
TheUI.MinimapW] = 
-                   SDL_MapRGB(MinimapSurface->format, color.r, color.g, 
color.b);
+                   SDL_MapRGB(MinimapSurface->format, c.r, c.g, c.b);
            }
        }
     }
Index: stratagus/src/ui/icons.c
diff -u stratagus/src/ui/icons.c:1.57 stratagus/src/ui/icons.c:1.58
--- stratagus/src/ui/icons.c:1.57       Thu Nov 20 14:19:24 2003
+++ stratagus/src/ui/icons.c    Mon Dec  1 23:00:14 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: icons.c,v 1.57 2003/11/20 19:19:24 jsalmon3 Exp $
+//     $Id: icons.c,v 1.58 2003/12/02 04:00:14 nehalmistry Exp $
 
 //@{
 
@@ -371,7 +371,7 @@
     int x, int y)
 {
 #ifdef USE_SDL_SURFACE
-    SDL_Color color;
+    Uint32 color;
 #else
     VMemType color;
 #endif
@@ -432,7 +432,7 @@
     int i;
 
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: icons $Id: icons.c,v 1.57 2003/11/20 19:19:24 
jsalmon3 Exp $\n\n");
+    CLprintf(file, ";;; MODULE: icons $Id: icons.c,v 1.58 2003/12/02 04:00:14 
nehalmistry Exp $\n\n");
 
     //
     //  Mapping the original icon numbers in puds to our internal strings
Index: stratagus/src/ui/mainscr.c
diff -u stratagus/src/ui/mainscr.c:1.144 stratagus/src/ui/mainscr.c:1.145
--- stratagus/src/ui/mainscr.c:1.144    Mon Nov 17 14:14:39 2003
+++ stratagus/src/ui/mainscr.c  Mon Dec  1 23:00:14 2003
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: mainscr.c,v 1.144 2003/11/17 19:14:39 nehalmistry Exp $
+//     $Id: mainscr.c,v 1.145 2003/12/02 04:00:14 nehalmistry Exp $
 
 //@{
 
@@ -81,7 +81,7 @@
 {
     int f;
 #ifdef USE_SDL_SURFACE
-    SDL_Color color;
+    Uint32 color;
 #else
     VMemType color;
 #endif
Index: stratagus/src/ui/ui.c
diff -u stratagus/src/ui/ui.c:1.89 stratagus/src/ui/ui.c:1.90
--- stratagus/src/ui/ui.c:1.89  Mon Nov 17 14:14:42 2003
+++ stratagus/src/ui/ui.c       Mon Dec  1 23:00:14 2003
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ui.c,v 1.89 2003/11/17 19:14:42 nehalmistry Exp $
+//     $Id: ui.c,v 1.90 2003/12/02 04:00:14 nehalmistry Exp $
 
 //@{
 
@@ -155,8 +155,10 @@
     }
 
 #ifdef USE_SDL_SURFACE
-    TheUI.CompletedBarColor = VideoMapRGB(TheUI.CompletedBarColorRGB.r,
-       TheUI.CompletedBarColorRGB.g, TheUI.CompletedBarColorRGB.b);
+    TheUI.CompletedBarColor = SDL_MapRGB(TheScreen->format,
+       TheUI.CompletedBarColorRGB.r,
+       TheUI.CompletedBarColorRGB.g,
+       TheUI.CompletedBarColorRGB.b);
     TheUI.ViewportCursorColor = ColorWhite;
 #else
     TheUI.CompletedBarColor = VideoMapRGB(TheUI.CompletedBarColorRGB.D24.a,
@@ -655,7 +657,7 @@
     int i;
 
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: ui $Id: ui.c,v 1.89 2003/11/17 19:14:42 
nehalmistry Exp $\n\n");
+    CLprintf(file, ";;; MODULE: ui $Id: ui.c,v 1.90 2003/12/02 04:00:14 
nehalmistry Exp $\n\n");
 
     // Contrast, Brightness, Saturation
     CLprintf(file, "(set-contrast! %d)\n", TheUI.Contrast);
Index: stratagus/src/video/cursor.c
diff -u stratagus/src/video/cursor.c:1.83 stratagus/src/video/cursor.c:1.84
--- stratagus/src/video/cursor.c:1.83   Thu Nov 27 01:41:07 2003
+++ stratagus/src/video/cursor.c        Mon Dec  1 23:00:15 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: cursor.c,v 1.83 2003/11/27 06:41:07 nehalmistry Exp $
+//     $Id: cursor.c,v 1.84 2003/12/02 04:00:15 nehalmistry Exp $
 
 //@{
 
@@ -817,7 +817,7 @@
     int mx;
     int my;
 #ifdef USE_SDL_SURFACE
-    SDL_Color color;
+    Uint32 color;
 #else
     int x1;
     int y1;
@@ -1257,7 +1257,7 @@
     int i;
 
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: cursors $Id: cursor.c,v 1.83 2003/11/27 
06:41:07 nehalmistry Exp $\n\n");
+    CLprintf(file, ";;; MODULE: cursors $Id: cursor.c,v 1.84 2003/12/02 
04:00:15 nehalmistry Exp $\n\n");
 
     for (i = 0; Cursors[i].OType; ++i) {
        CLprintf(file, "(define-cursor '%s '%s\n",
Index: stratagus/src/video/font.c
diff -u stratagus/src/video/font.c:1.64 stratagus/src/video/font.c:1.65
--- stratagus/src/video/font.c:1.64     Sat Nov 29 14:45:57 2003
+++ stratagus/src/video/font.c  Mon Dec  1 23:00:15 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: font.c,v 1.64 2003/11/29 19:45:57 jsalmon3 Exp $
+//     $Id: font.c,v 1.65 2003/12/02 04:00:15 nehalmistry Exp $
 
 //@{
 
@@ -1047,12 +1047,15 @@
     while (fcm) {
        color = fcm->Color;
        for (i = 0; i < NumFontColors; ++i) {
-           SDL_Color c;
+///        SDL_Color c;
            // FIXME: todo
 //         c = VideoMapRGB(fcm->RGB[i].R, fcm->RGB[i].G, fcm->RGB[i].B);
-           c = VideoMapRGB(fcm->Color[i].r, fcm->Color[i].g, fcm->Color[i].b);
+///        c = VideoMapRGB(fcm->Color[i].r, fcm->Color[i].g, fcm->Color[i].b);
 
-           color[i] = VideoMapRGB(c.r, c.g, c.b);
+///        color[i] = VideoMapRGB(c.r, c.g, c.b);
+           color[i].r = fcm->Color[i].r;
+           color[i].g = fcm->Color[i].g;
+           color[i].b = fcm->Color[i].b;
        }
        fcm = fcm->Next;
     }
Index: stratagus/src/video/linedraw.c
diff -u stratagus/src/video/linedraw.c:1.56 stratagus/src/video/linedraw.c:1.57
--- stratagus/src/video/linedraw.c:1.56 Fri Nov 28 23:39:14 2003
+++ stratagus/src/video/linedraw.c      Mon Dec  1 23:00:15 2003
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: linedraw.c,v 1.56 2003/11/29 04:39:14 nehalmistry Exp $
+//     $Id: linedraw.c,v 1.57 2003/12/02 04:00:15 nehalmistry Exp $
 
 //@{
 
@@ -69,29 +69,30 @@
 local SDL_Surface* PixelSurface;
 
 // FIXME: comments
-global void VideoDrawPixel(SDL_Color color, int x, int y);
-global void VideoDrawTransPixel(SDL_Color color, int x, int y, unsigned char 
alpha);
-global void VideoDrawPixelClip(SDL_Color color, int x, int y);
-global void VideoDrawVLine(SDL_Color color, int x, int y, int width);
-global void VideoDrawVLineClip(SDL_Color color, int x, int y, int width);
-global void VideoDrawTransVLine(SDL_Color color, int x, int y,
+global void (*VideoDrawPixel)(Uint32 color, int x, int y);
+global void (*VideoDrawTransPixel)(Uint32 color, int x, int y, unsigned char 
alpha);
+global void VideoDrawPixelClip(Uint32 color, int x, int y);
+global void VideoDrawTransPixelClip(Uint32 color, int x, int y, unsigned char 
alpha);
+global void VideoDrawVLine(Uint32 color, int x, int y, int width);
+global void VideoDrawVLineClip(Uint32 color, int x, int y, int width);
+global void VideoDrawTransVLine(Uint32 color, int x, int y,
     int height, unsigned char alpha);
-global void VideoDrawHLine(SDL_Color color, int x, int y, int width);
-global void VideoDrawHLineClip(SDL_Color color, int x, int y, int width);
-global void VideoDrawTransHLine(SDL_Color color, int x, int y,
+global void VideoDrawHLine(Uint32 color, int x, int y, int width);
+global void VideoDrawHLineClip(Uint32 color, int x, int y, int width);
+global void VideoDrawTransHLine(Uint32 color, int x, int y,
     int width, unsigned char alpha);
-global void VideoDrawLine(SDL_Color color, int sx, int sy, int dx, int dy);
-global void VideoDrawTransLine(SDL_Color color, int sx, int sy,
+global void VideoDrawLine(Uint32 color, int sx, int sy, int dx, int dy);
+global void VideoDrawTransLine(Uint32 color, int sx, int sy,
     int dx, int dy, unsigned char alpha);
-global void VideoDrawRectangle(SDL_Color color, int x, int y,
+global void VideoDrawRectangle(Uint32 color, int x, int y,
     int w, int h);
-global void VideoDrawRectangleClip(SDL_Color color, int x, int y,
+global void VideoDrawRectangleClip(Uint32 color, int x, int y,
     int w, int h);
-global void VideoDrawTransRectangle(SDL_Color color, int x, int y,
+global void VideoDrawTransRectangle(Uint32 color, int x, int y,
     int w, int h, unsigned char alpha);
-global void VideoFillRectangle(SDL_Color color, int x, int y,
+global void VideoFillRectangle(Uint32 color, int x, int y,
     int w, int h);
-global void VideoFillTransRectangle(SDL_Color color, int x, int y,
+global void VideoFillTransRectangle(Uint32 color, int x, int y,
     int w, int h, unsigned char alpha);
 #else
 /**
@@ -451,48 +452,55 @@
 #ifdef USE_SDL_SURFACE
     // FIXME: BIG todo
     // FIXME: optimize all these
-global void InitLineDraw()
+global void VideoDrawPixel16(Uint32 color, int x, int y)
 {
-    SDL_Surface* s;
-
-    s = SDL_CreateRGBSurface(SDL_SWSURFACE, 1, 1, 32, 
-       RMASK, GMASK, BMASK, AMASK);
-    PixelSurface = SDL_DisplayFormatAlpha(s);
-    SDL_FreeSurface(s);
+    VideoLockScreen();
+    ((Uint16*)TheScreen->pixels)[x + y * VideoWidth] = color;
+    VideoUnlockScreen();
 }
 
-global void VideoDrawPixel(SDL_Color color, int x, int y)
+global void VideoDrawPixel32(Uint32 color, int x, int y)
 {
-    SDL_Rect drect;
-
-    drect.x = x;
-    drect.y = y;
-
-    SDL_FillRect(PixelSurface, NULL, SDL_MapRGB(PixelSurface->format, 
-       color.r, color.g, color.b));
-    SDL_BlitSurface(PixelSurface, NULL, TheScreen, &drect);
+    VideoLockScreen();
+    ((Uint32*)TheScreen->pixels)[x + y * VideoWidth] = color;
+    VideoUnlockScreen();
 }
 
-global void VideoDrawTransPixel(SDL_Color color, int x, int y, unsigned char 
alpha)
+global void VideoDrawTransPixel16(Uint32 color, int x, int y, unsigned char 
alpha)
 {
-    SDL_Rect drect;
+    // FIXME: todo
+/*
+    Uint16* p;
 
-    drect.x = x;
-    drect.y = y;
+    VideoLockScreen();
+    p = &((Uint16*)TheScreen->pixels)[x + y * VideoWidth];
+    *p = ((((*p & 0xF800) >> 11) * (255 - alpha) + ((color & 0xF800) >> 11) * 
alpha) << 3) |
+       ((((*p & 0x7E0) >> 5) * (255 - alpha) + ((color & 0x7E0) >> 5) * alpha) 
>> 3) |
+       (((*p &0x1F) * (255 - alpha) + (color & 0x1F) * alpha) >> 8);
+    VideoUnlockScreen();
+*/
+}
 
-    SDL_FillRect(PixelSurface, NULL, SDL_MapRGBA(PixelSurface->format, 
-       color.r, color.g, color.b, alpha));
-    SDL_BlitSurface(PixelSurface, NULL, TheScreen, &drect);
+global void VideoDrawTransPixel32(Uint32 color, int x, int y, unsigned char 
alpha)
+{
+    // FIXME: todo
 }
 
-global void VideoDrawPixelClip(SDL_Color color, int x, int y)
+global void VideoDrawPixelClip(Uint32 color, int x, int y)
 {
     if (x >= ClipX1 && y >= ClipY1 && x <= ClipX2 && y <= ClipX2) {
        VideoDrawPixel(color, x, y);
     }
 }
 
-global void VideoDrawVLine(SDL_Color color, int x, int y, int height)
+global void VideoDrawTransPixelClip(Uint32 color, int x, int y, unsigned char 
alpha)
+{
+    if (x >= ClipX1 && y >= ClipY1 && x <= ClipX2 && y <= ClipX2) {
+       VideoDrawTransPixel(color, x, y, alpha);
+    }
+}
+
+global void VideoDrawVLine(Uint32 color, int x, int y, int height)
 {
     int i;
 
@@ -501,7 +509,7 @@
     }
 }
 
-global void VideoDrawTransVLine(SDL_Color color, int x, int y,
+global void VideoDrawTransVLine(Uint32 color, int x, int y,
     int height, unsigned char alpha)
 {
     int i;
@@ -511,14 +519,14 @@
     }
 }
 
-global void VideoDrawVLineClip(SDL_Color color, int x, int y, int height)
+global void VideoDrawVLineClip(Uint32 color, int x, int y, int height)
 {
     int w = 1;
     CLIP_RECTANGLE(x, y, w, height);
     VideoDrawVLine(color, x, y, height);
 }
 
-global void VideoDrawHLine(SDL_Color color, int x, int y, int width)
+global void VideoDrawHLine(Uint32 color, int x, int y, int width)
 {
     int i;
 
@@ -527,14 +535,14 @@
     }
 }
 
-global void VideoDrawHLineClip(SDL_Color color, int x, int y, int width)
+global void VideoDrawHLineClip(Uint32 color, int x, int y, int width)
 {
     int h = 1;
     CLIP_RECTANGLE(x, y, width, h);
     VideoDrawHLine(color, x, y, width);
 }
 
-global void VideoDrawTransHLine(SDL_Color color, int x, int y,
+global void VideoDrawTransHLine(Uint32 color, int x, int y,
     int width, unsigned char alpha)
 {
     int i;
@@ -544,7 +552,7 @@
     }
 }
 
-global void VideoDrawLine(SDL_Color color, int sx, int sy, int dx, int dy)
+global void VideoDrawLine(Uint32 color, int sx, int sy, int dx, int dy)
 {
     int x;
     int y;
@@ -645,7 +653,7 @@
     }
 }
 
-global void VideoDrawLineClip(SDL_Color color, int sx, int sy, int dx, int dy)
+global void VideoDrawLineClip(Uint32 color, int sx, int sy, int dx, int dy)
 {
     SDL_Rect oldrect;
     SDL_Rect newrect;
@@ -661,14 +669,14 @@
     SDL_SetClipRect(TheScreen, &oldrect);
 }
 
-global void VideoDrawTransLine(SDL_Color color, int sx, int sy,
+global void VideoDrawTransLine(Uint32 color, int sx, int sy,
     int dx, int dy, unsigned char alpha)
 {
     // FIXME: trans
     VideoDrawLine(color, sx, sy, dx, dy);
 }
 
-global void VideoDrawRectangle(SDL_Color color, int x, int y,
+global void VideoDrawRectangle(Uint32 color, int x, int y,
     int w, int h)
 {
     VideoDrawHLine(color, x, y, w);
@@ -678,7 +686,7 @@
     VideoDrawVLine(color, x + w - 1, y + 1, h - 2);
 }
 
-global void VideoDrawRectangleClip(SDL_Color color, int x, int y,
+global void VideoDrawRectangleClip(Uint32 color, int x, int y,
     int w, int h)
 {
     SDL_Rect oldrect;
@@ -695,7 +703,7 @@
     SDL_SetClipRect(TheScreen, &oldrect);
 }
 
-global void VideoDrawTransRectangle(SDL_Color color, int x, int y,
+global void VideoDrawTransRectangle(Uint32 color, int x, int y,
     int w, int h, unsigned char alpha)
 {
     VideoDrawTransHLine(color, x, y, w, alpha);
@@ -705,21 +713,20 @@
     VideoDrawTransVLine(color, x + w - 1, y + 1, h - 2, alpha);
 }
 
-global void VideoFillRectangle(SDL_Color color, int x, int y,
+global void VideoFillRectangle(Uint32 color, int x, int y,
     int w, int h)
 {
     SDL_Rect drect;
-    Uint32 c = SDL_MapRGB(TheScreen->format, color.r, color.g, color.b);
 
     drect.x = x;
     drect.y = y;
     drect.w = w;
     drect.h = h;
 
-    SDL_FillRect(TheScreen, &drect, c);
+    SDL_FillRect(TheScreen, &drect, color);
 }
 
-global void VideoFillRectangleClip(SDL_Color color, int x, int y,
+global void VideoFillRectangleClip(Uint32 color, int x, int y,
     int w, int h)
 {
     SDL_Rect oldrect;
@@ -736,19 +743,16 @@
     SDL_SetClipRect(TheScreen, &oldrect);
 }
 
-global void VideoFillTransRectangle(SDL_Color color, int x, int y,
+global void VideoFillTransRectangle(Uint32 color, int x, int y,
     int w, int h, unsigned char alpha)
 {
     SDL_Rect drect;
     SDL_Surface* s;
-    Uint32 c;
 
     s = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h,
        32, RMASK, GMASK, BMASK, AMASK);
 
-    c = SDL_MapRGBA(s->format, color.r, color.g, color.b, alpha);
-
-    SDL_FillRect(s, NULL, c);
+    SDL_FillRect(s, NULL, color);
 
     drect.x = x;
     drect.y = y;
@@ -757,7 +761,7 @@
     SDL_FreeSurface(s);
 }
 
-global void VideoFillTransRectangleClip(SDL_Color color, int x, int y,
+global void VideoFillTransRectangleClip(Uint32 color, int x, int y,
     int w, int h, unsigned char alpha)
 {
     SDL_Rect oldrect;
@@ -774,7 +778,7 @@
     SDL_SetClipRect(TheScreen, &oldrect);
 }
 
-global void VideoDrawCircle(SDL_Color color, int x, int y, int r)
+global void VideoDrawCircle(Uint32 color, int x, int y, int r)
 {
     int p;
     int px;
@@ -803,7 +807,7 @@
     }
 }
 
-global void VideoDrawTransCircle(SDL_Color color, int x, int y, 
+global void VideoDrawTransCircle(Uint32 color, int x, int y, 
     int r, unsigned char alpha)
 {
     int p;
@@ -833,7 +837,7 @@
     }
 }
 
-global void VideoDrawCircleClip(SDL_Color color, int x, int y, int r)
+global void VideoDrawCircleClip(Uint32 color, int x, int y, int r)
 {
     SDL_Rect oldrect;
     SDL_Rect newrect;
@@ -849,7 +853,7 @@
     SDL_SetClipRect(TheScreen, &oldrect);
 }
 
-global void VideoDrawTransCircleClip(SDL_Color color, int x, int y,
+global void VideoDrawTransCircleClip(Uint32 color, int x, int y,
     int r, unsigned char alpha)
 {
     SDL_Rect oldrect;
@@ -866,7 +870,7 @@
     SDL_SetClipRect(TheScreen, &oldrect);
 }
 
-global void VideoFillCircle(SDL_Color color, int x, int y, int r)
+global void VideoFillCircle(Uint32 color, int x, int y, int r)
 {
     int p;
     int px;
@@ -902,7 +906,7 @@
     }
 }
 
-global void VideoFillTransCircle(SDL_Color color, int x, int y, 
+global void VideoFillTransCircle(Uint32 color, int x, int y, 
     int r, unsigned char alpha)
 {
     int p;
@@ -939,7 +943,7 @@
     }
 }
 
-global void VideoFillCircleClip(SDL_Color color, int x, int y, int r)
+global void VideoFillCircleClip(Uint32 color, int x, int y, int r)
 {
     SDL_Rect oldrect;
     SDL_Rect newrect;
@@ -955,7 +959,7 @@
     SDL_SetClipRect(TheScreen, &oldrect);
 }
 
-global void VideoFillTransCircleClip(SDL_Color color, int x, int y,
+global void VideoFillTransCircleClip(Uint32 color, int x, int y,
     int r, unsigned char alpha)
 {
     SDL_Rect oldrect;
@@ -970,6 +974,27 @@
     SDL_SetClipRect(TheScreen, &newrect);
     VideoFillTransCircle(color, x, y, r, alpha);
     SDL_SetClipRect(TheScreen, &oldrect);
+}
+
+global void InitLineDraw()
+{
+/*
+    SDL_Surface* s;
+
+    s = SDL_CreateRGBSurface(SDL_SWSURFACE, 1, 1, 32, 
+       RMASK, GMASK, BMASK, AMASK);
+    PixelSurface = SDL_DisplayFormatAlpha(s);
+    SDL_FreeSurface(s);
+*/
+    switch (VideoDepth) {
+       case 16:
+           VideoDrawPixel = VideoDrawPixel16;
+           VideoDrawTransPixel = VideoDrawTransPixel16;
+           break;
+       case 32:
+           VideoDrawPixel = VideoDrawPixel32;
+           VideoDrawTransPixel = VideoDrawTransPixel32;
+    }
 }
 
 global void DebugTestDisplayLines(void)
Index: stratagus/src/video/sdl.c
diff -u stratagus/src/video/sdl.c:1.107 stratagus/src/video/sdl.c:1.108
--- stratagus/src/video/sdl.c:1.107     Mon Dec  1 00:42:50 2003
+++ stratagus/src/video/sdl.c   Mon Dec  1 23:00:16 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: sdl.c,v 1.107 2003/12/01 05:42:50 jsalmon3 Exp $
+//     $Id: sdl.c,v 1.108 2003/12/02 04:00:16 nehalmistry Exp $
 
 //@{
 
@@ -265,6 +265,17 @@
     InitOpenGL();
 #endif
 
+#ifdef USE_SDL_SURFACE
+    ColorBlack = SDL_MapRGB(TheScreen->format, 0, 0, 0);
+    ColorDarkGreen = SDL_MapRGB(TheScreen->format, 48, 100, 4);
+    ColorBlue = SDL_MapRGB(TheScreen->format, 0, 0, 252);
+    ColorOrange = SDL_MapRGB(TheScreen->format, 248, 140, 20);
+    ColorWhite = SDL_MapRGB(TheScreen->format, 252, 248, 240);
+    ColorGray = SDL_MapRGB(TheScreen->format, 128, 128, 128);
+    ColorRed = SDL_MapRGB(TheScreen->format, 252, 0, 0);
+    ColorGreen = SDL_MapRGB(TheScreen->format, 0, 252, 0);
+    ColorYellow = SDL_MapRGB(TheScreen->format, 252, 252, 0);
+#else
     ColorBlack = VideoMapRGB(0, 0, 0);
     ColorDarkGreen = VideoMapRGB(48, 100, 4);
     ColorBlue = VideoMapRGB(0, 0, 252);
@@ -274,6 +285,7 @@
     ColorRed = VideoMapRGB(252, 0, 0);
     ColorGreen = VideoMapRGB(0, 252, 0);
     ColorYellow = VideoMapRGB(252, 252, 0);
+#endif
 
     DebugLevel3Fn("Video init ready %d %d\n" _C_ VideoDepth _C_ VideoBpp);
 
@@ -782,18 +794,7 @@
 #endif
 }
 
-#ifdef USE_SDL_SURFACE
-global SDL_Color VideoMapRGB(int r, int g, int b)
-{
-    SDL_Color c;
-
-    c.r = r;
-    c.g = g;
-    c.b = b;
-
-    return c;
-}
-#else
+#ifndef USE_SDL_SURFACE
 /**
 **     Maps RGB to a hardware dependent pixel.
 **
Index: stratagus/src/video/video.c
diff -u stratagus/src/video/video.c:1.78 stratagus/src/video/video.c:1.79
--- stratagus/src/video/video.c:1.78    Sun Nov 30 20:36:02 2003
+++ stratagus/src/video/video.c Mon Dec  1 23:00:16 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: video.c,v 1.78 2003/12/01 01:36:02 jsalmon3 Exp $
+//     $Id: video.c,v 1.79 2003/12/02 04:00:16 nehalmistry Exp $
 
 //@{
 
@@ -286,15 +286,15 @@
 #ifdef USE_SDL_SURFACE
 global void ColorCycle(void);
 
-SDL_Color ColorBlack;
-SDL_Color ColorDarkGreen;
-SDL_Color ColorBlue;
-SDL_Color ColorOrange;
-SDL_Color ColorWhite;
-SDL_Color ColorGray;
-SDL_Color ColorRed;
-SDL_Color ColorGreen;
-SDL_Color ColorYellow;
+Uint32 ColorBlack;
+Uint32 ColorDarkGreen;
+Uint32 ColorBlue;
+Uint32 ColorOrange;
+Uint32 ColorWhite;
+Uint32 ColorGray;
+Uint32 ColorRed;
+Uint32 ColorGreen;
+Uint32 ColorYellow;
 #else
 global void (*ColorCycle)(void);
 




reply via email to

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