aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2017-01-20 20:36:26 -0500
committerPaul Gilbert2017-01-20 20:36:26 -0500
commit5aef8cb875f7a51d41dd012433cf3829b02c6d51 (patch)
treeadaa21387eb39499d6ea858df9e1f6b83bb84079 /engines
parent960342cb3742ae6904139cb6fe77d0dfb42f85de (diff)
downloadscummvm-rg350-5aef8cb875f7a51d41dd012433cf3829b02c6d51.tar.gz
scummvm-rg350-5aef8cb875f7a51d41dd012433cf3829b02c6d51.tar.bz2
scummvm-rg350-5aef8cb875f7a51d41dd012433cf3829b02c6d51.zip
TITANIC: Further NPC flag renaming, usage fixes
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/npcs/bellbot.cpp14
-rw-r--r--engines/titanic/npcs/deskbot.cpp24
-rw-r--r--engines/titanic/npcs/parrot.cpp45
-rw-r--r--engines/titanic/npcs/true_talk_npc.h6
4 files changed, 46 insertions, 43 deletions
diff --git a/engines/titanic/npcs/bellbot.cpp b/engines/titanic/npcs/bellbot.cpp
index ff9f865773..26c9b13e40 100644
--- a/engines/titanic/npcs/bellbot.cpp
+++ b/engines/titanic/npcs/bellbot.cpp
@@ -62,7 +62,7 @@ void CBellBot::load(SimpleFile *file) {
bool CBellBot::OnSummonBotMsg(COnSummonBotMsg *msg) {
if (msg->_value == 1) {
- _npcFlags |= NPCFLAG_40000;
+ _npcFlags |= NPCFLAG_MOVE_LOOP;
} else {
static const char *const ROOM_WAVES[8][2] = {
{ "EmbLobby", "z#193.wav" },
@@ -86,7 +86,7 @@ bool CBellBot::OnSummonBotMsg(COnSummonBotMsg *msg) {
playSound("z#147.wav");
sleep(2000);
- _npcFlags &= ~NPCFLAG_40000;
+ _npcFlags &= ~NPCFLAG_MOVE_LOOP;
}
playClip("Walk On", MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
@@ -114,9 +114,9 @@ bool CBellBot::MovieEndMsg(CMovieEndMsg *msg) {
setPosition(Point(80, 10));
loadFrame(543);
_npcFlags |= NPCFLAG_START_IDLING;
- if (_npcFlags & NPCFLAG_40000) {
+ if (_npcFlags & NPCFLAG_MOVE_LOOP) {
startTalking(this, 157);
- _npcFlags &= ~NPCFLAG_40000;
+ _npcFlags &= ~NPCFLAG_MOVE_LOOP;
}
setTalking(this, true);
@@ -125,7 +125,7 @@ bool CBellBot::MovieEndMsg(CMovieEndMsg *msg) {
CPutBotBackInHisBoxMsg boxMsg;
boxMsg.execute(this);
- if (_npcFlags & NPCFLAG_20000)
+ if (_npcFlags & NPCFLAG_MOVE_START)
startAnimTimer("SummonDoorbot", 1500);
} else {
CTrueTalkNPC::MovieEndMsg(msg);
@@ -167,7 +167,7 @@ bool CBellBot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) {
}
case 5:
- _npcFlags &= ~NPCFLAG_20000;
+ _npcFlags &= ~NPCFLAG_MOVE_START;
playClip("Walk Off", MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
movieEvent();
break;
@@ -246,7 +246,7 @@ bool CBellBot::TimerMsg(CTimerMsg *msg) {
botMsg.execute(room);
}
- _npcFlags &= ~NPCFLAG_20000;
+ _npcFlags &= ~NPCFLAG_MOVE_START;
} else {
CTrueTalkNPC::TimerMsg(msg);
}
diff --git a/engines/titanic/npcs/deskbot.cpp b/engines/titanic/npcs/deskbot.cpp
index e822ae9ee1..56f4d98f18 100644
--- a/engines/titanic/npcs/deskbot.cpp
+++ b/engines/titanic/npcs/deskbot.cpp
@@ -87,7 +87,7 @@ bool CDeskbot::TurnOn(CTurnOn *msg) {
playSound("b#69.wav");
petSetArea(PET_CONVERSATION);
- _npcFlags |= NPCFLAG_20000;
+ _npcFlags |= NPCFLAG_MOVE_START;
_deskbotActive = true;
}
@@ -126,11 +126,11 @@ bool CDeskbot::MovieEndMsg(CMovieEndMsg *msg) {
flag = true;
}
- if (_npcFlags & NPCFLAG_40000) {
+ if (_npcFlags & NPCFLAG_MOVE_LOOP) {
_deskbotActive = false;
- _npcFlags &= ~(NPCFLAG_40000 | NPCFLAG_20000);
+ _npcFlags &= ~(NPCFLAG_MOVE_LOOP | NPCFLAG_MOVE_START);
- if (_npcFlags & NPCFLAG_80000) {
+ if (_npcFlags & NPCFLAG_MOVE_FINISH) {
CTurnOn turnOn;
turnOn.execute("EmbBellbotTrigger");
unlockMouse();
@@ -142,12 +142,12 @@ bool CDeskbot::MovieEndMsg(CMovieEndMsg *msg) {
changeView("EmbLobby.Node 4.N", "");
}
- _npcFlags &= ~(NPCFLAG_80000 | NPCFLAG_MOVE_LEFT);
+ _npcFlags &= ~(NPCFLAG_MOVE_FINISH | NPCFLAG_MOVE_LEFT);
flag = true;
}
- if (_npcFlags & NPCFLAG_20000) {
- _npcFlags &= ~(NPCFLAG_40000 | NPCFLAG_20000);
+ if (_npcFlags & NPCFLAG_MOVE_START) {
+ _npcFlags &= ~(NPCFLAG_MOVE_LOOP | NPCFLAG_MOVE_START);
setTalking(this, true, findView());
_npcFlags |= NPCFLAG_START_IDLING;
@@ -231,7 +231,7 @@ bool CDeskbot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) {
break;
case 26:
- _npcFlags |= NPCFLAG_80000;
+ _npcFlags |= NPCFLAG_MOVE_FINISH;
CTurnOff turnOff;
turnOff.execute(this);
lockMouse();
@@ -254,7 +254,7 @@ bool CDeskbot::NPCPlayIdleAnimationMsg(CNPCPlayIdleAnimationMsg *msg) {
}
bool CDeskbot::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMsg *msg) {
- if (_npcFlags & NPCFLAG_40000)
+ if (_npcFlags & NPCFLAG_MOVE_LOOP)
return true;
CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(msg);
@@ -274,7 +274,7 @@ bool CDeskbot::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMsg *m
}
bool CDeskbot::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) {
- if (_npcFlags & NPCFLAG_40000)
+ if (_npcFlags & NPCFLAG_MOVE_LOOP)
return true;
CTurnOff turnOff;
@@ -285,7 +285,7 @@ bool CDeskbot::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg)
case 41787:
case 41788:
case 41789:
- _npcFlags |= NPCFLAG_80000;
+ _npcFlags |= NPCFLAG_MOVE_FINISH;
turnOff.execute(this);
case 41686:
@@ -305,7 +305,7 @@ bool CDeskbot::TurnOff(CTurnOff *msg) {
stopMovie();
performAction(1, findView());
- _npcFlags = (_npcFlags & ~(NPCFLAG_SPEAKING | NPCFLAG_IDLING | NPCFLAG_START_IDLING)) | NPCFLAG_40000;
+ _npcFlags = (_npcFlags & ~(NPCFLAG_SPEAKING | NPCFLAG_IDLING | NPCFLAG_START_IDLING)) | NPCFLAG_MOVE_LOOP;
playClip("Closing", MOVIE_GAMESTATE | MOVIE_NOTIFY_OBJECT);
}
diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp
index 0a067d07a8..f8cc440c03 100644
--- a/engines/titanic/npcs/parrot.cpp
+++ b/engines/titanic/npcs/parrot.cpp
@@ -231,15 +231,17 @@ bool CParrot::MovieEndMsg(CMovieEndMsg *msg) {
_npcFlags &= ~NPCFLAG_TAKE_OFF;
_state = PARROT_ESCAPED;
} else if (_npcFlags & NPCFLAG_MOVING) {
- if (_npcFlags & NPCFLAG_20000) {
- _npcFlags = (_npcFlags & ~NPCFLAG_20000) | NPCFLAG_40000;
+ if (_npcFlags & NPCFLAG_MOVE_START) {
+ // Parrot is about to loop
+ _npcFlags = (_npcFlags & ~NPCFLAG_MOVE_START) | NPCFLAG_MOVE_LOOP;
if (_npcFlags & NPCFLAG_MOVE_LEFT) {
playClip("Walk Left Loop", MOVIE_NOTIFY_OBJECT);
movieEvent(236);
} else {
playClip("Walk Right Loop", MOVIE_NOTIFY_OBJECT);
}
- } else if (_npcFlags & NPCFLAG_40000) {
+ } else if (_npcFlags & NPCFLAG_MOVE_LOOP) {
+ // In progress movement loop
int xp = _bounds.left + _bounds.width() / 2;
if (_npcFlags & NPCFLAG_MOVE_LEFT) {
@@ -250,7 +252,7 @@ bool CParrot::MovieEndMsg(CMovieEndMsg *msg) {
} else {
setPosition(Point(_bounds.left - 10, _bounds.top));
playClip("Walk Left Outro", MOVIE_NOTIFY_OBJECT);
- _npcFlags = (_npcFlags & ~NPCFLAG_40000) | NPCFLAG_80000;
+ _npcFlags = (_npcFlags & ~NPCFLAG_MOVE_LOOP) | NPCFLAG_MOVE_FINISH;
}
} else {
if ((_newXc - xp) > 32) {
@@ -258,25 +260,26 @@ bool CParrot::MovieEndMsg(CMovieEndMsg *msg) {
movieEvent(244);
} else {
playClip("Walk Right Outro", MOVIE_NOTIFY_OBJECT);
- _npcFlags = (_npcFlags & NPCFLAG_40000) | NPCFLAG_80000;
+ _npcFlags = (_npcFlags & ~NPCFLAG_MOVE_LOOP) | NPCFLAG_MOVE_FINISH;
}
}
- } else if (_npcFlags & NPCFLAG_80000) {
+ } else if (_npcFlags & NPCFLAG_MOVE_FINISH) {
+ // Finishing movement
loadFrame(0);
if (_npcFlags & NPCFLAG_MOVE_LEFT)
setPosition(Point(_bounds.left - 30, _bounds.top));
else
setPosition(Point(_bounds.left + 14, _bounds.top));
- _npcFlags &= ~(NPCFLAG_MOVING | NPCFLAG_80000 | NPCFLAG_MOVE_LEFT | NPCFLAG_MOVE_RIGHT);
+ _npcFlags &= ~(NPCFLAG_MOVING | NPCFLAG_MOVE_FINISH | NPCFLAG_MOVE_LEFT | NPCFLAG_MOVE_RIGHT);
CTrueTalkNPC::MovieEndMsg(msg);
} else {
- if (_npcFlags & NPCFLAG_MOVE_LEFT0) {
+ if (_npcFlags & NPCFLAG_1000000) {
Point pt = getMousePos();
if (pt.x > 70 || pt.y < 90 || pt.y > 280) {
stopMovie();
loadFrame(0);
- _npcFlags &= ~NPCFLAG_MOVE_LEFT0;
+ _npcFlags &= ~NPCFLAG_1000000;
}
if (clipExistsByEnd("Walk Left Loop", msg->_endFrame)) {
@@ -311,7 +314,7 @@ bool CParrot::MovieEndMsg(CMovieEndMsg *msg) {
actMsg.execute(chicken);
}
- _npcFlags &= ~NPCFLAG_MOVE_LEFT0;
+ _npcFlags &= ~NPCFLAG_1000000;
return true;
}
}
@@ -332,8 +335,8 @@ bool CParrot::MovieEndMsg(CMovieEndMsg *msg) {
_npcFlags |= NPCFLAG_TAKE_OFF;
} else {
// Resetting back to standing
- _npcFlags &= ~(NPCFLAG_MOVING | NPCFLAG_20000 | NPCFLAG_40000
- | NPCFLAG_80000 | NPCFLAG_MOVE_LEFT | NPCFLAG_MOVE_RIGHT);
+ _npcFlags &= ~(NPCFLAG_MOVING | NPCFLAG_MOVE_START | NPCFLAG_MOVE_LOOP
+ | NPCFLAG_MOVE_FINISH | NPCFLAG_MOVE_LEFT | NPCFLAG_MOVE_RIGHT);
_npcFlags |= NPCFLAG_MOVE_END;
stopMovie();
loadFrame(0);
@@ -357,8 +360,8 @@ bool CParrot::EnterViewMsg(CEnterViewMsg *msg) {
if (_state == PARROT_IN_CAGE) {
setPosition(Point(_newXp, _bounds.top));
_field118 = 1;
- _npcFlags &= ~(NPCFLAG_MOVING | NPCFLAG_20000 | NPCFLAG_40000
- | NPCFLAG_80000 | NPCFLAG_MOVE_LEFT | NPCFLAG_MOVE_RIGHT | NPCFLAG_MOVE_END);
+ _npcFlags &= ~(NPCFLAG_MOVING | NPCFLAG_MOVE_START | NPCFLAG_MOVE_LOOP
+ | NPCFLAG_MOVE_FINISH | NPCFLAG_MOVE_LEFT | NPCFLAG_MOVE_RIGHT | NPCFLAG_MOVE_END);
loadFrame(0);
setTalking(this, true, findView());
@@ -491,7 +494,7 @@ bool CParrot::NPCPlayTalkingAnimationMsg(CNPCPlayTalkingAnimationMsg *msg) {
"Talking5", "Talking6", "Talking7", nullptr
};
- if (!(_npcFlags & (NPCFLAG_MOVING | NPCFLAG_20000 | NPCFLAG_40000 | NPCFLAG_80000
+ if (!(_npcFlags & (NPCFLAG_MOVING | NPCFLAG_MOVE_START | NPCFLAG_MOVE_LOOP | NPCFLAG_MOVE_FINISH
| NPCFLAG_MOVE_LEFT | NPCFLAG_MOVE_RIGHT | NPCFLAG_MOVE_END))
&& _visible && _state == PARROT_IN_CAGE) {
if (!compareViewNameTo("ParrotLobby.Node 1.N"))
@@ -507,7 +510,7 @@ bool CParrot::NPCPlayIdleAnimationMsg(CNPCPlayIdleAnimationMsg *msg) {
"Peck At Feet Right", nullptr
};
- if (!(_npcFlags & (NPCFLAG_MOVING | NPCFLAG_20000 | NPCFLAG_40000 | NPCFLAG_80000
+ if (!(_npcFlags & (NPCFLAG_MOVING | NPCFLAG_MOVE_START | NPCFLAG_MOVE_LOOP | NPCFLAG_MOVE_FINISH
| NPCFLAG_MOVE_LEFT | NPCFLAG_MOVE_RIGHT | NPCFLAG_MOVE_END))
&& _visible && _state == PARROT_IN_CAGE && !compareViewNameTo("ParrotLobby.Node 1.N")) {
CGameObject *dragItem = getDraggingObject();
@@ -595,15 +598,15 @@ bool CParrot::FrameMsg(CFrameMsg *msg) {
_panTarget = nullptr;
}
- _npcFlags &= ~(NPCFLAG_MOVING | NPCFLAG_20000 | NPCFLAG_40000
- | NPCFLAG_80000 | NPCFLAG_MOVE_LEFT | NPCFLAG_MOVE_RIGHT | NPCFLAG_MOVE_END);
+ _npcFlags &= ~(NPCFLAG_MOVING | NPCFLAG_MOVE_START | NPCFLAG_MOVE_LOOP
+ | NPCFLAG_MOVE_FINISH | NPCFLAG_MOVE_LEFT | NPCFLAG_MOVE_RIGHT | NPCFLAG_MOVE_END);
return true;
}
} else {
if (dragObject)
chickenFlag = dragObject && dragObject->isEquals("Chicken");
- if (_npcFlags & NPCFLAG_MOVE_LEFT0) {
+ if (_npcFlags & NPCFLAG_1000000) {
if (!chickenFlag || pt.x > 70 || pt.y < 90 || pt.y > 280) {
stopMovie();
loadFrame(0);
@@ -621,7 +624,7 @@ bool CParrot::FrameMsg(CFrameMsg *msg) {
return true;
if (ABS(_newXc - xp) > 64) {
- _npcFlags |= NPCFLAG_MOVING | NPCFLAG_20000;
+ _npcFlags |= NPCFLAG_MOVING | NPCFLAG_MOVE_START;
if (_newXc >= xp) {
setPosition(Point(_bounds.left + 30, _bounds.top));
@@ -654,7 +657,7 @@ bool CParrot::FrameMsg(CFrameMsg *msg) {
if (action != 280266) {
if (pt.x < 75) {
- _npcFlags |= NPCFLAG_MOVE_LEFT0;
+ _npcFlags |= NPCFLAG_1000000;
playClip("Walk Left Intro", MOVIE_STOP_PREVIOUS);
playClip("Walk Left Loop", MOVIE_NOTIFY_OBJECT);
movieEvent(236);
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index 35d6690887..3727c49331 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -31,11 +31,11 @@ namespace Titanic {
enum NpcFlag {
NPCFLAG_SPEAKING = 1, NPCFLAG_IDLING = 2, NPCFLAG_START_IDLING = 4,
- NPCFLAG_8 = 8, NPCFLAG_MOVING = 0x10000, NPCFLAG_20000 = 0x20000,
- NPCFLAG_40000 = 0x40000, NPCFLAG_80000 = 0x80000,
+ NPCFLAG_8 = 8, NPCFLAG_MOVING = 0x10000, NPCFLAG_MOVE_START = 0x20000,
+ NPCFLAG_MOVE_LOOP = 0x40000, NPCFLAG_MOVE_FINISH = 0x80000,
NPCFLAG_MOVE_LEFT = 0x100000, NPCFLAG_MOVE_RIGHT = 0x200000,
NPCFLAG_MOVE_END = 0x400000, NPCFLAG_800000 = 0x800000,
- NPCFLAG_MOVE_LEFT0 = 0x1000000, NPCFLAG_TAKE_OFF = 0x2000000,
+ NPCFLAG_1000000 = 0x1000000, NPCFLAG_TAKE_OFF = 0x2000000,
NPCFLAG_4000000 = 0x4000000, NPCFLAG_DOORBOT_INTRO = 0x8000000
};