]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_video.c
fix compile error
[xonotic/darkplaces.git] / cl_video.c
index a9f2fc4df6564d6f817c3b924acec305ea9e08c3..fcfd0d0a96b452ec84cace550305635de677753c 100644 (file)
@@ -36,13 +36,13 @@ static qboolean OpenStream( clvideo_t * video )
 }
 
 static void VideoUpdateCallback(rtexture_t *rt, void *data) {
-       clvideo_t *video = data;
+       clvideo_t *video = (clvideo_t *) data;
        R_UpdateTexture( video->cpif.tex, (unsigned char *)video->imagedata, 0, 0, video->cpif.width, video->cpif.height );
 }
 
 static void LinkVideoTexture( clvideo_t *video ) {
        video->cpif.tex = R_LoadTexture2D( cl_videotexturepool, video->cpif.name,
-               video->cpif.width, video->cpif.height, NULL, TEXTYPE_BGRA, TEXF_ALWAYSPRECACHE | TEXF_PERSISTENT, NULL );
+               video->cpif.width, video->cpif.height, NULL, TEXTYPE_BGRA, TEXF_PERSISTENT | TEXF_ALLOWUPDATES, NULL );
        R_MakeTextureDynamic( video->cpif.tex, VideoUpdateCallback, video );
        CL_LinkDynTexture( video->cpif.name, video->cpif.tex );
 }
@@ -116,9 +116,7 @@ clvideo_t* CL_OpenVideo( const char *filename, const char *name, int owner )
        clvideo_t *video;
        // sanity check
        if( !name || !*name || strncmp( name, CLVIDEOPREFIX, sizeof( CLVIDEOPREFIX ) - 1 ) != 0 ) {
-               if( developer.integer > 0 ) {
-                       Con_Printf( "CL_OpenVideo: Bad video texture name '%s'!\n", name );
-               }
+               Con_DPrintf( "CL_OpenVideo: Bad video texture name '%s'!\n", name );
                return NULL;
        }
 
@@ -328,7 +326,7 @@ static void CL_PlayVideo_f(void)
                return;
        }
 
-       sprintf(name, "video/%s.dpv", Cmd_Argv(1));
+       dpsnprintf(name, sizeof(name), "video/%s.dpv", Cmd_Argv(1));
        CL_VideoStart(name);
 }