From 837cb4dff2f71cb1a8db2edff72ef4e4ec7dd7e9 Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Wed, 14 May 2014 23:14:37 +0200 Subject: [PATCH] Changed file testing for .bik videos to support fs_game. fixes #100 --- neo/renderer/Cinematic.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/neo/renderer/Cinematic.cpp b/neo/renderer/Cinematic.cpp index 5185a4b2..45130e4c 100644 --- a/neo/renderer/Cinematic.cpp +++ b/neo/renderer/Cinematic.cpp @@ -470,7 +470,34 @@ bool idCinematicLocal::InitFromFFMPEGFile( const char* qpath, bool amilooping ) isRoQ = false; CIN_HEIGHT = DEFAULT_CIN_HEIGHT; CIN_WIDTH = DEFAULT_CIN_WIDTH; - idStr fullpath = fileSystem->RelativePathToOSPath( qpath, "fs_basepath" ); + + idStr fullpath; + idFile* testFile = fileSystem->OpenFileRead( qpath ); + if( testFile ) + { + fullpath = testFile->GetFullPath(); + fileSystem->CloseFile( testFile ); + } + // RB: case sensitivity HACK for Linux + else if( idStr::Cmpn( qpath, "sound/vo", 8 ) == 0 ) + { + idStr newPath( qpath ); + newPath.Replace( "sound/vo", "sound/VO" ); + + testFile = fileSystem->OpenFileRead( qpath ); + if( testFile ) + { + fullpath = testFile->GetFullPath(); + fileSystem->CloseFile( testFile ); + } + else + { + common->Warning( "idCinematic: Cannot open FFMPEG video file: '%s', %d\n", qpath, looping ); + return false; + } + } + + //idStr fullpath = fileSystem->RelativePathToOSPath( qpath, "fs_basepath" ); if( ( ret = avformat_open_input( &fmt_ctx, fullpath, NULL, NULL ) ) < 0 ) {