diff options
author | Paul Gilbert | 2016-08-22 20:22:41 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-22 20:22:41 -0400 |
commit | 8b3829549a2c82a09f7475c35173238f7470d587 (patch) | |
tree | c0965bfcae7153af1f831be1204726644d99da9e /engines/titanic/core | |
parent | 65bc8cb83c01cc1e7e6c8c093b8f42080800718d (diff) | |
download | scummvm-rg350-8b3829549a2c82a09f7475c35173238f7470d587.tar.gz scummvm-rg350-8b3829549a2c82a09f7475c35173238f7470d587.tar.bz2 scummvm-rg350-8b3829549a2c82a09f7475c35173238f7470d587.zip |
TITANIC: Cleanup of engine references
Diffstat (limited to 'engines/titanic/core')
-rw-r--r-- | engines/titanic/core/game_object.cpp | 18 | ||||
-rw-r--r-- | engines/titanic/core/game_object.h | 8 |
2 files changed, 18 insertions, 8 deletions
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 |