ASYLUM: Fix two warnings and rename two flags in Encounter class
git-svn-id: http://asylumengine.googlecode.com/svn/trunk@658 0bfb4aae-4ea4-11de-8d8d-752d95cf3e3c
This commit is contained in:
parent
ac0ae2162f
commit
e5b3e4c476
6 changed files with 60 additions and 59 deletions
|
@ -518,7 +518,7 @@ void Actor::update() {
|
|||
break;
|
||||
|
||||
case kActorStatus8:
|
||||
if (_vm->encounter()->getFlag6()
|
||||
if (_vm->encounter()->isRunning()
|
||||
|| !_soundResourceId
|
||||
|| getSound()->isPlaying(_soundResourceId)) {
|
||||
_frameIndex = (_frameIndex + 1) % _frameCount;
|
||||
|
@ -613,7 +613,7 @@ void Actor::updateStatus(ActorStatus actorStatus) {
|
|||
break;
|
||||
|
||||
case kActorStatus9:
|
||||
if (_vm->encounter()->getFlag6())
|
||||
if (_vm->encounter()->isRunning())
|
||||
return;
|
||||
|
||||
if (_vm->getRandomBit() == 1 && isDefaultDirection(15))
|
||||
|
@ -1186,7 +1186,7 @@ void Actor::updateStatusEnabled() {
|
|||
|
||||
if (_vm->isGameFlagNotSet(kGameFlagScriptProcessing)
|
||||
&& isVisible()
|
||||
&& !_vm->encounter()->getFlag6()
|
||||
&& !_vm->encounter()->isRunning()
|
||||
&& !getSpeech()->getSoundResourceId()) {
|
||||
if (_vm->getRandom(100) < 50) {
|
||||
if (getWorld()->chapter == kChapter13)
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace Asylum {
|
|||
|
||||
Encounter::Encounter(AsylumEngine *engine) : _vm(engine),
|
||||
_index(0), _keywordIndex(0), _item(NULL), _objectId1(kObjectNone), _objectId2(kObjectNone), _actorIndex(kActorInvalid),
|
||||
_flag1(false), _flag2(false), _flag3(false), _flag4(false), _flag5(false), _flag6(false) {
|
||||
_flag1(false), _flag2(false), _flag3(false), _flag4(false), _disablePlayerOnExit(false), _isRunning(false) {
|
||||
|
||||
// TODO init rest of members
|
||||
|
||||
|
@ -248,7 +248,7 @@ void Encounter::exit() {
|
|||
// Original saves the item back here
|
||||
|
||||
// Update flags
|
||||
_flag6 = false;
|
||||
_isRunning = false;
|
||||
getSharedData()->setFlag(kFlag3, true);
|
||||
|
||||
if (_flag2)
|
||||
|
@ -256,10 +256,10 @@ void Encounter::exit() {
|
|||
else
|
||||
_flag1 = true;
|
||||
|
||||
if (_flag5)
|
||||
if (_disablePlayerOnExit)
|
||||
getScene()->getActor()->updateStatus(kActorStatusDisabled);
|
||||
|
||||
_flag5 = false;
|
||||
_disablePlayerOnExit = false;
|
||||
|
||||
if (getSound()->getMusicVolume() != Config.musicVolume)
|
||||
getSound()->setMusicVolume(Config.musicVolume);
|
||||
|
@ -303,7 +303,7 @@ bool Encounter::init() {
|
|||
getSound()->setMusicVolume(Config.musicVolume - 500);
|
||||
|
||||
if (!getSharedData()->getMatteBarHeight()) {
|
||||
_flag6 = true;
|
||||
_isRunning = true;
|
||||
_data_455BD4 = false;
|
||||
_data_455BD8 = false;
|
||||
_data_455BDC = false;
|
||||
|
@ -314,7 +314,7 @@ bool Encounter::init() {
|
|||
_rectIndex = -1;
|
||||
_value1 = 0;
|
||||
_data_455BF4 = 0;
|
||||
_data_455BF8 = false;
|
||||
_data_455BF8 = 0;
|
||||
_data_455B14 = -1;
|
||||
|
||||
getSpeech()->resetTextData();
|
||||
|
@ -398,7 +398,8 @@ bool Encounter::update() {
|
|||
_data_455BF4 = 2;
|
||||
runScript();
|
||||
}
|
||||
bool doScript;
|
||||
|
||||
bool doScript = false;
|
||||
if ((getSpeech()->getSoundResourceId()
|
||||
&& !getSound()->isPlaying(getSpeech()->getSoundResourceId())
|
||||
&& !_data_455BE0)
|
||||
|
|
|
@ -51,8 +51,8 @@ public:
|
|||
bool getFlag1() { return _flag1; }
|
||||
void setFlag3(bool state) { _flag3 = state; }
|
||||
bool getFlag3() { return _flag3; }
|
||||
void setFlag5(bool state) { _flag5 = state; }
|
||||
bool getFlag6() { return _flag6; }
|
||||
void disablePlayerOnExit(bool state) { _disablePlayerOnExit = state; }
|
||||
bool isRunning() { return _isRunning; }
|
||||
|
||||
private:
|
||||
AsylumEngine *_vm;
|
||||
|
@ -150,15 +150,15 @@ private:
|
|||
bool _data_455BE4;
|
||||
bool _data_455BE8;
|
||||
uint32 _data_455BF4;
|
||||
bool _data_455BF8;
|
||||
uint32 _data_455BF8;
|
||||
|
||||
// Internal flags
|
||||
bool _flag1;
|
||||
bool _flag2;
|
||||
bool _flag3;
|
||||
bool _flag4;
|
||||
bool _flag5;
|
||||
bool _flag6;
|
||||
bool _disablePlayerOnExit;
|
||||
bool _isRunning;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Data
|
||||
|
|
|
@ -756,10 +756,10 @@ END_OPCODE
|
|||
IMPLEMENT_OPCODE(RunEncounter)
|
||||
Encounter *encounter = _vm->encounter();
|
||||
|
||||
encounter->setFlag5(cmd->param5);
|
||||
encounter->disablePlayerOnExit(cmd->param5);
|
||||
|
||||
if (cmd->param6) {
|
||||
if (encounter->getFlag6())
|
||||
if (encounter->isRunning())
|
||||
_lineIncrement = 1;
|
||||
else
|
||||
cmd->param6 = 0;
|
||||
|
|
|
@ -666,7 +666,7 @@ void Special::chapter9(Object *object, ActorIndex actorIndex) {
|
|||
void Special::playChapterSound(Object *object, ActorIndex actorIndex) {
|
||||
ResourceId id = getResourceId(object, actorIndex);
|
||||
|
||||
if (_vm->encounter()->getFlag6())
|
||||
if (_vm->encounter()->isRunning())
|
||||
return;
|
||||
|
||||
if (id != kResourceNone && getSound()->isPlaying(id))
|
||||
|
|
|
@ -1045,7 +1045,7 @@ void Scene::updateCursor(ActorDirection direction, Common::Rect rect) {
|
|||
int16 rightLimit = rect.right - 10;
|
||||
Common::Point mouse = getCursor()->position();
|
||||
|
||||
if (getEncounter()->getFlag6()) {
|
||||
if (getEncounter()->isRunning()) {
|
||||
if (getCursor()->graphicResourceId != _ws->cursorResources[kCursorResourceTalkNPC])
|
||||
getCursor()->set(_ws->cursorResources[kCursorResourceTalkNPC]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue