forked from Mirrors/openclonk
Make a texture's average color able to be set externally
parent
26143ededc
commit
b6bcc0d36e
|
@ -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;
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue