aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/game')
-rw-r--r--engines/titanic/game/cdrom.cpp3
-rw-r--r--engines/titanic/game/cdrom_tray.cpp1
-rw-r--r--engines/titanic/game/computer.cpp2
-rw-r--r--engines/titanic/game/maitred/maitred_prod_receptor.cpp4
-rw-r--r--engines/titanic/game/pet/pet.cpp2
-rw-r--r--engines/titanic/game/pet/pet_lift.cpp4
-rw-r--r--engines/titanic/game/pet/pet_position.cpp4
-rw-r--r--engines/titanic/game/pet/pet_transport.cpp6
-rw-r--r--engines/titanic/game/pet/pet_transport.h1
-rw-r--r--engines/titanic/game/service_elevator_window.cpp41
-rw-r--r--engines/titanic/game/service_elevator_window.h8
-rw-r--r--engines/titanic/game/television.cpp4
-rw-r--r--engines/titanic/game/transport/gondolier.cpp2
-rw-r--r--engines/titanic/game/transport/lift_indicator.cpp34
-rw-r--r--engines/titanic/game/transport/lift_indicator.h6
-rw-r--r--engines/titanic/game/transport/service_elevator.cpp15
16 files changed, 77 insertions, 60 deletions
diff --git a/engines/titanic/game/cdrom.cpp b/engines/titanic/game/cdrom.cpp
index cd913d05f7..0d1cd3a6f2 100644
--- a/engines/titanic/game/cdrom.cpp
+++ b/engines/titanic/game/cdrom.cpp
@@ -50,6 +50,7 @@ void CCDROM::load(SimpleFile *file) {
bool CCDROM::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (checkStartDragging(msg)) {
+ hideMouse();
_tempPos = msg->_mousePos - _bounds;
setPosition(msg->_mousePos - _tempPos);
return true;
@@ -59,6 +60,8 @@ bool CCDROM::MouseDragStartMsg(CMouseDragStartMsg *msg) {
}
bool CCDROM::MouseDragEndMsg(CMouseDragEndMsg *msg) {
+ showMouse();
+
if (msg->_dropTarget && msg->_dropTarget->getName() == "newComputer") {
CCDROMTray *newTray = dynamic_cast<CCDROMTray *>(getRoom()->findByName("newTray"));
diff --git a/engines/titanic/game/cdrom_tray.cpp b/engines/titanic/game/cdrom_tray.cpp
index 505bdad319..d6aa32c702 100644
--- a/engines/titanic/game/cdrom_tray.cpp
+++ b/engines/titanic/game/cdrom_tray.cpp
@@ -95,6 +95,7 @@ bool CCDROMTray::ActMsg(CActMsg *msg) {
playSound("a#35.wav", 50, 0, 0);
} else if (msg->_action == "newSTCD") {
// Starship Titanic CD dropped on CDROM Tray
+ disableMouse();
playMovie(11, 21, MOVIE_NOTIFY_OBJECT);
playSound("a#35.wav", 50, 0, 0);
} else {
diff --git a/engines/titanic/game/computer.cpp b/engines/titanic/game/computer.cpp
index 3077b46178..9aa5db252c 100644
--- a/engines/titanic/game/computer.cpp
+++ b/engines/titanic/game/computer.cpp
@@ -54,7 +54,7 @@ bool CComputer::ActMsg(CActMsg *msg) {
else if (msg->_action == "CD2")
playMovie(50, 79, 0);
else if (msg->_action == "STCD")
- playMovie(80, 90, 4);
+ playMovie(80, 90, MOVIE_NOTIFY_OBJECT);
_currentCD = msg->_action;
_state = 0;
diff --git a/engines/titanic/game/maitred/maitred_prod_receptor.cpp b/engines/titanic/game/maitred/maitred_prod_receptor.cpp
index 95e029af44..6f64a76d7f 100644
--- a/engines/titanic/game/maitred/maitred_prod_receptor.cpp
+++ b/engines/titanic/game/maitred/maitred_prod_receptor.cpp
@@ -81,7 +81,7 @@ bool CMaitreDProdReceptor::MouseMoveMsg(CMouseMoveMsg *msg) {
prodMsg._value = 125;
CMaitreD *maitreD = dynamic_cast<CMaitreD *>(findRoomObject("MaitreD"));
- if (maitreD && maitreD->_field100 <= 0)
+ if (maitreD && maitreD->_speechCounter == 0)
prodMsg.execute(this);
return true;
@@ -90,7 +90,7 @@ bool CMaitreDProdReceptor::MouseMoveMsg(CMouseMoveMsg *msg) {
bool CMaitreDProdReceptor::ProdMaitreDMsg(CProdMaitreDMsg *msg) {
if (_fieldC4) {
CMaitreD *maitreD = static_cast<CMaitreD *>(findRoomObject("MaitreD"));
- if (maitreD->_field100 <= 0) {
+ if (maitreD->_speechCounter == 0) {
CViewItem *view = findView();
startTalking(maitreD, msg->_value, view);
diff --git a/engines/titanic/game/pet/pet.cpp b/engines/titanic/game/pet/pet.cpp
index 99c9e01eb3..235d68f242 100644
--- a/engines/titanic/game/pet/pet.cpp
+++ b/engines/titanic/game/pet/pet.cpp
@@ -62,7 +62,7 @@ void CPET::load(SimpleFile *file) {
bool CPET::ShowTextMsg(CShowTextMsg *msg) {
CPetControl *pet = getPetControl();
if (pet)
- pet->petDisplayMessage(1, msg->_value);
+ pet->petDisplayMessage(1, msg->_message);
return true;
}
diff --git a/engines/titanic/game/pet/pet_lift.cpp b/engines/titanic/game/pet/pet_lift.cpp
index a7b48853e6..75a48a6a6c 100644
--- a/engines/titanic/game/pet/pet_lift.cpp
+++ b/engines/titanic/game/pet/pet_lift.cpp
@@ -50,8 +50,8 @@ bool CPETLift::TransportMsg(CTransportMsg *msg) {
} else if (msg->_roomName == "BottomOfWell") {
floorNum = 39;
} else if (msg->_roomName == "PlayersRoom" && pet) {
- int assignedFloor = pet->getAssignedFloorNum();
- if (assignedFloor < 1 || assignedFloor > 39) {
+ floorNum = pet->getAssignedFloorNum();
+ if (floorNum < 1 || floorNum > 39) {
pet->petDisplayMessage(NO_ROOM_ASSIGNED);
floorNum = -1;
}
diff --git a/engines/titanic/game/pet/pet_position.cpp b/engines/titanic/game/pet/pet_position.cpp
index d3d030eb16..db6f9997c9 100644
--- a/engines/titanic/game/pet/pet_position.cpp
+++ b/engines/titanic/game/pet/pet_position.cpp
@@ -171,8 +171,8 @@ bool CPETPosition::EnterViewMsg(CEnterViewMsg *msg) {
bool CPETPosition::LeaveViewMsg(CLeaveViewMsg *msg) {
CPetControl *pet = getPetControl();
- CString oldView = msg->_oldView->getName();
- CString newView = msg->_newView->getName();
+ CString oldView = msg->_oldView->getFullViewName();
+ CString newView = msg->_newView->getFullViewName();
if (pet && newView == "Lift.Node 1.N") {
int elevatorNum = pet->getRoomsElevatorNum();
diff --git a/engines/titanic/game/pet/pet_transport.cpp b/engines/titanic/game/pet/pet_transport.cpp
index a48e70ed01..29dce6c1b6 100644
--- a/engines/titanic/game/pet/pet_transport.cpp
+++ b/engines/titanic/game/pet/pet_transport.cpp
@@ -26,6 +26,7 @@ namespace Titanic {
BEGIN_MESSAGE_MAP(CPETTransport, CGameObject)
ON_MESSAGE(EnterRoomMsg)
+ ON_MESSAGE(LeaveRoomMsg)
END_MESSAGE_MAP()
void CPETTransport::save(SimpleFile *file, int indent) {
@@ -39,6 +40,11 @@ void CPETTransport::load(SimpleFile *file) {
}
bool CPETTransport::EnterRoomMsg(CEnterRoomMsg *msg) {
+ petSetRemoteTarget();
+ return true;
+}
+
+bool CPETTransport::LeaveRoomMsg(CLeaveRoomMsg *msg) {
petClear();
return true;
}
diff --git a/engines/titanic/game/pet/pet_transport.h b/engines/titanic/game/pet/pet_transport.h
index 58aefe6743..6a08c4bdf3 100644
--- a/engines/titanic/game/pet/pet_transport.h
+++ b/engines/titanic/game/pet/pet_transport.h
@@ -31,6 +31,7 @@ namespace Titanic {
class CPETTransport : public CGameObject {
DECLARE_MESSAGE_MAP;
virtual bool EnterRoomMsg(CEnterRoomMsg *msg);
+ virtual bool LeaveRoomMsg(CLeaveRoomMsg *msg);
public:
CLASSDEF;
diff --git a/engines/titanic/game/service_elevator_window.cpp b/engines/titanic/game/service_elevator_window.cpp
index 13db7a26f8..d548bbf37e 100644
--- a/engines/titanic/game/service_elevator_window.cpp
+++ b/engines/titanic/game/service_elevator_window.cpp
@@ -35,25 +35,25 @@ END_MESSAGE_MAP()
static const int FACTORS[4] = { 0, 20, 100, 0 };
CServiceElevatorWindow::CServiceElevatorWindow() : CBackground(),
- _fieldE0(0), _fieldE4(0), _fieldE8(0), _fieldEC(0) {
+ _destFloor(0), _notifyFlag(false), _isIndicator(false), _intoSpace(false) {
}
void CServiceElevatorWindow::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeNumberLine(_fieldE0, indent);
- file->writeNumberLine(_fieldE4, indent);
- file->writeNumberLine(_fieldE8, indent);
- file->writeNumberLine(_fieldEC, indent);
+ file->writeNumberLine(_destFloor, indent);
+ file->writeNumberLine(_notifyFlag, indent);
+ file->writeNumberLine(_isIndicator, indent);
+ file->writeNumberLine(_intoSpace, indent);
CBackground::save(file, indent);
}
void CServiceElevatorWindow::load(SimpleFile *file) {
file->readNumber();
- _fieldE0 = file->readNumber();
- _fieldE4 = file->readNumber();
- _fieldE8 = file->readNumber();
- _fieldEC = file->readNumber();
+ _destFloor = file->readNumber();
+ _notifyFlag = file->readNumber();
+ _isIndicator = file->readNumber();
+ _intoSpace = file->readNumber();
CBackground::load(file);
}
@@ -61,39 +61,42 @@ void CServiceElevatorWindow::load(SimpleFile *file) {
bool CServiceElevatorWindow::ServiceElevatorFloorChangeMsg(CServiceElevatorFloorChangeMsg *msg) {
if (getView() == findView()) {
CDoorbot *doorbot = dynamic_cast<CDoorbot *>(findRoom()->findByName("Doorbot"));
- int val = (_fieldE8 && doorbot) ? 65 : 15;
+ int fps = (_isIndicator && doorbot) ? 65 : 15;
CMovieClip *clip = _movieClips.findByName("Going Up");
if (!clip)
return true;
- int count = _endFrame - _startFrame;
- setMovieFrameRate(1.0 * count / val);
+ int count = clip->_endFrame - clip->_startFrame;
+ setMovieFrameRate(1.0 * count / fps);
- int startFrame = clip->_startFrame + count * FACTORS[msg->_value1] / 100;
- int endFrame = clip->_startFrame + count * FACTORS[msg->_value2] / 100;
+ int startFrame = clip->_startFrame + count * FACTORS[msg->_startFloor] / 100;
+ int endFrame = clip->_startFrame + count * FACTORS[msg->_endFloor] / 100;
- if (_fieldE4) {
+ if (_notifyFlag) {
+ // Service elevator indicator
playMovie(startFrame, endFrame, MOVIE_NOTIFY_OBJECT);
} else {
+ // Background outside elevator
playMovie(startFrame, endFrame, 0);
- if (_fieldEC)
+ if (_intoSpace)
playClip("Into Space");
}
}
- _fieldE0 = msg->_value2;
+ _destFloor = msg->_endFloor;
return true;
}
bool CServiceElevatorWindow::MovieEndMsg(CMovieEndMsg *msg) {
+ // Called when indicator reaches desired destination floor
CServiceElevatorMsg elevMsg(5);
elevMsg.execute(findRoom()->findByName("Service Elevator Entity"));
return true;
}
bool CServiceElevatorWindow::EnterViewMsg(CEnterViewMsg *msg) {
- if (_fieldEC) {
+ if (_intoSpace) {
playClip("Fade Up");
playMovie(1, 2, 0);
} else {
@@ -101,7 +104,7 @@ bool CServiceElevatorWindow::EnterViewMsg(CEnterViewMsg *msg) {
if (clip) {
int frameNum = clip->_startFrame + (clip->_endFrame - clip->_startFrame)
- * FACTORS[_fieldE0] / 100;
+ * FACTORS[_destFloor] / 100;
loadFrame(frameNum);
} else {
loadFrame(0);
diff --git a/engines/titanic/game/service_elevator_window.h b/engines/titanic/game/service_elevator_window.h
index 88e1663aba..baeef5aeb8 100644
--- a/engines/titanic/game/service_elevator_window.h
+++ b/engines/titanic/game/service_elevator_window.h
@@ -33,10 +33,10 @@ class CServiceElevatorWindow : public CBackground {
bool MovieEndMsg(CMovieEndMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
public:
- int _fieldE0;
- int _fieldE4;
- int _fieldE8;
- int _fieldEC;
+ int _destFloor;
+ bool _notifyFlag;
+ bool _isIndicator;
+ bool _intoSpace;
public:
CLASSDEF;
CServiceElevatorWindow();
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index 571ebcd6fa..2d5a09790b 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -257,11 +257,11 @@ bool CTelevision::MovieEndMsg(CMovieEndMsg *msg) {
if (_turnOn)
loadFrame(502);
else
- warning("There is currently nothing available for your viewing pleasure on this channel.");
+ petDisplayMessage(NOTHING_ON_CHANNEL);
} else if (_fieldE0 == 5 && *CGetLiftEye2::_destObject != "NULL") {
loadFrame(393 + _v4);
} else {
- warning("There is currently nothing available for your viewing pleasure on this channel.");
+ petDisplayMessage(NOTHING_ON_CHANNEL);
}
return true;
diff --git a/engines/titanic/game/transport/gondolier.cpp b/engines/titanic/game/transport/gondolier.cpp
index 8c28ff9b66..85f3b365b5 100644
--- a/engines/titanic/game/transport/gondolier.cpp
+++ b/engines/titanic/game/transport/gondolier.cpp
@@ -46,7 +46,7 @@ void CGondolier::load(SimpleFile *file) {
}
bool CGondolier::StatusChangeMsg(CStatusChangeMsg *msg) {
- CShowTextMsg textMsg("Only First Class passengers are allowed to use the Gondoliers.");
+ CShowTextMsg textMsg(GONDOLIERS_FIRST_CLASS_ONLY);
textMsg.execute("PET");
return true;
}
diff --git a/engines/titanic/game/transport/lift_indicator.cpp b/engines/titanic/game/transport/lift_indicator.cpp
index a642451fe0..df0ff397da 100644
--- a/engines/titanic/game/transport/lift_indicator.cpp
+++ b/engines/titanic/game/transport/lift_indicator.cpp
@@ -38,31 +38,31 @@ BEGIN_MESSAGE_MAP(CLiftindicator, CLift)
END_MESSAGE_MAP()
CLiftindicator::CLiftindicator() : CLift(),
- _fieldFC(0), _start(0), _end(0) {
+ _multiplier(0), _startY(0), _endY(0) {
}
void CLiftindicator::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeNumberLine(_fieldFC, indent);
+ file->writeNumberLine(_multiplier, indent);
file->writePoint(_indicatorPos, indent);
- file->writeNumberLine(_start, indent);
- file->writeNumberLine(_end, indent);
+ file->writeNumberLine(_startY, indent);
+ file->writeNumberLine(_endY, indent);
CLift::save(file, indent);
}
void CLiftindicator::load(SimpleFile *file) {
file->readNumber();
- _fieldFC = file->readNumber();
+ _multiplier = file->readNumber();
_indicatorPos = file->readPoint();
- _start = file->readNumber();
- _end = file->readNumber();
+ _startY = file->readNumber();
+ _endY = file->readNumber();
CLift::load(file);
}
bool CLiftindicator::EnterViewMsg(CEnterViewMsg *msg) {
- double multiplier = _fieldFC * 0.037037037;
+ double multiplier = _multiplier * 0.037037037;
CPetControl *pet = getPetControl();
int floorNum = pet->getRoomsFloorNum();
debugC(kDebugScripts, "Lifts = %d,%d,%d,%d, %d",
@@ -70,7 +70,7 @@ bool CLiftindicator::EnterViewMsg(CEnterViewMsg *msg) {
CLift::_elevator3Floor, CLift::_elevator4Floor,
floorNum);
- if ((pet->petGetRoomsWellEntry() & 1) == (_fieldFC & 1)) {
+ if ((pet->petGetRoomsWellEntry() & 1) == (_liftNum & 1)) {
petSetRemoteTarget();
petSetArea(PET_REMOTE);
@@ -142,7 +142,7 @@ bool CLiftindicator::LeaveViewMsg(CLeaveViewMsg *msg) {
}
bool CLiftindicator::PETActivateMsg(CPETActivateMsg *msg) {
- double multiplier = _fieldFC * 0.037037037;
+ double multiplier = _multiplier * 0.037037037;
CPetControl *pet = getPetControl();
if (msg->_name == "Lift") {
@@ -155,8 +155,8 @@ bool CLiftindicator::PETActivateMsg(CPETActivateMsg *msg) {
&& pet->getRoomsFloorNum() != CLift::_elevator4Floor) {
petDisplayMessage(1, ELEVATOR_NON_FUNCTIONAL);
} else {
- _start = _indicatorPos.y + (int)(_startFrame * multiplier);
- _end = _indicatorPos.y + (int)(_endFrame * multiplier);
+ _startY = _indicatorPos.y + (int)(_startFrame * multiplier);
+ _endY = _indicatorPos.y + (int)(_endFrame * multiplier);
lockMouse();
addTimer(100);
@@ -213,15 +213,15 @@ bool CLiftindicator::LeaveRoomMsg(CLeaveRoomMsg *msg) {
}
bool CLiftindicator::TimerMsg(CTimerMsg *msg) {
- debugC(kDebugScripts, "Start %d, End %d", _start, _end);
+ debugC(kDebugScripts, "Start %d, End %d", _startY, _endY);
- if (_start > _end) {
+ if (_startY > _endY) {
setPosition(Point(_bounds.left, _bounds.top - 1));
- --_start;
+ --_startY;
addTimer(20);
- } else if (_start < _end) {
+ } else if (_startY < _endY) {
setPosition(Point(_bounds.left, _bounds.top + 1));
- ++_start;
+ ++_startY;
addTimer(20);
} else {
CMovieEndMsg endMsg(0, 0);
diff --git a/engines/titanic/game/transport/lift_indicator.h b/engines/titanic/game/transport/lift_indicator.h
index 5d0bc45d7b..5ff9dc6d36 100644
--- a/engines/titanic/game/transport/lift_indicator.h
+++ b/engines/titanic/game/transport/lift_indicator.h
@@ -39,10 +39,10 @@ class CLiftindicator : public CLift {
bool LeaveRoomMsg(CLeaveRoomMsg *msg);
bool TimerMsg(CTimerMsg *msg);
private:
- int _fieldFC;
+ int _multiplier;
Point _indicatorPos;
- int _start;
- int _end;
+ int _startY;
+ int _endY;
public:
CLASSDEF;
CLiftindicator();
diff --git a/engines/titanic/game/transport/service_elevator.cpp b/engines/titanic/game/transport/service_elevator.cpp
index 066a418dbb..dbd4e5d74f 100644
--- a/engines/titanic/game/transport/service_elevator.cpp
+++ b/engines/titanic/game/transport/service_elevator.cpp
@@ -116,6 +116,7 @@ bool CServiceElevator::ServiceElevatorMsg(CServiceElevatorMsg *msg) {
break;
case 5:
+ // Reaching destination floor
_fieldF8 = false;
_fieldDC = _v3;
loadSound("z#423.wav");
@@ -164,9 +165,10 @@ bool CServiceElevator::TimerMsg(CTimerMsg *msg) {
if (!isSoundActive(_soundHandle1)) {
stopAnimTimer(_timerId);
if (msg->_actionVal == 0) {
+ // Elevator in motion after pressing button
_fieldF8 = true;
CServiceElevatorFloorChangeMsg changeMsg(_fieldDC, _v3);
- changeMsg.execute(getRoom());
+ changeMsg.execute(getRoom(), nullptr, MSGFLAG_SCAN);
_soundHandle2 = playSound("z#424.wav");
if (doorbot) {
@@ -174,6 +176,7 @@ bool CServiceElevator::TimerMsg(CTimerMsg *msg) {
actMsg.execute(doorbot);
}
} else {
+ // Finished playing message for bottom/middle floor disabled
enableMouse();
if (doorbot) {
CActMsg actMsg;
@@ -207,10 +210,10 @@ bool CServiceElevator::ServiceElevatorFloorRequestMsg(CServiceElevatorFloorReque
if (doorbot && _v3 == 0) {
_soundHandle1 = playSound("z#415.wav", 50);
- addTimer(1, 1000, 500);
+ _timerId = addTimer(1, 1000, 500);
} else if (doorbot && _v3 == 1) {
_soundHandle1 = playSound("z#417.wav", 50);
- addTimer(1, 1000, 500);
+ _timerId = addTimer(1, 1000, 500);
} else if (_fieldDC == _v3) {
switch (_v3) {
case 0:
@@ -226,7 +229,7 @@ bool CServiceElevator::ServiceElevatorFloorRequestMsg(CServiceElevatorFloorReque
break;
}
- addTimer(1, 1000, 500);
+ _timerId = addTimer(1, 1000, 500);
} else {
switch (_v3) {
case 0:
@@ -236,13 +239,13 @@ bool CServiceElevator::ServiceElevatorFloorRequestMsg(CServiceElevatorFloorReque
_soundHandle1 = playSound(_fieldDC ? "z#419.wav" : "z#418.wav", 50);
break;
case 2:
- _soundHandle1 = playSound("z#414.wav", 50);
+ _soundHandle1 = playSound("z#409.wav", 50);
break;
default:
break;
}
- addTimer(0, 1000, 500);
+ _timerId = addTimer(0, 1000, 500);
}
return true;