Skip to content

Commit

Permalink
PINK: fix shadowing declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
voltya authored and sev- committed Jun 28, 2018
1 parent 25a9e09 commit 28a1ff7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions engines/pink/objects/sequences/sequence_context.cpp
Expand Up @@ -32,9 +32,9 @@
namespace Pink {

void SequenceActorState::execute(uint segment, Sequence *sequence, bool loadingSave) const {
Actor *actor = sequence->getSequencer()->getPage()->findActor(this->actor);
if (actor && this->segment != segment && !defaultAction.empty()) {
Action *action = actor->findAction(defaultAction);
Actor *actor = sequence->getSequencer()->getPage()->findActor(this->actorName);
if (actor && _segment != segment && !defaultActionName.empty()) {
Action *action = actor->findAction(defaultActionName);
if (action && actor->getAction() != action) {
actor->setAction(action, loadingSave);
}
Expand All @@ -52,7 +52,7 @@ SequenceContext::SequenceContext(Sequence *sequence)
for (uint i = 0; i < items.size(); ++i) {
bool found = 0;
for (uint j = 0; j < _states.size(); ++j) {
if (items[i]->getActor() == _states[j].actor) {
if (items[i]->getActor() == _states[j].actorName) {
found = 1;
break;
}
Expand All @@ -76,21 +76,21 @@ void SequenceContext::execute(uint nextItemIndex, bool loadingSave) {

void SequenceContext::clearDefaultActions() {
for (uint i = 0; i < _states.size(); ++i) {
_states[i].defaultAction.clear();
_states[i].defaultActionName.clear();
}
}

SequenceActorState *SequenceContext::findState(const Common::String &actor) {
for (uint i = 0; i < _states.size(); ++i) {
if (_states[i].actor == actor)
if (_states[i].actorName == actor)
return &_states[i];
}
return nullptr;
}

bool SequenceContext::isConflictsWith(SequenceContext *context) {
for (uint i = 0; i < _states.size(); ++i) {
if (context->findState(_states[i].actor))
if (context->findState(_states[i].actorName))
return true;
}
return false;
Expand Down
10 changes: 5 additions & 5 deletions engines/pink/objects/sequences/sequence_context.h
Expand Up @@ -31,14 +31,14 @@ class Sequence;
class Sequencer;

struct SequenceActorState {
SequenceActorState(const Common::String actorName)
: actor(actorName), segment(0) {}
SequenceActorState(const Common::String actor)
: actorName(actor), _segment(0) {}

void execute(uint segment, Sequence *sequence, bool loadingSave) const;

Common::String actor;
Common::String defaultAction;
uint segment;
Common::String actorName;
Common::String defaultActionName;
uint _segment;
};

class Actor;
Expand Down
4 changes: 2 additions & 2 deletions engines/pink/objects/sequences/sequence_item.cpp
Expand Up @@ -53,7 +53,7 @@ bool SequenceItem::execute(uint segment, Sequence *sequence, bool loadingSave) {
SequenceContext *context = sequence->getContext();
SequenceActorState *state = context->findState(_actor);
if (state)
state->segment = segment;
state->_segment = segment;
if (isLeader())
context->setActor(actor);
return true;
Expand Down Expand Up @@ -84,7 +84,7 @@ void SequenceItemLeaderAudio::toConsole() {
bool SequenceItemDefaultAction::execute(uint segment, Sequence *sequence, bool loadingSave) {
SequenceActorState *state = sequence->getContext()->findState(_actor);
if (state)
state->defaultAction = _action;
state->defaultActionName = _action;
return true;
}

Expand Down

0 comments on commit 28a1ff7

Please sign in to comment.