mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 23:54:35 +00:00
from @rextimmy - linearcolor set and = operators
This commit is contained in:
parent
600859bd63
commit
4e984cfd40
1 changed files with 9 additions and 0 deletions
|
|
@ -40,6 +40,7 @@ public:
|
||||||
|
|
||||||
GFXVertexColor() : mPackedColorData( 0xFFFFFFFF ) {} // White with full alpha
|
GFXVertexColor() : mPackedColorData( 0xFFFFFFFF ) {} // White with full alpha
|
||||||
GFXVertexColor( const ColorI &color ) { set( color ); }
|
GFXVertexColor( const ColorI &color ) { set( color ); }
|
||||||
|
GFXVertexColor( const LinearColorF &color) { set(color); }
|
||||||
|
|
||||||
void set( U8 red, U8 green, U8 blue, U8 alpha = 255 )
|
void set( U8 red, U8 green, U8 blue, U8 alpha = 255 )
|
||||||
{
|
{
|
||||||
|
|
@ -57,7 +58,15 @@ public:
|
||||||
mDeviceSwizzle->InPlace(&mPackedColorData, sizeof(mPackedColorData));
|
mDeviceSwizzle->InPlace(&mPackedColorData, sizeof(mPackedColorData));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set(const LinearColorF &color)
|
||||||
|
{
|
||||||
|
mPackedColorData = color.getRGBAPack();
|
||||||
|
mDeviceSwizzle->InPlace(&mPackedColorData, sizeof(mPackedColorData));
|
||||||
|
}
|
||||||
|
|
||||||
GFXVertexColor &operator=( const ColorI &color ) { set( color ); return *this; }
|
GFXVertexColor &operator=( const ColorI &color ) { set( color ); return *this; }
|
||||||
|
GFXVertexColor &operator=( const LinearColorF &color ) { set(color); return *this; }
|
||||||
|
|
||||||
operator const U32 *() const { return &mPackedColorData; }
|
operator const U32 *() const { return &mPackedColorData; }
|
||||||
const U32& getPackedColorData() const { return mPackedColorData; }
|
const U32& getPackedColorData() const { return mPackedColorData; }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue