aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/pink/archive.cpp4
-rw-r--r--engines/pink/archive.h4
-rw-r--r--engines/pink/cursor_mgr.cpp6
-rw-r--r--engines/pink/cursor_mgr.h2
-rw-r--r--engines/pink/file.cpp4
-rw-r--r--engines/pink/file.h2
-rw-r--r--engines/pink/objects/actions/action.cpp3
-rw-r--r--engines/pink/objects/actions/action.h2
-rw-r--r--engines/pink/objects/actions/action_cel.cpp8
-rw-r--r--engines/pink/objects/actions/action_cel.h4
-rw-r--r--engines/pink/objects/actors/actor.cpp53
-rw-r--r--engines/pink/objects/actors/actor.h26
-rw-r--r--engines/pink/objects/actors/lead_actor.cpp6
-rw-r--r--engines/pink/objects/actors/lead_actor.h4
-rw-r--r--engines/pink/objects/handlers/handler.cpp2
-rw-r--r--engines/pink/objects/handlers/handler_timer.cpp2
-rw-r--r--engines/pink/objects/inventory.cpp12
-rw-r--r--engines/pink/objects/inventory.h9
-rw-r--r--engines/pink/objects/module.cpp12
-rw-r--r--engines/pink/objects/module.h8
-rw-r--r--engines/pink/objects/object.cpp21
-rw-r--r--engines/pink/objects/object.h18
-rw-r--r--engines/pink/objects/pages/game_page.cpp12
-rw-r--r--engines/pink/objects/pages/game_page.h6
-rw-r--r--engines/pink/objects/pages/page.cpp13
-rw-r--r--engines/pink/objects/pages/page.h8
-rw-r--r--engines/pink/objects/sequences/sequence.cpp8
-rw-r--r--engines/pink/objects/sequences/sequence.h4
-rw-r--r--engines/pink/objects/sequences/sequence_context.cpp16
-rw-r--r--engines/pink/objects/sequences/sequence_context.h8
-rw-r--r--engines/pink/objects/sequences/sequence_item.cpp12
-rw-r--r--engines/pink/objects/sequences/sequence_item.h8
-rw-r--r--engines/pink/pda_mgr.cpp23
-rw-r--r--engines/pink/pda_mgr.h10
-rw-r--r--engines/pink/pink.cpp13
-rw-r--r--engines/pink/pink.h7
-rw-r--r--engines/pink/resource_mgr.cpp4
-rw-r--r--engines/pink/resource_mgr.h2
-rw-r--r--engines/pink/utils.h2
39 files changed, 70 insertions, 298 deletions
diff --git a/engines/pink/archive.cpp b/engines/pink/archive.cpp
index 13b2008b74..c5737ba840 100644
--- a/engines/pink/archive.cpp
+++ b/engines/pink/archive.cpp
@@ -231,8 +231,10 @@ void Archive::mapObject(Object *obj) {
int Archive::readCount() {
int count = _readStream->readUint16LE();
- if (count == 0xffff)
+ if (count == 0xffff) {
+ assert(0);
count = _readStream->readUint32LE();
+ }
return count;
}
diff --git a/engines/pink/archive.h b/engines/pink/archive.h
index 2f32388c43..ad51819963 100644
--- a/engines/pink/archive.h
+++ b/engines/pink/archive.h
@@ -27,8 +27,6 @@
#include "common/str-array.h"
#include "common/stream.h"
-#include "pink/objects/object.h"
-
namespace Common {
class File;
@@ -37,6 +35,8 @@ class File;
namespace Pink {
+class Object;
+
class Archive {
public:
Archive(Common::SeekableReadStream *stream);
diff --git a/engines/pink/cursor_mgr.cpp b/engines/pink/cursor_mgr.cpp
index 379d46912c..99febcdc8a 100644
--- a/engines/pink/cursor_mgr.cpp
+++ b/engines/pink/cursor_mgr.cpp
@@ -99,7 +99,7 @@ void CursorMgr::setCursor(const Common::String &cursorName, const Common::Point
void CursorMgr::hideItem() {
if (_actor)
- _actor->hide();
+ _actor->setAction(kHideAction);
}
void CursorMgr::startAnimation(int index) {
@@ -112,8 +112,4 @@ void CursorMgr::startAnimation(int index) {
}
}
-void CursorMgr::setPage(Page *page) {
- _page = page;
-}
-
} // End of namespace Pink
diff --git a/engines/pink/cursor_mgr.h b/engines/pink/cursor_mgr.h
index 391fcd3bb6..d7f17bb429 100644
--- a/engines/pink/cursor_mgr.h
+++ b/engines/pink/cursor_mgr.h
@@ -44,7 +44,7 @@ public:
void setCursor(uint index, const Common::Point point, const Common::String &itemName);
void setCursor(const Common::String &cursorName, const Common::Point point);
- void setPage(Page *page);
+ void setPage(Page *page) { _page = page; }
private:
void hideItem();
diff --git a/engines/pink/file.cpp b/engines/pink/file.cpp
index 9646961b57..861ffc4948 100644
--- a/engines/pink/file.cpp
+++ b/engines/pink/file.cpp
@@ -126,10 +126,6 @@ ResourceDescription *OrbFile::getResDescTable(ObjectDescription *objDesc){
return table;
}
-uint32 OrbFile::getTimestamp() {
- return _timestamp;
-}
-
void OrbFile::seekToObject(const char *name) {
ObjectDescription *desc = getObjDesc(name);
seek(desc->objectsOffset);
diff --git a/engines/pink/file.h b/engines/pink/file.h
index d124eb205d..80b7ec6f44 100644
--- a/engines/pink/file.h
+++ b/engines/pink/file.h
@@ -64,7 +64,7 @@ public:
ResourceDescription *getResDescTable(ObjectDescription *objDesc);
- uint32 getTimestamp();
+ uint32 getTimestamp() { return _timestamp; }
private:
void seekToObject(const char *name);
diff --git a/engines/pink/objects/actions/action.cpp b/engines/pink/objects/actions/action.cpp
index 107cff5eeb..24233ad253 100644
--- a/engines/pink/objects/actions/action.cpp
+++ b/engines/pink/objects/actions/action.cpp
@@ -41,8 +41,5 @@ Coordinates Action::getCoordinates() {
return Coordinates();
}
-Actor *Action::getActor() const {
- return _actor;
-}
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action.h b/engines/pink/objects/actions/action.h
index a6e36dbf20..e3b4416a3d 100644
--- a/engines/pink/objects/actions/action.h
+++ b/engines/pink/objects/actions/action.h
@@ -43,7 +43,7 @@ public:
virtual void pause(bool paused);
virtual Coordinates getCoordinates();
- Actor *getActor() const;
+ Actor *getActor() const { return _actor; }
protected:
Actor *_actor;
diff --git a/engines/pink/objects/actions/action_cel.cpp b/engines/pink/objects/actions/action_cel.cpp
index 4b03f68739..7efd0778c4 100644
--- a/engines/pink/objects/actions/action_cel.cpp
+++ b/engines/pink/objects/actions/action_cel.cpp
@@ -82,14 +82,6 @@ void ActionCEL::pause(bool paused) {
_decoder->pauseVideo(paused);
}
-uint32 ActionCEL::getZ() {
- return _z;
-}
-
-CelDecoder *ActionCEL::getDecoder() {
- return _decoder;
-}
-
Coordinates ActionCEL::getCoordinates() {
if (!_decoder)
_decoder = _actor->getPage()->loadCel(_fileName);
diff --git a/engines/pink/objects/actions/action_cel.h b/engines/pink/objects/actions/action_cel.h
index 355323da45..c67623ac47 100644
--- a/engines/pink/objects/actions/action_cel.h
+++ b/engines/pink/objects/actions/action_cel.h
@@ -47,8 +47,8 @@ public:
Coordinates getCoordinates() override;
- uint32 getZ();
- CelDecoder *getDecoder();
+ uint32 getZ() { return _z; }
+ CelDecoder *getDecoder() { return _decoder; }
protected:
virtual void onStart() = 0;
diff --git a/engines/pink/objects/actors/actor.cpp b/engines/pink/objects/actors/actor.cpp
index fe44728df0..25e2a85a0a 100644
--- a/engines/pink/objects/actors/actor.cpp
+++ b/engines/pink/objects/actors/actor.cpp
@@ -86,31 +86,11 @@ void Actor::toConsole() {
}
}
-bool Actor::isPlaying() {
- return !_isActionEnded;
-}
-
void Actor::pause(bool paused) {
if (_action)
_action->pause(paused);
}
-void Actor::hide() {
- setAction(kHideAction);
-}
-
-void Actor::endAction() {
- _isActionEnded = 1;
-}
-
-bool Actor::isLeftClickHandlers() {
- return false;
-}
-
-bool Actor::isUseClickHandlers(InventoryItem *item) {
- return false;
-}
-
void Actor::onMouseOver(const Common::Point point, CursorMgr *mgr) {
mgr->setCursor(kDefaultCursor, point, Common::String());
}
@@ -119,18 +99,6 @@ void Actor::onHover(const Common::Point point, const Common::String &itemName, C
cursorMgr->setCursor(kHoldingItemCursor, point, itemName);
}
-void Actor::onClick() {}
-
-void Actor::onTimerMessage() {}
-
-bool Actor::onLeftClickMessage() {
- return false;
-}
-
-bool Actor::onUseClickMessage(InventoryItem *item, InventoryMgr *mgr) {
- return false;
-}
-
Action *Actor::findAction(const Common::String &name) {
for (uint i = 0; i < _actions.size(); ++i) {
if (_actions[i]->getName() == name)
@@ -139,28 +107,11 @@ Action *Actor::findAction(const Common::String &name) {
return nullptr;
}
-Action *Actor::getAction() const {
- return _action;
-}
-
-Page *Actor::getPage() const {
- return _page;
-}
-
-Sequencer *Actor::getSequencer() const {
- return _page->getSequencer();
-}
-
const Common::String &Actor::getLocation() const {
static const Common::String empty;
return empty;
}
-void Actor::setAction(const Common::String &name) {
- Action *newAction = findAction(name);
- setAction(newAction);
-}
-
void Actor::setAction(Action *newAction) {
if (_action) {
_isActionEnded = 1;
@@ -183,8 +134,4 @@ void Actor::setAction(Action *newAction, bool unk) {
}
}
-void Actor::setPage(Page *page) {
- _page = page;
-}
-
} // End of namespace Pink
diff --git a/engines/pink/objects/actors/actor.h b/engines/pink/objects/actors/actor.h
index 6a4d19c117..2d42f37705 100644
--- a/engines/pink/objects/actors/actor.h
+++ b/engines/pink/objects/actors/actor.h
@@ -52,37 +52,35 @@ public:
void toConsole() override ;
- bool isPlaying();
+ bool isPlaying() { return !_isActionEnded; }
virtual void pause(bool paused);
- void hide();
- void endAction();
+ void endAction() { _isActionEnded = true; }
- virtual bool isLeftClickHandlers();
- virtual bool isUseClickHandlers(InventoryItem *item);
+ virtual bool isLeftClickHandlers() { return false; }
+ virtual bool isUseClickHandlers(InventoryItem *item) { return false; }
virtual void onMouseOver(const Common::Point point, CursorMgr *mgr);
virtual void onHover(const Common::Point point, const Common::String &itemName, CursorMgr *cursorMgr);
- virtual void onClick();
+ virtual void onClick() {}
- virtual void onTimerMessage();
- virtual bool onLeftClickMessage();
- virtual bool onUseClickMessage(InventoryItem *item, InventoryMgr *mgr);
+ virtual void onTimerMessage() {}
+ virtual bool onLeftClickMessage() { return false; }
+ virtual bool onUseClickMessage(InventoryItem *item, InventoryMgr *mgr) { return false; }
Action *findAction(const Common::String &name);
- Action *getAction() const;
- Page *getPage() const;
- Sequencer *getSequencer() const;
+ Action *getAction() const { return _action; }
+ Page *getPage() const { return _page; }
virtual const Common::String &getLocation() const;
- void setAction(const Common::String &name);
+ void setAction(const Common::String &name) { setAction(findAction(name)); }
void setAction(Action *newAction);
void setAction(Action *newAction, bool unk);
- void setPage(Page *page);
+ void setPage(Page *page) { _page = page;}
protected:
Page *_page;
diff --git a/engines/pink/objects/actors/lead_actor.cpp b/engines/pink/objects/actors/lead_actor.cpp
index 96f6226a6b..c4e41b12c8 100644
--- a/engines/pink/objects/actors/lead_actor.cpp
+++ b/engines/pink/objects/actors/lead_actor.cpp
@@ -284,8 +284,6 @@ void LeadActor::onClick() {
}
}
-void LeadActor::onVariableSet() {}
-
void LeadActor::onInventoryClosed(bool isItemClicked) {
_isHaveItem = isItemClicked;
_state = _stateCopy;
@@ -329,10 +327,6 @@ void LeadActor::setNextExecutors(const Common::String &nextModule, const Common:
}
}
-LeadActor::State LeadActor::getState() const {
- return _state;
-}
-
void LeadActor::forceUpdateCursor() {
const Common::Point point = _page->getGame()->getEventManager()->getMousePos();
updateCursor(point);
diff --git a/engines/pink/objects/actors/lead_actor.h b/engines/pink/objects/actors/lead_actor.h
index 5428d48e91..5b2ea70b7c 100644
--- a/engines/pink/objects/actors/lead_actor.h
+++ b/engines/pink/objects/actors/lead_actor.h
@@ -76,7 +76,7 @@ public:
void onMouseOver(const Common::Point point, CursorMgr *mgr) override;
virtual void onClick();
- virtual void onVariableSet();
+ virtual void onVariableSet() {}
void onInventoryClosed(bool isItemClicked);
void onWalkEnd();
void onPDAClose();
@@ -85,7 +85,7 @@ public:
void setNextExecutors (const Common::String &nextModule, const Common::String &nextPage);
- State getState() const;
+ State getState() const { return _state; }
protected:
void forceUpdateCursor();
diff --git a/engines/pink/objects/handlers/handler.cpp b/engines/pink/objects/handlers/handler.cpp
index f27b79a5de..019d349527 100644
--- a/engines/pink/objects/handlers/handler.cpp
+++ b/engines/pink/objects/handlers/handler.cpp
@@ -71,7 +71,7 @@ void HandlerSequences::deserialize(Archive &archive) {
void HandlerSequences::handle(Actor *actor) {
Handler::handle(actor);
- Sequencer *sequencer = actor->getSequencer();
+ Sequencer *sequencer = actor->getPage()->getSequencer();
assert(!_sequences.empty());
diff --git a/engines/pink/objects/handlers/handler_timer.cpp b/engines/pink/objects/handlers/handler_timer.cpp
index 57d217913e..46d3d579e4 100644
--- a/engines/pink/objects/handlers/handler_timer.cpp
+++ b/engines/pink/objects/handlers/handler_timer.cpp
@@ -95,7 +95,7 @@ void HandlerTimerSequences::toConsole() {
void HandlerTimerSequences::handle(Actor *actor) {
Handler::handle(actor);
- Sequencer *sequencer = actor->getSequencer();
+ Sequencer *sequencer = actor->getPage()->getSequencer();
assert(!_sequences.empty());
diff --git a/engines/pink/objects/inventory.cpp b/engines/pink/objects/inventory.cpp
index 4836880ec5..2082869232 100644
--- a/engines/pink/objects/inventory.cpp
+++ b/engines/pink/objects/inventory.cpp
@@ -41,10 +41,6 @@ void Pink::InventoryItem::deserialize(Archive &archive) {
_currentOwner = _initialOwner;
}
-Common::String &InventoryItem::getCurrentOwner() {
- return _currentOwner;
-}
-
void InventoryItem::toConsole() {
debug("\tInventoryItem: _initialOwner=%s _currentOwner=%s", _initialOwner.c_str(), _currentOwner.c_str());
}
@@ -68,10 +64,6 @@ InventoryItem *InventoryMgr::findInventoryItem(const Common::String &name) {
return nullptr;
}
-void InventoryMgr::setLeadActor(LeadActor *lead) {
- _lead = lead;
-}
-
void InventoryMgr::toConsole() {
debug("InventoryMgr:");
for (uint i = 0; i < _items.size(); ++i) {
@@ -195,10 +187,6 @@ void InventoryMgr::showNextItem(bool direction) {
}
}
-InventoryItem *InventoryMgr::getCurrentItem() {
- return _item;
-}
-
void InventoryMgr::loadState(Archive &archive) {
_state = (State) archive.readByte();
_isClickedOnItem = archive.readByte();
diff --git a/engines/pink/objects/inventory.h b/engines/pink/objects/inventory.h
index 104a8e80cb..836aa7f8a3 100644
--- a/engines/pink/objects/inventory.h
+++ b/engines/pink/objects/inventory.h
@@ -35,7 +35,7 @@ public:
virtual void toConsole();
- Common::String &getCurrentOwner();
+ const Common::String &getCurrentOwner() { return _currentOwner; }
friend class InventoryMgr;
private:
@@ -61,13 +61,13 @@ public:
bool start(bool playOpening);
- void setLeadActor(LeadActor *lead);
+ void setLeadActor(LeadActor *lead) { _lead = lead; }
InventoryItem* findInventoryItem(const Common::String &name);
bool isPinkOwnsAnyItems();
void setItemOwner(const Common::String &owner, InventoryItem *item);
- InventoryItem *getCurrentItem();
+ InventoryItem *getCurrentItem() { return _item; }
private:
void close();
@@ -77,9 +77,6 @@ private:
};
void showNextItem(bool direction);
-
-
-
LeadActor *_lead;
Actor *_window;
Actor *_itemActor;
diff --git a/engines/pink/objects/module.cpp b/engines/pink/objects/module.cpp
index a09e202fb3..30a1ae01be 100644
--- a/engines/pink/objects/module.cpp
+++ b/engines/pink/objects/module.cpp
@@ -82,24 +82,12 @@ GamePage *Module::findPage(const Common::String &pageName) const {
return nullptr;
}
-PinkEngine *Module::getGame() const {
- return _game;
-}
-
bool Module::checkValueOfVariable(Common::String &variable, Common::String &value) {
if (!_variables.contains(variable))
return value == kUndefined;
return _variables[variable] == value;
}
-void Module::setVariable(Common::String &variable, Common::String &value) {
- _variables[variable] = value;
-}
-
-InventoryMgr *Module::getInventoryMgr() {
- return &_invMgr;
-}
-
void Module::loadState(Archive &archive) {
_invMgr.loadState(archive);
_variables.deserialize(archive);
diff --git a/engines/pink/objects/module.h b/engines/pink/objects/module.h
index 084fb19e93..819c19dc3d 100644
--- a/engines/pink/objects/module.h
+++ b/engines/pink/objects/module.h
@@ -57,13 +57,13 @@ public:
void onMouseMove();
void onKeyboardButtonClick();
- PinkEngine *getGame() const;
- InventoryMgr *getInventoryMgr();
+ PinkEngine *getGame() const { return _game; }
+ InventoryMgr *getInventoryMgr() { return &_invMgr; }
bool checkValueOfVariable(Common::String &variable, Common::String &value);
- void setVariable(Common::String &variable, Common::String &value);
+ void setVariable(Common::String &variable, Common::String &value) { _variables[variable] = value; }
- GamePage *getPage() { return _page; };
+ GamePage *getPage() { return _page; }
private:
GamePage *findPage(const Common::String &pageName) const;
diff --git a/engines/pink/objects/object.cpp b/engines/pink/objects/object.cpp
index 0218cb70c8..570587dea9 100644
--- a/engines/pink/objects/object.cpp
+++ b/engines/pink/objects/object.cpp
@@ -20,33 +20,14 @@
*
*/
-#include "common/debug.h"
-
-#include "pink/archive.h"
+#include "pink/objects/object.h"
namespace Pink {
-Object::~Object() {}
-
void Object::load(Archive &) {}
void Object::deserialize(Archive &) {}
-void Object::init() {}
-
void Object::toConsole() {}
-NamedObject::NamedObject() {}
-
-NamedObject::NamedObject(const Common::String &name)
- : _name(name) {}
-
-void NamedObject::deserialize(Archive &archive) {
- _name = archive.readString();
-}
-
-const Common::String &NamedObject::getName() const {
- return _name;
-}
-
} // End of namespace Pink
diff --git a/engines/pink/objects/object.h b/engines/pink/objects/object.h
index 3f331f2f4b..7e90c05f4d 100644
--- a/engines/pink/objects/object.h
+++ b/engines/pink/objects/object.h
@@ -25,30 +25,28 @@
#include "common/str.h"
-namespace Pink {
+#include "pink/archive.h"
-class Archive;
+namespace Pink {
class Object {
public:
- virtual ~Object();
+ virtual ~Object() {};
virtual void load(Archive &);
virtual void deserialize(Archive &);
-
- virtual void init();
-
virtual void toConsole();
};
class NamedObject : public Object {
public:
- NamedObject();
- NamedObject(const Common::String &name);
+ NamedObject() {}
+ NamedObject(const Common::String &name)
+ : _name(name) {}
- void deserialize(Archive &archive);
+ void deserialize(Archive &archive) { _name = archive.readString(); }
- const Common::String &getName() const;
+ const Common::String &getName() const { return _name; }
protected:
Common::String _name;
diff --git a/engines/pink/objects/pages/game_page.cpp b/engines/pink/objects/pages/game_page.cpp
index 8ab1b0a077..35961164df 100644
--- a/engines/pink/objects/pages/game_page.cpp
+++ b/engines/pink/objects/pages/game_page.cpp
@@ -116,14 +116,6 @@ void GamePage::loadManagers() {
}
}
-Sequencer *GamePage::getSequencer() {
- return _sequencer;
-}
-
-Module *GamePage::getModule() const {
- return _module;
-}
-
bool GamePage::checkValueOfVariable(const Common::String &variable, const Common::String &value) {
if (!_variables.contains(variable))
return value == kUndefined;
@@ -135,10 +127,6 @@ void GamePage::setVariable(Common::String &variable, Common::String &value) {
_leadActor->onVariableSet();
}
-WalkMgr *GamePage::getWalkMgr() {
- return _walkMgr;
-}
-
void GamePage::loadStateFromMem() {
Archive archive(static_cast<Common::SeekableReadStream*>(_memFile));
_variables.deserialize(archive);
diff --git a/engines/pink/objects/pages/game_page.h b/engines/pink/objects/pages/game_page.h
index 3cd537d077..81d4686d1a 100644
--- a/engines/pink/objects/pages/game_page.h
+++ b/engines/pink/objects/pages/game_page.h
@@ -47,9 +47,9 @@ public:
void loadManagers();
void init(bool isLoadingSave);
- Sequencer *getSequencer();
- WalkMgr *getWalkMgr();
- Module *getModule() const;
+ Sequencer *getSequencer() { return _sequencer; }
+ WalkMgr *getWalkMgr() { return _walkMgr; }
+ Module *getModule() { return _module; }
bool checkValueOfVariable(const Common::String &variable, const Common::String &value);
void setVariable(Common::String &variable, Common::String &value);
diff --git a/engines/pink/objects/pages/page.cpp b/engines/pink/objects/pages/page.cpp
index bb93d17f93..c15d3dbae9 100644
--- a/engines/pink/objects/pages/page.cpp
+++ b/engines/pink/objects/pages/page.cpp
@@ -47,11 +47,6 @@ Actor *Page::findActor(const Common::String &name) {
return nullptr;
}
-
-CelDecoder *Page::loadCel(Common::String &fileName) {
- return _resMgr.loadCEL(fileName);
-}
-
void Page::toConsole() {
for (uint i = 0; i < _actors.size(); ++i) {
_actors[i]->toConsole();
@@ -72,10 +67,6 @@ void Page::initPallete() {
}
}
-LeadActor *Page::getLeadActor() {
- return _leadActor;
-}
-
void Page::clear() {
for (uint i = 0; i < _actors.size(); ++i) {
delete _actors[i];
@@ -90,8 +81,4 @@ void Page::pause(bool paused) {
}
}
-PinkEngine *Page::getGame() {
- return _resMgr.getGame();
-}
-
} // End of namespace Pink
diff --git a/engines/pink/objects/pages/page.h b/engines/pink/objects/pages/page.h
index 9ccfe20166..bda4c147fa 100644
--- a/engines/pink/objects/pages/page.h
+++ b/engines/pink/objects/pages/page.h
@@ -44,19 +44,19 @@ public:
void initPallete();
Actor *findActor(const Common::String &name);
- LeadActor *getLeadActor();
+ LeadActor *getLeadActor() { return _leadActor; }
Common::SafeSeekableSubReadStream *getResourceStream(const Common::String &fileName) { return _resMgr.getResourceStream(fileName); }
- CelDecoder *loadCel(Common::String &fileName);
+ CelDecoder *loadCel(Common::String &fileName) { return _resMgr.loadCEL(fileName); }
virtual void clear();
void pause(bool paused);
- PinkEngine *getGame();
+ PinkEngine *getGame() { return _resMgr.getGame(); }
virtual Sequencer *getSequencer() { return nullptr; }
virtual WalkMgr *getWalkMgr() { return nullptr; }
- virtual Module *getModule() const { return nullptr; }
+ virtual Module *getModule() { return nullptr; }
virtual bool checkValueOfVariable(const Common::String &variable, const Common::String &value) { return 0; }
virtual void setVariable(Common::String &variable, Common::String &value) {}
diff --git a/engines/pink/objects/sequences/sequence.cpp b/engines/pink/objects/sequences/sequence.cpp
index e7d5783050..35c2ef5301 100644
--- a/engines/pink/objects/sequences/sequence.cpp
+++ b/engines/pink/objects/sequences/sequence.cpp
@@ -57,14 +57,6 @@ void Sequence::toConsole() {
}
}
-Common::Array<SequenceItem*> &Sequence::getItems() {
- return _items;
-}
-
-void Sequence::setContext(SequenceContext *context) {
- _context = context;
-}
-
void Sequence::init(int unk) {
assert(_items.size());
assert(dynamic_cast<SequenceItemLeader*>(_items[0])); // first item must always be a leader
diff --git a/engines/pink/objects/sequences/sequence.h b/engines/pink/objects/sequences/sequence.h
index 93dcb25d26..c3439a1737 100644
--- a/engines/pink/objects/sequences/sequence.h
+++ b/engines/pink/objects/sequences/sequence.h
@@ -40,9 +40,9 @@ public:
virtual void toConsole();
- Common::Array<SequenceItem *> &getItems();
+ Common::Array<SequenceItem *> &getItems() { return _items; }
- void setContext(SequenceContext *context);
+ void setContext(SequenceContext *context) { _context = context; }
virtual void init(int unk);
virtual void start(int unk);
virtual void end();
diff --git a/engines/pink/objects/sequences/sequence_context.cpp b/engines/pink/objects/sequences/sequence_context.cpp
index 200fcb416a..61ac13ce97 100644
--- a/engines/pink/objects/sequences/sequence_context.cpp
+++ b/engines/pink/objects/sequences/sequence_context.cpp
@@ -34,10 +34,6 @@ namespace Pink {
SequenceActorState::SequenceActorState(const Common::String &name)
:_actorName(name), _index(0) {}
-const Common::String &SequenceActorState::getActor() const {
- return _actorName;
-}
-
void SequenceActorState::check(int index, Sequence *sequence, bool unk) {
Actor *actor = sequence->_sequencer->_page->findActor(_actorName);
debug("%s %s", _actorName.c_str(), _actionName.c_str());
@@ -71,22 +67,10 @@ SequenceContext::SequenceContext(Sequence *sequence, Sequencer *sequencer)
}
}
-uint SequenceContext::getNextItemIndex() const {
- return _nextItemIndex;
-}
-
-Sequence *SequenceContext::getSequence() const {
- return _sequence;
-}
-
void SequenceContext::clearActionsFromActorStates() {
for (uint i = 0; i < _states.size(); ++i) {
_states[i]._actionName.clear();
}
}
-void SequenceContext::setNextItemIndex(int index) {
- _nextItemIndex = index;
-}
-
} // End of namespace Pink
diff --git a/engines/pink/objects/sequences/sequence_context.h b/engines/pink/objects/sequences/sequence_context.h
index e7acf093ea..5ba608154f 100644
--- a/engines/pink/objects/sequences/sequence_context.h
+++ b/engines/pink/objects/sequences/sequence_context.h
@@ -34,7 +34,7 @@ class SequenceActorState {
public:
SequenceActorState(const Common::String &name);
- const Common::String &getActor() const;
+ const Common::String &getActor() const { return _actorName; }
void check(int index, Sequence *sequence, bool unk);
public:
@@ -49,10 +49,10 @@ class SequenceContext {
public:
SequenceContext(Sequence *sequence, Sequencer* sequencer);
- uint getNextItemIndex() const;
- Sequence *getSequence() const;
+ uint getNextItemIndex() const { return _nextItemIndex; }
+ Sequence *getSequence() const { return _sequence; }
- void setNextItemIndex(int index);
+ void setNextItemIndex(int index) { _nextItemIndex = index; }
void clearActionsFromActorStates();
diff --git a/engines/pink/objects/sequences/sequence_item.cpp b/engines/pink/objects/sequences/sequence_item.cpp
index 2d048b0b08..cd21a100da 100644
--- a/engines/pink/objects/sequences/sequence_item.cpp
+++ b/engines/pink/objects/sequences/sequence_item.cpp
@@ -42,14 +42,6 @@ void SequenceItem::toConsole() {
debug("\t\t\t\tSequenceItem: _actor=%s, _action=%s", _actor.c_str(), _action.c_str());
}
-const Common::String &SequenceItem::getActor() const {
- return _actor;
-}
-
-const Common::String &SequenceItem::getAction() const {
- return _action;
-}
-
bool SequenceItem::execute(int index, Sequence *sequence, bool unk2) {
Actor *actor;
Action *action;
@@ -88,10 +80,6 @@ void SequenceItemLeaderAudio::toConsole() {
debug("\t\t\t\tSequenceItemLeaderAudio: _actor=%s, _action=%s _sample=%d", _actor.c_str(), _action.c_str(), _sample);
}
-uint32 SequenceItemLeaderAudio::getSample() {
- return _sample;
-}
-
bool SequenceItemDefaultAction::execute(int index, Sequence *sequence, bool unk2) {
SequenceActorState *state = sequence->_sequencer->findSequenceActorState(_actor);
state->_actionName = _action;
diff --git a/engines/pink/objects/sequences/sequence_item.h b/engines/pink/objects/sequences/sequence_item.h
index df22f86fe5..d67e0f5939 100644
--- a/engines/pink/objects/sequences/sequence_item.h
+++ b/engines/pink/objects/sequences/sequence_item.h
@@ -35,8 +35,8 @@ public:
virtual void toConsole();
- const Common::String &getActor() const;
- const Common::String &getAction() const;
+ const Common::String &getActor() const { return _actor; }
+ const Common::String &getAction() const { return _action; }
virtual bool execute(int index, Sequence *sequence, bool unk2);
virtual bool isLeader();
@@ -57,7 +57,7 @@ class SequenceItemLeaderAudio : public SequenceItemLeader {
public:
virtual void deserialize(Archive &archive);
virtual void toConsole();
- uint32 getSample();
+ uint32 getSample() { return _sample; }
private:
uint32 _sample;
@@ -81,6 +81,6 @@ private
};
*/
-}
+} // End of namespace Pink
#endif
diff --git a/engines/pink/pda_mgr.cpp b/engines/pink/pda_mgr.cpp
index a2cfb5d454..1b7b8dddba 100644
--- a/engines/pink/pda_mgr.cpp
+++ b/engines/pink/pda_mgr.cpp
@@ -26,16 +26,11 @@
#include "pink/objects/actors/lead_actor.h"
#include "pink/objects/pages/pda_page.h"
-
namespace Pink {
PDAMgr::PDAMgr(Pink::PinkEngine *game)
: _game(game), _page(nullptr), _cursorMgr(game, nullptr) {}
-void PDAMgr::loadState(Archive &archive) {
- _savedPage = archive.readString();
-}
-
void PDAMgr::saveState(Archive &archive) {
if (_page)
archive.writeString(_page->getName());
@@ -74,10 +69,6 @@ void PDAMgr::goToPage(const Common::String &pageName) {
_cursorMgr.setPage(_page);
}
-void PDAMgr::update() {
- _cursorMgr.update();
-}
-
void PDAMgr::onLeftButtonClick(Common::Point point) {
Actor *actor = _game->getDirector()->getActorByPoint(point);
if (actor)
@@ -91,20 +82,6 @@ void PDAMgr::onMouseMove(Common::Point point) {
else _cursorMgr.setCursor(kPDADefaultCursor, point,Common::String());
}
-
-PinkEngine *PDAMgr::getGame() const {
- return _game;
-}
-
-const Common::String &PDAMgr::getSavedPageName() {
- return _savedPage;
-}
-
-
-void PDAMgr::setLead(LeadActor *lead) {
- _lead = lead;
-}
-
void PDAMgr::close() {
for (uint i = 0; i < _globalActors.size(); ++i) {
delete _globalActors[i];
diff --git a/engines/pink/pda_mgr.h b/engines/pink/pda_mgr.h
index fd35674156..c2e09ee287 100644
--- a/engines/pink/pda_mgr.h
+++ b/engines/pink/pda_mgr.h
@@ -37,21 +37,21 @@ class PDAMgr {
public:
PDAMgr(PinkEngine *game);
- void loadState(Archive &archive);
+ void loadState(Archive &archive) { _savedPage = archive.readString(); }
void saveState(Archive &archive);
void execute(const Command &command);
void goToPage(const Common::String &pageName);
- void update();
+ void update() { _cursorMgr.update(); }
void onLeftButtonClick(Common::Point point);
void onMouseMove(Common::Point point);
- PinkEngine *getGame() const;
- const Common::String &getSavedPageName();
+ PinkEngine *getGame() const { return _game; }
+ const Common::String &getSavedPageName() { return _savedPage; }
- void setLead(LeadActor *lead);
+ void setLead(LeadActor *lead) { _lead = lead; }
private:
void close();
diff --git a/engines/pink/pink.cpp b/engines/pink/pink.cpp
index d28b05828d..a940ea989f 100644
--- a/engines/pink/pink.cpp
+++ b/engines/pink/pink.cpp
@@ -177,11 +177,6 @@ void PinkEngine::changeScene(Page *page) {
}
}
-void PinkEngine::setNextExecutors(const Common::String &nextModule, const Common::String &nextPage) {
- _nextModule = nextModule;
- _nextPage = nextPage;
-}
-
void PinkEngine::loadModule(int index) {
Module *module = new Module(this, _modules[index]->getName());
@@ -197,10 +192,6 @@ bool PinkEngine::checkValueOfVariable(Common::String &variable, Common::String &
return _variables[variable] == value;
}
-void PinkEngine::setVariable(Common::String &variable, Common::String &value) {
- _variables[variable] = value;
-}
-
bool PinkEngine::loadCursors() {
Common::PEResources exeResources;
bool isPokus = !strcmp(_desc.gameId, kPokus);
@@ -319,10 +310,6 @@ void PinkEngine::pauseEngineIntern(bool pause) {
_system->showMouse(!pause);
}
-PDAMgr &PinkEngine::getPdaMgr() {
- return _pdaMgr;
-}
-
Common::String generateSaveName(int slot, const char *gameId) {
return Common::String::format("%s.s%02d", gameId, slot);
}
diff --git a/engines/pink/pink.h b/engines/pink/pink.h
index f4d0ad34af..299de3faeb 100644
--- a/engines/pink/pink.h
+++ b/engines/pink/pink.h
@@ -104,16 +104,15 @@ public:
BroFile *getBro() { return _bro; }
Common::RandomSource &getRnd() { return _rnd; };
Director *getDirector() { return &_director; }
+ PDAMgr &getPdaMgr() { return _pdaMgr; }
- void setNextExecutors(const Common::String &nextModule, const Common::String &nextPage);
+ void setNextExecutors(const Common::String &nextModule, const Common::String &nextPage) { _nextModule = nextModule; _nextPage = nextPage; }
void setLeadActor(LeadActor *actor) { _actor = actor; };
void setCursor(uint cursorIndex);
- void setVariable(Common::String &variable, Common::String &value);
+ void setVariable(Common::String &variable, Common::String &value) { _variables[variable] = value; }
bool checkValueOfVariable(Common::String &variable, Common::String &value);
- PDAMgr &getPdaMgr();
-
protected:
virtual void pauseEngineIntern(bool pause);
diff --git a/engines/pink/resource_mgr.cpp b/engines/pink/resource_mgr.cpp
index ebaf219ddc..6d99c6972d 100644
--- a/engines/pink/resource_mgr.cpp
+++ b/engines/pink/resource_mgr.cpp
@@ -71,10 +71,6 @@ static int resDescComp(const void *a, const void *b) {
return scumm_stricmp((char *) a, (char *) b);
}
-PinkEngine *ResourceMgr::getGame() const {
- return _game;
-}
-
Common::SafeSeekableSubReadStream *ResourceMgr::getResourceStream(const Common::String &name) {
Common::SeekableReadStream *stream;
diff --git a/engines/pink/resource_mgr.h b/engines/pink/resource_mgr.h
index 0cdf2ae8ba..5332953f5a 100644
--- a/engines/pink/resource_mgr.h
+++ b/engines/pink/resource_mgr.h
@@ -55,7 +55,7 @@ public:
CelDecoder *loadCEL(Common::String &name);
Common::String loadText(Common::String &name);
- PinkEngine *getGame() const;
+ PinkEngine *getGame() const { return _game; }
private:
PinkEngine *_game;
diff --git a/engines/pink/utils.h b/engines/pink/utils.h
index 2a01ba9325..75a2464538 100644
--- a/engines/pink/utils.h
+++ b/engines/pink/utils.h
@@ -23,7 +23,7 @@
#ifndef PINK_UTILS_H
#define PINK_UTILS_H
-#include "pink/archive.h"
+#include "pink/objects/object.h"
namespace Pink {