mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-31 13:00:59 +00:00
- fixed a few issues pointed out by the assert in the TArray [] operator.
This commit is contained in:
parent
77c4a57c51
commit
d00ad60437
4 changed files with 18 additions and 3 deletions
|
@ -709,7 +709,7 @@ void MapLoader::InitRenderInfo()
|
||||||
PrepareSectorData();
|
PrepareSectorData();
|
||||||
InitVertexData();
|
InitVertexData();
|
||||||
FloodSectorStacks();
|
FloodSectorStacks();
|
||||||
TArray<int> checkmap(Level->vertexes.Size());
|
TArray<int> checkmap(Level->vertexes.Size(), true);
|
||||||
memset(checkmap.Data(), -1, sizeof(int)*Level->vertexes.Size());
|
memset(checkmap.Data(), -1, sizeof(int)*Level->vertexes.Size());
|
||||||
for(auto &sec : Level->sectors)
|
for(auto &sec : Level->sectors)
|
||||||
{
|
{
|
||||||
|
|
|
@ -374,7 +374,7 @@ FSerializer &FLevelLocals::SerializeSubsectors(FSerializer &arc, const char *key
|
||||||
auto numsubsectors = subsectors.Size();
|
auto numsubsectors = subsectors.Size();
|
||||||
if (arc.isWriting())
|
if (arc.isWriting())
|
||||||
{
|
{
|
||||||
TArray<char> encoded(1 + (numsubsectors + 5) / 6);
|
TArray<char> encoded(1 + (numsubsectors + 5) / 6, true);
|
||||||
int p = 0;
|
int p = 0;
|
||||||
for (unsigned i = 0; i < numsubsectors; i += 6)
|
for (unsigned i = 0; i < numsubsectors; i += 6)
|
||||||
{
|
{
|
||||||
|
|
|
@ -803,6 +803,21 @@ public:
|
||||||
sub.section = bestfit;
|
sub.section = bestfit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set all empty sectors' initial index to 0, so that we do not have to range-check each access.
|
||||||
|
for (unsigned i = 0; i < Level->sectors.Size(); i++)
|
||||||
|
{
|
||||||
|
if (Level->sections.firstSectionForSectorPtr[i] < 0)
|
||||||
|
{
|
||||||
|
Level->sections.firstSectionForSectorPtr[i] = 0;
|
||||||
|
if (Level->sections.numberOfSectionForSectorPtr[i] > 0)
|
||||||
|
{
|
||||||
|
// This should never happen.
|
||||||
|
Printf("Warning: Sector %d has a non-empty section list with no address\n", i);
|
||||||
|
Level->sections.numberOfSectionForSectorPtr = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -83,7 +83,7 @@ struct FRemapTable
|
||||||
|
|
||||||
uint8_t Remap[256]; // For the software renderer
|
uint8_t Remap[256]; // For the software renderer
|
||||||
PalEntry Palette[256]; // The ideal palette this maps to
|
PalEntry Palette[256]; // The ideal palette this maps to
|
||||||
FUniquePalette *Native; // The index into the list of unique palettes (this is to avoid frequent texture recreation with changing ACS translations)
|
FUniquePalette *Native = nullptr; // The index into the list of unique palettes (this is to avoid frequent texture recreation with changing ACS translations)
|
||||||
//int crc32;
|
//int crc32;
|
||||||
int NumEntries; // # of elements in this table (usually 256)
|
int NumEntries; // # of elements in this table (usually 256)
|
||||||
bool Inactive = false; // This table is inactive and should be treated as if it was passed as NULL
|
bool Inactive = false; // This table is inactive and should be treated as if it was passed as NULL
|
||||||
|
|
Loading…
Reference in a new issue