mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-31 13:10:39 +00:00
- unlimited the bit arrays for the automap and the bunch drawer, removed some leftover constants/declarations.
This commit is contained in:
parent
d30bf8c8bb
commit
d5c27e6239
15 changed files with 38 additions and 39 deletions
|
@ -61,8 +61,8 @@ int follow_x = INT_MAX, follow_y = INT_MAX, follow_a = INT_MAX;
|
|||
static int gZoom = 768;
|
||||
bool automapping;
|
||||
bool gFullMap;
|
||||
FixedBitArray<MAXSECTORS> show2dsector;
|
||||
FixedBitArray<MAXWALLS> show2dwall;
|
||||
BitArray show2dsector;
|
||||
BitArray show2dwall;
|
||||
static int x_min_bound = INT_MAX, y_min_bound, x_max_bound, y_max_bound;
|
||||
|
||||
CVAR(Color, am_twosidedcolor, 0xaaaaaa, CVAR_ARCHIVE)
|
||||
|
@ -268,8 +268,8 @@ void SerializeAutomap(FSerializer& arc)
|
|||
arc("automapping", automapping)
|
||||
("fullmap", gFullMap)
|
||||
// Only store what's needed. Unfortunately for sprites it is not that easy
|
||||
.SerializeMemory("mappedsectors", show2dsector.Storage(), (numsectors + 7) / 8)
|
||||
.SerializeMemory("mappedwalls", show2dwall.Storage(), (numwalls + 7) / 8)
|
||||
.SerializeMemory("mappedsectors", show2dsector.Storage().Data(), (numsectors + 7) / 8)
|
||||
.SerializeMemory("mappedwalls", show2dwall.Storage().Data(), (numwalls + 7) / 8)
|
||||
.EndObject();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,8 +10,8 @@ struct event_t;
|
|||
|
||||
extern bool automapping;
|
||||
extern bool gFullMap;
|
||||
extern FixedBitArray<MAXSECTORS> show2dsector;
|
||||
extern FixedBitArray<MAXWALLS> show2dwall;
|
||||
extern BitArray show2dsector;
|
||||
extern BitArray show2dwall;
|
||||
|
||||
void SerializeAutomap(FSerializer& arc);
|
||||
void ClearAutomap();
|
||||
|
|
|
@ -184,9 +184,9 @@ void setsectinterpolate(int sectnum)
|
|||
{
|
||||
StartInterpolation(&wal, Interp_Wall_X);
|
||||
StartInterpolation(&wal, Interp_Wall_Y);
|
||||
auto nwal = wal.nextWall();
|
||||
if (nwal)
|
||||
if (wal.twoSided())
|
||||
{
|
||||
auto nwal = wal.nextWall();
|
||||
StartInterpolation(nwal, Interp_Wall_X);
|
||||
StartInterpolation(nwal, Interp_Wall_Y);
|
||||
nwal = nwal->point2Wall();
|
||||
|
@ -204,7 +204,7 @@ void clearsectinterpolate(int sectnum)
|
|||
{
|
||||
StopInterpolation(&wal, Interp_Wall_X);
|
||||
StopInterpolation(&wal, Interp_Wall_Y);
|
||||
if (wal.nextwall >= 0)
|
||||
if (wal.twoSided())
|
||||
{
|
||||
StopInterpolation(wal.nextWall(), Interp_Wall_X);
|
||||
StopInterpolation(wal.nextWall(), Interp_Wall_Y);
|
||||
|
|
|
@ -411,6 +411,9 @@ void allocateMapArrays(int numsprites)
|
|||
ClearInterpolations();
|
||||
|
||||
|
||||
show2dsector.Resize(numsectors);
|
||||
show2dwall.Resize(numwalls);
|
||||
|
||||
mapDataArena.FreeAll();
|
||||
sector.Resize(numsectors);
|
||||
memset(sector.Data(), 0, sizeof(sectortype) * numsectors);
|
||||
|
|
|
@ -76,6 +76,8 @@ void BunchDrawer::Init(HWDrawInfo *_di, Clipper* c, vec2_t& view, binangle a1, b
|
|||
}
|
||||
memset(sectionstartang, -1, sizeof(sectionstartang));
|
||||
memset(sectionendang, -1, sizeof(sectionendang));
|
||||
gotwall.Resize(numwalls);
|
||||
blockwall.Resize(numwalls);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -29,8 +29,8 @@ class BunchDrawer
|
|||
float gcosang, gsinang;
|
||||
FixedBitArray<MAXSECTORS> gotsector;
|
||||
FixedBitArray<MAXSECTORS*5/4> gotsection2;
|
||||
FixedBitArray<MAXWALLS> gotwall;
|
||||
FixedBitArray<MAXWALLS> blockwall;
|
||||
BitArray gotwall;
|
||||
BitArray blockwall;
|
||||
binangle ang1, ang2, angrange;
|
||||
|
||||
int sectionstartang[MAXSECTORS*5/4], sectionendang[MAXSECTORS*5/4];
|
||||
|
|
|
@ -3851,7 +3851,7 @@ void actHitcodeToData(int a1, HITINFO* pHitInfo, DBloodActor** pActor, walltype*
|
|||
case 0:
|
||||
case 4:
|
||||
nWall = pHitInfo->hitwall;
|
||||
if (nWall >= 0 && nWall < kMaxWalls) pWall = &wall[nWall];
|
||||
if (validWallIndex(nWall)) pWall = &wall[nWall];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -6818,7 +6818,7 @@ bool actCheckRespawn(DBloodActor* actor)
|
|||
|
||||
bool actCanSplatWall(int nWall)
|
||||
{
|
||||
assert(nWall >= 0 && nWall < kMaxWalls);
|
||||
assert(validWallIndex(nWall));
|
||||
walltype* pWall = &wall[nWall];
|
||||
if (pWall->cstat & 16384) return 0;
|
||||
if (pWall->cstat & 32768) return 0;
|
||||
|
@ -6895,7 +6895,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
|
|||
case 0:
|
||||
{
|
||||
int nWall = gHitInfo.hitwall;
|
||||
assert(nWall >= 0 && nWall < kMaxWalls);
|
||||
assert(validWallIndex(nWall));
|
||||
auto pWall = &wall[nWall];
|
||||
nSurf = surfType[pWall->picnum];
|
||||
if (actCanSplatWall(nWall))
|
||||
|
@ -6920,7 +6920,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
|
|||
case 4:
|
||||
{
|
||||
int nWall = gHitInfo.hitwall;
|
||||
assert(nWall >= 0 && nWall < kMaxWalls);
|
||||
assert(validWallIndex(nWall));
|
||||
auto pWall = &wall[nWall];
|
||||
nSurf = surfType[pWall->overpicnum];
|
||||
if (pWall->hasX())
|
||||
|
|
|
@ -35,8 +35,6 @@ void QuitGame(void);
|
|||
|
||||
enum
|
||||
{
|
||||
kMaxSectors = MAXSECTORS,
|
||||
kMaxWalls = MAXWALLS,
|
||||
kMaxSprites = MAXSPRITES,
|
||||
|
||||
kMaxTiles = MAXTILES,
|
||||
|
|
|
@ -145,7 +145,7 @@ void RemoveSpriteStat(int nSprite)
|
|||
|
||||
void qinitspritelists(void) // Replace
|
||||
{
|
||||
for (int i = 0; i <= kMaxSectors; i++)
|
||||
for (int i = 0; i <= MAXSECTORS; i++)
|
||||
{
|
||||
headspritesect[i] = -1;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
|
||||
BEGIN_BLD_NS
|
||||
|
||||
POINT2D baseWall[kMaxWalls];
|
||||
HITINFO gHitInfo;
|
||||
|
||||
bool FindSector(int nX, int nY, int nZ, int *nSector)
|
||||
|
@ -299,7 +298,7 @@ int GetWallAngle(walltype* pWall)
|
|||
|
||||
void GetWallNormal(int nWall, int *pX, int *pY)
|
||||
{
|
||||
assert(nWall >= 0 && nWall < kMaxWalls);
|
||||
assert(validWallIndex(nWall));
|
||||
int nWall2 = wall[nWall].point2;
|
||||
int dX = -(wall[nWall2].y - wall[nWall].y);
|
||||
dX >>= 4;
|
||||
|
|
|
@ -42,7 +42,6 @@ struct HITINFO {
|
|||
void set(hitdata_t* hit);
|
||||
};
|
||||
|
||||
extern POINT2D baseWall[kMaxWalls];
|
||||
extern HITINFO gHitInfo;
|
||||
|
||||
enum {
|
||||
|
|
|
@ -716,7 +716,7 @@ void seqProcess(int nTicks)
|
|||
|
||||
else if (pInst->type == SS_MASKED)
|
||||
{
|
||||
assert(index >= 0 && index < kMaxWalls);
|
||||
assert(validWallIndex(index));
|
||||
auto pWall = &wall[index];
|
||||
pWall->cstat &= ~(8 + 16 + 32);
|
||||
if (pWall->twoSided())
|
||||
|
|
|
@ -827,8 +827,8 @@ void TranslateSector(int nSector, int a2, int a3, int a4, int a5, int a6, int a7
|
|||
{
|
||||
for (int i = 0; i < pSector->wallnum; nWall++, i++)
|
||||
{
|
||||
x = baseWall[nWall].x;
|
||||
y = baseWall[nWall].y;
|
||||
x = wall[nWall].baseWall.x;
|
||||
y = wall[nWall].baseWall.y;
|
||||
if (vbp)
|
||||
RotatePoint((int*)&x, (int*)&y, vbp, a4, a5);
|
||||
DragPoint(nWall, x+vc-a4, y+v8-a5);
|
||||
|
@ -839,8 +839,8 @@ void TranslateSector(int nSector, int a2, int a3, int a4, int a5, int a6, int a7
|
|||
for (int i = 0; i < pSector->wallnum; nWall++, i++)
|
||||
{
|
||||
int v10 = wall[nWall].point2;
|
||||
x = baseWall[nWall].x;
|
||||
y = baseWall[nWall].y;
|
||||
x = wall[nWall].baseWall.x;
|
||||
y = wall[nWall].baseWall.y;
|
||||
if (wall[nWall].cstat&16384)
|
||||
{
|
||||
if (vbp)
|
||||
|
@ -848,8 +848,8 @@ void TranslateSector(int nSector, int a2, int a3, int a4, int a5, int a6, int a7
|
|||
DragPoint(nWall, x+vc-a4, y+v8-a5);
|
||||
if ((wall[v10].cstat&49152) == 0)
|
||||
{
|
||||
x = baseWall[v10].x;
|
||||
y = baseWall[v10].y;
|
||||
x = wall[v10].baseWall.x;
|
||||
y = wall[v10].baseWall.y;
|
||||
if (vbp)
|
||||
RotatePoint((int*)&x, (int*)&y, vbp, a4, a5);
|
||||
DragPoint(v10, x+vc-a4, y+v8-a5);
|
||||
|
@ -863,8 +863,8 @@ void TranslateSector(int nSector, int a2, int a3, int a4, int a5, int a6, int a7
|
|||
DragPoint(nWall, x-(vc-a4), y-(v8-a5));
|
||||
if ((wall[v10].cstat&49152) == 0)
|
||||
{
|
||||
x = baseWall[v10].x;
|
||||
y = baseWall[v10].y;
|
||||
x = wall[v10].baseWall.x;
|
||||
y = wall[v10].baseWall.y;
|
||||
if (vbp)
|
||||
RotatePoint((int*)&x, (int*)&y, -vbp, a4, a5);
|
||||
DragPoint(v10, x-(vc-a4), y-(v8-a5));
|
||||
|
@ -1997,8 +1997,8 @@ void trInit(void)
|
|||
gBusyCount = 0;
|
||||
for (int i = 0; i < numwalls; i++)
|
||||
{
|
||||
baseWall[i].x = wall[i].x;
|
||||
baseWall[i].y = wall[i].y;
|
||||
wall[i].baseWall.x = wall[i].x;
|
||||
wall[i].baseWall.y = wall[i].y;
|
||||
}
|
||||
BloodLinearSpriteIterator it;
|
||||
while (auto actor = it.Next())
|
||||
|
@ -2053,8 +2053,8 @@ void trInit(void)
|
|||
TranslateSector(i, 0, -65536, pSprite1->x, pSprite1->y, pSprite1->x, pSprite1->y, pSprite1->ang, pSprite2->x, pSprite2->y, pSprite2->ang, pSector->type == kSectorSlide);
|
||||
for (int j = 0; j < pSector->wallnum; j++)
|
||||
{
|
||||
baseWall[pSector->wallptr+j].x = wall[pSector->wallptr+j].x;
|
||||
baseWall[pSector->wallptr+j].y = wall[pSector->wallptr+j].y;
|
||||
wall[pSector->wallptr + j].baseWall.x = wall[pSector->wallptr+j].x;
|
||||
wall[pSector->wallptr + j].baseWall.y = wall[pSector->wallptr+j].y;
|
||||
}
|
||||
BloodSectIterator it(i);
|
||||
while (auto actor = it.Next())
|
||||
|
@ -2072,8 +2072,8 @@ void trInit(void)
|
|||
TranslateSector(i, 0, -65536, pSprite1->x, pSprite1->y, pSprite1->x, pSprite1->y, 0, pSprite1->x, pSprite1->y, pSprite1->ang, pSector->type == kSectorRotate);
|
||||
for (int j = 0; j < pSector->wallnum; j++)
|
||||
{
|
||||
baseWall[pSector->wallptr+j].x = wall[pSector->wallptr+j].x;
|
||||
baseWall[pSector->wallptr+j].y = wall[pSector->wallptr+j].y;
|
||||
wall[pSector->wallptr + j].baseWall.x = wall[pSector->wallptr + j].x;
|
||||
wall[pSector->wallptr + j].baseWall.y = wall[pSector->wallptr + j].y;
|
||||
}
|
||||
BloodSectIterator it(i);
|
||||
while (auto actor = it.Next())
|
||||
|
|
|
@ -26,8 +26,6 @@ enum
|
|||
{
|
||||
kStatIgnited = 404,
|
||||
kMaxSprites = 4096,
|
||||
kMaxSectors = 1024,
|
||||
kMaxWalls = 8192,
|
||||
kMaxVoxels = 4096,
|
||||
kMaxPalookups = 256,
|
||||
kMaxStatus = 1024,
|
||||
|
|
|
@ -423,7 +423,7 @@ void UndoFlashes()
|
|||
|
||||
case 1:
|
||||
{
|
||||
assert(nIndex >= 0 && nIndex < kMaxWalls);
|
||||
assert(validWallIndex(nIndex));
|
||||
|
||||
pShade = &wall[nIndex].shade;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue