Ticket #1574: shallowsOnMinimap.patch
File shallowsOnMinimap.patch, 1.9 KB (added by , 12 years ago) |
---|
-
source/gui/MiniMap.h
77 77 78 78 // 1.f if map is circular or 1.414f if square (to shrink it inside the circle) 79 79 float m_MapScale; 80 81 // maximal water height to allow the passage of a unit (for underwater shallows). 82 float m_ShallowPassageHeight; 80 83 81 84 void DrawTexture(float coordMax, float angle, float x, float y, float x2, float y2, float z); 82 85 -
source/gui/MiniMap.cpp
41 41 #include "simulation2/Simulation2.h" 42 42 #include "simulation2/components/ICmpMinimap.h" 43 43 #include "simulation2/components/ICmpTerritoryManager.h" 44 #include "simulation2/components/ICmpTerritoryManager.h" 45 #include "simulation2/system/ParamNode.h" 44 46 45 47 bool g_GameRestarted = false; 46 48 … … 60 62 AddSetting(GUIST_CStr, "tooltip_style"); 61 63 m_Clicking = false; 62 64 m_MouseHovering = false; 65 66 // Get the maximum height for unit passage in water. 67 CParamNode externalParamNode; 68 CParamNode::LoadXML(externalParamNode, L"simulation/data/pathfinder.xml"); 69 const CParamNode pathingSettings = externalParamNode.GetChild("Pathfinder").GetChild("PassabilityClasses"); 70 m_ShallowPassageHeight = pathingSettings.GetChild("default").GetChild("MaxWaterDepth").ToFloat(); 63 71 } 64 72 65 73 CMiniMap::~CMiniMap() … … 498 506 + m_Terrain->GetVertexGroundLevel((int)i+1, (int)j+1) 499 507 ) / 4.0f; 500 508 501 if(avgHeight < waterHeight )509 if(avgHeight < waterHeight && avgHeight > waterHeight - m_ShallowPassageHeight) 502 510 { 511 // shallow water 512 *dataPtr++ = 0xff7098c0; 513 } else if (avgHeight < waterHeight) 514 { 503 515 // Set water as constant color for consistency on different maps 504 516 *dataPtr++ = 0xff5078a0; 505 517 }