[Scummvm-git-logs] scummvm master -> 3c67ce0eed26712946244d06e119ee398562a704
whiterandrek
whiterandrek at gmail.com
Wed May 8 11:02:56 CEST 2019
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
711b7399a0 PINK: removed unnecessary namespace in function declaration
3c67ce0eed PINK: removed usage of global variable
Commit: 711b7399a07d602df1b33f98a4b2225770b51c30
https://github.com/scummvm/scummvm/commit/711b7399a07d602df1b33f98a4b2225770b51c30
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2019-05-08T11:23:44+03:00
Commit Message:
PINK: removed unnecessary namespace in function declaration
Changed paths:
engines/pink/objects/condition.cpp
diff --git a/engines/pink/objects/condition.cpp b/engines/pink/objects/condition.cpp
index 646da7d..cc98651 100644
--- a/engines/pink/objects/condition.cpp
+++ b/engines/pink/objects/condition.cpp
@@ -28,12 +28,12 @@
namespace Pink {
-void Pink::ConditionVariable::deserialize(Archive &archive) {
+void ConditionVariable::deserialize(Archive &archive) {
_name = archive.readString();
_value = archive.readString();
}
-bool Pink::ConditionGameVariable::evaluate(Actor *actor) {
+bool ConditionGameVariable::evaluate(Actor *actor) {
return actor->getPage()->getModule()->getGame()->checkValueOfVariable(_name, _value);
}
@@ -41,7 +41,7 @@ void ConditionGameVariable::toConsole() {
debugC(6, kPinkDebugLoadingObjects, "\t\tConditionGameVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
}
-bool Pink::ConditionModuleVariable::evaluate(Actor *actor) {
+bool ConditionModuleVariable::evaluate(Actor *actor) {
return actor->getPage()->getModule()->checkValueOfVariable(_name, _value);
}
@@ -49,7 +49,7 @@ void ConditionModuleVariable::toConsole() {
debugC(6, kPinkDebugLoadingObjects, "\t\tConditionModuleVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
}
-bool Pink::ConditionNotModuleVariable::evaluate(Actor *actor) {
+bool ConditionNotModuleVariable::evaluate(Actor *actor) {
return !ConditionModuleVariable::evaluate(actor);
}
Commit: 3c67ce0eed26712946244d06e119ee398562a704
https://github.com/scummvm/scummvm/commit/3c67ce0eed26712946244d06e119ee398562a704
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2019-05-08T12:01:22+03:00
Commit Message:
PINK: removed usage of global variable
Changed paths:
engines/pink/objects/actions/action_play_with_sfx.cpp
engines/pink/objects/actions/action_play_with_sfx.h
engines/pink/objects/sequences/sequencer.cpp
engines/pink/objects/sequences/sequencer.h
diff --git a/engines/pink/objects/actions/action_play_with_sfx.cpp b/engines/pink/objects/actions/action_play_with_sfx.cpp
index 3064215..0ebb869 100644
--- a/engines/pink/objects/actions/action_play_with_sfx.cpp
+++ b/engines/pink/objects/actions/action_play_with_sfx.cpp
@@ -26,11 +26,10 @@
#include "pink/objects/actors/actor.h"
#include "pink/objects/actions/action_play_with_sfx.h"
#include "pink/objects/pages/game_page.h"
+#include "pink/objects/sequences/sequencer.h"
namespace Pink {
-bool g_skipping = false; // FIXME: non-const global var
-
ActionPlayWithSfx::~ActionPlayWithSfx() {
ActionPlay::end();
for (uint i = 0; i < _sfxArray.size(); ++i) {
@@ -77,7 +76,7 @@ void ActionPlayWithSfx::end() {
ActionCEL::end();
debugC(6, kPinkDebugActions, "ActionPlayWithSfx %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
// original bug fix
- if (g_skipping) {
+ if (_actor->getPage()->getSequencer()->isSkipping()) {
for (uint i = 0; i < _sfxArray.size(); ++i) {
_sfxArray[i]->end();
}
diff --git a/engines/pink/objects/actions/action_play_with_sfx.h b/engines/pink/objects/actions/action_play_with_sfx.h
index 16d1855..d595bc1 100644
--- a/engines/pink/objects/actions/action_play_with_sfx.h
+++ b/engines/pink/objects/actions/action_play_with_sfx.h
@@ -28,8 +28,6 @@
namespace Pink {
-extern bool g_skipping;
-
class ActionSfx;
class ActionPlayWithSfx : public ActionPlay {
diff --git a/engines/pink/objects/sequences/sequencer.cpp b/engines/pink/objects/sequences/sequencer.cpp
index df5522d..437f6b9 100644
--- a/engines/pink/objects/sequences/sequencer.cpp
+++ b/engines/pink/objects/sequences/sequencer.cpp
@@ -24,7 +24,6 @@
#include "pink/archive.h"
#include "pink/pink.h"
-#include "pink/objects/actions/action_play_with_sfx.h"
#include "pink/objects/actors/lead_actor.h"
#include "pink/objects/pages/game_page.h"
#include "pink/objects/sequences/sequencer.h"
@@ -35,7 +34,7 @@
namespace Pink {
Sequencer::Sequencer(GamePage *page)
- : _context(nullptr), _page(page), _time(0) {}
+ : _context(nullptr), _page(page), _time(0), _isSkipping(false) {}
Sequencer::~Sequencer() {
for (uint i = 0; i < _sequences.size(); ++i) {
@@ -145,25 +144,25 @@ void Sequencer::removeContext(SequenceContext *context) {
void Sequencer::skipSubSequence() {
if (_context) {
- g_skipping = true;
+ _isSkipping = true;
_context->getSequence()->skipSubSequence();
- g_skipping = false;
+ _isSkipping = false;
}
}
void Sequencer::restartSequence() {
if (_context) {
- g_skipping = true;
+ _isSkipping = true;
_context->getSequence()->restart();
- g_skipping = false;
+ _isSkipping = false;
}
}
void Sequencer::skipSequence() {
if (_context && _context->getSequence()->isSkippingAllowed()) {
- g_skipping = true;
+ _isSkipping = true;
_context->getSequence()->skip();
- g_skipping = false;
+ _isSkipping = false;
}
}
diff --git a/engines/pink/objects/sequences/sequencer.h b/engines/pink/objects/sequences/sequencer.h
index 7c74b27..1aec5f5 100644
--- a/engines/pink/objects/sequences/sequencer.h
+++ b/engines/pink/objects/sequences/sequencer.h
@@ -47,6 +47,7 @@ public:
void saveState(Archive &archive);
bool isPlaying() { return _context != nullptr; }
+ bool isSkipping() { return _isSkipping; }
void update();
void authorSequence(Sequence *sequence, bool loadingSave);
@@ -72,6 +73,7 @@ private:
Array<Sequence *> _sequences;
Array<SeqTimer *> _timers;
uint _time;
+ bool _isSkipping;
};
} // End of namespace Pink
More information about the Scummvm-git-logs
mailing list