From 1eaa2e1b561381c467e3995da58849e824b820dc Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 5 Sep 2004 23:17:47 +0000 Subject: [PATCH] shift format data to an array --- stepmania/src/RageSurface.cpp | 10 ++++++++-- stepmania/src/RageSurface.h | 9 ++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/stepmania/src/RageSurface.cpp b/stepmania/src/RageSurface.cpp index ff24553afa..10227d1d35 100644 --- a/stepmania/src/RageSurface.cpp +++ b/stepmania/src/RageSurface.cpp @@ -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 ) diff --git a/stepmania/src/RageSurface.h b/stepmania/src/RageSurface.h index 269c0f93ea..fabeaf62cf 100644 --- a/stepmania/src/RageSurface.h +++ b/stepmania/src/RageSurface.h @@ -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;