Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/TerritoryTexture.cpp
/* Copyright (C) 2017 Wildfire Games. | /* Copyright (C) 2018 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | void CTerritoryTexture::GenerateBitmap(const Grid<u8>& territories, u8* bitmap, ssize_t w, ssize_t h) | ||||
std::vector<CColor> colors; | std::vector<CColor> colors; | ||||
i32 numPlayers = cmpPlayerManager->GetNumPlayers(); | i32 numPlayers = cmpPlayerManager->GetNumPlayers(); | ||||
for (i32 p = 0; p < numPlayers; ++p) | for (i32 p = 0; p < numPlayers; ++p) | ||||
{ | { | ||||
CColor color(1, 0, 1, 1); | CColor color(1, 0, 1, 1); | ||||
CmpPtr<ICmpPlayer> cmpPlayer(m_Simulation, cmpPlayerManager->GetPlayerByID(p)); | CmpPtr<ICmpPlayer> cmpPlayer(m_Simulation, cmpPlayerManager->GetPlayerByID(p)); | ||||
if (cmpPlayer) | if (cmpPlayer) | ||||
color = cmpPlayer->GetColor(); | color = cmpPlayer->GetDisplayedColor(); | ||||
elexis: No more `->GetColor(` in the entire C++ code base except FCollada, so patch seems complete. | |||||
Not Done Inline Actions(I think the PlayerManager one is correct as is.) temple: (I think the PlayerManager one is correct as is.) | |||||
colors.push_back(color); | colors.push_back(color); | ||||
} | } | ||||
u8* p = bitmap; | u8* p = bitmap; | ||||
for (ssize_t j = 0; j < h; ++j) | for (ssize_t j = 0; j < h; ++j) | ||||
{ | { | ||||
for (ssize_t i = 0; i < w; ++i) | for (ssize_t i = 0; i < w; ++i) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
No more ->GetColor( in the entire C++ code base except FCollada, so patch seems complete.
Only 2 JS calls remaining.
The one new in the playermanager in rP20951 is only relevant for atlas and can use the displayedplayercolor, as that color should persist after having changed the civ. I couldn't get atlas to bug, but I think we might have to copy over the diplo properties too.