- fixed: When parsing an endgame block there was one check too many for an opening brace.

- fixed: Endgame texts across multiple lines did not get newlines added.
- increased string heap to 128kb after getting overflows with some MAPINFOs that contained a lot of large endgame texts.


SVN r1390 (newmapinfo)
This commit is contained in:
Christoph Oelckers 2009-02-01 16:49:31 +00:00
parent f0d89f71d0
commit fabc0906a7
3 changed files with 8 additions and 5 deletions

View file

@ -335,7 +335,7 @@ void FMapInfoParser::SkipToNext()
//==========================================================================
//
// ParseLookupnamr
// ParseLookupname
// Parses a string that may reference the string table
//
//==========================================================================
@ -367,9 +367,11 @@ bool FMapInfoParser::ParseLookupName(FString &dest)
do
{
sc.MustGetString();
dest += sc.String;
dest << sc.String << '\n';
}
while (sc.CheckString(","));
// strip off the last newline
dest.Truncate(long(dest.Len()-1));
return false;
}
}
@ -541,7 +543,6 @@ void FMapInfoParser::ParseNextMap(char *mapname)
newSeq.EndType = END_Pic1;
newSeq.PlayTheEnd = false;
newSeq.MusicLooping = true;
sc.MustGetStringName("{");
while (!sc.CheckString("}"))
{
sc.MustGetString();

View file

@ -22,6 +22,7 @@
#include "m_misc.h"
#include "templates.h"
#include "doomstat.h"
#include "v_text.h"
// MACROS ------------------------------------------------------------------
@ -1012,7 +1013,7 @@ void STACK_ARGS FScanner::ScriptMessage (const char *message, ...)
va_end (arglist);
}
Printf ("Script error, \"%s\" line %d:\n%s\n", ScriptName.GetChars(),
Printf (TEXTCOLOR_RED"Script error, \"%s\" line %d:\n%s\n", ScriptName.GetChars(),
AlreadyGot? AlreadyGotLine : Line, composed.GetChars());
}

View file

@ -1110,6 +1110,7 @@ void FString::ReallocBuffer (size_t newlen)
#include <windows.h>
static HANDLE StringHeap;
const SIZE_T STRING_HEAP_SIZE = 128*1024;
#endif
FStringData *FStringData::Alloc (size_t strlen)
@ -1120,7 +1121,7 @@ FStringData *FStringData::Alloc (size_t strlen)
#ifdef _WIN32
if (StringHeap == NULL)
{
StringHeap = HeapCreate (0, 64*1024, 0);
StringHeap = HeapCreate (0, STRING_HEAP_SIZE, 0);
if (StringHeap == NULL)
{
throw std::bad_alloc();