diff options
author | Kari Salminen | 2009-03-28 17:04:46 +0000 |
---|---|---|
committer | Kari Salminen | 2009-03-28 17:04:46 +0000 |
commit | a329b64eccfafdddec562e5618e6fade971402a4 (patch) | |
tree | a2c4b55e6006dc1cb64747c51c000ccbd3f583b0 /engines/cine | |
parent | 2b7af654bdc66ac81cbf3e4218a2a4e1ab262330 (diff) | |
download | scummvm-rg350-a329b64eccfafdddec562e5618e6fade971402a4.tar.gz scummvm-rg350-a329b64eccfafdddec562e5618e6fade971402a4.tar.bz2 scummvm-rg350-a329b64eccfafdddec562e5618e6fade971402a4.zip |
Cine::Palette: Revamp palette constants so they can be used for e.g. allocating a constant sized byte buffer from stack.
svn-id: r39728
Diffstat (limited to 'engines/cine')
-rw-r--r-- | engines/cine/pal.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/engines/cine/pal.h b/engines/cine/pal.h index 9082bb3865..03c146a69d 100644 --- a/engines/cine/pal.h +++ b/engines/cine/pal.h @@ -30,15 +30,21 @@ namespace Cine { +// Constants related to kLowPalFormat +#define kLowPalBytesPerColor 2 +#define kLowPalNumColors 16 +#define kLowPalNumBytes ((kLowPalNumColors) * (kLowPalBytesPerColor)) + /*! \brief Low resolution (9-bit) color format used in Cine's 16-color modes. */ -static const Graphics::PixelFormat kLowPalFormat = {2, 5, 5, 5, 8, 8, 4, 0, 0}; -static const int kLowPalNumColors = 16; -static const int kLowPalNumBytes = kLowPalNumColors * kLowPalFormat.bytesPerPixel; +static const Graphics::PixelFormat kLowPalFormat = {kLowPalBytesPerColor, 5, 5, 5, 8, 8, 4, 0, 0}; + +// Constants related to kHighPalFormat +#define kHighPalBytesPerColor 3 +#define kHighPalNumColors 256 +#define kHighPalNumBytes ((kHighPalNumColors) * (kHighPalBytesPerColor)) /*! \brief High resolution (24-bit) color format used in Cine's 256-color modes. */ -static const Graphics::PixelFormat kHighPalFormat = {3, 0, 0, 0, 8, 0, 8, 16, 0}; -static const int kHighPalNumColors = 256; -static const int kHighPalNumBytes = kHighPalNumColors * kHighPalFormat.bytesPerPixel; +static const Graphics::PixelFormat kHighPalFormat = {kHighPalBytesPerColor, 0, 0, 0, 8, 0, 8, 16, 0}; /*! \brief The color format used by OSystem's setPalette-function. */ static const Graphics::PixelFormat kSystemPalFormat = {4, 0, 0, 0, 8, 0, 8, 16, 0}; |