netpanzer-cvs
[Top][All Lists]
Advanced

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

[netPanzer-CVS] netpanzer/src/NetPanzer/Interfaces GameConfig.c...


From: Hankin Chick
Subject: [netPanzer-CVS] netpanzer/src/NetPanzer/Interfaces GameConfig.c...
Date: Sun, 09 Nov 2003 08:43:31 -0500

CVSROOT:        /cvsroot/netpanzer
Module name:    netpanzer
Branch:         
Changes by:     Hankin Chick <address@hidden>   03/11/09 08:43:31

Modified files:
        src/NetPanzer/Interfaces: GameConfig.cpp GameConfig.hpp 
                                  GameManager.cpp MiniMapInterface.cpp 
                                  MiniMapInterface.hpp UnitInterface.cpp 
                                  UnitInterface.hpp 

Log message:
        Draws a different color(white) for selected units on the mini map
        Useful if you've grouped & moved some units and forget
        where they are.

Patches:
Index: netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp:1.14 
netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp:1.15
--- netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp:1.14      Wed Oct 22 
19:05:40 2003
+++ netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp   Sun Nov  9 08:43:29 2003
@@ -67,6 +67,7 @@
                   
       radar_displayclouds("displayclouds", false),
       radar_playerunitcolor("playerunitcolor", _color_aqua, 0, _color_last-1),
+      radar_selectedunitcolor("selectedunitcolor", _color_white, 0, 
_color_last-1),
       radar_alliedunitcolor("alliedunitcolor", _color_orange, 0, 
_color_last-1),
       radar_playeroutpostcolor("playeroutpostcolor", _color_blue, 0, 
_color_last-1),
       radar_alliedoutpostcolor("alliedoutpostcolor", _color_orange, 0, 
_color_last),
Index: netpanzer/src/NetPanzer/Interfaces/GameConfig.hpp
diff -u netpanzer/src/NetPanzer/Interfaces/GameConfig.hpp:1.12 
netpanzer/src/NetPanzer/Interfaces/GameConfig.hpp:1.13
--- netpanzer/src/NetPanzer/Interfaces/GameConfig.hpp:1.12      Wed Oct 22 
19:05:40 2003
+++ netpanzer/src/NetPanzer/Interfaces/GameConfig.hpp   Sun Nov  9 08:43:30 2003
@@ -154,6 +154,7 @@
     // radar settings
     ConfigBool  radar_displayclouds;
     ConfigInt   radar_playerunitcolor;
+    ConfigInt   radar_selectedunitcolor;
     ConfigInt   radar_alliedunitcolor;
     ConfigInt   radar_playeroutpostcolor;
     ConfigInt   radar_alliedoutpostcolor;
@@ -212,6 +213,11 @@
     PIX getPlayerRadarUnitColor() const
     {
         return( colorEnumToPix( radar_playerunitcolor ) );
+    }
+
+    PIX getSelectedRadarUnitColor() const
+    {
+        return( colorEnumToPix( radar_selectedunitcolor ) );
     }
     
     PIX getAlliedRadarUnitColor() const
Index: netpanzer/src/NetPanzer/Interfaces/GameManager.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/GameManager.cpp:1.64 
netpanzer/src/NetPanzer/Interfaces/GameManager.cpp:1.65
--- netpanzer/src/NetPanzer/Interfaces/GameManager.cpp:1.64     Wed Oct 22 
09:19:30 2003
+++ netpanzer/src/NetPanzer/Interfaces/GameManager.cpp  Sun Nov  9 08:43:30 2003
@@ -572,6 +572,7 @@
 {
 
     MiniMapInterface::setProperties( gameconfig->getPlayerRadarUnitColor(),
+                                     gameconfig->getSelectedRadarUnitColor(),
                                      gameconfig->getAlliedRadarUnitColor(),
                                      gameconfig->getPlayerOutpostRadarColor(),
                                      gameconfig->getAlliedOutpostRadarColor(),
Index: netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.cpp:1.9 
netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.cpp:1.10
--- netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.cpp:1.9 Sun Oct 12 
18:09:36 2003
+++ netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.cpp     Sun Nov  9 
08:43:30 2003
@@ -32,6 +32,7 @@
 bool MiniMapInterface::pathing_debug_mode = false;
 
 PIX MiniMapInterface::player_unit_color;
+PIX MiniMapInterface::selected_unit_color;
 PIX MiniMapInterface::allie_unit_color;
 
 PIX MiniMapInterface::player_objective_color;
@@ -78,33 +79,34 @@
 
 void MiniMapInterface::annotateUnits( Surface &map_surface )
 {
-    iXY world_loc, map_loc;
+    iXY map_loc;
     unsigned char unit_dispostion;
-    unsigned char threat_level;
+    UnitState *unit_state;
 
     UnitInterface::startUnitPositionEnumeration( );
 
     iRect unitRect;
 
-    while( UnitInterface::unitPositionEnumeration( &world_loc, 
&unit_dispostion, &threat_level) ) {
-        map_loc.x = int(float(world_loc.x) / scale_factor.x);
-        map_loc.y = int(float(world_loc.y) / scale_factor.y);
+    while( UnitInterface::unitPositionEnumeration( 
&unit_dispostion,&unit_state ) ) {
+        map_loc.x = int(float(unit_state->location.x) / scale_factor.x);
+        map_loc.y = int(float(unit_state->location.y) / scale_factor.y);
 
         if (gameconfig->radar_unitsize == _mini_map_unit_size_large) {
             unitRect = iRect(map_loc, map_loc + iXY(1,1));
         }
 
         if ( unit_dispostion == _unit_player ) {
-            if ( threat_level == _threat_level_under_attack ) {
+            if ( unit_state->threat_level == _threat_level_under_attack ) {
                 if ( radar_blink_flag == true ) {
                     drawLargeUnitDot( map_surface, map_loc, Color::yellow );
                 }
             } else {
+                PIX *unit_color=&player_unit_color;
+                if(unit_state->select) { unit_color=&selected_unit_color; }
                 if (gameconfig->radar_unitsize == _mini_map_unit_size_small) {
-                    drawSmallUnitDot( map_surface, map_loc, player_unit_color 
);
+                    drawSmallUnitDot( map_surface, map_loc, *unit_color );
                 } else if (gameconfig->radar_unitsize == 
_mini_map_unit_size_large) {
-                    drawLargeUnitDot( map_surface, map_loc, player_unit_color 
);
-
+                    drawLargeUnitDot( map_surface, map_loc, *unit_color );
                 } else {
                     assert(false);
                 }
@@ -268,6 +270,7 @@
 }
 
 void MiniMapInterface::setProperties( PIX player_unit_color,
+                                      PIX selected_unit_color,
                                       PIX allie_unit_color,
                                       PIX player_objective_color,
                                       PIX allie_objective_color,
@@ -275,6 +278,7 @@
                                     )
 {
     MiniMapInterface::player_unit_color = player_unit_color;
+    MiniMapInterface::selected_unit_color = selected_unit_color;
     MiniMapInterface::allie_unit_color = allie_unit_color;
 
     MiniMapInterface::player_objective_color = player_objective_color;
Index: netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.hpp
diff -u netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.hpp:1.5 
netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.hpp:1.6
--- netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.hpp:1.5 Tue Sep 16 
16:16:12 2003
+++ netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.hpp     Sun Nov  9 
08:43:30 2003
@@ -37,6 +37,7 @@
     static bool        show_enemy_radar_flag;
 
     static PIX player_unit_color;
+    static PIX selected_unit_color;
     static PIX allie_unit_color;
 
     static PIX player_objective_color;
@@ -79,6 +80,7 @@
     static void setShowEnemyRadar( float time );
 
     static void setProperties( PIX player_unit_color,
+                               PIX selected_unit_color,
                                PIX allie_unit_color,
                                PIX player_objective_color,
                                PIX allie_objective_color,
Index: netpanzer/src/NetPanzer/Interfaces/UnitInterface.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/UnitInterface.cpp:1.10 
netpanzer/src/NetPanzer/Interfaces/UnitInterface.cpp:1.11
--- netpanzer/src/NetPanzer/Interfaces/UnitInterface.cpp:1.10   Tue Sep 23 
08:14:04 2003
+++ netpanzer/src/NetPanzer/Interfaces/UnitInterface.cpp        Sun Nov  9 
08:43:30 2003
@@ -803,7 +803,7 @@
 
 // ******************************************************************
 
-bool UnitInterface::unitPositionEnumeration( iXY *position, unsigned char 
*unit_disposition, unsigned char *threat_level  )
+bool UnitInterface::unitPositionEnumeration( unsigned char *unit_disposition 
,UnitState **state )
 {
     UnitBase *unit_ptr;
 
@@ -828,8 +828,7 @@
                 *unit_disposition =  _unit_enemy;
             }
 
-        *position = unit_ptr->unit_state.location;
-        *threat_level = unit_ptr->unit_state.threat_level;
+        state[0]=&unit_ptr->unit_state;
         return( true );
     }
 
Index: netpanzer/src/NetPanzer/Interfaces/UnitInterface.hpp
diff -u netpanzer/src/NetPanzer/Interfaces/UnitInterface.hpp:1.5 
netpanzer/src/NetPanzer/Interfaces/UnitInterface.hpp:1.6
--- netpanzer/src/NetPanzer/Interfaces/UnitInterface.hpp:1.5    Tue Sep 16 
16:16:12 2003
+++ netpanzer/src/NetPanzer/Interfaces/UnitInterface.hpp        Sun Nov  9 
08:43:30 2003
@@ -176,7 +176,7 @@
 public:
     // Unit positions, almost exclusivly for mini map
     static void startUnitPositionEnumeration( void );
-    static bool unitPositionEnumeration( iXY *position, unsigned char 
*unit_disposition, unsigned char *threat_level );
+    static bool unitPositionEnumeration( unsigned char *unit_disposition, 
UnitState **state );
 
     static void resetUnitCycleIterator( unsigned long *iterator );
     static iXY unitPositionCycle( unsigned long *iterator );




reply via email to

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