- make mirrorwall a pointer array

This commit is contained in:
Christoph Oelckers 2021-11-18 00:24:17 +01:00
parent caa9ef6dd3
commit 58cd8bd6b9
5 changed files with 7 additions and 7 deletions

View file

@ -168,16 +168,16 @@ void renderMirror(int cposx, int cposy, int cposz, binangle cang, fixedhoriz cho
int dst = 0x7fffffff, i = 0;
for (int k = 0; k < mirrorcnt; k++)
{
int j = abs(wall[mirrorwall[k]].x - cposx) + abs(wall[mirrorwall[k]].y - cposy);
int j = abs(mirrorwall[k]->x - cposx) + abs(mirrorwall[k]->y - cposy);
if (j < dst) dst = j, i = k;
}
if (wall[mirrorwall[i]].overpicnum == TILE_MIRROR)
if (mirrorwall[i]->overpicnum == TILE_MIRROR)
{
int tposx, tposy;
fixed_t tang;
renderPrepareMirror(cposx, cposy, cposz, cang.asq16(), choriz.asq16(), mirrorwall[i], &tposx, &tposy, &tang);
renderPrepareMirror(cposx, cposy, cposz, cang.asq16(), choriz.asq16(), wallnum(mirrorwall[i]), &tposx, &tposy, &tang);
int j = g_visibility;
g_visibility = (j >> 1) + (j >> 2);

View file

@ -116,7 +116,7 @@ int numcyclers; // sector lighting effects
Cycler cyclers[MAXCYCLERS];
int mirrorcnt;
int mirrorsector[64]; // mirrors
int mirrorwall[64];
walltype* mirrorwall[64];
int numplayersprites; // player management for some SEs.
player_orig po[MAXPLAYERS];
unsigned ambientfx; // used by soundtag and soundtagonce script commands. If exported, export the commands, not the data!

View file

@ -98,7 +98,7 @@ extern int cloudclock;
extern DDukeActor *spriteq[1024];
extern Cycler cyclers[MAXCYCLERS];
extern int mirrorsector[64];
extern int mirrorwall[64];
extern walltype* mirrorwall[64];
extern int wupass;
extern int chickenplant;

View file

@ -389,7 +389,7 @@ void prelevel_d(int g)
assert(wallnum(&wal) > 0);
sectp->ceilingpicnum = MIRROR;
sectp->floorpicnum = MIRROR;
mirrorwall[mirrorcnt] = wallnum(&wal);
mirrorwall[mirrorcnt] = &wal;
mirrorsector[mirrorcnt] = sectnum(sectp);
mirrorcnt++;
continue;

View file

@ -732,7 +732,7 @@ void prelevel_r(int g)
{
sector[j].ceilingpicnum = MIRROR;
sector[j].floorpicnum = MIRROR;
mirrorwall[mirrorcnt] = i;
mirrorwall[mirrorcnt] = wal;
mirrorsector[mirrorcnt] = j;
mirrorcnt++;
continue;