ref: 6a4b0870f46777af02011fcd07fdc2b506b4144f
parent: 151064726ca94693fc6c552c29d98eff2353a2d8
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Fri Jan 5 17:55:31 EST 2024
reset zbuffer when resizing
--- a/m_dotproduct.c
+++ b/m_dotproduct.c
@@ -1,6 +1,6 @@
#include "quakedef.h"
-float
+vec_t
DotProduct(const vec3_t v1, const vec3_t v2)
{
return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
--- a/vid_plan9.c
+++ b/vid_plan9.c
@@ -45,6 +45,7 @@
hunkvbuf += scachesz;
if((dvars.zbuffer = realloc(dvars.zbuffer, hunkvbuf)) == nil)
sysfatal("%r");
+ memset(dvars.zbuffer, 0, hunkvbuf);
surfcache = (byte*)(dvars.zbuffer + vid.width * vid.height);
D_InitCaches(surfcache, scachesz);
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -67,6 +67,7 @@
scachesz = D_SurfaceCacheForRes(vid.width, vid.height);
hunkvbuf += scachesz;
dvars.zbuffer = realloc(dvars.zbuffer, hunkvbuf);
+ memset(dvars.zbuffer, 0, hunkvbuf);
surfcache = (byte *)(dvars.zbuffer + vid.width * vid.height);
D_InitCaches(surfcache, scachesz);
}