aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorwhiterandrek2018-05-16 16:33:23 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commit3411750a1ce0a78826a38b88124ec2e3d580f776 (patch)
treeaa20bfad4e5008d3ea1e03a3ff4af347b5b32d1b /engines
parentd54c2a68cb45cadbc43d94e58bbcb73c8cb297c6 (diff)
downloadscummvm-rg350-3411750a1ce0a78826a38b88124ec2e3d580f776.tar.gz
scummvm-rg350-3411750a1ce0a78826a38b88124ec2e3d580f776.tar.bz2
scummvm-rg350-3411750a1ce0a78826a38b88124ec2e3d580f776.zip
PINK: removed single-line function from SeqTimer
Diffstat (limited to 'engines')
-rw-r--r--engines/pink/objects/sequences/seq_timer.cpp16
-rw-r--r--engines/pink/objects/sequences/seq_timer.h3
2 files changed, 6 insertions, 13 deletions
diff --git a/engines/pink/objects/sequences/seq_timer.cpp b/engines/pink/objects/sequences/seq_timer.cpp
index 78a5bd554a..26c8afa93a 100644
--- a/engines/pink/objects/sequences/seq_timer.cpp
+++ b/engines/pink/objects/sequences/seq_timer.cpp
@@ -31,9 +31,7 @@
namespace Pink {
SeqTimer::SeqTimer()
- : _updatesToMessage(0) {
-
-}
+ : _updatesToMessage(0) {}
void SeqTimer::deserialize(Archive &archive) {
archive >> _actor;
@@ -47,20 +45,18 @@ void SeqTimer::toConsole() {
}
void SeqTimer::update() {
- Common::RandomSource &random =_sequencer->_page->getGame()->getRnd();
+ Common::RandomSource &rnd =_sequencer->_page->getGame()->getRnd();
if (_updatesToMessage--)
return;
- calculateUpdatesCount();
- SupportingActor *actor = static_cast<SupportingActor*>(_sequencer->_page->findActor(_actor));
+ _updatesToMessage = _range ? _period + rnd.getRandomNumber(_range) : _period;
+
+ SupportingActor *actor = static_cast<SupportingActor*>(_sequencer->_page->findActor(_actor));
if (actor && !_sequencer->findSequenceActorState(actor->getName())){
actor->onTimerMessage();
}
}
-void SeqTimer::calculateUpdatesCount() {
- Common::RandomSource &random =_sequencer->_page->getGame()->getRnd();
- _updatesToMessage = _range ? _period + random.getRandomNumber(_range) : _period;
-}
+
} // End of namespace Pink \ No newline at end of file
diff --git a/engines/pink/objects/sequences/seq_timer.h b/engines/pink/objects/sequences/seq_timer.h
index 0b961c0c25..5970d2ab4c 100644
--- a/engines/pink/objects/sequences/seq_timer.h
+++ b/engines/pink/objects/sequences/seq_timer.h
@@ -34,12 +34,9 @@ public:
SeqTimer();
virtual void deserialize(Archive &archive);
virtual void toConsole();
-
virtual void update();
-
private:
- void calculateUpdatesCount();
Common::String _actor;
Sequencer *_sequencer;
int _period;