aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner
diff options
context:
space:
mode:
authorThomas Fach-Pedersen2014-05-30 12:45:01 -0700
committerEugene Sandulenko2016-09-29 22:33:35 +0200
commit691d0f9888830699861a9406a4c5fc6bff5c5aef (patch)
tree0b7821dc782609b8e20265c3b1c6c068ccb4dcfa /engines/bladerunner
parent5a12394a763b569977c697dca0ec8e1e428b6db4 (diff)
downloadscummvm-rg350-691d0f9888830699861a9406a4c5fc6bff5c5aef.tar.gz
scummvm-rg350-691d0f9888830699861a9406a4c5fc6bff5c5aef.tar.bz2
scummvm-rg350-691d0f9888830699861a9406a4c5fc6bff5c5aef.zip
BLADERUNNER: Avoid global constructor for pixelformat
Diffstat (limited to 'engines/bladerunner')
-rw-r--r--engines/bladerunner/bladerunner.cpp5
-rw-r--r--engines/bladerunner/bladerunner.h7
-rw-r--r--engines/bladerunner/vqa_decoder.cpp2
3 files changed, 9 insertions, 5 deletions
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 6f6b2f259b..b8bfce98b4 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -58,7 +58,8 @@ bool BladeRunnerEngine::hasFeature(EngineFeature f) const {
}
Common::Error BladeRunnerEngine::run() {
- initGraphics(640, 480, true, &RGB555);
+ Graphics::PixelFormat format = createRGB555();
+ initGraphics(640, 480, true, &format);
if (!startup())
return Common::Error(Common::kUnknownError, "Failed to initialize resources");
@@ -78,7 +79,7 @@ Common::Error BladeRunnerEngine::run() {
bool BladeRunnerEngine::startup() {
bool r;
- _surface1.create(640, 480, RGB555);
+ _surface1.create(640, 480, createRGB555());
r = openArchive("STARTUP.MIX");
if (!r)
diff --git a/engines/bladerunner/bladerunner.h b/engines/bladerunner/bladerunner.h
index 5a02d94b11..353a003641 100644
--- a/engines/bladerunner/bladerunner.h
+++ b/engines/bladerunner/bladerunner.h
@@ -35,8 +35,6 @@
namespace BladeRunner {
-const Graphics::PixelFormat RGB555(2, 5, 5, 5, 0, 10, 5, 0, 0);
-
class Chapters;
class Scene;
class Script;
@@ -91,6 +89,11 @@ public:
void ISez(const char *str);
};
+static inline
+const Graphics::PixelFormat createRGB555() {
+ return Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
+}
+
} // End of namespace BladeRunner
#endif
diff --git a/engines/bladerunner/vqa_decoder.cpp b/engines/bladerunner/vqa_decoder.cpp
index 345fc2cc4d..ba30e73ee4 100644
--- a/engines/bladerunner/vqa_decoder.cpp
+++ b/engines/bladerunner/vqa_decoder.cpp
@@ -550,7 +550,7 @@ VQADecoder::VQAVideoTrack::VQAVideoTrack(VQADecoder *vqaDecoder) {
_zbufChunk = new uint8[roundup(_maxZBUFChunkSize)];
_surface = new Graphics::Surface();
- _surface->create(_width, _height, RGB555);
+ _surface->create(_width, _height, createRGB555());
}
VQADecoder::VQAVideoTrack::~VQAVideoTrack() {