- replaced a few temporary allocations with TArray and added a few convenience loader functions for this.

Amazingly with today's optimizers this creates code which is just as good as doing it all manually with the added benefit of being safer.
This commit is contained in:
Christoph Oelckers 2018-11-10 11:56:18 +01:00
commit 3448749de6
10 changed files with 60 additions and 39 deletions

View file

@ -473,10 +473,7 @@ class USDFParser : public UDMFParserBase
public:
bool Parse(int lumpnum, FileReader &lump, int lumplen)
{
char *buffer = new char[lumplen];
lump.Read(buffer, lumplen);
sc.OpenMem(Wads.GetLumpFullName(lumpnum), buffer, lumplen);
delete [] buffer;
sc.OpenMem(Wads.GetLumpFullName(lumpnum), lump.Read(lumplen));
sc.SetCMode(true);
// Namespace must be the first field because everything else depends on it.
if (sc.CheckString("namespace"))