]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - clvm_cmds.c
use checkdisk flag on model loading after ingame download, this should
[xonotic/darkplaces.git] / clvm_cmds.c
index 965b64ebf8eeaf3402ffa4e3ad2d0643c11e85c2..a9c30b4297d49526ab10f6461e475270912a6d4e 100644 (file)
@@ -23,6 +23,8 @@
 extern cvar_t v_flipped;
 extern cvar_t r_equalize_entities_fullbright;
 
+r_refdef_view_t csqc_original_r_refdef_view;
+
 sfx_t *S_FindName(const char *name);
 int Sbar_GetSortedPlayerIndex (int index);
 void Sbar_SortFrags (void);
@@ -205,7 +207,7 @@ static void VM_CL_sound (void)
        }
 
        CL_VM_GetEntitySoundOrigin(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), org);
-       S_StartSound_StartPosition_Flags(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), channel, S_FindName(sample), org, volume, attenuation, 0, CHANNELFLAG_NONE, pitchchange > 0.0f ? pitchchange * 0.01f : 1.0f);
+       S_StartSound_StartPosition_Flags(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), channel, S_FindName(sample), org, volume, attenuation, 0, flags, pitchchange > 0.0f ? pitchchange * 0.01f : 1.0f);
 }
 
 // #483 void(vector origin, string sample, float volume, float attenuation) pointsound
@@ -722,23 +724,8 @@ void VM_CL_R_ClearScene (void)
        // clear renderable entity and light lists
        r_refdef.scene.numentities = 0;
        r_refdef.scene.numlights = 0;
-       // FIXME: restore these to the values from VM_CL_UpdateView
-       r_refdef.view.x = 0;
-       r_refdef.view.y = 0;
-       r_refdef.view.z = 0;
-       r_refdef.view.width = vid.width;
-       r_refdef.view.height = vid.height;
-       r_refdef.view.depth = 1;
-       // FIXME: restore frustum_x/frustum_y
-       r_refdef.view.useperspective = true;
-       r_refdef.view.frustum_y = tan(scr_fov.value * M_PI / 360.0) * (3.0/4.0) * cl.viewzoom;
-       r_refdef.view.frustum_x = r_refdef.view.frustum_y * (float)r_refdef.view.width / (float)r_refdef.view.height / vid_pixelheight.value;
-       r_refdef.view.frustum_x *= r_refdef.frustumscale_x;
-       r_refdef.view.frustum_y *= r_refdef.frustumscale_y;
-       r_refdef.view.ortho_x = scr_fov.value * (3.0 / 4.0) * (float)r_refdef.view.width / (float)r_refdef.view.height / vid_pixelheight.value;
-       r_refdef.view.ortho_y = scr_fov.value * (3.0 / 4.0);
-       r_refdef.view.clear = true;
-       r_refdef.view.isoverlay = false;
+       // restore the view settings to the values that VM_CL_UpdateView received from the client code
+       r_refdef.view = csqc_original_r_refdef_view;
        VectorCopy(cl.csqc_vieworiginfromengine, cl.csqc_vieworigin);
        VectorCopy(cl.csqc_viewanglesfromengine, cl.csqc_viewangles);
        cl.csqc_vidvars.drawworld = r_drawworld.integer != 0;
@@ -3179,7 +3166,7 @@ static void VM_DrawPolygonCallback (const entity_render_t *ent, const rtlight_t
                rtexture_t *tex = polys->data_triangles[surfacelist[surfacelistindex]].texture;
                int drawflag = polys->data_triangles[surfacelist[surfacelistindex]].drawflag;
                DrawQ_ProcessDrawFlag(drawflag, polys->data_triangles[surfacelist[surfacelistindex]].hasalpha);
-               R_SetupShader_Generic(tex, NULL, GL_MODULATE, 1, false, false);
+               R_SetupShader_Generic(tex, NULL, GL_MODULATE, 1, false, false, false);
                numtriangles = 0;
                for (;surfacelistindex < numsurfaces;surfacelistindex++)
                {