Fix two bugs (everything should behave as usual now, when you're not using menu rende...
authorblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 6 Jan 2008 01:05:25 +0000 (01:05 +0000)
committerblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 6 Jan 2008 01:05:25 +0000 (01:05 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7925 d7cf8633-e32d-0410-b094-e92efae38249

clvm_cmds.c
menu.c
mvm_cmds.c

index 0f1e5be..45a0a49 100644 (file)
@@ -2367,11 +2367,16 @@ static void VM_CL_AddPolygonTo2DScene (vm_polygon_t *p)
                DrawQ_Mesh (&mesh, (p->flags&0x0f));
 }
 
+// TODO: move this into the client code and clean-up everything else, too! [1/6/2008 Black]
 void VM_CL_AddPolygonsToMeshQueue (void)
 {
        int i;
        vmpolygons_t* polys = vmpolygons + PRVM_GetProgNr();
 
+       // only add polygons of the currently active prog to the queue - if there is none, we're done
+       if( !prog )
+               return;
+
        if(!polys->drawpolygons_num)
                return;
        R_Mesh_Matrix(&identitymatrix);
diff --git a/menu.c b/menu.c
index ec46530..8e99c53 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -5079,7 +5079,9 @@ void MP_Draw (void)
        // reset the temp entities each frame
        r_refdef.numtempentities = 0;
 
+       // TODO: fix these evil hacks! [1/6/2008 Black]
        R_UpdateVariables();
+       R_ResetViewRendering2D();
 
        PRVM_Begin;
        PRVM_SetProg(PRVM_MENUPROG);
index 1509c1b..899d141 100644 (file)
@@ -1452,7 +1452,7 @@ void VM_M_Cmd_Init(void)
        menu_refdef.view.colormask[2] = true;
        menu_refdef.view.colormask[3] = true;
        
-       menu_refdef.view.useperspective = true;
+       menu_refdef.view.useperspective = false;
        menu_refdef.view.frustum_y = tan(scr_fov.value * M_PI / 360.0) * (3.0/4.0);
        menu_refdef.view.frustum_x = menu_refdef.view.frustum_y * (float)menu_refdef.view.width / (float)menu_refdef.view.height / vid_pixelheight.value;
 }