aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/core/game_object.cpp63
-rw-r--r--engines/titanic/core/game_object.h46
-rw-r--r--engines/titanic/npcs/true_talk_npc.cpp4
-rw-r--r--engines/titanic/npcs/true_talk_npc.h5
-rw-r--r--engines/titanic/support/mouse_cursor.cpp18
-rw-r--r--engines/titanic/support/mouse_cursor.h7
-rw-r--r--engines/titanic/support/video_surface.cpp4
-rw-r--r--engines/titanic/support/video_surface.h4
8 files changed, 146 insertions, 5 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 183cb6b6ee..9c5f9db3b4 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -830,10 +830,32 @@ void CGameObject::moveToView() {
view->addUnder(this);
}
+void CGameObject::moveToView(const CString &name) {
+ CViewItem *view = parseView(name);
+ detach();
+ view->addUnder(this);
+}
+
void CGameObject::incState38() {
getGameManager()->_gameState.inc38();
}
+void CGameObject::stateInc14() {
+ getGameManager()->_gameState.inc14();
+}
+
+int CGameObject::stateGet14() {
+ return getGameManager()->_gameState._field14;
+}
+
+void CGameObject::stateSet24() {
+ getGameManager()->_gameState.set24(1);
+}
+
+int CGameObject::stateGet24() {
+ return getGameManager()->_gameState.get24();
+}
+
void CGameObject::inc54() {
getGameManager()->inc54();
}
@@ -842,6 +864,11 @@ void CGameObject::dec54() {
getGameManager()->dec54();
}
+void CGameObject::surface39(int v1, int v2) {
+ if (_surface)
+ _surface->proc39(v1, v2);
+}
+
void CGameObject::lockMouse() {
CGameManager *gameMan = getGameManager();
gameMan->lockInputHandler();
@@ -858,6 +885,36 @@ void CGameObject::showMouse() {
CScreenManager::_screenManagerPtr->_mouseCursor->show();
}
+void CGameObject::disableMouse() {
+ lockInputHandler();
+ hideMouse();
+}
+
+void CGameObject::enableMouse() {
+ unlockInputHandler();
+ showMouse();
+}
+
+void CGameObject::mouseLockE4() {
+ CScreenManager::_screenManagerPtr->_mouseCursor->lockE4();
+}
+
+void CGameObject::mouseUnlockE4() {
+ CScreenManager::_screenManagerPtr->_mouseCursor->unlockE4();
+}
+
+void CGameObject::mouseSaveState(int v1, int v2, int v3) {
+ CScreenManager::_screenManagerPtr->_mouseCursor->saveState(v1, v2, v3);
+}
+
+void CGameObject::lockInputHandler() {
+ getGameManager()->lockInputHandler();
+}
+
+void CGameObject::unlockInputHandler() {
+ getGameManager()->unlockInputHandler();
+}
+
void CGameObject::unlockMouse() {
if (CScreenManager::_screenManagerPtr->_mouseCursor)
CScreenManager::_screenManagerPtr->_mouseCursor->show();
@@ -1244,6 +1301,12 @@ void CGameObject::petSetRooms1D0(int val) {
petControl->setRooms1D0(val);
}
+void CGameObject::petSetRooms1D4(int v) {
+ CPetControl *pet = getPetControl();
+ if (pet)
+ pet->setRooms1D4(v);
+}
+
void CGameObject::petOnSummonBot(const CString &name, int val) {
CPetControl *pet = getPetControl();
if (pet)
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index d9f382c2e4..02168c9f00 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -122,7 +122,6 @@ protected:
*/
CViewItem * parseView(const CString &viewString);
- void incState38();
void inc54();
void dec54();
@@ -147,6 +146,31 @@ protected:
void showMouse();
/**
+ * Disable the mouse
+ */
+ void disableMouse();
+
+ /**
+ * Enable the mouse
+ */
+ void enableMouse();
+
+ void mouseLockE4();
+ void mouseUnlockE4();
+
+ void mouseSaveState(int v1, int v2, int v3);
+
+ /**
+ * Lock the input handler
+ */
+ void lockInputHandler();
+
+ /**
+ * Unlock the input handler
+ */
+ void unlockInputHandler();
+
+ /**
* Load a sound
*/
void loadSound(const CString &name);
@@ -243,11 +267,16 @@ protected:
CGameObject *findInRoom(const CString &name);
/**
- * Moves the item from it's original position to be under the current view
+ * Moves the object to be under the current view
*/
void moveToView();
/**
+ * Moves the object to be under the specified view
+ */
+ void moveToView(const CString &name);
+
+ /**
* Change the view
*/
bool changeView(const CString &viewName, const CString &clipName);
@@ -364,8 +393,6 @@ protected:
*/
uint32 getTickCount();
- void setState1C(bool flag);
-
/**
* Adds an object to the mail list
*/
@@ -405,6 +432,15 @@ protected:
* Unlocks PET input
*/
void petUnlockInput();
+
+ void setState1C(bool flag);
+ void incState38();
+ void stateInc14();
+ int stateGet14();
+ void stateSet24();
+ int stateGet24();
+
+ void surface39(int v1, int v2);
public:
bool _isMail;
int _id;
@@ -696,6 +732,8 @@ public:
void petSetRemoteTarget();
void petSetRooms1D0(int val);
+ void petSetRooms1D4(int v);
+
/**
* Show the PET
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
index 0295826eb5..c989aa3bd7 100644
--- a/engines/titanic/npcs/true_talk_npc.cpp
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -205,6 +205,10 @@ int CTrueTalkNPC::startAnimTimer(const CString &action, uint firstDuration, uint
return timer->_id;
}
+void CTrueTalkNPC::stopAnimTimer(int id) {
+ getGameManager()->stopTimer(id);
+}
+
void CTrueTalkNPC::setView(CViewItem *view) {
CTrueTalkManager *talkManager = getGameManager()->getTalkManager();
if (talkManager)
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index b13841b742..23613041d0 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -67,6 +67,11 @@ protected:
* Start an animation timer
*/
int startAnimTimer(const CString &action, uint firstDuration, uint duration);
+
+ /**
+ * Stop an animation timer
+ */
+ void stopAnimTimer(int id);
public:
CLASSDEF
CTrueTalkNPC();
diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp
index 6ebf4f2164..d87e7a499b 100644
--- a/engines/titanic/support/mouse_cursor.cpp
+++ b/engines/titanic/support/mouse_cursor.cpp
@@ -51,7 +51,8 @@ static const int CURSOR_DATA[NUM_CURSORS][4] = {
};
CMouseCursor::CMouseCursor(CScreenManager *screenManager) :
- _screenManager(screenManager), _cursorId(CURSOR_HOURGLASS), _setCursorCount(0) {
+ _screenManager(screenManager), _cursorId(CURSOR_HOURGLASS),
+ _setCursorCount(0), _fieldE4(0), _fieldE8(0) {
loadCursorImages();
setCursor(CURSOR_ARROW);
}
@@ -129,4 +130,19 @@ void CMouseCursor::update() {
// No implementation needed
}
+void CMouseCursor::lockE4() {
+ _fieldE4 = 0;
+ CScreenManager::_screenManagerPtr->_inputHandler->incLockCount();
+}
+
+void CMouseCursor::unlockE4() {
+ _fieldE4 = 1;
+ _fieldE8 = 0;
+ CScreenManager::_screenManagerPtr->_inputHandler->decLockCount();
+}
+
+void CMouseCursor::saveState(int v1, int v2, int v3) {
+ // TODO
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/support/mouse_cursor.h b/engines/titanic/support/mouse_cursor.h
index ac5da26382..55e0cb4da5 100644
--- a/engines/titanic/support/mouse_cursor.h
+++ b/engines/titanic/support/mouse_cursor.h
@@ -62,6 +62,8 @@ private:
CursorId _cursorId;
CursorEntry _cursors[NUM_CURSORS];
uint _setCursorCount;
+ int _fieldE4;
+ int _fieldE8;
/**
* Load the images for each cursor
@@ -95,6 +97,11 @@ public:
* Returns the number of times the cursor has been set
*/
uint getChangeCount() const { return _setCursorCount; }
+
+ void lockE4();
+ void unlockE4();
+
+ void saveState(int v1, int v2, int v3);
};
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 3b026c546c..c1af869e1e 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -422,6 +422,10 @@ void OSVideoSurface::proc38(int v1, int v2) {
warning("OSVideoSurface::proc38");
}
+void OSVideoSurface::proc39(int v1, int v2) {
+ warning("OSVideoSurface::proc39");
+}
+
bool OSVideoSurface::loadIfReady() {
_videoSurfaceNum = _videoSurfaceCounter;
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 6f707a39ff..2b66b269e7 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -180,6 +180,8 @@ public:
virtual void proc38(int v1, int v2) = 0;
+ virtual void proc39(int v1, int v2) = 0;
+
/**
* Loads the surface's resource if there's one pending
*/
@@ -347,6 +349,8 @@ public:
virtual void proc38(int v1, int v2);
+ virtual void proc39(int v1, int v2);
+
/**
* Loads the surface's resource if there's one pending
*/