netpanzer-cvs
[Top][All Lists]
Advanced

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

[netPanzer-CVS] netpanzer/src/NetPanzer Interfaces/BaseGameMana...


From: Hankin Chick
Subject: [netPanzer-CVS] netpanzer/src/NetPanzer Interfaces/BaseGameMana...
Date: Sat, 22 Nov 2003 04:46:42 -0500

CVSROOT:        /cvsroot/netpanzer
Module name:    netpanzer
Branch:         
Changes by:     Hankin Chick <address@hidden>   03/11/22 04:46:41

Modified files:
        src/NetPanzer/Interfaces: BaseGameManager.cpp GameConfig.cpp 
                                  GameConfig.hpp MiniMapInterface.cpp 
        src/NetPanzer/Views: GameViewGlobals.cpp GameViewGlobals.hpp 
        src/NetPanzer/Views/Game: GameInfoView.cpp GameInfoView.hpp 
                                  GameTemplateView.cpp 
                                  GameTemplateView.hpp 
                                  GameToolbarView.cpp 
                                  GameToolbarView.hpp MiniMapView.cpp 
                                  MiniMapView.hpp RankView.cpp 
                                  RankView.hpp 
        src/NetPanzer/Views/MainMenu/Multi: FlagSelectionView.cpp 

Log message:
        Remember position/shade of the in game windows.

Patches:
Index: netpanzer/src/NetPanzer/Interfaces/BaseGameManager.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/BaseGameManager.cpp:1.5 
netpanzer/src/NetPanzer/Interfaces/BaseGameManager.cpp:1.6
--- netpanzer/src/NetPanzer/Interfaces/BaseGameManager.cpp:1.5  Fri Nov 21 
09:47:11 2003
+++ netpanzer/src/NetPanzer/Interfaces/BaseGameManager.cpp      Sat Nov 22 
04:46:40 2003
@@ -144,7 +144,7 @@
     if(UNIT_FLAGS_SURFACE.getFrameCount() == 0) {
         throw Exception("Couldn't find any flag in pics/flags/.");
     }
-    if(gameconfig->playerflag<0) {
+    if(!gameconfig->configfileexists) {
         gameconfig->playerflag=rand()%UNIT_FLAGS_SURFACE.getFrameCount();
     }
 }
Index: netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp:1.20 
netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp:1.21
--- netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp:1.20      Fri Nov 21 
14:42:07 2003
+++ netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp   Sat Nov 22 04:46:40 2003
@@ -25,6 +25,8 @@
 #include "NetworkGlobals.hpp"
 #include "XmlConfig.hpp"
 #include "XmlStore.hpp"
+#include "MiniMapView.hpp"
+#include "GameViewGlobals.hpp"
 
 GameConfig::GameConfig(const std::string& newconfigfile)
     // VariableName("Name", value [, minimum, maximum])
@@ -76,6 +78,13 @@
       consoletextdelay("consoletextdelay", 3, 1, 20),
       consoletextusage("consoletextusage", 25, 1, 100),
       scrollrate("scrollrate", 1000, 100, 10000),
+      minimapposition("minimapposition", iXY(0,0)),
+      minimapsize("minimapsize", iXY(194,194)),
+      minimapdrawtype("minimapdrawtype", MAP_SOLID),
+      gameinfoposition("gameinfoposition", iXY(0,0)),
+      toolbarposition("toolbarposition", iXY(0,0)),
+      rankposition("rankposition", iXY(0,0)),
+      
viewdrawbackgroundmode("viewdrawbackgroundmode",(int)VIEW_BACKGROUND_DARK_GRAY_BLEND),
                   
       radar_displayclouds("displayclouds", false),
       radar_playerunitcolor("playerunitcolor", _color_aqua, 0, _color_last-1),
@@ -89,6 +98,7 @@
       radar_resizerate("resizerate", 400, 10, 1000)      
 {
     configfile = newconfigfile;
+    configfileexists = false;
 
     //gamesettings.push_back(&hostorjoin);
 
@@ -142,6 +152,13 @@
     interfacesettings.push_back(&consoletextdelay);
     interfacesettings.push_back(&consoletextusage);
     interfacesettings.push_back(&scrollrate);
+    interfacesettings.push_back(&minimapposition);
+    interfacesettings.push_back(&minimapsize);
+    interfacesettings.push_back(&minimapdrawtype);
+    interfacesettings.push_back(&gameinfoposition);
+    interfacesettings.push_back(&toolbarposition);
+    interfacesettings.push_back(&rankposition);
+    interfacesettings.push_back(&viewdrawbackgroundmode);
 
     radarsettings.push_back(&radar_displayclouds);
     radarsettings.push_back(&radar_playerunitcolor);
@@ -172,6 +189,7 @@
 void GameConfig::loadConfig()
 {
     const char *xmlfile = FileSystem::getRealName(configfile.c_str()).c_str();
+
     XmlConfig config(xmlfile);
 
     loadSettings(config, "game", gamesettings);
@@ -181,6 +199,7 @@
     loadSettings(config, "interface", interfacesettings);
     loadSettings(config, "radar", radarsettings);
     loadSettings(config, "server", serversettings);
+    configfileexists = true;
 }
 
 void GameConfig::loadSettings(XmlConfig& config, const char* name,
@@ -197,6 +216,12 @@
                 ConfigInt* confint = dynamic_cast<ConfigInt*> (var);
                 if(confint)
                     *confint = section.readInt(confint->getName().c_str());
+
+                ConfigXY* confxy = dynamic_cast<ConfigXY*> (var);
+                if(confxy) {
+                    *confxy = section.readXY(confxy->getName().c_str());
+                }
+
                 ConfigBool* confbool = dynamic_cast<ConfigBool*> (var);
                 if(confbool) {
                     std::string str =
@@ -209,6 +234,7 @@
                         throw Exception("No boolean value for setting '%s'.",
                                         confbool->getName().c_str());
                 }
+
                 ConfigString* confstring = dynamic_cast<ConfigString*> (var);
                 if(confstring)
                     *confstring =
@@ -255,7 +281,12 @@
         if(confbool)
             store.writeString(confbool->getName().c_str(),
                     *confbool ? "yes" : "no");
-            
+
+        ConfigXY* confxy = dynamic_cast<ConfigXY*> (var);
+        if(confxy) {
+            store.writeXY(confxy->getName().c_str(), (const iXY&)(*confxy));
+        }
+
         ConfigString* confstring = dynamic_cast<ConfigString*> (var);
         if(confstring) {
             const char* string = 
Index: netpanzer/src/NetPanzer/Interfaces/GameConfig.hpp
diff -u netpanzer/src/NetPanzer/Interfaces/GameConfig.hpp:1.16 
netpanzer/src/NetPanzer/Interfaces/GameConfig.hpp:1.17
--- netpanzer/src/NetPanzer/Interfaces/GameConfig.hpp:1.16      Thu Nov 20 
19:19:26 2003
+++ netpanzer/src/NetPanzer/Interfaces/GameConfig.hpp   Sat Nov 22 04:46:40 2003
@@ -107,6 +107,8 @@
     void loadConfig();
     void saveConfig();
 
+    bool configfileexists;   // whether we loaded from a config file
+
     // game Settings
     ConfigInt hostorjoin;           //1=host, 2=join
 
@@ -162,6 +164,13 @@
     ConfigInt   consoletextdelay;
     ConfigInt   consoletextusage;
     ConfigInt   scrollrate;
+    ConfigXY    minimapposition;
+    ConfigXY    minimapsize;
+    ConfigInt   minimapdrawtype;
+    ConfigXY    gameinfoposition;
+    ConfigXY    toolbarposition;
+    ConfigXY    rankposition;
+    ConfigInt   viewdrawbackgroundmode;
 
     // radar settings
     ConfigBool  radar_displayclouds;
Index: netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.cpp:1.11 
netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.cpp:1.12
--- netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.cpp:1.11        Fri Nov 
21 09:23:55 2003
+++ netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.cpp     Sat Nov 22 
04:46:40 2003
@@ -28,7 +28,6 @@
 #include "GameConfig.hpp"
 
 fXY MiniMapInterface::scale_factor;
-iXY MiniMapInterface::mini_map_size;
 bool MiniMapInterface::pathing_debug_mode = false;
 
 PIX MiniMapInterface::player_unit_color;
@@ -62,8 +61,8 @@
 {
     iXY map_size;
 
-    MiniMapInterface::mini_map_size = mini_map_size;
-
+    gameconfig->minimapsize=mini_map_size;
+ 
     MapInterface::getMapPointSize( &map_size );
     scale_factor.x = float(map_size.x) / float(mini_map_size.x);
     scale_factor.y = float(map_size.y) / float(mini_map_size.y);
Index: netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp:1.12 
netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp:1.13
--- netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp:1.12    Mon Oct 13 
10:30:18 2003
+++ netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp Sat Nov 22 04:46:40 2003
@@ -76,12 +76,17 @@
     setVisible(false);
     setBordered(true);
 
-    moveTo(iXY(0, 0));
+    moveTo(iXY(0,0));
     //resizeClientArea(iXY(100, 2 * 2 + 12 * 3 + 8));
     resizeClientArea(iXY(140, 2 * 2 + 12 * 5 + 8));
 
-    // Start it in the top-left corner.
-    moveTo(screen->getPixX() - getSize().x, 0);
+    if(!gameconfig->configfileexists) {
+        // Start it in the top-left corner.
+        moveTo(screen->getPixX() - getSize().x, 0);
+    } else {
+        moveTo(gameconfig->gameinfoposition); 
+    }
+    checkArea(screen->getPix());
 } // end GameInfoView::GameInfoView
 
 // doDraw
@@ -180,3 +185,12 @@
     }
 
 } // end GameInfoView::checkGameInfoRect
+
+
+// save position, background into gameconfig
+void GameInfoView::notifyMoveTo()
+{
+    gameconfig->gameinfoposition=min;
+}
+
+
Index: netpanzer/src/NetPanzer/Views/Game/GameInfoView.hpp
diff -u netpanzer/src/NetPanzer/Views/Game/GameInfoView.hpp:1.3 
netpanzer/src/NetPanzer/Views/Game/GameInfoView.hpp:1.4
--- netpanzer/src/NetPanzer/Views/Game/GameInfoView.hpp:1.3     Mon Oct 13 
10:30:18 2003
+++ netpanzer/src/NetPanzer/Views/Game/GameInfoView.hpp Sat Nov 22 04:46:40 2003
@@ -32,6 +32,7 @@
 
 public:
     GameInfoView();
+    virtual void notifyMoveTo();
 
     virtual void doDraw(Surface &windowArea, Surface &clientArea);
 }; // end GameInfoView
Index: netpanzer/src/NetPanzer/Views/Game/GameTemplateView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/GameTemplateView.cpp:1.7 
netpanzer/src/NetPanzer/Views/Game/GameTemplateView.cpp:1.8
--- netpanzer/src/NetPanzer/Views/Game/GameTemplateView.cpp:1.7 Fri Oct  3 
10:45:14 2003
+++ netpanzer/src/NetPanzer/Views/Game/GameTemplateView.cpp     Sat Nov 22 
04:46:40 2003
@@ -22,6 +22,7 @@
 #include "GameViewGlobals.hpp"
 #include "KeyboardInterface.hpp"
 #include "ScreenSurface.hpp"
+#include "GameConfig.hpp"
 
 #include "WorldInputCmdProcessor.hpp"
 
@@ -41,17 +42,18 @@
 {
     // Check for view blending mode change.
     if (KeyboardInterface::getKeyPressed(SDLK_1)) {
-        viewDrawBackgroundMode = VIEW_BACKGROUND_DARK_GRAY_BLEND;
+        gameconfig->viewdrawbackgroundmode = VIEW_BACKGROUND_DARK_GRAY_BLEND;
     } else if (KeyboardInterface::getKeyPressed(SDLK_2)) {
-        viewDrawBackgroundMode = VIEW_BACKGROUND_LIGHT_GRAY_BLEND;
+        gameconfig->viewdrawbackgroundmode = VIEW_BACKGROUND_LIGHT_GRAY_BLEND;
     } else if (KeyboardInterface::getKeyPressed(SDLK_3)) {
-        viewDrawBackgroundMode = VIEW_BACKGROUND_SOLID_BLACK;
+        gameconfig->viewdrawbackgroundmode = VIEW_BACKGROUND_SOLID_BLACK;
     } else if (KeyboardInterface::getKeyPressed(SDLK_4)) {
-        viewDrawBackgroundMode = VIEW_BACKGROUND_TRANSPARENT;
+        gameconfig->viewdrawbackgroundmode = VIEW_BACKGROUND_TRANSPARENT;
     }
 
     moveTo(min + newPos - prevPos);
     checkArea(screen->getPix());
+    notifyMoveTo();
 }
 
 // doActivate
Index: netpanzer/src/NetPanzer/Views/Game/GameTemplateView.hpp
diff -u netpanzer/src/NetPanzer/Views/Game/GameTemplateView.hpp:1.3 
netpanzer/src/NetPanzer/Views/Game/GameTemplateView.hpp:1.4
--- netpanzer/src/NetPanzer/Views/Game/GameTemplateView.hpp:1.3 Tue Sep 16 
16:16:12 2003
+++ netpanzer/src/NetPanzer/Views/Game/GameTemplateView.hpp     Sat Nov 22 
04:46:40 2003
@@ -33,7 +33,7 @@
     //virtual void mouseEnter(const iXY &pos);
     virtual void doActivate();
     virtual void doDeactivate();
-
+    virtual void notifyMoveTo() {}
 }
 ; // end GameTemplateView
 
Index: netpanzer/src/NetPanzer/Views/Game/GameToolbarView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/GameToolbarView.cpp:1.8 
netpanzer/src/NetPanzer/Views/Game/GameToolbarView.cpp:1.9
--- netpanzer/src/NetPanzer/Views/Game/GameToolbarView.cpp:1.8  Mon Oct 13 
10:30:18 2003
+++ netpanzer/src/NetPanzer/Views/Game/GameToolbarView.cpp      Sat Nov 22 
04:46:40 2003
@@ -216,8 +216,13 @@
 
     resizeClientArea(iXY(117, pos.y));
 
-    // Start it in the bottom-left corner.
-    moveTo(screen->getPix() - getSize());
+    if(gameconfig->configfileexists) {
+        moveTo(gameconfig->toolbarposition);
+    } else {
+        // Start it in the bottom-left corner.
+        moveTo(screen->getPix() - getSize());
+    }
+    checkArea(screen->getPix());
 } // end GameToolbarView::GameToolbarView
 
 // doDraw
@@ -228,3 +233,9 @@
 
     View::doDraw(viewArea, clientArea);
 } // end GameToolbarView::doDraw
+
+
+void GameToolbarView::notifyMoveTo()
+{
+    gameconfig->toolbarposition=min;
+}
Index: netpanzer/src/NetPanzer/Views/Game/GameToolbarView.hpp
diff -u netpanzer/src/NetPanzer/Views/Game/GameToolbarView.hpp:1.3 
netpanzer/src/NetPanzer/Views/Game/GameToolbarView.hpp:1.4
--- netpanzer/src/NetPanzer/Views/Game/GameToolbarView.hpp:1.3  Mon Oct 13 
10:30:18 2003
+++ netpanzer/src/NetPanzer/Views/Game/GameToolbarView.hpp      Sat Nov 22 
04:46:40 2003
@@ -28,7 +28,9 @@
 public:
     GameToolbarView();
 
+
     virtual void doDraw(Surface &windowArea, Surface &clientArea);
+    virtual void notifyMoveTo();
 }; // end GameToolbarView
 
 #endif // end __GameToolbarView_hpp__
Index: netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp:1.21 
netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp:1.22
--- netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp:1.21     Tue Nov 11 
08:42:05 2003
+++ netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp  Sat Nov 22 04:46:40 2003
@@ -25,10 +25,10 @@
 #include "cMouse.hpp"
 #include "ScreenSurface.hpp"
 #include "WorldInputCmdProcessor.hpp"
+#include "GameConfig.hpp"
 
 MiniMapView miniMapView;
 
-MAP_DRAW_TYPES MiniMapView::mapDrawType;
 
 float MiniMapView::scaleDelta   = 400.0f;
 int   MiniMapView::decreaseSize = 0;
@@ -63,16 +63,19 @@
     miniMap = MiniMapInterface::getMiniMap();
 
     //iXY size = miniMap->getPix();
-    iXY size(196, 196);
+    iXY size(((const iXY &)gameconfig->minimapsize)+iXY(2,2));
     resize(size);
-    moveTo(iXY(0, screen->getPix().y - 196));
-
-    mapDrawType = MAP_SOLID;
+    if(gameconfig->configfileexists) {
+        moveTo(gameconfig->minimapposition);
+    } else {
+        moveTo(iXY(0, screen->getPix().y - 196));
+    }
 
     //int xOffset = size.x;
     //int yOffset = 0;
 
     MiniMapInterface::setMapScale(getSize() - iXY(2,2));
+    checkArea(screen->getPix());
 
     minMapSize =  64;
     maxMapSize = 480;
@@ -128,6 +131,7 @@
 
     iRect r(iXY(0,0), getSize());
 
+    int mapDrawType=gameconfig->minimapdrawtype;
     if (needScale) {
         // Draw the slow on the fly scaled map.
         if (mapDrawType == MAP_SOLID) {
@@ -262,6 +266,11 @@
 
 } // end MiniMapView::rMouseDown
 
+void MiniMapView::setMapDrawType(MAP_DRAW_TYPES type)
+{
+    gameconfig->minimapdrawtype=type;
+}
+
 //--------------------------------------------------------------------------
 void MiniMapView::rMouseDrag(const iXY &downPos, const iXY &prevPos, const iXY 
&newPos)
 {
@@ -269,24 +278,26 @@
     //maxMapSize = std::min(SCREEN_XPIX, SCREEN_YPIX);
     maxMapSize = std::min(640, 480);
 
-    moveTo(min + newPos - prevPos);
+    iXY map_pos=min + newPos - prevPos;
+    moveTo(map_pos);
+    gameconfig->minimapposition=map_pos;
     checkArea(screen->getPix());
 
     // Check for map blending mode change.
     if (KeyboardInterface::getKeyPressed(SDLK_1)) {
-        MiniMapView::mapDrawType = MAP_SOLID;
+        setMapDrawType(MAP_SOLID);
     } else if (KeyboardInterface::getKeyPressed(SDLK_2)) {
-        MiniMapView::mapDrawType = MAP_2080;
+        setMapDrawType(MAP_2080);
     } else if (KeyboardInterface::getKeyPressed(SDLK_3)) {
-        MiniMapView::mapDrawType = MAP_4060;
+        setMapDrawType(MAP_4060);
     } else if (KeyboardInterface::getKeyPressed(SDLK_4)) {
-        MiniMapView::mapDrawType = MAP_BLEND_GRAY;
+        setMapDrawType(MAP_BLEND_GRAY);
     } else if (KeyboardInterface::getKeyPressed(SDLK_5)) {
-        MiniMapView::mapDrawType = MAP_BLEND_DARK_GRAY;
+        setMapDrawType(MAP_BLEND_DARK_GRAY);
     } else if (KeyboardInterface::getKeyPressed(SDLK_6)) {
-        MiniMapView::mapDrawType = MAP_BLACK;
+        setMapDrawType(MAP_BLACK);
     } else if (KeyboardInterface::getKeyPressed(SDLK_7)) {
-        MiniMapView::mapDrawType = MAP_TRANSPARENT;
+        setMapDrawType(MAP_TRANSPARENT);
     }
 
     if (KeyboardInterface::getKeyState(SDLK_KP_PLUS)) {
Index: netpanzer/src/NetPanzer/Views/Game/MiniMapView.hpp
diff -u netpanzer/src/NetPanzer/Views/Game/MiniMapView.hpp:1.4 
netpanzer/src/NetPanzer/Views/Game/MiniMapView.hpp:1.5
--- netpanzer/src/NetPanzer/Views/Game/MiniMapView.hpp:1.4      Mon Oct 13 
10:30:19 2003
+++ netpanzer/src/NetPanzer/Views/Game/MiniMapView.hpp  Sat Nov 22 04:46:40 2003
@@ -67,9 +67,9 @@
 
     void drawMouseBox(Surface &dest);
     void setViewWindow(const iXY &pos);
+    void setMapDrawType(MAP_DRAW_TYPES type);
 
     static float          scaleDelta;
-    static MAP_DRAW_TYPES mapDrawType;
 
     static int decreaseSize;
     static int increaseSize;
Index: netpanzer/src/NetPanzer/Views/Game/RankView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/RankView.cpp:1.10 
netpanzer/src/NetPanzer/Views/Game/RankView.cpp:1.11
--- netpanzer/src/NetPanzer/Views/Game/RankView.cpp:1.10        Thu Nov 20 
19:19:28 2003
+++ netpanzer/src/NetPanzer/Views/Game/RankView.cpp     Sat Nov 22 04:46:40 2003
@@ -21,6 +21,8 @@
 #include "RankView.hpp"
 #include "Stats.hpp"
 #include "GameViewGlobals.hpp"
+#include "ScreenSurface.hpp"
+#include "GameConfig.hpp"
 
 #include "SelectionBoxSprite.hpp"
 
@@ -33,8 +35,10 @@
     setSubTitle(" - F6");
 
     setAllowResize(false);
-    moveTo(iXY(0, 0));
+    moveTo(gameconfig->rankposition);
     resize(iXY(450, 200));
+    checkArea(screen->getPix());
+
 
     const unsigned MAX_NAME_CHARS      = 20;
     const unsigned MAX_FLAG_CHARS      =  5;
@@ -181,3 +185,8 @@
     }
 
 } // end RankView::drawPlayerStats
+
+void RankView::notifyMoveTo()
+{
+    gameconfig->rankposition=min;
+}
Index: netpanzer/src/NetPanzer/Views/Game/RankView.hpp
diff -u netpanzer/src/NetPanzer/Views/Game/RankView.hpp:1.4 
netpanzer/src/NetPanzer/Views/Game/RankView.hpp:1.5
--- netpanzer/src/NetPanzer/Views/Game/RankView.hpp:1.4 Mon Oct 13 10:30:19 2003
+++ netpanzer/src/NetPanzer/Views/Game/RankView.hpp     Sat Nov 22 04:46:40 2003
@@ -44,7 +44,7 @@
     }
 
     virtual void doDraw(Surface &windowArea, Surface &clientArea);
-
+    virtual void notifyMoveTo();
 }
 ; // end _WIN
 
Index: netpanzer/src/NetPanzer/Views/GameViewGlobals.cpp
diff -u netpanzer/src/NetPanzer/Views/GameViewGlobals.cpp:1.7 
netpanzer/src/NetPanzer/Views/GameViewGlobals.cpp:1.8
--- netpanzer/src/NetPanzer/Views/GameViewGlobals.cpp:1.7       Mon Oct 13 
10:30:16 2003
+++ netpanzer/src/NetPanzer/Views/GameViewGlobals.cpp   Sat Nov 22 04:46:40 2003
@@ -19,6 +19,7 @@
 
 #include "Palette.hpp"
 #include "GameViewGlobals.hpp"
+#include "GameConfig.hpp"
 
 iXY exitPos(6, 454);
 iXY readyPos(480, 32);
@@ -54,7 +55,6 @@
 iRect bodyTextRect(27, 72, 620, 430);
 
 bool gDrawGameHelp          = false;
-int  viewDrawBackgroundMode = VIEW_BACKGROUND_DARK_GRAY_BLEND;
 
 //--------------------------------------------------------------------------
 void bltViewBackground(Surface &dest)
@@ -65,11 +65,11 @@
 //--------------------------------------------------------------------------
 void bltBlendRect(Surface &dest, const iRect &r)
 {
-    if (viewDrawBackgroundMode == VIEW_BACKGROUND_DARK_GRAY_BLEND) {
+    if (gameconfig->viewdrawbackgroundmode == VIEW_BACKGROUND_DARK_GRAY_BLEND) 
{
         dest.bltLookup(r, Palette::darkGray256.getColorArray());
-    } else if (viewDrawBackgroundMode == VIEW_BACKGROUND_LIGHT_GRAY_BLEND) {
+    } else if (gameconfig->viewdrawbackgroundmode == 
VIEW_BACKGROUND_LIGHT_GRAY_BLEND) {
         dest.bltLookup(r, Palette::gray256.getColorArray());
-    } else if (viewDrawBackgroundMode == VIEW_BACKGROUND_SOLID_BLACK) {
+    } else if (gameconfig->viewdrawbackgroundmode == 
VIEW_BACKGROUND_SOLID_BLACK) {
         dest.fillRect(r, Color::black);
-    } else if (viewDrawBackgroundMode == VIEW_BACKGROUND_TRANSPARENT) {}
+    } else if (gameconfig->viewdrawbackgroundmode == 
VIEW_BACKGROUND_TRANSPARENT) {}
 }
Index: netpanzer/src/NetPanzer/Views/GameViewGlobals.hpp
diff -u netpanzer/src/NetPanzer/Views/GameViewGlobals.hpp:1.5 
netpanzer/src/NetPanzer/Views/GameViewGlobals.hpp:1.6
--- netpanzer/src/NetPanzer/Views/GameViewGlobals.hpp:1.5       Mon Oct 13 
10:30:17 2003
+++ netpanzer/src/NetPanzer/Views/GameViewGlobals.hpp   Sat Nov 22 04:46:40 2003
@@ -59,7 +59,6 @@
 extern iRect bodyTextRect;
 
 // These are the possible background colors for the menus.
-extern int viewDrawBackgroundMode;
 enum
 {
     VIEW_BACKGROUND_DARK_GRAY_BLEND,
Index: netpanzer/src/NetPanzer/Views/MainMenu/Multi/FlagSelectionView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/Multi/FlagSelectionView.cpp:1.16 
netpanzer/src/NetPanzer/Views/MainMenu/Multi/FlagSelectionView.cpp:1.17
--- netpanzer/src/NetPanzer/Views/MainMenu/Multi/FlagSelectionView.cpp:1.16     
Wed Nov 12 06:26:00 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Multi/FlagSelectionView.cpp  Sat Nov 
22 04:46:41 2003
@@ -95,7 +95,7 @@
     }
 
     playerFlag.setFrame(0);
-    if(gameconfig->playerflag<0) {
+    if(!gameconfig->configfileexists) {
         // new player, no flag...
         gameconfig->playerflag=rand()%playerFlag.getFrameCount();
     }




reply via email to

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