Default all unowned ColorByOwner objects to blue (#486)

Nicolas Hake 2010-11-15 12:22:08 +01:00
parent a70b36b0b5
commit 59594a9ef2
2 changed files with 3 additions and 1 deletions

View File

@ -286,6 +286,8 @@ bool C4Object::Init(C4PropList *pDef, C4Object *pCreator,
if (Def->ColorByOwner)
if (ValidPlr(Owner))
Color=::Players.Get(Owner)->ColorDw;
else
Color=0xff; // no-owner color: blue
// Shape & face
Shape=Def->Shape;

View File

@ -166,7 +166,7 @@ public:
IDirect3DSurface9 *GetSurface(); // get internal surface
#endif
bool GetSurfaceSize(int &irX, int &irY); // get surface size
void SetClr(DWORD toClr) { ClrByOwnerClr=toClr?toClr:0xff; }
void SetClr(DWORD toClr) { ClrByOwnerClr=toClr; }
DWORD GetClr() { return ClrByOwnerClr; }
bool CopyBytes(BYTE *pImageData); // assumes an array of wdt*hgt*bitdepth/8 and copies data directly from it
protected: