ref: 9d53fdbe02b919dfac73c747c2422d486a441544
parent: dda3108ef832909e13f17bee3fd25eab50784d09
author: Tanguy Fautre <tanguy@fautre.com>
date: Sun Feb 23 09:15:21 EST 2020
Fix minimap sprite rendering: another incorrect index when Fabien converted the code to struct (IMHO, once you know what the old variables names meant, it was easier to read, the structs multi-indexing is too long :-\ )
--- a/Engine/src/engine.c
+++ b/Engine/src/engine.c
@@ -8393,7 +8393,9 @@
pvWalls[z].screenSpaceCoo[0][VEC_COL] = -1;
s1 = s2;
s2 = cx1-pvWalls[zz].cameraSpaceCoo[0][VEC_X];
- if (s1 < 0){
+
+ if (s1 < 0)
+ {
pvWalls[npoints2].cameraSpaceCoo[1][VEC_X] = pvWalls[z].cameraSpaceCoo[0][VEC_X];
pvWalls[npoints2].cameraSpaceCoo[1][VEC_Y] = pvWalls[z].cameraSpaceCoo[0][VEC_Y];
pvWalls[npoints2].screenSpaceCoo[1][VEC_COL] = npoints2+1;
@@ -8400,16 +8402,17 @@
npoints2++;
}
- if ((s1^s2) < 0){
+ if ((s1 ^ s2) < 0)
+ {
pvWalls[npoints2].cameraSpaceCoo[1][VEC_X] =
- pvWalls[z].cameraSpaceCoo[0][VEC_X]+scale(pvWalls[zz].cameraSpaceCoo[0][VEC_X]-pvWalls[z].cameraSpaceCoo[0][VEC_X],s1,s1-s2);
+ pvWalls[z].cameraSpaceCoo[0][VEC_X] + scale(pvWalls[zz].cameraSpaceCoo[0][VEC_X] - pvWalls[z].cameraSpaceCoo[0][VEC_X], s1, s1 - s2);
pvWalls[npoints2].cameraSpaceCoo[1][VEC_Y] =
- pvWalls[z].cameraSpaceCoo[0][VEC_Y]+scale(pvWalls[zz].cameraSpaceCoo[0][VEC_Y]-pvWalls[z].cameraSpaceCoo[0][VEC_Y],s1,s1-s2);
-
+ pvWalls[z].cameraSpaceCoo[0][VEC_Y] + scale(pvWalls[zz].cameraSpaceCoo[0][VEC_Y] - pvWalls[z].cameraSpaceCoo[0][VEC_Y], s1, s1 - s2);
+
if (s1 < 0)
bunchWallsList[splitcnt++] = npoints2;
-
- pvWalls[npoints2].screenSpaceCoo[1][VEC_COL] = npoints2+1;
+
+ pvWalls[npoints2].screenSpaceCoo[1][VEC_COL] = npoints2 + 1;
npoints2++;
}
z = zz;
@@ -8632,7 +8635,7 @@
}
-void drawmapview(int32_t dax, int32_t day, int32_t zoome, short ang)
+void drawmapview(int32_t dax, int32_t day, int32_t zoome, int16_t ang)
{
walltype *wal;
sectortype *sec;
@@ -8879,7 +8882,7 @@
pvWalls[2].cameraSpaceCoo[0][VEC_Y] = y;
x = pvWalls[0].cameraSpaceCoo[0][VEC_X]+pvWalls[2].cameraSpaceCoo[0][VEC_X]-pvWalls[1].cameraSpaceCoo[0][VEC_X];
- y = pvWalls[3].cameraSpaceCoo[0][VEC_Y]+pvWalls[2].cameraSpaceCoo[0][VEC_Y]-pvWalls[1].cameraSpaceCoo[0][VEC_Y];
+ y = pvWalls[0].cameraSpaceCoo[0][VEC_Y]+pvWalls[2].cameraSpaceCoo[0][VEC_Y]-pvWalls[1].cameraSpaceCoo[0][VEC_Y];
i |= getclipmask(x-cx1,cx2-x,y-cy1,cy2-y);
pvWalls[3].cameraSpaceCoo[0][VEC_X] = x;
pvWalls[3].cameraSpaceCoo[0][VEC_Y] = y;
--- a/README.md
+++ b/README.md
@@ -24,7 +24,6 @@
### Known Issues
* Engine: Leaning left/right falls back to low-res rendering.
-* Engine: Minimap has rendering glitches when fully-textured (i.e. sprites).
* Engine: Pixel imprecision when rendering health/ammo numbers in the status bar, leaving ghost pixels.
* Game: Duke is always running, no matter whether SHIFT is pressed or not.