mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-31 12:30:32 +00:00
- a few more explicit local buffer allocations removed.
# Conflicts: # src/gl/data/gl_setup.cpp
This commit is contained in:
parent
82d05dce13
commit
fcacb80db5
3 changed files with 11 additions and 21 deletions
|
@ -549,8 +549,8 @@ void gl_PreprocessLevel()
|
|||
PrepareSegs();
|
||||
PrepareSectorData();
|
||||
InitVertexData();
|
||||
int *checkmap = new int[level.vertexes.Size()];
|
||||
memset(checkmap, -1, sizeof(int)*level.vertexes.Size());
|
||||
TArray<int> checkmap(level.vertexes.Size());
|
||||
memset(checkmap.Data(), -1, sizeof(int)*level.vertexes.Size());
|
||||
for(auto &sec : level.sectors)
|
||||
{
|
||||
int i = sec.sectornum;
|
||||
|
@ -579,8 +579,6 @@ void gl_PreprocessLevel()
|
|||
}
|
||||
}
|
||||
}
|
||||
delete[] checkmap;
|
||||
|
||||
gl_InitPortals();
|
||||
|
||||
if (GLRenderer != NULL)
|
||||
|
@ -588,10 +586,6 @@ void gl_PreprocessLevel()
|
|||
GLRenderer->SetupLevel();
|
||||
}
|
||||
|
||||
#if 0
|
||||
gl_CreateSections();
|
||||
#endif
|
||||
|
||||
InitGLRMapinfoData();
|
||||
}
|
||||
|
||||
|
|
|
@ -319,12 +319,12 @@ void R_InitSpriteDefs ()
|
|||
struct Hasher
|
||||
{
|
||||
int Head, Next;
|
||||
} *hashes;
|
||||
};
|
||||
struct VHasher
|
||||
{
|
||||
int Head, Next, Name, Spin;
|
||||
char Frame;
|
||||
} *vhashes;
|
||||
};
|
||||
unsigned int i, j, smax, vmax;
|
||||
uint32_t intname;
|
||||
|
||||
|
@ -332,8 +332,8 @@ void R_InitSpriteDefs ()
|
|||
|
||||
// Create a hash table to speed up the process
|
||||
smax = TexMan.NumTextures();
|
||||
hashes = new Hasher[smax];
|
||||
memset(hashes, -1, sizeof(Hasher)*smax);
|
||||
TArray<Hasher> hashes(smax, true);
|
||||
memset(hashes.Data(), -1, sizeof(Hasher)*smax);
|
||||
for (i = 0; i < smax; ++i)
|
||||
{
|
||||
FTexture *tex = TexMan.ByIndex(i);
|
||||
|
@ -347,8 +347,8 @@ void R_InitSpriteDefs ()
|
|||
|
||||
// Repeat, for voxels
|
||||
vmax = Wads.GetNumLumps();
|
||||
vhashes = new VHasher[vmax];
|
||||
memset(vhashes, -1, sizeof(VHasher)*vmax);
|
||||
TArray<VHasher> vhashes(vmax, true);
|
||||
memset(vhashes.Data(), -1, sizeof(VHasher)*vmax);
|
||||
for (i = 0; i < vmax; ++i)
|
||||
{
|
||||
if (Wads.GetLumpNamespace(i) == ns_voxels)
|
||||
|
@ -463,9 +463,6 @@ void R_InitSpriteDefs ()
|
|||
|
||||
R_InstallSprite ((int)i, sprtemp, maxframe);
|
||||
}
|
||||
|
||||
delete[] hashes;
|
||||
delete[] vhashes;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -471,10 +471,9 @@ bool FSerializer::OpenReader(FCompressedBuffer *input)
|
|||
}
|
||||
else
|
||||
{
|
||||
char *unpacked = new char[input->mSize];
|
||||
input->Decompress(unpacked);
|
||||
r = new FReader(unpacked, input->mSize);
|
||||
delete[] unpacked;
|
||||
TArray<char> unpacked(input->mSize);
|
||||
input->Decompress(unpacked.Data());
|
||||
r = new FReader(unpacked.Data(), input->mSize);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue