aboutsummaryrefslogtreecommitdiff
path: root/engines/pink/objects/actions
diff options
context:
space:
mode:
Diffstat (limited to 'engines/pink/objects/actions')
-rw-r--r--engines/pink/objects/actions/action.cpp4
-rw-r--r--engines/pink/objects/actions/action.h20
-rw-r--r--engines/pink/objects/actions/action_cel.cpp50
-rw-r--r--engines/pink/objects/actions/action_cel.h30
-rw-r--r--engines/pink/objects/actions/action_hide.cpp10
-rw-r--r--engines/pink/objects/actions/action_hide.h10
-rw-r--r--engines/pink/objects/actions/action_loop.cpp54
-rw-r--r--engines/pink/objects/actions/action_loop.h22
-rw-r--r--engines/pink/objects/actions/action_play.cpp32
-rw-r--r--engines/pink/objects/actions/action_play.h12
-rw-r--r--engines/pink/objects/actions/action_play_with_sfx.cpp92
-rw-r--r--engines/pink/objects/actions/action_play_with_sfx.h38
-rw-r--r--engines/pink/objects/actions/action_sound.cpp64
-rw-r--r--engines/pink/objects/actions/action_sound.h28
-rw-r--r--engines/pink/objects/actions/action_still.cpp26
-rw-r--r--engines/pink/objects/actions/action_still.h10
-rw-r--r--engines/pink/objects/actions/action_talk.cpp44
-rw-r--r--engines/pink/objects/actions/action_talk.h18
-rw-r--r--engines/pink/objects/actions/action_text.cpp20
-rw-r--r--engines/pink/objects/actions/action_text.h16
-rw-r--r--engines/pink/objects/actions/walk_action.cpp12
-rw-r--r--engines/pink/objects/actions/walk_action.h8
22 files changed, 310 insertions, 310 deletions
diff --git a/engines/pink/objects/actions/action.cpp b/engines/pink/objects/actions/action.cpp
index c6398833ae..934d6fc5be 100644
--- a/engines/pink/objects/actions/action.cpp
+++ b/engines/pink/objects/actions/action.cpp
@@ -27,8 +27,8 @@
namespace Pink {
void Action::deserialize(Archive &archive) {
- NamedObject::deserialize(archive);
- _actor = static_cast<Actor*>(archive.readObject());
+ NamedObject::deserialize(archive);
+ _actor = static_cast<Actor*>(archive.readObject());
}
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action.h b/engines/pink/objects/actions/action.h
index 0d57fbb129..241aee821f 100644
--- a/engines/pink/objects/actions/action.h
+++ b/engines/pink/objects/actions/action.h
@@ -32,21 +32,21 @@ class Director;
class Action : public NamedObject {
public:
- virtual void deserialize(Archive &archive);
- virtual void start(bool unk) {};
- virtual void end() {};
- virtual void update() {};
- virtual void toConsole() {};
+ virtual void deserialize(Archive &archive);
+ virtual void start(bool unk) {};
+ virtual void end() {};
+ virtual void update() {};
+ virtual void toConsole() {};
- virtual bool initPalette(Director *director) { return 0;}
+ virtual bool initPalette(Director *director) { return 0;}
- Actor *getActor() { return _actor;}
+ Actor *getActor() { return _actor;}
- virtual void pause() {};
- virtual void unpause() {};
+ virtual void pause() {};
+ virtual void unpause() {};
protected:
- Actor *_actor;
+ Actor *_actor;
};
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_cel.cpp b/engines/pink/objects/actions/action_cel.cpp
index 352c635d68..f38c127782 100644
--- a/engines/pink/objects/actions/action_cel.cpp
+++ b/engines/pink/objects/actions/action_cel.cpp
@@ -32,64 +32,64 @@
namespace Pink {
ActionCEL::ActionCEL()
- : _decoder(nullptr) {
+ : _decoder(nullptr) {
}
void ActionCEL::deserialize(Archive &archive) {
- Action::deserialize(archive);
- _fileName = archive.readString();
- _z = archive.readDWORD();
+ Action::deserialize(archive);
+ _fileName = archive.readString();
+ _z = archive.readDWORD();
}
void ActionCEL::start(bool unk) {
- if (!_decoder)
- _decoder = _actor->getPage()->loadCel(_fileName);
- _actor->getPage()->getGame()->getDirector()->addSprite(this);
+ if (!_decoder)
+ _decoder = _actor->getPage()->loadCel(_fileName);
+ _actor->getPage()->getGame()->getDirector()->addSprite(this);
- this->onStart();
+ this->onStart();
}
void ActionCEL::end() {
- _actor->getPage()->getGame()->getDirector()->removeSprite(this);
- delete _decoder;
- _decoder = nullptr;
+ _actor->getPage()->getGame()->getDirector()->removeSprite(this);
+ delete _decoder;
+ _decoder = nullptr;
}
uint32 ActionCEL::getZ() {
- return _z;
+ return _z;
}
CelDecoder *ActionCEL::getDecoder() {
- return _decoder;
+ return _decoder;
}
bool ActionCEL::initPalette(Director *director) {
- _decoder = _actor->getPage()->loadCel(_fileName);
- _decoder->decodeNextFrame();
- _decoder->rewind();
- director->setPallette(_decoder->getPalette());
+ _decoder = _actor->getPage()->loadCel(_fileName);
+ _decoder->decodeNextFrame();
+ _decoder->rewind();
+ director->setPallette(_decoder->getPalette());
- return 1;
+ return 1;
}
void ActionCEL::update() {
- if (_decoder->endOfVideo()){
- _decoder->stop();
- _actor->endAction();
- }
+ if (_decoder->endOfVideo()){
+ _decoder->stop();
+ _actor->endAction();
+ }
}
ActionCEL::~ActionCEL() {
- end();
+ end();
}
void ActionCEL::pause() {
- _decoder->pauseVideo(1);
+ _decoder->pauseVideo(1);
}
void ActionCEL::unpause() {
- _decoder->pauseVideo(0);
+ _decoder->pauseVideo(0);
}
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_cel.h b/engines/pink/objects/actions/action_cel.h
index 937c23bc08..765fe8dd61 100644
--- a/engines/pink/objects/actions/action_cel.h
+++ b/engines/pink/objects/actions/action_cel.h
@@ -31,28 +31,28 @@ class CelDecoder;
class ActionCEL : public Action {
public:
- ~ActionCEL() override;
+ ~ActionCEL() override;
- ActionCEL();
- virtual void deserialize(Archive &archive);
- virtual void start(bool unk);
- virtual void end();
- virtual void update();
+ ActionCEL();
+ virtual void deserialize(Archive &archive);
+ virtual void start(bool unk);
+ virtual void end();
+ virtual void update();
- uint32 getZ();
- CelDecoder *getDecoder();
+ uint32 getZ();
+ CelDecoder *getDecoder();
- virtual bool initPalette(Director *director);
+ virtual bool initPalette(Director *director);
- void pause() override;
+ void pause() override;
- void unpause() override;
+ void unpause() override;
protected:
- virtual void onStart() {} ;
- CelDecoder *_decoder;
- Common::String _fileName;
- uint32 _z;
+ virtual void onStart() {} ;
+ CelDecoder *_decoder;
+ Common::String _fileName;
+ uint32 _z;
};
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_hide.cpp b/engines/pink/objects/actions/action_hide.cpp
index a8a9a3a0b7..1732d2d967 100644
--- a/engines/pink/objects/actions/action_hide.cpp
+++ b/engines/pink/objects/actions/action_hide.cpp
@@ -27,20 +27,20 @@
namespace Pink {
void Pink::ActionHide::deserialize(Archive &archive) {
- Action::deserialize(archive);
+ Action::deserialize(archive);
}
void ActionHide::start(bool unk_startNow) {
- debug("Actor %s has now ActionHide %s", _actor->getName().c_str(), _name.c_str());
- _actor->endAction();
+ debug("Actor %s has now ActionHide %s", _actor->getName().c_str(), _name.c_str());
+ _actor->endAction();
}
void ActionHide::end() {
- debug("ActionHide %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
+ debug("ActionHide %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
}
void ActionHide::toConsole() {
- debug("\tActionHide: _name = %s", _name.c_str());
+ debug("\tActionHide: _name = %s", _name.c_str());
}
ActionHide::~ActionHide() {}
diff --git a/engines/pink/objects/actions/action_hide.h b/engines/pink/objects/actions/action_hide.h
index a7c23a4b15..eb2b8da519 100644
--- a/engines/pink/objects/actions/action_hide.h
+++ b/engines/pink/objects/actions/action_hide.h
@@ -29,13 +29,13 @@ namespace Pink {
class ActionHide : public Action {
public:
- ~ActionHide() override;
+ ~ActionHide() override;
- virtual void deserialize(Archive &archive);
- virtual void toConsole();
+ virtual void deserialize(Archive &archive);
+ virtual void toConsole();
- virtual void start(bool unk);
- virtual void end();
+ virtual void start(bool unk);
+ virtual void end();
};
} //End of namespace Pink
diff --git a/engines/pink/objects/actions/action_loop.cpp b/engines/pink/objects/actions/action_loop.cpp
index 77a17630e2..f32a3a4035 100644
--- a/engines/pink/objects/actions/action_loop.cpp
+++ b/engines/pink/objects/actions/action_loop.cpp
@@ -28,42 +28,42 @@
namespace Pink {
void ActionLoop::deserialize(Archive &archive) {
- ActionPlay::deserialize(archive);
- uint16 style;
- _intro = archive.readDWORD();
- style = archive.readWORD();
- switch (style) {
- case kPingPong:
- _style = kPingPong;
- break;
- case kRandom:
- _style = kRandom;
- break;
- default:
- _style = kForward;
- break;
- }
+ ActionPlay::deserialize(archive);
+ uint16 style;
+ _intro = archive.readDWORD();
+ style = archive.readWORD();
+ switch (style) {
+ case kPingPong:
+ _style = kPingPong;
+ break;
+ case kRandom:
+ _style = kRandom;
+ break;
+ default:
+ _style = kForward;
+ break;
+ }
}
void ActionLoop::toConsole() {
- debug("\tActionLoop: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
- " _endFrame = %d, _intro = %u, _style = %u",
- _name.c_str(), _fileName.c_str(), _z, _startFrame, _stopFrame, _intro, _style);
+ debug("\tActionLoop: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
+ " _endFrame = %d, _intro = %u, _style = %u",
+ _name.c_str(), _fileName.c_str(), _z, _startFrame, _stopFrame, _intro, _style);
}
void ActionLoop::update() {
- // for now it supports only forward loop animation
- if (_style == kForward) {
- if (_decoder->endOfVideo() || _decoder->getCurFrame() == _stopFrame){
- //debug("ACTION LOOP : NEXT ITERATION");
- _decoder->rewind();
- }
- }
+ // for now it supports only forward loop animation
+ if (_style == kForward) {
+ if (_decoder->endOfVideo() || _decoder->getCurFrame() == _stopFrame){
+ //debug("ACTION LOOP : NEXT ITERATION");
+ _decoder->rewind();
+ }
+ }
}
void ActionLoop::onStart() {
- ActionPlay::onStart();
- _actor->endAction();
+ ActionPlay::onStart();
+ _actor->endAction();
}
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_loop.h b/engines/pink/objects/actions/action_loop.h
index 12c9e2dd88..0b8132aa5c 100644
--- a/engines/pink/objects/actions/action_loop.h
+++ b/engines/pink/objects/actions/action_loop.h
@@ -29,19 +29,19 @@ namespace Pink {
class ActionLoop : public ActionPlay {
public:
- virtual void deserialize(Archive &archive);
- virtual void toConsole();
- virtual void update();
+ virtual void deserialize(Archive &archive);
+ virtual void toConsole();
+ virtual void update();
protected:
- virtual void onStart();
+ virtual void onStart();
- enum Style {
- kPingPong = 2,
- kRandom = 3,
- kForward = 4
- };
- uint _intro;
- Style _style;
+ enum Style {
+ kPingPong = 2,
+ kRandom = 3,
+ kForward = 4
+ };
+ uint _intro;
+ Style _style;
};
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_play.cpp b/engines/pink/objects/actions/action_play.cpp
index 6ab21db32e..6ae56df349 100644
--- a/engines/pink/objects/actions/action_play.cpp
+++ b/engines/pink/objects/actions/action_play.cpp
@@ -30,34 +30,34 @@
namespace Pink {
void ActionPlay::deserialize(Archive &archive) {
- ActionStill::deserialize(archive);
- _stopFrame = archive.readDWORD();
+ ActionStill::deserialize(archive);
+ _stopFrame = archive.readDWORD();
}
void ActionPlay::toConsole() {
- debug("\tActionPlay: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
- " _endFrame = %d", _name.c_str(), _fileName.c_str(), _z, _startFrame, _stopFrame);
+ debug("\tActionPlay: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
+ " _endFrame = %d", _name.c_str(), _fileName.c_str(), _z, _startFrame, _stopFrame);
}
void ActionPlay::end() {
- ActionCEL::end();
- debug("ActionPlay %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
+ ActionCEL::end();
+ debug("ActionPlay %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
}
void ActionPlay::onStart() {
- debug("Actor %s has now ActionPlay %s", _actor->getName().c_str(), _name.c_str());
- _decoder->start();
- for (uint i = 0; i < _startFrame; ++i) {
- _decoder->skipFrame();
- }
- _decoder->decodeNextFrame();
+ debug("Actor %s has now ActionPlay %s", _actor->getName().c_str(), _name.c_str());
+ _decoder->start();
+ for (uint i = 0; i < _startFrame; ++i) {
+ _decoder->skipFrame();
+ }
+ _decoder->decodeNextFrame();
}
void ActionPlay::update() {
- if (_decoder->endOfVideo() || _decoder->getCurFrame() == _stopFrame){
- _decoder->stop();
- _actor->endAction();
- }
+ if (_decoder->endOfVideo() || _decoder->getCurFrame() == _stopFrame){
+ _decoder->stop();
+ _actor->endAction();
+ }
}
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_play.h b/engines/pink/objects/actions/action_play.h
index 319d05921c..6553bb1776 100644
--- a/engines/pink/objects/actions/action_play.h
+++ b/engines/pink/objects/actions/action_play.h
@@ -29,17 +29,17 @@ namespace Pink {
class ActionPlay : public ActionStill {
public:
- virtual void deserialize(Archive &archive);
- virtual void toConsole();
+ virtual void deserialize(Archive &archive);
+ virtual void toConsole();
- virtual void end();
+ virtual void end();
- void update() override;
+ void update() override;
protected:
- virtual void onStart();
+ virtual void onStart();
- int32 _stopFrame;
+ int32 _stopFrame;
};
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_play_with_sfx.cpp b/engines/pink/objects/actions/action_play_with_sfx.cpp
index e6f557051f..9cb850384e 100644
--- a/engines/pink/objects/actions/action_play_with_sfx.cpp
+++ b/engines/pink/objects/actions/action_play_with_sfx.cpp
@@ -29,90 +29,90 @@
namespace Pink {
void ActionPlayWithSfx::deserialize(Pink::Archive &archive) {
- ActionPlay::deserialize(archive);
- _isLoop = archive.readDWORD();
- _sfxArray.deserialize(archive);
+ ActionPlay::deserialize(archive);
+ _isLoop = archive.readDWORD();
+ _sfxArray.deserialize(archive);
}
void ActionPlayWithSfx::toConsole() {
- debug("\tActionPlayWithSfx: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
- " _endFrame = %d, _isLoop = %u", _name.c_str(), _fileName.c_str(), _z, _startFrame, _stopFrame, _isLoop);
- for (uint i = 0; i < _sfxArray.size(); ++i) {
- _sfxArray[i]->toConsole();
- }
+ debug("\tActionPlayWithSfx: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
+ " _endFrame = %d, _isLoop = %u", _name.c_str(), _fileName.c_str(), _z, _startFrame, _stopFrame, _isLoop);
+ for (uint i = 0; i < _sfxArray.size(); ++i) {
+ _sfxArray[i]->toConsole();
+ }
}
void ActionPlayWithSfx::update() {
- if ((_decoder->endOfVideo() || _decoder->getCurFrame() == _stopFrame) && _isLoop) {
- _decoder->rewind();
- } else if (_decoder->endOfVideo() || _decoder->getCurFrame() == _stopFrame) {
- _decoder->stop();
- _actor->endAction();
- }
-
- updateSound();
+ if ((_decoder->endOfVideo() || _decoder->getCurFrame() == _stopFrame) && _isLoop) {
+ _decoder->rewind();
+ } else if (_decoder->endOfVideo() || _decoder->getCurFrame() == _stopFrame) {
+ _decoder->stop();
+ _actor->endAction();
+ }
+
+ updateSound();
}
void ActionPlayWithSfx::onStart() {
- ActionPlay::onStart();
- if (_isLoop) {
- _actor->endAction();
- }
- updateSound();
+ ActionPlay::onStart();
+ if (_isLoop) {
+ _actor->endAction();
+ }
+ updateSound();
}
void ActionPlayWithSfx::updateSound() {
- if (!_actor->isPlaying() && !_isLoop)
- return;
-
- for (uint i = 0; i < _sfxArray.size(); ++i) {
- if (_sfxArray[i]->getFrame() == _decoder->getCurFrame()) {
- _sfxArray[i]->play(_actor->getPage());
- }
- }
+ if (!_actor->isPlaying() && !_isLoop)
+ return;
+
+ for (uint i = 0; i < _sfxArray.size(); ++i) {
+ if (_sfxArray[i]->getFrame() == _decoder->getCurFrame()) {
+ _sfxArray[i]->play(_actor->getPage());
+ }
+ }
}
ActionPlayWithSfx::~ActionPlayWithSfx() {
- ActionPlay::end();
- for (uint i = 0; i < _sfxArray.size(); ++i) {
- delete _sfxArray[i];
- }
+ ActionPlay::end();
+ for (uint i = 0; i < _sfxArray.size(); ++i) {
+ delete _sfxArray[i];
+ }
}
void ActionSfx::deserialize(Pink::Archive &archive) {
- _frame = archive.readDWORD();
+ _frame = archive.readDWORD();
_volume = archive.readDWORD();
- _sfxName = archive.readString();
- archive.readObject(); // pointer of ActionPlayWithSfx
+ _sfxName = archive.readString();
+ archive.readObject(); // pointer of ActionPlayWithSfx
}
void ActionSfx::toConsole() {
- debug("\t\tActionSfx: _sfx = %s, _volume = %u, _frame = %u", _sfxName.c_str(), _volume, _frame);
+ debug("\t\tActionSfx: _sfx = %s, _volume = %u, _frame = %u", _sfxName.c_str(), _volume, _frame);
}
void ActionSfx::play(GamePage *page) {
- if (!_sound)
- _sound = page->loadSound(_sfxName);
+ if (!_sound)
+ _sound = page->loadSound(_sfxName);
- if (!_sound->isPlaying())
- _sound->play(Audio::Mixer::SoundType::kSFXSoundType, _volume, 0);
+ if (!_sound->isPlaying())
+ _sound->play(Audio::Mixer::SoundType::kSFXSoundType, _volume, 0);
}
ActionSfx::~ActionSfx() {
- end();
+ end();
}
uint32 ActionSfx::getFrame() {
- return _frame;
+ return _frame;
}
ActionSfx::ActionSfx()
- : _sound(nullptr)
+ : _sound(nullptr)
{}
void ActionSfx::end() {
- delete _sound;
- _sound = nullptr;
+ delete _sound;
+ _sound = nullptr;
}
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_play_with_sfx.h b/engines/pink/objects/actions/action_play_with_sfx.h
index 865f3685cc..89b2ec61ab 100644
--- a/engines/pink/objects/actions/action_play_with_sfx.h
+++ b/engines/pink/objects/actions/action_play_with_sfx.h
@@ -31,18 +31,18 @@ class ActionSfx;
class ActionPlayWithSfx : public ActionPlay {
public:
- virtual ~ActionPlayWithSfx();
- virtual void deserialize(Archive &archive);
- virtual void toConsole();
- virtual void update();
+ virtual ~ActionPlayWithSfx();
+ virtual void deserialize(Archive &archive);
+ virtual void toConsole();
+ virtual void update();
protected:
- virtual void onStart();
+ virtual void onStart();
private:
- void updateSound();
- uint32 _isLoop;
- Array<ActionSfx*> _sfxArray;
+ void updateSound();
+ uint32 _isLoop;
+ Array<ActionSfx*> _sfxArray;
};
class Sound;
@@ -50,20 +50,20 @@ class GamePage;
class ActionSfx : public Object {
public:
- ActionSfx();
- virtual ~ActionSfx();
- virtual void deserialize(Archive &archive);
- virtual void toConsole();
+ ActionSfx();
+ virtual ~ActionSfx();
+ virtual void deserialize(Archive &archive);
+ virtual void toConsole();
- void play(GamePage *page);
- uint32 getFrame();
- void end();
+ void play(GamePage *page);
+ uint32 getFrame();
+ void end();
private:
- Sound *_sound;
- Common::String _sfxName;
- uint32 _volume;
- uint32 _frame;
+ Sound *_sound;
+ Common::String _sfxName;
+ uint32 _volume;
+ uint32 _frame;
};
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_sound.cpp b/engines/pink/objects/actions/action_sound.cpp
index 45d74be23a..e94251d9c0 100644
--- a/engines/pink/objects/actions/action_sound.cpp
+++ b/engines/pink/objects/actions/action_sound.cpp
@@ -32,68 +32,68 @@
namespace Pink {
ActionSound::ActionSound()
- : _sound(nullptr)
+ : _sound(nullptr)
{}
ActionSound::~ActionSound(){
- end();
+ end();
}
void ActionSound::deserialize(Archive &archive) {
- Action::deserialize(archive);
- _fileName = archive.readString();
- _volume = archive.readDWORD();
- _isLoop = (bool) archive.readDWORD();
- _isBackground = (bool) archive.readDWORD();
+ Action::deserialize(archive);
+ _fileName = archive.readString();
+ _volume = archive.readDWORD();
+ _isLoop = (bool) archive.readDWORD();
+ _isBackground = (bool) archive.readDWORD();
}
void ActionSound::toConsole() {
- debug("\tActionSound: _name = %s, _fileName = %s, _volume = %u, _isLoop = %u,"
- " _isBackground = %u", _name.c_str(), _fileName.c_str(), _volume, _isLoop, _isBackground);
+ debug("\tActionSound: _name = %s, _fileName = %s, _volume = %u, _isLoop = %u,"
+ " _isBackground = %u", _name.c_str(), _fileName.c_str(), _volume, _isLoop, _isBackground);
}
void ActionSound::start(bool unk) {
- assert(!_sound);
- _sound = _actor->getPage()->loadSound(_fileName);
+ assert(!_sound);
+ _sound = _actor->getPage()->loadSound(_fileName);
- Audio::Mixer::SoundType soundType = _isBackground ? Audio::Mixer::SoundType::kMusicSoundType
- : Audio::Mixer::SoundType::kSpeechSoundType;
+ Audio::Mixer::SoundType soundType = _isBackground ? Audio::Mixer::SoundType::kMusicSoundType
+ : Audio::Mixer::SoundType::kSpeechSoundType;
- Director *director = _actor->getPage()->getGame()->getDirector();
- director->addSound(this);
+ Director *director = _actor->getPage()->getGame()->getDirector();
+ director->addSound(this);
- _sound->play(soundType, _volume, _isLoop);
- if (_isLoop)
- _actor->endAction();
+ _sound->play(soundType, _volume, _isLoop);
+ if (_isLoop)
+ _actor->endAction();
- debug("Actor %s has now ActionSound %s", _actor->getName().c_str(), _name.c_str());
+ debug("Actor %s has now ActionSound %s", _actor->getName().c_str(), _name.c_str());
}
void ActionSound::end() {
- if (_sound) {
- debug("ActionSound %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
+ if (_sound) {
+ debug("ActionSound %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
- Director *director = _actor->getPage()->getGame()->getDirector();
- director->removeSound(this);
+ Director *director = _actor->getPage()->getGame()->getDirector();
+ director->removeSound(this);
- delete _sound;
- _sound = nullptr;
- }
+ delete _sound;
+ _sound = nullptr;
+ }
}
void ActionSound::update() {
- if (!_sound->isPlaying())
- _actor->endAction();
+ if (!_sound->isPlaying())
+ _actor->endAction();
}
void ActionSound::pause() {
- if (_sound)
- _sound->pause();
+ if (_sound)
+ _sound->pause();
}
void ActionSound::unpause() {
- if (_sound)
- _sound->resume();
+ if (_sound)
+ _sound->resume();
}
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_sound.h b/engines/pink/objects/actions/action_sound.h
index 0fb39bbf66..6e18f97c67 100644
--- a/engines/pink/objects/actions/action_sound.h
+++ b/engines/pink/objects/actions/action_sound.h
@@ -31,26 +31,26 @@ class Sound;
class ActionSound : public Action {
public:
- ActionSound();
- ~ActionSound();
+ ActionSound();
+ ~ActionSound();
- virtual void deserialize(Archive &archive);
+ virtual void deserialize(Archive &archive);
- virtual void toConsole();
+ virtual void toConsole();
- virtual void start(bool unk_startNow);
- virtual void end();
- virtual void update();
+ virtual void start(bool unk_startNow);
+ virtual void end();
+ virtual void update();
- void pause() override;
- void unpause() override;
+ void pause() override;
+ void unpause() override;
private:
- Sound *_sound;
- Common::String _fileName;
- uint32 _volume;
- bool _isLoop;
- bool _isBackground;
+ Sound *_sound;
+ Common::String _fileName;
+ uint32 _volume;
+ bool _isLoop;
+ bool _isBackground;
};
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_still.cpp b/engines/pink/objects/actions/action_still.cpp
index c72e6347b4..ebdde4ed09 100644
--- a/engines/pink/objects/actions/action_still.cpp
+++ b/engines/pink/objects/actions/action_still.cpp
@@ -30,28 +30,28 @@
namespace Pink {
void ActionStill::deserialize(Archive &archive) {
- ActionCEL::deserialize(archive);
- _startFrame = archive.readDWORD();
+ ActionCEL::deserialize(archive);
+ _startFrame = archive.readDWORD();
}
void ActionStill::toConsole() {
- debug("\tActionStill: _name = %s, _fileName = %s, _z =%u _startFrame = %u",
- _name.c_str(), _fileName.c_str(), _z, _startFrame);
+ debug("\tActionStill: _name = %s, _fileName = %s, _z =%u _startFrame = %u",
+ _name.c_str(), _fileName.c_str(), _z, _startFrame);
}
void ActionStill::end() {
- ActionCEL::end();
- debug("ActionStill %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
+ ActionCEL::end();
+ debug("ActionStill %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
}
void ActionStill::onStart() {
- debug("Actor %s has now ActionStill %s", _actor->getName().c_str(), _name.c_str());
- for (uint i = 0; i < _startFrame; ++i) {
- _decoder->skipFrame();
- }
- _decoder->decodeNextFrame();
- _decoder->stop();
- _actor->endAction();
+ debug("Actor %s has now ActionStill %s", _actor->getName().c_str(), _name.c_str());
+ for (uint i = 0; i < _startFrame; ++i) {
+ _decoder->skipFrame();
+ }
+ _decoder->decodeNextFrame();
+ _decoder->stop();
+ _actor->endAction();
}
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_still.h b/engines/pink/objects/actions/action_still.h
index cef3967e33..a62b201ce8 100644
--- a/engines/pink/objects/actions/action_still.h
+++ b/engines/pink/objects/actions/action_still.h
@@ -29,15 +29,15 @@ namespace Pink {
class ActionStill : public ActionCEL {
public:
- virtual void deserialize(Archive &archive);
- virtual void toConsole();
+ virtual void deserialize(Archive &archive);
+ virtual void toConsole();
- virtual void end();
+ virtual void end();
protected:
- virtual void onStart();
+ virtual void onStart();
- uint32 _startFrame;
+ uint32 _startFrame;
};
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_talk.cpp b/engines/pink/objects/actions/action_talk.cpp
index fad3f19ff9..1f55de1f42 100644
--- a/engines/pink/objects/actions/action_talk.cpp
+++ b/engines/pink/objects/actions/action_talk.cpp
@@ -30,46 +30,46 @@
namespace Pink {
void ActionTalk::deserialize(Archive &archive) {
- ActionLoop::deserialize(archive);
- _vox = archive.readString();
+ ActionLoop::deserialize(archive);
+ _vox = archive.readString();
}
void ActionTalk::toConsole() {
- debug("\tActionTalk: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
- " _endFrame = %d, _intro = %u, _style = %u, _vox = %s",
- _name.c_str(), _fileName.c_str(), _z, _startFrame, _stopFrame, _intro, _style, _vox.c_str());
+ debug("\tActionTalk: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
+ " _endFrame = %d, _intro = %u, _style = %u, _vox = %s",
+ _name.c_str(), _fileName.c_str(), _z, _startFrame, _stopFrame, _intro, _style, _vox.c_str());
}
void ActionTalk::onStart() {
- ActionPlay::onStart();
- _sound = _actor->getPage()->loadSound(_vox);
- _sound->play(Audio::Mixer::SoundType::kSpeechSoundType, 100, 0);
+ ActionPlay::onStart();
+ _sound = _actor->getPage()->loadSound(_vox);
+ _sound->play(Audio::Mixer::SoundType::kSpeechSoundType, 100, 0);
}
void ActionTalk::update() {
- ActionLoop::update();
- if (!_sound->isPlaying()) {
- _decoder->stop();
- _actor->endAction();
- }
+ ActionLoop::update();
+ if (!_sound->isPlaying()) {
+ _decoder->stop();
+ _actor->endAction();
+ }
}
void ActionTalk::end() {
- ActionPlay::end();
- delete _sound;
- _sound = nullptr;
+ ActionPlay::end();
+ delete _sound;
+ _sound = nullptr;
}
void ActionTalk::pause() {
- ActionCEL::pause();
- if (_sound)
- _sound->pause();
+ ActionCEL::pause();
+ if (_sound)
+ _sound->pause();
}
void ActionTalk::unpause() {
- ActionCEL::unpause();
- if (_sound)
- _sound->resume();
+ ActionCEL::unpause();
+ if (_sound)
+ _sound->resume();
}
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_talk.h b/engines/pink/objects/actions/action_talk.h
index 77e8d9099d..61ef1a452f 100644
--- a/engines/pink/objects/actions/action_talk.h
+++ b/engines/pink/objects/actions/action_talk.h
@@ -31,21 +31,21 @@ class Sound;
class ActionTalk : public ActionLoop {
public:
- virtual void deserialize(Archive &archive);
- virtual void toConsole();
- virtual void update();
+ virtual void deserialize(Archive &archive);
+ virtual void toConsole();
+ virtual void update();
- virtual void end();
+ virtual void end();
- void pause() override;
- void unpause() override;
+ void pause() override;
+ void unpause() override;
protected:
- virtual void onStart();
+ virtual void onStart();
private:
- Sound *_sound;
- Common::String _vox;
+ Sound *_sound;
+ Common::String _vox;
};
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_text.cpp b/engines/pink/objects/actions/action_text.cpp
index 12e2809d21..3e05346b88 100644
--- a/engines/pink/objects/actions/action_text.cpp
+++ b/engines/pink/objects/actions/action_text.cpp
@@ -28,19 +28,19 @@
namespace Pink {
void ActionText::deserialize(Archive &archive) {
- for (int i = 0; i < 4 ; ++i) {
- _bounds[i] = archive.readDWORD();
- }
- _centered = archive.readDWORD();
- _scrollBar = archive.readDWORD();
- _textColor = archive.readDWORD();
- _backgroundColor = archive.readDWORD();
+ for (int i = 0; i < 4 ; ++i) {
+ _bounds[i] = archive.readDWORD();
+ }
+ _centered = archive.readDWORD();
+ _scrollBar = archive.readDWORD();
+ _textColor = archive.readDWORD();
+ _backgroundColor = archive.readDWORD();
}
void ActionText::toConsole() {
- debug("\tActionText: _name = %s, _text = %s, "
- "_bound0 = %u, _bound1 = %u, _bound2 = %u, _bound3 = %u _centered = %u, _scrollBar = %u, _textColor = %u _backgroundColor = %u",
- _name.c_str(), _text.c_str(), _bounds[0], _bounds[1], _bounds[2], _bounds[3], _centered, _scrollBar, _textColor, _backgroundColor);
+ debug("\tActionText: _name = %s, _text = %s, "
+ "_bound0 = %u, _bound1 = %u, _bound2 = %u, _bound3 = %u _centered = %u, _scrollBar = %u, _textColor = %u _backgroundColor = %u",
+ _name.c_str(), _text.c_str(), _bounds[0], _bounds[1], _bounds[2], _bounds[3], _centered, _scrollBar, _textColor, _backgroundColor);
}
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_text.h b/engines/pink/objects/actions/action_text.h
index 22159490ce..c881610fad 100644
--- a/engines/pink/objects/actions/action_text.h
+++ b/engines/pink/objects/actions/action_text.h
@@ -29,17 +29,17 @@ namespace Pink {
class ActionText : public Action {
public:
- void deserialize(Archive &archive) override;
+ void deserialize(Archive &archive) override;
- void toConsole() override;
+ void toConsole() override;
private:
- Common::String _text;
- uint32 _bounds[4];
- uint32 _centered;
- uint32 _scrollBar;
- uint32 _textColor;
- uint32 _backgroundColor;
+ Common::String _text;
+ uint32 _bounds[4];
+ uint32 _centered;
+ uint32 _scrollBar;
+ uint32 _textColor;
+ uint32 _backgroundColor;
};
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/walk_action.cpp b/engines/pink/objects/actions/walk_action.cpp
index d05e94eadb..e4e35184ca 100644
--- a/engines/pink/objects/actions/walk_action.cpp
+++ b/engines/pink/objects/actions/walk_action.cpp
@@ -27,18 +27,18 @@
namespace Pink {
void WalkAction::deserialize(Archive &archive) {
- ActionCEL::deserialize(archive);
- uint32 calcFramePositions = archive.readDWORD();
- _toCalcFramePositions = calcFramePositions;
+ ActionCEL::deserialize(archive);
+ uint32 calcFramePositions = archive.readDWORD();
+ _toCalcFramePositions = calcFramePositions;
}
void WalkAction::toConsole() {
- debug("\tWalkAction: _name = %s, _fileName = %s, _calcFramePositions = %u",
- _name.c_str(), _fileName.c_str(), _toCalcFramePositions);
+ debug("\tWalkAction: _name = %s, _fileName = %s, _calcFramePositions = %u",
+ _name.c_str(), _fileName.c_str(), _toCalcFramePositions);
}
void WalkAction::onStart() {
- _decoder->start();
+ _decoder->start();
}
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/walk_action.h b/engines/pink/objects/actions/walk_action.h
index 21926ab9c1..d53c8c2bdc 100644
--- a/engines/pink/objects/actions/walk_action.h
+++ b/engines/pink/objects/actions/walk_action.h
@@ -29,15 +29,15 @@ namespace Pink {
class WalkAction : public ActionCEL {
public:
- virtual void deserialize(Archive &archive);
+ virtual void deserialize(Archive &archive);
- virtual void toConsole();
+ virtual void toConsole();
protected:
- void onStart() override;
+ void onStart() override;
private:
- bool _toCalcFramePositions;
+ bool _toCalcFramePositions;
};
} // End of namespace Pink