aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/bladerunner.cpp
diff options
context:
space:
mode:
authorPeter Kohaut2019-04-13 01:03:48 +0200
committerPeter Kohaut2019-04-17 22:51:18 +0200
commite86ee33999f33ad66bb7c018b4d4b7604b48badb (patch)
treefbc44cf5d597c7aaed1ee230bad4e5918ee92b4b /engines/bladerunner/bladerunner.cpp
parent955bf0c6694cca49e5031ec9866b343cc86f596d (diff)
downloadscummvm-rg350-e86ee33999f33ad66bb7c018b4d4b7604b48badb.tar.gz
scummvm-rg350-e86ee33999f33ad66bb7c018b4d4b7604b48badb.tar.bz2
scummvm-rg350-e86ee33999f33ad66bb7c018b4d4b7604b48badb.zip
BLADERUNNER: Abstraction from 555 pixel format
Removing hardcoded 555 pixel format to support Android
Diffstat (limited to 'engines/bladerunner/bladerunner.cpp')
-rw-r--r--engines/bladerunner/bladerunner.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 31aae35823..e8a22a8c04 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -302,7 +302,7 @@ void BladeRunnerEngine::pauseEngineIntern(bool pause) {
}
Common::Error BladeRunnerEngine::run() {
- Graphics::PixelFormat format = createRGB555();
+ Graphics::PixelFormat format = screenPixelForrmat();
initGraphics(640, 480, &format);
_system->showMouse(true);
@@ -375,8 +375,8 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
// This is the original startup in the game
- _surfaceFront.create(640, 480, createRGB555());
- _surfaceBack.create(640, 480, createRGB555());
+ _surfaceFront.create(640, 480, screenPixelForrmat());
+ _surfaceBack.create(640, 480, screenPixelForrmat());
_time = new Time(this);
@@ -535,7 +535,7 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
_scores = new Scores(this);
_mainFont = new Font(this);
- _mainFont->open("KIA6PT.FON", 640, 480, -1, 0, 0x252D);
+ _mainFont->open("KIA6PT.FON", 640, 480, -1, 0, _surfaceFront.format.RGBToColor(72, 72, 104));
_mainFont->setSpacing(1, 0);
for (int i = 0; i != 43; ++i) {
@@ -1874,7 +1874,7 @@ void BladeRunnerEngine::playerDied() {
_kia->open(kKIASectionLoad);
}
-bool BladeRunnerEngine::saveGame(Common::WriteStream &stream, const Graphics::Surface &thumbnail) {
+bool BladeRunnerEngine::saveGame(Common::WriteStream &stream, Graphics::Surface &thumbnail) {
if ( !_gameIsAutoSaving
&& ( !playerHasControl() || _sceneScript->isInsideScript() || _aiScripts->isInsideScript())
){
@@ -1884,6 +1884,7 @@ bool BladeRunnerEngine::saveGame(Common::WriteStream &stream, const Graphics::Su
Common::MemoryWriteStreamDynamic memoryStream(DisposeAfterUse::YES);
SaveFileWriteStream s(memoryStream);
+ thumbnail.convertToInPlace(gameDataPixelFormat());
s.write(thumbnail.getPixels(), SaveFileManager::kThumbnailSize);
s.writeFloat(1.0f);
_settings->save(s);
@@ -2080,7 +2081,7 @@ void BladeRunnerEngine::blitToScreen(const Graphics::Surface &src) const {
Graphics::Surface BladeRunnerEngine::generateThumbnail() const {
Graphics::Surface thumbnail;
- thumbnail.create(640 / 8, 480 / 8, createRGB555());
+ thumbnail.create(640 / 8, 480 / 8, _surfaceFront.format);
for (int y = 0; y < thumbnail.h; ++y) {
for (int x = 0; x < thumbnail.w; ++x) {