aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwhiterandrek2018-06-03 14:29:40 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commit44efa90377afaf7131fab50ede322f95c7626e9f (patch)
tree956641a1312f543eb98591cbf739f7e521f8d152
parent83799edcba86d1f6dc553fb727072c3305f4cbd4 (diff)
downloadscummvm-rg350-44efa90377afaf7131fab50ede322f95c7626e9f.tar.gz
scummvm-rg350-44efa90377afaf7131fab50ede322f95c7626e9f.tar.bz2
scummvm-rg350-44efa90377afaf7131fab50ede322f95c7626e9f.zip
PINK: revised page initialization
-rw-r--r--engines/pink/objects/pages/game_page.cpp10
-rw-r--r--engines/pink/objects/pages/page.cpp12
-rw-r--r--engines/pink/objects/pages/page.h14
-rw-r--r--engines/pink/objects/pages/pda_page.cpp11
-rw-r--r--engines/pink/objects/pages/pda_page.h3
5 files changed, 21 insertions, 29 deletions
diff --git a/engines/pink/objects/pages/game_page.cpp b/engines/pink/objects/pages/game_page.cpp
index 4aa77cb2b6..5bd420c442 100644
--- a/engines/pink/objects/pages/game_page.cpp
+++ b/engines/pink/objects/pages/game_page.cpp
@@ -73,16 +73,12 @@ void GamePage::init(bool isLoadingSave) {
toConsole();
- for (uint j = 0; j < _actors.size(); ++j) {
- if (_actors[j]->initPallete(_module->getGame()->getDirector()))
- break;
- }
+ initPallete();
LeadActor::State state = _leadActor->getState();
- bool startNow = !(state == LeadActor::kInventory || state == LeadActor::kPDA);
-
+ bool paused = (state == LeadActor::kInventory || state == LeadActor::kPDA);
for (uint i = 0; i < _actors.size(); ++i) {
- _actors[i]->init(startNow);
+ _actors[i]->init(paused);
}
bool isHandler = false;
diff --git a/engines/pink/objects/pages/page.cpp b/engines/pink/objects/pages/page.cpp
index 844bd9462b..b7a210b82f 100644
--- a/engines/pink/objects/pages/page.cpp
+++ b/engines/pink/objects/pages/page.cpp
@@ -21,6 +21,7 @@
*/
#include "pink/director.h"
+#include "pink/pink.h"
#include "pink/objects/actors/lead_actor.h"
#include "pink/objects/pages/page.h"
@@ -63,11 +64,16 @@ void Page::toConsole() {
}
void Page::init() {
- LeadActor::State state = _leadActor->getState();
- bool unk = (state == LeadActor::kInventory || state == LeadActor::kPDA);
+ initPallete();
+ for (uint i = 0; i < _actors.size(); ++i) {
+ _actors[i]->init(0);
+ }
+}
+void Page::initPallete() {
for (uint i = 0; i < _actors.size(); ++i) {
- _actors[i]->init(unk);
+ if (_actors[i]->initPallete(getGame()->getDirector()))
+ break;
}
}
diff --git a/engines/pink/objects/pages/page.h b/engines/pink/objects/pages/page.h
index 2927f071ea..0ed16db2c8 100644
--- a/engines/pink/objects/pages/page.h
+++ b/engines/pink/objects/pages/page.h
@@ -40,6 +40,9 @@ public:
virtual void toConsole();
void load(Archive &archive);
+ void init();
+ void initPallete();
+
Actor *findActor(const Common::String &name);
LeadActor *getLeadActor();
@@ -51,15 +54,14 @@ public:
PinkEngine *getGame();
- virtual Sequencer *getSequencer() { return nullptr; };
- virtual WalkMgr *getWalkMgr() { return nullptr;};
- virtual Module *getModule() const { return nullptr; };
+ virtual Sequencer *getSequencer() { return nullptr; }
+ virtual WalkMgr *getWalkMgr() { return nullptr; }
+ virtual Module *getModule() const { return nullptr; }
- virtual bool checkValueOfVariable(const Common::String &variable, const Common::String &value) { return 0; };
- virtual void setVariable(Common::String &variable, Common::String &value) {};
+ virtual bool checkValueOfVariable(const Common::String &variable, const Common::String &value) { return 0; }
+ virtual void setVariable(Common::String &variable, Common::String &value) {}
protected:
- void init();
Array<Actor *> _actors;
ResourceMgr _resMgr;
diff --git a/engines/pink/objects/pages/pda_page.cpp b/engines/pink/objects/pages/pda_page.cpp
index 1b13c2afaf..f8d7e17bbf 100644
--- a/engines/pink/objects/pages/pda_page.cpp
+++ b/engines/pink/objects/pages/pda_page.cpp
@@ -41,17 +41,6 @@ Array<Actor *> PDAPage::takeActors() {
return actorsCopy;
}
-void PDAPage::init() {
- for (uint i = 0; i < _actors.size(); ++i) {
- if (_actors[i]->initPallete(_pdaMgr.getGame()->getDirector()))
- break;
- }
-
- for (uint i = 0; i < _actors.size(); ++i) {
- _actors[i]->init(0);
- }
-}
-
PDAPage::PDAPage(const Common::String &name, PDAMgr &pdaMgr)
: _pdaMgr(pdaMgr) {
_name = name;
diff --git a/engines/pink/objects/pages/pda_page.h b/engines/pink/objects/pages/pda_page.h
index f6cf2a5cf0..51b7a5e9ba 100644
--- a/engines/pink/objects/pages/pda_page.h
+++ b/engines/pink/objects/pages/pda_page.h
@@ -32,9 +32,8 @@ class PDAMgr;
class PDAPage : public Page {
public:
static PDAPage create(const Common::String &pageName, PDAMgr &pdaMgr);
-
Array<Actor *> takeActors();
- void init();
+
private:
PDAPage(const Common::String &name, PDAMgr &pdaMgr);
PDAMgr &_pdaMgr;