stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src/stratagus mainloop.c player.c str...


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src/stratagus mainloop.c player.c str...
Date: 15 Jan 2004 13:07:40 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       04/01/15 13:07:40

Modified files:
        src/stratagus  : mainloop.c player.c stratagus.c 

Log message:
        USE_SDL_SURFACE is default

Patches:
Index: stratagus/src/stratagus/mainloop.c
diff -u stratagus/src/stratagus/mainloop.c:1.178 
stratagus/src/stratagus/mainloop.c:1.179
--- stratagus/src/stratagus/mainloop.c:1.178    Thu Jan 15 11:57:00 2004
+++ stratagus/src/stratagus/mainloop.c  Thu Jan 15 13:07:39 2004
@@ -5,12 +5,12 @@
 //     /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
 //             \/                  \/          \//_____/            \/
 //  ______________________                           ______________________
-//                       T H E   W A R   B E G I N S
-//        Stratagus - A free fantasy real time strategy game engine
+//                        T H E   W A R   B E G I N S
+//         Stratagus - A free fantasy real time strategy game engine
 //
 /address@hidden mainloop.c     -       The main game loop. */
 //
-//     (c) Copyright 1998-2003 by Lutz Sammer and Jimmy Salmon
+//      (c) Copyright 1998-2004 by Lutz Sammer and Jimmy Salmon
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: mainloop.c,v 1.178 2004/01/15 00:57:00 wizzard Exp $
+//      $Id: mainloop.c,v 1.179 2004/01/15 02:07:39 jsalmon3 Exp $
 
 //@{
 
@@ -494,11 +494,7 @@
        //              Separate the viewports and mark the active viewport.
        //
        for (vp = TheUI.Viewports; vp < evp; ++vp) {
-#ifdef USE_SDL_SURFACE
                Uint32 color;
-#else
-               VMemType color;
-#endif
 
                if (vp == TheUI.SelectedViewport) {
                        color = ColorOrange;
@@ -527,10 +523,6 @@
 {
        MustRedraw &= EnableRedraw;                             // Don't redraw 
disabled parts
 
-#ifndef USE_SDL_SURFACE
-       VideoLockScreen();                                              // 
prepare video write
-#endif
-
        HideAnyCursor();                                                // 
remove cursor (when available)
 
        if (MustRedraw & RedrawMap) {
@@ -626,10 +618,6 @@
        }
 
        DrawAnyCursor();
-
-#ifndef USE_SDL_SURFACE
-       VideoUnlockScreen();                            // End write access
-#endif
 
        //
        //              Update changes to display.
Index: stratagus/src/stratagus/player.c
diff -u stratagus/src/stratagus/player.c:1.110 
stratagus/src/stratagus/player.c:1.111
--- stratagus/src/stratagus/player.c:1.110      Sat Jan 10 06:18:36 2004
+++ stratagus/src/stratagus/player.c    Thu Jan 15 13:07:39 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: player.c,v 1.110 2004/01/09 19:18:36 jsalmon3 Exp $
+//      $Id: player.c,v 1.111 2004/01/15 02:07:39 jsalmon3 Exp $
 
 //@{
 
@@ -66,13 +66,8 @@
 /**
 **             Colors used for minimap.                FIXME: make this 
configurable
 */
-#ifdef USE_SDL_SURFACE
 local SDL_Color PlayerColorsRGB[PlayerMax][4];
 global Uint32 PlayerColors[PlayerMax][4];
-#else
-global VMemType PlayerColorsRGB[PlayerMax][4];
-global VMemType PlayerColors[PlayerMax][4];
-#endif
 
 global char* PlayerColorNames[PlayerMax] = {
        "red",
@@ -150,15 +145,9 @@
        // FIXME: remove this
        for (p = 0; p < PlayerMax; ++p) {
                for (x = 0; x < 4; ++x) {
-#ifdef USE_SDL_SURFACE
                        PlayerColorsRGB[p][x].r = PColors[p][x].R;
                        PlayerColorsRGB[p][x].g = PColors[p][x].G;
                        PlayerColorsRGB[p][x].b = PColors[p][x].B;
-#else
-                       PlayerColorsRGB[p][x].D24.a = PColors[p][x].R;
-                       PlayerColorsRGB[p][x].D24.b = PColors[p][x].G;
-                       PlayerColorsRGB[p][x].D24.c = PColors[p][x].B;
-#endif
                }
        }
 
@@ -168,13 +157,8 @@
                        Players[p].Type = PlayerNobody;
                }
                for (x = 0; x < 4; ++x) {
-#ifdef USE_SDL_SURFACE
                        PlayerColors[p][x] = SDL_MapRGB(TheScreen->format, 
PlayerColorsRGB[p][x].r,
                                PlayerColorsRGB[p][x].g, 
PlayerColorsRGB[p][x].b);
-#else
-                       PlayerColors[p][x] = 
VideoMapRGB(PlayerColorsRGB[p][x].D24.a,
-                               PlayerColorsRGB[p][x].D24.b, 
PlayerColorsRGB[p][x].D24.c);
-#endif
                }
        }
 }
@@ -223,7 +207,7 @@
        int j;
 
        CLprintf(file, "\n--- -----------------------------------------\n");
-       CLprintf(file, "--- MODULE: players $Id: player.c,v 1.110 2004/01/09 
19:18:36 jsalmon3 Exp $\n\n");
+       CLprintf(file, "--- MODULE: players $Id: player.c,v 1.111 2004/01/15 
02:07:39 jsalmon3 Exp $\n\n");
 
 #if 0
        //
@@ -919,7 +903,6 @@
 */
 global void GraphicPlayerPixels(const Player* player, const Graphic* sprite)
 {
-#ifdef USE_SDL_SURFACE
        SDL_LockSurface(sprite->Surface);
        SDL_SetColors(sprite->Surface, ((Player*)player)->UnitColors.Colors, 
208, 4);
        if (sprite->SurfaceFlip) {
@@ -927,27 +910,6 @@
                        ((Player*)player)->UnitColors.Colors, 208, 4);
        }
        SDL_UnlockSurface(sprite->Surface);
-#else
-       switch (VideoBpp) {
-               case 8:
-                       *((struct __4pixel8__*)(((VMemType8*)sprite->Pixels) + 
208)) =
-                               player->UnitColors.Depth8;
-                       break;
-               case 15:
-               case 16:
-                       *((struct __4pixel16__*)(((VMemType16*)sprite->Pixels) 
+ 208)) =
-                               player->UnitColors.Depth16;
-                       break;
-               case 24:
-                       *((struct __4pixel24__*)(((VMemType24*)sprite->Pixels) 
+ 208)) =
-                               player->UnitColors.Depth24;
-                       break;
-               case 32:
-                       *((struct __4pixel32__*)(((VMemType32*)sprite->Pixels) 
+ 208)) =
-                               player->UnitColors.Depth32;
-                       break;
-       }
-#endif
 }
 
 /**
@@ -964,53 +926,11 @@
 
        //o = rand() & 0x7;                                             // 
FIXME: random colors didn't work
        o = 0;
-#ifdef USE_SDL_SURFACE
        for (i = 0; i < PlayerMax; ++i) {
                memcpy(Players[o].UnitColors.Colors, PlayerColorsRGB[i],
                        sizeof(SDL_Color) * 4);
                o = (o + 1) % PlayerMax;
        }
-#else
-       switch (VideoBpp) {
-       case 8:
-               for (i = 0; i < PlayerMax; ++i) {
-                       Players[o].UnitColors.Depth8.Pixels[0] = 
PlayerColors[i][0].D8;
-                       Players[o].UnitColors.Depth8.Pixels[1] = 
PlayerColors[i][1].D8;
-                       Players[o].UnitColors.Depth8.Pixels[2] = 
PlayerColors[i][2].D8;
-                       Players[o].UnitColors.Depth8.Pixels[3] = 
PlayerColors[i][3].D8;
-                       o = (o + 1) % PlayerMax;
-               }
-               break;
-       case 15:
-       case 16:
-               for (i = 0; i < PlayerMax; ++i) {
-                       Players[o].UnitColors.Depth16.Pixels[0] = 
PlayerColors[i][0].D16;
-                       Players[o].UnitColors.Depth16.Pixels[1] = 
PlayerColors[i][1].D16;
-                       Players[o].UnitColors.Depth16.Pixels[2] = 
PlayerColors[i][2].D16;
-                       Players[o].UnitColors.Depth16.Pixels[3] = 
PlayerColors[i][3].D16;
-                       o = (o + 1) % PlayerMax;
-               }
-               break;
-       case 24:
-               for (i = 0; i < PlayerMax; ++i) {
-                       Players[o].UnitColors.Depth24.Pixels[0] = 
PlayerColors[i][0].D24;
-                       Players[o].UnitColors.Depth24.Pixels[1] = 
PlayerColors[i][1].D24;
-                       Players[o].UnitColors.Depth24.Pixels[2] = 
PlayerColors[i][2].D24;
-                       Players[o].UnitColors.Depth24.Pixels[3] = 
PlayerColors[i][3].D24;
-                       o = (o + 1) % PlayerMax;
-               }
-               break;
-       case 32:
-               for (i = 0; i < 7; ++i) {
-                       Players[o].UnitColors.Depth32.Pixels[0] = 
PlayerColors[i][0].D32;
-                       Players[o].UnitColors.Depth32.Pixels[1] = 
PlayerColors[i][1].D32;
-                       Players[o].UnitColors.Depth32.Pixels[2] = 
PlayerColors[i][2].D32;
-                       Players[o].UnitColors.Depth32.Pixels[3] = 
PlayerColors[i][3].D32;
-                       o = (o + 1) % PlayerMax;
-               }
-               break;
-       }
-#endif
 }
 
 /**
Index: stratagus/src/stratagus/stratagus.c
diff -u stratagus/src/stratagus/stratagus.c:1.246 
stratagus/src/stratagus/stratagus.c:1.247
--- stratagus/src/stratagus/stratagus.c:1.246   Thu Jan 15 10:48:43 2004
+++ stratagus/src/stratagus/stratagus.c Thu Jan 15 13:07:39 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: stratagus.c,v 1.246 2004/01/14 23:48:43 jsalmon3 Exp $
+//      $Id: stratagus.c,v 1.247 2004/01/15 02:07:39 jsalmon3 Exp $
 
 //@{
 
@@ -533,13 +533,7 @@
                WaitEventsOneFrame(&callbacks);
        }
 
-#ifdef USE_SDL_SURFACE
        VideoClearScreen();
-#else
-       VideoLockScreen();
-       VideoClearScreen();
-       VideoUnlockScreen();
-#endif
        Invalidate();
        RealizeVideoMemory();
 }
@@ -560,9 +554,6 @@
        va_end(va);
 
        if (VideoDepth && IsFontLoaded(GameFont)) {
-#ifndef USE_SDL_SURFACE
-               VideoLockScreen();
-#endif
                // Remove non printable chars
                for (s = temp; *s; ++s) {
                        if (*s < 32) {
@@ -571,9 +562,6 @@
                }
                VideoFillRectangle(ColorBlack, 5, VideoHeight - 18, VideoWidth 
- 10, 18);
                VideoDrawTextCentered(VideoWidth / 2, VideoHeight - 16, 
GameFont, temp);
-#ifndef USE_SDL_SURFACE
-               VideoUnlockScreen();
-#endif
                InvalidateArea(5, VideoHeight - 18, VideoWidth - 10, 18);
                RealizeVideoMemory();
        } else {
@@ -620,15 +608,8 @@
                //
                //  Clear screen
                //
-#ifdef USE_SDL_SURFACE
-               VideoClearScreen();
-               Invalidate();
-#else
-               VideoLockScreen();
                VideoClearScreen();
-               VideoUnlockScreen();
                Invalidate();
-#endif
                RealizeVideoMemory();
 
                //
@@ -758,9 +739,6 @@
 #ifdef USE_SDL
        "SDL "
 #endif
-#ifdef USE_SDL_SURFACE
-       "SDL-SURFACE "
-#endif
 #ifdef USE_SDLA
        "SDL-AUDIO "
 #endif
@@ -863,9 +841,6 @@
                                DisplayPicture(TitleScreens[i]->File);
                                labels = TitleScreens[i]->Labels;
                                if (labels && labels[0] && 
IsFontLoaded(labels[0]->Font)) {
-#ifndef USE_SDL_SURFACE
-                                       VideoLockScreen();
-#endif
                                        for (j = 0; labels[j]; ++j) {
                                                x = labels[j]->Xofs * 
VideoWidth / 640;
                                                y = labels[j]->Yofs * 
VideoWidth / 640;
@@ -874,9 +849,6 @@
                                                }
                                                VideoDrawText(x, y, 
labels[j]->Font, labels[j]->Text);
                                        }
-#ifndef USE_SDL_SURFACE
-                                       VideoUnlockScreen();
-#endif
                                }
                                Invalidate();
                                RealizeVideoMemory();




reply via email to

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