]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_cmds.c
fixed r_speeds stats with r_showsurfaces 1 mode
[xonotic/darkplaces.git] / prvm_cmds.c
index 19925a9776c29a051498d50e842dc70a404344d3..f5c13fdee93370e03ca9347aea9ad2d5db411c17 100644 (file)
@@ -1563,13 +1563,13 @@ void VM_fopen(void)
 
        if (VM_FILES[filenum] == NULL)
        {
-               if (developer.integer)
+               if (developer.integer >= 10)
                        Con_Printf("VM_fopen: %s: %s mode %s failed\n", PRVM_NAME, filename, modestring);
                PRVM_G_FLOAT(OFS_RETURN) = -1;
        }
        else
        {
-               if (developer.integer)
+               if (developer.integer >= 10)
                        Con_Printf("VM_fopen: %s: %s mode %s opened as #%i\n", PRVM_NAME, filename, modestring, filenum);
                PRVM_G_FLOAT(OFS_RETURN) = filenum;
        }
@@ -1600,7 +1600,7 @@ void VM_fclose(void)
                Con_Printf("VM_fclose: no such file handle %i (or file has been closed) in %s\n", filenum, PRVM_NAME);
                return;
        }
-       if (developer.integer)
+       if (developer.integer >= 10)
                Con_Printf("VM_fclose: %s: #%i closed\n", PRVM_NAME, filenum);
        FS_Close(VM_FILES[filenum]);
        VM_FILES[filenum] = NULL;
@@ -1650,7 +1650,7 @@ void VM_fgets(void)
                if (c != '\n')
                        FS_UnGetc(VM_FILES[filenum], (unsigned char)c);
        }
-       if (developer.integer >= 3)
+       if (developer.integer >= 100)
                Con_Printf("fgets: %s: %s\n", PRVM_NAME, string);
        if (c >= 0 || end)
                PRVM_G_INT(OFS_RETURN) = PRVM_SetEngineString(string);
@@ -1688,7 +1688,7 @@ void VM_fputs(void)
        VM_VarString(1, string, sizeof(string));
        if ((stringlength = (int)strlen(string)))
                FS_Write(VM_FILES[filenum], string, stringlength);
-       if (developer.integer)
+       if (developer.integer >= 100)
                Con_Printf("fputs: %s: %s\n", PRVM_NAME, string);
 }
 
@@ -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, true), 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 );
 }
@@ -2972,7 +2972,7 @@ void VM_R_PolygonBegin (void)
        p = &vm_polygons[vm_drawpolygons_num];
        picname = PRVM_G_STRING(OFS_PARM0);
        if(picname[0])
-               p->tex = Draw_CachePic(picname, false)->tex;
+               p->tex = Draw_CachePic(picname, true)->tex;
        else
                p->tex = r_texture_notexture;
        p->flags = (unsigned char)PRVM_G_FLOAT(OFS_PARM1);