diff --git a/source/build/src/mdsprite.cpp b/source/build/src/mdsprite.cpp index 206e65c02..4563759c4 100644 --- a/source/build/src/mdsprite.cpp +++ b/source/build/src/mdsprite.cpp @@ -1360,7 +1360,7 @@ static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr) continue; int palid = TRANSLATION(Translation_Remap + curbasepal, globalpal); - GLInterface.SetFade(sector[tspr->sectnum].floorpal); + GLInterface.SetFade(tspr->sector()->floorpal); GLInterface.SetTexture(tex, palid, CLAMP_XY); if (tspr->clipdist & TSPR_FLAGS_MDHACK) diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index 4bfa0f9b6..8ad06a532 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -2633,7 +2633,7 @@ void polymost_deletesprite(int num) static inline int32_t polymost_findwall(tspritetype const * const tspr, vec2_t const * const tsiz, int32_t * rd) { int32_t dist = 4, closest = -1; - auto const sect = §or[tspr->sectnum]; + auto const sect = tspr->sector(); vec2_t n; for (intptr_t i=sect->wallptr; iwallptr + sect->wallnum; i++) @@ -2716,7 +2716,7 @@ void polymost_drawsprite(int32_t snum) globalpicnum = tspr->picnum; globalshade = tspr->shade; globalpal = tspr->pal; - globalfloorpal = sector[tspr->sectnum].floorpal; + globalfloorpal = tspr->sector()->floorpal; globalorientation = tspr->cstat; GLInterface.SetVisibility(sectorVisibility(tspr->sectnum)); @@ -2740,7 +2740,7 @@ void polymost_drawsprite(int32_t snum) drawpoly_alpha = spriteext[spritenum].alpha; drawpoly_blend = tspr->blend; - sec = (usectorptr_t)§or[tspr->sectnum]; + sec = (usectorptr_t)tspr->sector(); while (!(spriteext[spritenum].flags & SPREXT_NOTMD)) { @@ -2881,16 +2881,16 @@ void polymost_drawsprite(int32_t snum) } // Clip sprites to ceilings/floors when no parallaxing and not sloped - if (!(sector[tspr->sectnum].ceilingstat & 3)) + if (!(tspr->sector()->ceilingstat & 3)) { - s0.Y = ((float) (sector[tspr->sectnum].ceilingz - globalposz)) * gyxscale * ryp0 + ghoriz; + s0.Y = ((float) (tspr->sector()->ceilingz - globalposz)) * gyxscale * ryp0 + ghoriz; if (pxy[0].Y < s0.Y) pxy[0].Y = pxy[1].Y = s0.Y; } - if (!(sector[tspr->sectnum].floorstat & 3)) + if (!(tspr->sector()->floorstat & 3)) { - s0.Y = ((float) (sector[tspr->sectnum].floorz - globalposz)) * gyxscale * ryp0 + ghoriz; + s0.Y = ((float) (tspr->sector()->floorz - globalposz)) * gyxscale * ryp0 + ghoriz; if (pxy[2].Y > s0.Y) pxy[2].Y = pxy[3].Y = s0.Y; } @@ -3054,20 +3054,20 @@ void polymost_drawsprite(int32_t snum) } // Clip sprites to ceilings/floors when no parallaxing - if (!(sector[tspr->sectnum].ceilingstat & 1)) + if (!(tspr->sector()->ceilingstat & 1)) { - if (sector[tspr->sectnum].ceilingz > pos.z - (float)((tspr->yrepeat * tsiz.y) << 2)) + if (tspr->sector()->ceilingz > pos.z - (float)((tspr->yrepeat * tsiz.y) << 2)) { - sc0 = (float)(sector[tspr->sectnum].ceilingz - globalposz) * ryp0 + ghoriz; - sc1 = (float)(sector[tspr->sectnum].ceilingz - globalposz) * ryp1 + ghoriz; + sc0 = (float)(tspr->sector()->ceilingz - globalposz) * ryp0 + ghoriz; + sc1 = (float)(tspr->sector()->ceilingz - globalposz) * ryp1 + ghoriz; } } - if (!(sector[tspr->sectnum].floorstat & 1)) + if (!(tspr->sector()->floorstat & 1)) { - if (sector[tspr->sectnum].floorz < pos.z) + if (tspr->sector()->floorz < pos.z) { - sf0 = (float)(sector[tspr->sectnum].floorz - globalposz) * ryp0 + ghoriz; - sf1 = (float)(sector[tspr->sectnum].floorz - globalposz) * ryp1 + ghoriz; + sf0 = (float)(tspr->sector()->floorz - globalposz) * ryp0 + ghoriz; + sf1 = (float)(tspr->sector()->floorz - globalposz) * ryp1 + ghoriz; } } @@ -3924,7 +3924,7 @@ int32_t polymost_voxdraw(voxmodel_t* m, tspriteptr_t const tspr, bool rotate) GLInterface.SetMatrix(Matrix_Model, mat); GLInterface.SetPalswap(globalpal); - GLInterface.SetFade(sector[tspr->sectnum].floorpal); + GLInterface.SetFade(tspr->sector()->floorpal); auto tex = TexMan.GetGameTexture(m->model->GetPaletteTexture()); GLInterface.SetTexture(tex, TRANSLATION(Translation_Remap + curbasepal, globalpal), CLAMP_NOFILTER_XY, true); diff --git a/source/core/rendering/scene/hw_drawinfo.cpp b/source/core/rendering/scene/hw_drawinfo.cpp index 4c3121613..f1513b19a 100644 --- a/source/core/rendering/scene/hw_drawinfo.cpp +++ b/source/core/rendering/scene/hw_drawinfo.cpp @@ -309,7 +309,7 @@ void HWDrawInfo::DispatchSprites() { HWSprite hwsprite; int num = tilenum; - hwsprite.ProcessVoxel(this, voxmodels[tspr->picnum], tspr, §or[tspr->sectnum], voxrotate[num]); + hwsprite.ProcessVoxel(this, voxmodels[tspr->picnum], tspr, tspr->sector(), voxrotate[num]); continue; } } @@ -331,21 +331,21 @@ void HWDrawInfo::DispatchSprites() case CSTAT_SPRITE_ALIGNMENT_FACING: { HWSprite sprite; - sprite.Process(this, tspr, §or[tspr->sectnum], false); + sprite.Process(this, tspr, tspr->sector(), false); break; } case CSTAT_SPRITE_ALIGNMENT_WALL: { HWWall wall; - wall.ProcessWallSprite(this, tspr, §or[tspr->sectnum]); + wall.ProcessWallSprite(this, tspr, tspr->sector()); break; } case CSTAT_SPRITE_ALIGNMENT_FLOOR: { HWFlat flat; - flat.ProcessFlatSprite(this, tspr, §or[tspr->sectnum]); + flat.ProcessFlatSprite(this, tspr, tspr->sector()); break; } diff --git a/source/core/rendering/scene/hw_walls.cpp b/source/core/rendering/scene/hw_walls.cpp index a2f3ee2d4..391f51f9e 100644 --- a/source/core/rendering/scene/hw_walls.cpp +++ b/source/core/rendering/scene/hw_walls.cpp @@ -109,7 +109,7 @@ static int GetClosestPointOnWall(spritetype* spr, walltype* wal, vec2_t* const n static int IsOnWall(spritetype* tspr, int height) { int dist = 3, closest = -1; - auto sect = §or[tspr->sectnum]; + auto sect = tspr->sector(); vec2_t n; int topz = (tspr->z - ((height * tspr->yrepeat) << 2)); diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 2d7dfbbe8..16ce6ce66 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -1098,7 +1098,7 @@ void lotsofglass(DDukeActor *actor, walltype* wal, int n) for (j = n - 1; j >= 0; j--) { a = sp->ang - 256 + (krand() & 511) + 1024; - EGS(sp->sector(), sp->x, sp->y, sp->z, TILE_GLASSPIECES + (j % 3), -32, 36, 36, a, 32 + (krand() & 63), 1024 - (krand() & 1023), &hittype[j], 5); + EGS(sp->sector(), sp->x, sp->y, sp->z, TILE_GLASSPIECES + (j % 3), -32, 36, 36, a, 32 + (krand() & 63), 1024 - (krand() & 1023), actor, 5); } return; }