shift format data to an array
This commit is contained in:
@@ -38,12 +38,18 @@ int32_t RageSurfacePalette::FindClosestColor( const RageSurfaceColor &color ) co
|
|||||||
return iBest;
|
return iBest;
|
||||||
}
|
}
|
||||||
|
|
||||||
RageSurfaceFormat::RageSurfaceFormat()
|
RageSurfaceFormat::RageSurfaceFormat():
|
||||||
|
Rmask(Mask[0]), Gmask(Mask[1]), Bmask(Mask[2]), Amask(Mask[3]),
|
||||||
|
Rshift(Shift[0]), Gshift(Shift[1]), Bshift(Shift[2]), Ashift(Shift[3]),
|
||||||
|
Rloss(Loss[0]), Gloss(Loss[1]), Bloss(Loss[2]), Aloss(Loss[3])
|
||||||
{
|
{
|
||||||
palette = NULL;
|
palette = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
RageSurfaceFormat::RageSurfaceFormat( const RageSurfaceFormat &cpy )
|
RageSurfaceFormat::RageSurfaceFormat( const RageSurfaceFormat &cpy ):
|
||||||
|
Rmask(Mask[0]), Gmask(Mask[1]), Bmask(Mask[2]), Amask(Mask[3]),
|
||||||
|
Rshift(Shift[0]), Gshift(Shift[1]), Bshift(Shift[2]), Ashift(Shift[3]),
|
||||||
|
Rloss(Loss[0]), Gloss(Loss[1]), Bloss(Loss[2]), Aloss(Loss[3])
|
||||||
{
|
{
|
||||||
memcpy( this, &cpy, sizeof(RageSurfaceFormat) );
|
memcpy( this, &cpy, sizeof(RageSurfaceFormat) );
|
||||||
if( palette )
|
if( palette )
|
||||||
|
|||||||
@@ -32,9 +32,12 @@ struct RageSurfaceFormat
|
|||||||
|
|
||||||
int32_t BytesPerPixel;
|
int32_t BytesPerPixel;
|
||||||
int32_t BitsPerPixel;
|
int32_t BitsPerPixel;
|
||||||
uint32_t Rmask, Gmask, Bmask, Amask;
|
uint32_t Mask[4];
|
||||||
uint32_t Rshift, Gshift, Bshift, Ashift;
|
uint32_t Shift[4];
|
||||||
uint8_t Rloss, Gloss, Bloss, Aloss;
|
uint8_t Loss[4];
|
||||||
|
uint32_t &Rmask, &Gmask, &Bmask, &Amask; /* deprecated */
|
||||||
|
uint32_t &Rshift, &Gshift, &Bshift, &Ashift; /* deprecated */
|
||||||
|
uint8_t &Rloss, &Gloss, &Bloss, &Aloss; /* deprecated */
|
||||||
RageSurfacePalette *palette;
|
RageSurfacePalette *palette;
|
||||||
|
|
||||||
void GetRGB( uint32_t val, uint8_t *r, uint8_t *g, uint8_t *b ) const;
|
void GetRGB( uint32_t val, uint8_t *r, uint8_t *g, uint8_t *b ) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user