]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix a warning
authorvortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 26 Apr 2010 19:29:19 +0000 (19:29 +0000)
committervortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 26 Apr 2010 19:29:19 +0000 (19:29 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10105 d7cf8633-e32d-0410-b094-e92efae38249

cl_video.c

index e7f44cacfd383a548a28d3e11dacc7dd99c987e7..f97bb0a365c373089e153b6c18c44992b89eb32d 100644 (file)
@@ -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 );