diff options
author | Matthew Hoops | 2015-07-15 23:59:21 -0400 |
---|---|---|
committer | Matthew Hoops | 2015-07-17 20:05:00 -0400 |
commit | 7e6c8be7db2449c1f793b6fb01af5613282e7f27 (patch) | |
tree | 02fd969920a4c0a4aad285462eee2050885e620e /engines/mohawk/riven.cpp | |
parent | 95b1288329b12dce9d96a1a97a28f1bc457d605f (diff) | |
download | scummvm-rg350-7e6c8be7db2449c1f793b6fb01af5613282e7f27.tar.gz scummvm-rg350-7e6c8be7db2449c1f793b6fb01af5613282e7f27.tar.bz2 scummvm-rg350-7e6c8be7db2449c1f793b6fb01af5613282e7f27.zip |
MOHAWK: Make video handles actual objects
Diffstat (limited to 'engines/mohawk/riven.cpp')
-rw-r--r-- | engines/mohawk/riven.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp index a7fe12b9e1..898f68c581 100644 --- a/engines/mohawk/riven.cpp +++ b/engines/mohawk/riven.cpp @@ -828,7 +828,7 @@ static void sunnersTopStairsTimer(MohawkEngine_Riven *vm) { VideoHandle oldHandle = vm->_video->findVideoHandleRiven(1); uint32 timerTime = 500; - if (oldHandle == NULL_VID_HANDLE || vm->_video->endOfVideo(oldHandle)) { + if (!oldHandle || oldHandle->endOfVideo()) { uint32 &sunnerTime = vm->_vars["jsunnertime"]; if (sunnerTime == 0) { @@ -836,7 +836,7 @@ static void sunnersTopStairsTimer(MohawkEngine_Riven *vm) { } else if (sunnerTime < vm->getTotalPlayTime()) { VideoHandle handle = vm->_video->playMovieRiven(vm->_rnd->getRandomNumberRng(1, 3)); - timerTime = vm->_video->getDuration(handle).msecs() + vm->_rnd->getRandomNumberRng(2, 15) * 1000; + timerTime = handle->getDuration().msecs() + vm->_rnd->getRandomNumberRng(2, 15) * 1000; } sunnerTime = timerTime + vm->getTotalPlayTime(); @@ -858,7 +858,7 @@ static void sunnersMidStairsTimer(MohawkEngine_Riven *vm) { VideoHandle oldHandle = vm->_video->findVideoHandleRiven(1); uint32 timerTime = 500; - if (oldHandle == NULL_VID_HANDLE || vm->_video->endOfVideo(oldHandle)) { + if (!oldHandle || oldHandle->endOfVideo()) { uint32 &sunnerTime = vm->_vars["jsunnertime"]; if (sunnerTime == 0) { @@ -874,7 +874,7 @@ static void sunnersMidStairsTimer(MohawkEngine_Riven *vm) { VideoHandle handle = vm->_video->playMovieRiven(movie); - timerTime = vm->_video->getDuration(handle).msecs() + vm->_rnd->getRandomNumberRng(1, 10) * 1000; + timerTime = handle->getDuration().msecs() + vm->_rnd->getRandomNumberRng(1, 10) * 1000; } sunnerTime = timerTime + vm->getTotalPlayTime(); @@ -896,7 +896,7 @@ static void sunnersLowerStairsTimer(MohawkEngine_Riven *vm) { VideoHandle oldHandle = vm->_video->findVideoHandleRiven(1); uint32 timerTime = 500; - if (oldHandle == NULL_VID_HANDLE || vm->_video->endOfVideo(oldHandle)) { + if (!oldHandle || oldHandle->endOfVideo()) { uint32 &sunnerTime = vm->_vars["jsunnertime"]; if (sunnerTime == 0) { @@ -904,7 +904,7 @@ static void sunnersLowerStairsTimer(MohawkEngine_Riven *vm) { } else if (sunnerTime < vm->getTotalPlayTime()) { VideoHandle handle = vm->_video->playMovieRiven(vm->_rnd->getRandomNumberRng(3, 5)); - timerTime = vm->_video->getDuration(handle).msecs() + vm->_rnd->getRandomNumberRng(1, 30) * 1000; + timerTime = handle->getDuration().msecs() + vm->_rnd->getRandomNumberRng(1, 30) * 1000; } sunnerTime = timerTime + vm->getTotalPlayTime(); @@ -926,7 +926,7 @@ static void sunnersBeachTimer(MohawkEngine_Riven *vm) { VideoHandle oldHandle = vm->_video->findVideoHandleRiven(3); uint32 timerTime = 500; - if (oldHandle == NULL_VID_HANDLE || vm->_video->endOfVideo(oldHandle)) { + if (!oldHandle || oldHandle->endOfVideo()) { uint32 &sunnerTime = vm->_vars["jsunnertime"]; if (sunnerTime == 0) { @@ -938,7 +938,7 @@ static void sunnersBeachTimer(MohawkEngine_Riven *vm) { vm->_video->activateMLST(mlstID, vm->getCurCard()); VideoHandle handle = vm->_video->playMovieRiven(mlstID); - timerTime = vm->_video->getDuration(handle).msecs() + vm->_rnd->getRandomNumberRng(1, 30) * 1000; + timerTime = handle->getDuration().msecs() + vm->_rnd->getRandomNumberRng(1, 30) * 1000; } sunnerTime = timerTime + vm->getTotalPlayTime(); @@ -969,7 +969,7 @@ void MohawkEngine_Riven::installCardTimer() { } void MohawkEngine_Riven::doVideoTimer(VideoHandle handle, bool force) { - assert(handle != NULL_VID_HANDLE); + assert(handle); uint16 id = _scriptMan->getStoredMovieOpcodeID(); @@ -977,7 +977,7 @@ void MohawkEngine_Riven::doVideoTimer(VideoHandle handle, bool force) { return; // Run the opcode if we can at this point - if (force || _video->getTime(handle) >= _scriptMan->getStoredMovieOpcodeTime()) + if (force || handle->getTime() >= _scriptMan->getStoredMovieOpcodeTime()) _scriptMan->runStoredMovieOpcode(); } @@ -1003,7 +1003,7 @@ void MohawkEngine_Riven::checkSunnerAlertClick() { // If the alert video is no longer playing, we have nothing left to do VideoHandle handle = _video->findVideoHandleRiven(1); - if (handle == NULL_VID_HANDLE || _video->endOfVideo(handle)) + if (!handle || handle->endOfVideo()) return; sunners = 1; |