From fabc0906a795283ebdaf922bcf356d0e471c9de4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 1 Feb 2009 16:49:31 +0000 Subject: [PATCH] - 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) --- src/g_mapinfo.cpp | 7 ++++--- src/sc_man.cpp | 3 ++- src/zstring.cpp | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/g_mapinfo.cpp b/src/g_mapinfo.cpp index cd0b18497a..1873ec4ac8 100644 --- a/src/g_mapinfo.cpp +++ b/src/g_mapinfo.cpp @@ -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(); diff --git a/src/sc_man.cpp b/src/sc_man.cpp index 233ea2f3e9..c474439b6c 100644 --- a/src/sc_man.cpp +++ b/src/sc_man.cpp @@ -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()); } diff --git a/src/zstring.cpp b/src/zstring.cpp index 9f39264389..812a5f4640 100644 --- a/src/zstring.cpp +++ b/src/zstring.cpp @@ -1110,6 +1110,7 @@ void FString::ReallocBuffer (size_t newlen) #include 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();