]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_cmds.c
don't set qc impulse more than once per packet
[xonotic/darkplaces.git] / prvm_cmds.c
index 19925a9776c29a051498d50e842dc70a404344d3..8f0a3fd944198ee53638046352ac9dac29e05a12 100644 (file)
@@ -2482,27 +2482,27 @@ float   drawpic(vector position, string pic, vector size, vector rgb, float alpha,
 */
 void VM_drawpic(void)
 {
-       const char *pic;
+       const char *picname;
        float *size, *pos, *rgb;
        int flag;
 
        VM_SAFEPARMCOUNT(6,VM_drawpic);
 
-       pic = PRVM_G_STRING(OFS_PARM1);
+       picname = PRVM_G_STRING(OFS_PARM1);
 
-       if(!pic)
+       if(!picname)
        {
                Con_Printf("VM_drawpic: %s passed null picture name !\n", PRVM_NAME);
                PRVM_G_FLOAT(OFS_RETURN) = -1;
                return;
        }
 
-       VM_CheckEmptyString (pic);
+       VM_CheckEmptyString (picname);
 
        // is pic cached ? no function yet for that
        if(!1)
        {
-               Con_Printf("VM_drawpic: %s: %s not cached !\n", PRVM_NAME, pic);
+               Con_Printf("VM_drawpic: %s: %s not cached !\n", PRVM_NAME, picname);
                PRVM_G_FLOAT(OFS_RETURN) = -4;
                return;
        }
@@ -2522,7 +2522,7 @@ void VM_drawpic(void)
        if(pos[2] || size[2])
                Con_Printf("VM_drawstring: z value%c from %s discarded\n",(pos[2] && size[2]) ? 's' : 0,((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size")));
 
-       DrawQ_Pic(pos[0], pos[1], pic, size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag);
+       DrawQ_Pic(pos[0], pos[1], Draw_CachePic(picname, false), size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag);
        PRVM_G_FLOAT(OFS_RETURN) = 1;
 }
 
@@ -2556,7 +2556,7 @@ void VM_drawfill(void)
        if(pos[2] || size[2])
                Con_Printf("VM_drawstring: z value%c from %s discarded\n",(pos[2] && size[2]) ? 's' : 0,((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size")));
 
-       DrawQ_Pic(pos[0], pos[1], 0, size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM3), flag);
+       DrawQ_Pic(pos[0], pos[1], NULL, size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM3), flag);
        PRVM_G_FLOAT(OFS_RETURN) = 1;
 }
 
@@ -2683,7 +2683,7 @@ void VM_cin_open( void )
        VM_CheckEmptyString( file );
     VM_CheckEmptyString( name );
 
-       if( CL_OpenVideo( file, name, MENUOWNER, false ) )
+       if( CL_OpenVideo( file, name, MENUOWNER ) )
                PRVM_G_FLOAT( OFS_RETURN ) = 1;
        else
                PRVM_G_FLOAT( OFS_RETURN ) = 0;
@@ -2705,7 +2705,7 @@ void VM_cin_close( void )
        name = PRVM_G_STRING( OFS_PARM0 );
        VM_CheckEmptyString( name );
 
-       CL_CloseVideo( CL_GetVideo( name ) );
+       CL_CloseVideo( CL_GetVideoByName( name ) );
 }
 
 /*
@@ -2727,7 +2727,7 @@ void VM_cin_setstate( void )
 
        state = (clvideostate_t)((int)PRVM_G_FLOAT( OFS_PARM1 ));
 
-       video = CL_GetVideo( name );
+       video = CL_GetVideoByName( name );
        if( video && state > CLVIDEO_UNUSED && state < CLVIDEO_STATECOUNT )
                CL_SetVideoState( video, state );
 }
@@ -2749,7 +2749,7 @@ void VM_cin_getstate( void )
        name = PRVM_G_STRING( OFS_PARM0 );
        VM_CheckEmptyString( name );
 
-       video = CL_GetVideo( name );
+       video = CL_GetVideoByName( name );
        if( video )
                PRVM_G_FLOAT( OFS_RETURN ) = (int)video->state;
        else
@@ -2773,7 +2773,7 @@ void VM_cin_restart( void )
        name = PRVM_G_STRING( OFS_PARM0 );
        VM_CheckEmptyString( name );
 
-       video = CL_GetVideo( name );
+       video = CL_GetVideoByName( name );
        if( video )
                CL_RestartVideo( video );
 }