From 2fb0296199fd9fd94e5cb8437213dfcddca44e4a Mon Sep 17 00:00:00 2001 From: vortex Date: Mon, 26 Apr 2010 19:29:19 +0000 Subject: [PATCH] fix a warning git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10105 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_video.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/cl_video.c b/cl_video.c index e7f44cac..f97bb0a3 100644 --- a/cl_video.c +++ b/cl_video.c @@ -96,11 +96,30 @@ static qboolean WakeVideo( clvideo_t * video ) static void LoadSubtitles( clvideo_t *video, const char *subtitlesfile ) { - char *subtitle_text, *data; + char *subtitle_text; + const char *data; float subtime, sublen; int numsubs = 0; - subtitle_text = (char *)FS_LoadFile(subtitlesfile, cls.permanentmempool, false, NULL); + if (gamemode == GAME_BLOODOMNICIDE) + { + char overridename[MAX_QPATH]; + cvar_t *langcvar; + + langcvar = Cvar_FindVar("language"); + subtitle_text = NULL; + if (langcvar) + { + dpsnprintf(overridename, sizeof(overridename), "script/locale/%s/%s", langcvar->string, subtitlesfile); + subtitle_text = (char *)FS_LoadFile(overridename, cls.permanentmempool, false, NULL); + } + if (!subtitle_text) + subtitle_text = (char *)FS_LoadFile(subtitlesfile, cls.permanentmempool, false, NULL); + } + else + { + subtitle_text = (char *)FS_LoadFile(subtitlesfile, cls.permanentmempool, false, NULL); + } if (!subtitle_text) { Con_DPrintf( "LoadSubtitles: can't open subtitle file '%s'!\n", subtitlesfile ); -- 2.39.2