shift format data to an array

This commit is contained in:
Glenn Maynard
2004-09-05 23:17:47 +00:00
parent d990cc92f8
commit 1eaa2e1b56
2 changed files with 14 additions and 5 deletions
+8 -2
View File
@@ -38,12 +38,18 @@ int32_t RageSurfacePalette::FindClosestColor( const RageSurfaceColor &color ) co
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;
}
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) );
if( palette )
+6 -3
View File
@@ -32,9 +32,12 @@ struct RageSurfaceFormat
int32_t BytesPerPixel;
int32_t BitsPerPixel;
uint32_t Rmask, Gmask, Bmask, Amask;
uint32_t Rshift, Gshift, Bshift, Ashift;
uint8_t Rloss, Gloss, Bloss, Aloss;
uint32_t Mask[4];
uint32_t Shift[4];
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;
void GetRGB( uint32_t val, uint8_t *r, uint8_t *g, uint8_t *b ) const;