Make a texture's average color able to be set externally

scancodes-fix
Armin Burgmeier 2013-01-08 00:24:41 +01:00
parent 26143ededc
commit b6bcc0d36e
2 changed files with 3 additions and 2 deletions

View File

@ -162,11 +162,11 @@ bool C4TextureMap::AddTexture(const char *szTexture, C4Surface * sfcSurface)
avg_c[1] = static_cast<uint32_t>(avg_c[1] / Size + 0.5);
avg_c[2] = static_cast<uint32_t>(avg_c[2] / Size + 0.5);
avg_c[3] = static_cast<uint32_t>(avg_c[3] / Size + 0.5);
pTexture->AvgColor = avg_c[0] | (avg_c[1] << 8) | (avg_c[2] << 16) | (avg_c[3] << 24);
pTexture->SetAverageColor(avg_c[0] | (avg_c[1] << 8) | (avg_c[2] << 16) | (avg_c[3] << 24));
}
else
{
pTexture->AvgColor = 0x00000000;
pTexture->SetAverageColor(0x00000000);
}
return true;

View File

@ -36,6 +36,7 @@ public:
~C4Texture();
C4Surface * Surface32;
void SetAverageColor(uint32_t Color) { AvgColor = Color; }
uint32_t GetAverageColor() const { return AvgColor; }
protected:
char Name[C4M_MaxName+1];