aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2010-04-28 22:24:11 +0000
committerMax Horn2010-04-28 22:24:11 +0000
commit76553e64182c3e508e112be7cce2e74a03f27512 (patch)
treedb080402efe5179aa4ab364eb574bbb46a09e3f0 /engines
parentc75ff0515e144ab4c6a1c5d55d65508b32b3ef4d (diff)
downloadscummvm-rg350-76553e64182c3e508e112be7cce2e74a03f27512.tar.gz
scummvm-rg350-76553e64182c3e508e112be7cce2e74a03f27512.tar.bz2
scummvm-rg350-76553e64182c3e508e112be7cce2e74a03f27512.zip
CINE: Get rid of some global constructor uses
svn-id: r48843
Diffstat (limited to 'engines')
-rw-r--r--engines/cine/gfx.cpp17
-rw-r--r--engines/cine/pal.cpp4
-rw-r--r--engines/cine/pal.h20
3 files changed, 20 insertions, 21 deletions
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index 9392636b39..b266b84647 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -40,6 +40,23 @@ namespace Cine {
byte *collisionPage;
FWRenderer *renderer = NULL;
+// Constants related to kLowPalFormat
+#define kLowPalBytesPerColor 2
+#define kLowPalNumColors 16
+#define kLowPalNumBytes ((kLowPalNumColors) * (kLowPalBytesPerColor))
+
+/** Low resolution (9-bit) color format used in Cine's 16-color modes. */
+#define kLowPalFormat Graphics::PixelFormat(kLowPalBytesPerColor, 3, 3, 3, 0, 8, 4, 0, 0)
+
+
+// Constants related to kHighPalFormat
+#define kHighPalBytesPerColor 3
+#define kHighPalNumColors 256
+#define kHighPalNumBytes ((kHighPalNumColors) * (kHighPalBytesPerColor))
+
+/** High resolution (24-bit) color format used in Cine's 256-color modes. */
+#define kHighPalFormat Graphics::PixelFormat(kHighPalBytesPerColor, 8, 8, 8, 0, 0, 8, 16, 0)
+
static const byte mouseCursorNormal[] = {
0x00, 0x00, 0x40, 0x00, 0x60, 0x00, 0x70, 0x00,
0x78, 0x00, 0x7C, 0x00, 0x7E, 0x00, 0x7F, 0x00,
diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp
index 6da121a0f2..6e730aedd9 100644
--- a/engines/cine/pal.cpp
+++ b/engines/cine/pal.cpp
@@ -186,7 +186,9 @@ const Graphics::PixelFormat &Palette::colorFormat() const {
void Palette::setGlobalOSystemPalette() const {
byte buf[256 * 4]; // Allocate space for the largest possible palette
- save(buf, sizeof(buf), Cine::kSystemPalFormat, CINE_LITTLE_ENDIAN);
+ // The color format used by OSystem's setPalette-function:
+ static const Graphics::PixelFormat kSystemPalFormat(4, 8, 8, 8, 0, 0, 8, 16, 0);
+ save(buf, sizeof(buf), kSystemPalFormat, CINE_LITTLE_ENDIAN);
if (g_cine->getPlatform() == Common::kPlatformAmiga && colorCount() == 16) {
// The Amiga version of Future Wars does use the upper 16 colors for a darkened
diff --git a/engines/cine/pal.h b/engines/cine/pal.h
index e5bb8db78f..0086711636 100644
--- a/engines/cine/pal.h
+++ b/engines/cine/pal.h
@@ -30,26 +30,6 @@
namespace Cine {
-// Constants related to kLowPalFormat
-#define kLowPalBytesPerColor 2
-#define kLowPalNumColors 16
-#define kLowPalNumBytes ((kLowPalNumColors) * (kLowPalBytesPerColor))
-
-/** Low resolution (9-bit) color format used in Cine's 16-color modes. */
-static const Graphics::PixelFormat kLowPalFormat(kLowPalBytesPerColor, 3, 3, 3, 0, 8, 4, 0, 0);
-
-
-// Constants related to kHighPalFormat
-#define kHighPalBytesPerColor 3
-#define kHighPalNumColors 256
-#define kHighPalNumBytes ((kHighPalNumColors) * (kHighPalBytesPerColor))
-
-/** High resolution (24-bit) color format used in Cine's 256-color modes. */
-static const Graphics::PixelFormat kHighPalFormat(kHighPalBytesPerColor, 8, 8, 8, 0, 0, 8, 16, 0);
-
-/** The color format used by OSystem's setPalette-function. */
-static const Graphics::PixelFormat kSystemPalFormat(4, 8, 8, 8, 0, 0, 8, 16, 0);
-
/**
* Endian types. Used at least by Palette class's load and save functions.
* TODO: Move somewhere more general as this is definitely not Cine-engine specific