aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2019-12-27 14:36:38 +0200
committerFilippos Karapetis2019-12-27 16:54:58 +0200
commitda9bd9a102dd1e8ea7e1b8c88500bb456b597e07 (patch)
treeb8c3f7d724bdc1a200bdc1b5bc7364a343df4931 /engines
parent9ebb737a06a1eb66d8106930b76c20958141d7ff (diff)
downloadscummvm-rg350-da9bd9a102dd1e8ea7e1b8c88500bb456b597e07.tar.gz
scummvm-rg350-da9bd9a102dd1e8ea7e1b8c88500bb456b597e07.tar.bz2
scummvm-rg350-da9bd9a102dd1e8ea7e1b8c88500bb456b597e07.zip
STARTREK: Simplify setBackgroundImage()
Diffstat (limited to 'engines')
-rw-r--r--engines/startrek/awaymission.cpp2
-rw-r--r--engines/startrek/graphics.cpp4
-rw-r--r--engines/startrek/graphics.h2
-rw-r--r--engines/startrek/intro.cpp2
-rw-r--r--engines/startrek/menu.cpp6
-rw-r--r--engines/startrek/rooms/demon4.cpp4
-rw-r--r--engines/startrek/rooms/demon6.cpp4
-rw-r--r--engines/startrek/startrek.cpp3
8 files changed, 13 insertions, 14 deletions
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 5db4f42248..3d3a273754 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -85,7 +85,7 @@ void StarTrekEngine::loadRoom(const Common::String &missionName, int roomIndex)
_gfx->fadeoutScreen();
_sound->stopAllVocSounds();
- _gfx->setBackgroundImage(_gfx->loadBitmap(getScreenName()));
+ _gfx->setBackgroundImage(getScreenName());
_gfx->loadPri(getScreenName());
_gfx->loadPalette("palette");
_gfx->copyBackgroundScreen();
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index e1073e2c50..c782bc5ed6 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -72,8 +72,8 @@ Graphics::~Graphics() {
delete _font;
}
-void Graphics::setBackgroundImage(Bitmap *bitmap) {
- _backgroundImage = SharedPtr<Bitmap>(bitmap);
+void Graphics::setBackgroundImage(Common::String imageName) {
+ _backgroundImage = SharedPtr<Bitmap>(loadBitmap(imageName));
}
void Graphics::drawBitmapToBackground(const Common::Rect &origRect, const Common::Rect &drawRect, Bitmap *bitmap) {
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 26a6798c8b..7b4bb06882 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -51,7 +51,7 @@ public:
Graphics(StarTrekEngine *vm);
~Graphics();
- void setBackgroundImage(Bitmap *bitmap);
+ void setBackgroundImage(Common::String imageName);
/**
* @param origRect The rectangle containing the original bitmap (must contain the
* whole bitmap, even if some is outside the drawable space)
diff --git a/engines/startrek/intro.cpp b/engines/startrek/intro.cpp
index fe4c6fa5c9..dd791cb747 100644
--- a/engines/startrek/intro.cpp
+++ b/engines/startrek/intro.cpp
@@ -45,7 +45,7 @@ void StarTrekEngine::playIntro() {
_gfx->clearScreenAndPriBuffer();
_gfx->fadeoutScreen();
_gfx->loadPalette("gold");
- _gfx->setBackgroundImage(_gfx->loadBitmap("goldlogo"));
+ _gfx->setBackgroundImage("goldlogo");
_sound->playVoc("logo");
_gfx->copyBackgroundScreen();
_system->updateScreen();
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index a46c717c96..72531c8554 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -1028,7 +1028,7 @@ void StarTrekEngine::showRepublicMap(int16 arg0, int16 turbolift) {
_gfx->pushSprites();
if (!_awayMission.veng.showedRepublicMapFirstTime) {
- _gfx->setBackgroundImage(_gfx->loadBitmap("veng9b"));
+ _gfx->setBackgroundImage("veng9b");
_gfx->copyBackgroundScreen();
_system->updateScreen();
_system->delayMillis(10);
@@ -1085,7 +1085,7 @@ void StarTrekEngine::showRepublicMap(int16 arg0, int16 turbolift) {
_gfx->fadeoutScreen();
}
- _gfx->setBackgroundImage(_gfx->loadBitmap("veng9"));
+ _gfx->setBackgroundImage("veng9");
_gfx->copyBackgroundScreen();
_system->updateScreen();
_system->delayMillis(10);
@@ -1171,7 +1171,7 @@ lclick:
_gfx->popSprites();
_gfx->loadPri(getScreenName());
- _gfx->setBackgroundImage(_gfx->loadBitmap(getScreenName()));
+ _gfx->setBackgroundImage(getScreenName());
_gfx->copyBackgroundScreen();
_system->updateScreen();
_system->delayMillis(10);
diff --git a/engines/startrek/rooms/demon4.cpp b/engines/startrek/rooms/demon4.cpp
index 30cfa729da..46ae5c8f4c 100644
--- a/engines/startrek/rooms/demon4.cpp
+++ b/engines/startrek/rooms/demon4.cpp
@@ -383,7 +383,7 @@ bool Room::demon4ShowSunPuzzle() {
_vm->_sound->stopAllVocSounds();
_vm->_gfx->pushSprites();
- _vm->_gfx->setBackgroundImage(_vm->_gfx->loadBitmap("machineb"));
+ _vm->_gfx->setBackgroundImage("machineb");
_vm->_gfx->copyBackgroundScreen();
_vm->_gfx->clearPri();
@@ -528,7 +528,7 @@ done:
_vm->_gfx->fadeoutScreen();
_vm->_gfx->popSprites();
_vm->_gfx->loadPri(_vm->getScreenName());
- _vm->_gfx->setBackgroundImage(_vm->_gfx->loadBitmap(_vm->getScreenName()));
+ _vm->_gfx->setBackgroundImage(_vm->getScreenName());
_vm->_gfx->copyBackgroundScreen();
_vm->_gfx->forceDrawAllSprites();
diff --git a/engines/startrek/rooms/demon6.cpp b/engines/startrek/rooms/demon6.cpp
index 8c35a70b43..38e274ef41 100644
--- a/engines/startrek/rooms/demon6.cpp
+++ b/engines/startrek/rooms/demon6.cpp
@@ -452,7 +452,7 @@ int Room::demon6ShowCase(int visible) {
_vm->_gfx->fadeoutScreen();
_vm->_gfx->pushSprites();
- _vm->_gfx->setBackgroundImage(_vm->_gfx->loadBitmap("stlcase"));
+ _vm->_gfx->setBackgroundImage("stlcase");
_vm->_gfx->copyBackgroundScreen();
_vm->_gfx->clearPri();
@@ -489,7 +489,7 @@ int Room::demon6ShowCase(int visible) {
_vm->_gfx->fadeoutScreen();
_vm->_gfx->popSprites();
_vm->_gfx->loadPri(_vm->getScreenName());
- _vm->_gfx->setBackgroundImage(_vm->_gfx->loadBitmap(_vm->getScreenName()));
+ _vm->_gfx->setBackgroundImage(_vm->getScreenName());
_vm->_gfx->copyBackgroundScreen();
_vm->_gfx->forceDrawAllSprites();
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 941052a65f..cd9ec63a34 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -274,8 +274,7 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
actorFunc1();
initActors();
- Bitmap *bgImage = _gfx->loadBitmap("transprt");
- _gfx->setBackgroundImage(bgImage);
+ _gfx->setBackgroundImage("transprt");
_gfx->clearPri();
_gfx->loadPalette("palette");
_gfx->copyBackgroundScreen();