mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-20 18:42:26 +00:00
- made mirrorsector a pointer array
This commit is contained in:
parent
58cd8bd6b9
commit
6b73a37b56
5 changed files with 12 additions and 14 deletions
|
@ -182,7 +182,7 @@ void renderMirror(int cposx, int cposy, int cposz, binangle cang, fixedhoriz cho
|
|||
int j = g_visibility;
|
||||
g_visibility = (j >> 1) + (j >> 2);
|
||||
|
||||
renderDrawRoomsQ16(tposx, tposy, cposz, tang, choriz.asq16(), mirrorsector[i], true);
|
||||
renderDrawRoomsQ16(tposx, tposy, cposz, tang, choriz.asq16(), sectnum(mirrorsector[i]), true);
|
||||
|
||||
display_mirror = 1;
|
||||
fi.animatesprites(pm_tsprite, pm_spritesortcnt, tposx, tposy, tang, smoothratio);
|
||||
|
|
|
@ -115,7 +115,7 @@ int cloudclock;
|
|||
int numcyclers; // sector lighting effects
|
||||
Cycler cyclers[MAXCYCLERS];
|
||||
int mirrorcnt;
|
||||
int mirrorsector[64]; // mirrors
|
||||
sectortype* mirrorsector[64]; // mirrors
|
||||
walltype* mirrorwall[64];
|
||||
int numplayersprites; // player management for some SEs.
|
||||
player_orig po[MAXPLAYERS];
|
||||
|
|
|
@ -97,7 +97,7 @@ extern int cloudclock;
|
|||
|
||||
extern DDukeActor *spriteq[1024];
|
||||
extern Cycler cyclers[MAXCYCLERS];
|
||||
extern int mirrorsector[64];
|
||||
extern sectortype* mirrorsector[64];
|
||||
extern walltype* mirrorwall[64];
|
||||
|
||||
extern int wupass;
|
||||
|
|
|
@ -390,7 +390,7 @@ void prelevel_d(int g)
|
|||
sectp->ceilingpicnum = MIRROR;
|
||||
sectp->floorpicnum = MIRROR;
|
||||
mirrorwall[mirrorcnt] = &wal;
|
||||
mirrorsector[mirrorcnt] = sectnum(sectp);
|
||||
mirrorsector[mirrorcnt] = sectp;
|
||||
mirrorcnt++;
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -724,16 +724,16 @@ void prelevel_r(int g)
|
|||
|
||||
if (wal->overpicnum == MIRROR && (wal->cstat & 32) != 0)
|
||||
{
|
||||
j = wal->nextsector;
|
||||
auto sect = wal->nextSector();
|
||||
|
||||
if (mirrorcnt > 63)
|
||||
I_Error("Too many mirrors (64 max.)");
|
||||
if ((j >= 0) && sector[j].ceilingpicnum != MIRROR)
|
||||
if ((j >= 0) && sect->ceilingpicnum != MIRROR)
|
||||
{
|
||||
sector[j].ceilingpicnum = MIRROR;
|
||||
sector[j].floorpicnum = MIRROR;
|
||||
sect->ceilingpicnum = MIRROR;
|
||||
sect->floorpicnum = MIRROR;
|
||||
mirrorwall[mirrorcnt] = wal;
|
||||
mirrorsector[mirrorcnt] = j;
|
||||
mirrorsector[mirrorcnt] = sect;
|
||||
mirrorcnt++;
|
||||
continue;
|
||||
}
|
||||
|
@ -777,12 +777,10 @@ void prelevel_r(int g)
|
|||
//Invalidate textures in sector behind mirror
|
||||
for (i = 0; i < mirrorcnt; i++)
|
||||
{
|
||||
startwall = sector[mirrorsector[i]].wallptr;
|
||||
endwall = startwall + sector[mirrorsector[i]].wallnum;
|
||||
for (j = startwall; j < endwall; j++)
|
||||
for (auto& mwal : wallsofsector(mirrorsector[i]))
|
||||
{
|
||||
wall[j].picnum = MIRROR;
|
||||
wall[j].overpicnum = MIRROR;
|
||||
mwal.picnum = MIRROR;
|
||||
mwal.overpicnum = MIRROR;
|
||||
}
|
||||
}
|
||||
thunder_brightness = 0;
|
||||
|
|
Loading…
Reference in a new issue