From 8b3829549a2c82a09f7475c35173238f7470d587 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 22 Aug 2016 20:22:41 -0400 Subject: TITANIC: Cleanup of engine references --- engines/titanic/core/game_object.cpp | 18 +++++++++++------- engines/titanic/core/game_object.h | 8 +++++++- 2 files changed, 18 insertions(+), 8 deletions(-) (limited to 'engines/titanic/core') diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index 261e77877d..29a6fd2209 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -782,24 +782,24 @@ void CGameObject::stopSound(int handle, uint seconds) { } int CGameObject::addTimer(int endVal, uint firstDuration, uint repeatDuration) { - CTimeEventInfo *timer = new CTimeEventInfo(g_vm->_events->getTicksCount(), - repeatDuration != 0, firstDuration, repeatDuration, this, endVal, CString()); + CTimeEventInfo *timer = new CTimeEventInfo(getTicksCount(), repeatDuration != 0, + firstDuration, repeatDuration, this, endVal, CString()); getGameManager()->addTimer(timer); return timer->_id; } int CGameObject::addTimer(uint firstDuration, uint repeatDuration) { - CTimeEventInfo *timer = new CTimeEventInfo(g_vm->_events->getTicksCount(), - repeatDuration != 0, firstDuration, repeatDuration, this, 0, CString()); + CTimeEventInfo *timer = new CTimeEventInfo(getTicksCount(), repeatDuration != 0, + firstDuration, repeatDuration, this, 0, CString()); getGameManager()->addTimer(timer); return timer->_id; } int CGameObject::startAnimTimer(const CString &action, uint firstDuration, uint repeatDuration) { - CTimeEventInfo *timer = new CTimeEventInfo(g_vm->_events->getTicksCount(), - repeatDuration > 0, firstDuration, repeatDuration, this, 0, action); + CTimeEventInfo *timer = new CTimeEventInfo(getTicksCount(), repeatDuration > 0, + firstDuration, repeatDuration, this, 0, action); getGameManager()->addTimer(timer); return timer->_id; @@ -1381,10 +1381,14 @@ int CGameObject::getClipDuration(const CString &name, int frameRate) const { return clip ? (clip->_endFrame - clip->_startFrame) * 1000 / frameRate : 0; } -uint32 CGameObject::getTickCount() { +uint32 CGameObject::getTicksCount() { return g_vm->_events->getTicksCount(); } +Common::SeekableReadStream *CGameObject::getResource(const CString &name) { + return g_vm->_filesManager->getResource(name); +} + bool CGameObject::compareRoomFlags(int mode, uint flags1, uint flags2) { switch (mode) { case 1: diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index fca635388e..e2170a81d5 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -23,6 +23,7 @@ #ifndef TITANIC_GAME_OBJECT_H #define TITANIC_GAME_OBJECT_H +#include "common/stream.h" #include "titanic/support/mouse_cursor.h" #include "titanic/support/credit_text.h" #include "titanic/support/movie_range_info.h" @@ -442,7 +443,12 @@ protected: /** * Returns the current system tick count */ - uint32 getTickCount(); + uint32 getTicksCount(); + + /** + * Gets a resource from the DAT file + */ + Common::SeekableReadStream *getResource(const CString &name); /** * Returns true if a mail with a specified Id exists -- cgit v1.2.3