- Timestamp:
- 07/30/11 14:07:27 (13 years ago)
- File:
-
- 1 edited
-
ps/trunk/source/graphics/TerritoryTexture.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/source/graphics/TerritoryTexture.cpp
r9889 r9932 22 22 #include "graphics/Terrain.h" 23 23 #include "lib/bits.h" 24 #include "ps/Overlay.h" 24 25 #include "ps/Profile.h" 25 26 #include "renderer/Renderer.h" 26 27 #include "simulation2/Simulation2.h" 28 #include "simulation2/components/ICmpPlayer.h" 29 #include "simulation2/components/ICmpPlayerManager.h" 27 30 #include "simulation2/components/ICmpTerrain.h" 28 31 #include "simulation2/components/ICmpTerritoryManager.h" … … 172 175 int alphaFalloff = 0x20; 173 176 177 CmpPtr<ICmpPlayerManager> cmpPlayerManager(m_Simulation, SYSTEM_ENTITY); 178 174 179 u8* p = bitmap; 175 180 for (ssize_t j = 0; j < h; ++j) … … 178 183 { 179 184 u8 val = territories.get(i, j); 180 switch (val) 185 186 CColor color(1, 0, 1, 1); 187 if (!cmpPlayerManager.null()) 181 188 { 182 // TODO: use player colours or something 183 case 1: *p++ = 0x00; *p++ = 0x00; *p++ = 0xFF; break; 184 case 2: *p++ = 0x00; *p++ = 0xFF; *p++ = 0x00; break; 185 case 3: *p++ = 0xFF; *p++ = 0x00; *p++ = 0x00; break; 186 case 4: *p++ = 0x00; *p++ = 0xFF; *p++ = 0xFF; break; 187 case 5: *p++ = 0xFF; *p++ = 0xFF; *p++ = 0x00; break; 188 case 6: *p++ = 0xFF; *p++ = 0x00; *p++ = 0xFF; break; 189 default: *p++ = 0xFF; *p++ = 0xFF; *p++ = 0xFF; break; 189 CmpPtr<ICmpPlayer> cmpPlayer(m_Simulation, cmpPlayerManager->GetPlayerByID(val)); 190 if (!cmpPlayer.null()) 191 color = cmpPlayer->GetColour(); 190 192 } 193 194 *p++ = (int)(color.b*255.f); 195 *p++ = (int)(color.g*255.f); 196 *p++ = (int)(color.r*255.f); 191 197 192 198 if ((i > 0 && territories.get(i-1, j) != val)
Note:
See TracChangeset
for help on using the changeset viewer.
