aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicola Mettifogo2009-04-03 16:32:47 +0000
committerNicola Mettifogo2009-04-03 16:32:47 +0000
commit58df840a1353ab64c894a4205b45a517311a4648 (patch)
tree21175a14245ebeee912f4fe292583c8adca6a7c1
parent21ebc88b000d74cfcb6add52ae6053e553ced9e9 (diff)
downloadscummvm-rg350-58df840a1353ab64c894a4205b45a517311a4648.tar.gz
scummvm-rg350-58df840a1353ab64c894a4205b45a517311a4648.tar.bz2
scummvm-rg350-58df840a1353ab64c894a4205b45a517311a4648.zip
Moved Nippon Safes specific code from Parallaction to Parallaction_ns and adapted client code.
svn-id: r39813
-rw-r--r--engines/parallaction/gui_ns.cpp6
-rw-r--r--engines/parallaction/parallaction.cpp6
-rw-r--r--engines/parallaction/parallaction.h3
-rw-r--r--engines/parallaction/parallaction_ns.cpp12
-rw-r--r--engines/parallaction/parser_ns.cpp2
5 files changed, 12 insertions, 17 deletions
diff --git a/engines/parallaction/gui_ns.cpp b/engines/parallaction/gui_ns.cpp
index efa1c40309..6437e9f9bd 100644
--- a/engines/parallaction/gui_ns.cpp
+++ b/engines/parallaction/gui_ns.cpp
@@ -291,12 +291,12 @@ public:
class NewGameInputState_NS : public MenuInputState {
- Parallaction *_vm;
+ Parallaction_ns *_vm;
static const char *introMsg3[4];
public:
- NewGameInputState_NS(Parallaction *vm, MenuInputHelper *helper) : MenuInputState("newgame", helper), _vm(vm) {
+ NewGameInputState_NS(Parallaction_ns *vm, MenuInputHelper *helper) : MenuInputState("newgame", helper), _vm(vm) {
}
virtual MenuInputState* run() {
@@ -318,7 +318,7 @@ public:
}
virtual void enter() {
- _vm->setBackground("test", NULL, NULL);
+ _vm->changeBackground("test");
_vm->_input->setMouseState(MOUSE_ENABLED_HIDE);
uint id[4];
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index f7b4e226c4..fcd162f9a9 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -268,12 +268,6 @@ void Parallaction::showSlide(const char *name, int x, int y) {
}
-void Parallaction::setBackground(const char* name, const char* mask, const char* path) {
- BackgroundInfo *info = new BackgroundInfo;
- _disk->loadScenery(*info, name, mask, path);
- _gfx->setBackground(kBackgroundLocation, info);
-}
-
void Parallaction::showLocationComment(const Common::String &text, bool end) {
_balloonMan->setLocationBalloon(text.c_str(), end);
}
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index a4f11d3675..988a16a297 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -356,7 +356,6 @@ public:
bool pickupItem(ZonePtr z);
void updateDoor(ZonePtr z, bool close);
void showZone(ZonePtr z, bool visible);
- void setBackground(const char *background, const char *mask, const char *path);
void highlightInventoryItem(ItemPosition pos);
int16 getHoverInventoryItem(int16 x, int16 y);
int addInventoryItem(ItemName item);
@@ -406,7 +405,7 @@ public:
virtual void scheduleWalk(int16 x, int16 y, bool fromUser);
virtual DialogueManager *createDialogueManager(ZonePtr z);
- void switchBackground(const char* background, const char* mask);
+ void changeBackground(const char *background, const char *mask = 0, const char *path = 0);
private:
bool _inTestResult;
diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp
index 60644f7eba..364123e641 100644
--- a/engines/parallaction/parallaction_ns.cpp
+++ b/engines/parallaction/parallaction_ns.cpp
@@ -260,9 +260,7 @@ Common::Error Parallaction_ns::go() {
return Common::kNoError;
}
-void Parallaction_ns::switchBackground(const char* background, const char* mask) {
-// printf("switchBackground(%s)", name);
-
+void Parallaction_ns::changeBackground(const char* background, const char* mask, const char* path) {
Palette pal;
uint16 v2 = 0;
@@ -278,9 +276,13 @@ void Parallaction_ns::switchBackground(const char* background, const char* mask)
_gfx->updateScreen();
}
- setBackground(background, mask, mask);
+ if (path == 0) {
+ path = mask;
+ }
- return;
+ BackgroundInfo *info = new BackgroundInfo;
+ _disk->loadScenery(*info, background, mask, path);
+ _gfx->setBackground(kBackgroundLocation, info);
}
diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp
index 8739795741..9971828c31 100644
--- a/engines/parallaction/parser_ns.cpp
+++ b/engines/parallaction/parser_ns.cpp
@@ -918,7 +918,7 @@ DECLARE_LOCATION_PARSER(location) {
}
strcpy(_vm->_location._name, _tokens[1]);
- _vm->switchBackground(_vm->_location._name, mask);
+ _vm->changeBackground(_vm->_location._name, mask);
if (_tokens[2][0] != '\0') {
_vm->_char._ani->setX(atoi(_tokens[2]));