From 207e1cbb296c8f825d19167d420bbf141398ac1d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 10 Jul 2016 17:19:11 -0400 Subject: TITANIC: Remove old hard-coded video loading code from cursors loading --- engines/titanic/support/mouse_cursor.cpp | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) (limited to 'engines/titanic/support') diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp index be607a432f..496b1527fe 100644 --- a/engines/titanic/support/mouse_cursor.cpp +++ b/engines/titanic/support/mouse_cursor.cpp @@ -63,26 +63,10 @@ CMouseCursor::~CMouseCursor() { } void CMouseCursor::loadCursorImages() { - const CString name("ycursors.avi"); - g_vm->_filesManager->fn4(name); - - // WORKAROUND: We need to manipulate ycursors.avi file so it can be read - // by the ScummVM AVIDecoder, by removing the redundant second video track - Common::File f; - if (!f.open(name)) - error("Could not open cursors file"); - - // Read in the entire file - byte *movieData = (byte *)malloc(f.size()); - f.read(movieData, f.size()); - - if (READ_BE_UINT32(movieData + 254) == MKTAG('s', 't', 'r', 'h')) { - // Change the second video chunk to junk data so it gets ignored - WRITE_BE_UINT32(movieData + 254, MKTAG('J', 'U', 'N', 'K')); - WRITE_LE_UINT32(movieData + 258, 1128); - } + const CResourceKey key("ycursors.avi"); + g_vm->_filesManager->fn4(key.getString()); - // Iterate through each cursor + // Iterate through getting each cursor for (int idx = 0; idx < NUM_CURSORS; ++idx) { assert(CURSOR_DATA[idx][0] == (idx + 1)); _cursors[idx]._centroid = Common::Point(CURSOR_DATA[idx][2], @@ -91,16 +75,14 @@ void CMouseCursor::loadCursorImages() { // Create the surface CVideoSurface *surface = _screenManager->createSurface(64, 64); _cursors[idx]._videoSurface = surface; -/* - Common::SeekableReadStream *stream = new Common::MemoryReadStream( - movieData, f.size(), DisposeAfterUse::NO); - OSMovie movie(stream, surface); + + // Open the cursors video and move to the given frame + OSMovie movie(key, surface); movie.setFrame(idx); void *frameInfo = movie.duplicateFrameInfo(); _cursors[idx]._frameInfo = frameInfo; surface->setMovieFrameInfo(frameInfo); - */ } } -- cgit v1.2.3