Sfoglia il codice sorgente

Merge branch 'alpha40vertcolorCorrection' of https://github.com/Azaezel/Torque3D into Preview4_0

Areloch 6 anni fa
parent
commit
210009e498
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9 0
      Engine/source/gfx/gfxVertexColor.h

+ 9 - 0
Engine/source/gfx/gfxVertexColor.h

@@ -40,6 +40,7 @@ public:
 
    GFXVertexColor() : mPackedColorData( 0xFFFFFFFF ) {} // White with full alpha
    GFXVertexColor( const ColorI &color ) { set( color ); }
+   GFXVertexColor( const LinearColorF &color) { set(color); }
 
    void set( U8 red, U8 green, U8 blue, U8 alpha = 255 )
    {
@@ -57,7 +58,15 @@ public:
       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 LinearColorF &color ) { set(color); return *this; }
+
    operator const U32 *() const { return &mPackedColorData; }
    const U32& getPackedColorData() const { return mPackedColorData; }