- Changed wad namespacing so that wads with a missing end marker will be

loaded as if they had one more lump with that end marker. This matches the
  behaviour of previously released ZDooms. (The warning is still present, so
  there's no excuse to release more wads like this.)


SVN r1667 (trunk)
This commit is contained in:
Randy Heit 2009-06-11 22:58:06 +00:00
parent 8d83d3791d
commit e69f90076d
2 changed files with 12 additions and 5 deletions

View file

@ -1,4 +1,8 @@
June 10, 2009 June 10, 2009
- Changed wad namespacing so that wads with a missing end marker will be
loaded as if they had one more lump with that end marker. This matches the
behaviour of previously released ZDooms. (The warning is still present, so
there's no excuse to release more wads like this.)
- Moved Raw Input processing into a seperate method of FInputDevice so that - Moved Raw Input processing into a seperate method of FInputDevice so that
all the devices can share the same setup code. all the devices can share the same setup code.

View file

@ -224,7 +224,7 @@ void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, name
i++; i++;
continue; continue;
} }
// same for x_START markers // same for x_END markers
while (i < markers.Size()-1 && (markers[i].markertype == 1 && markers[i+1].markertype == 1)) while (i < markers.Size()-1 && (markers[i].markertype == 1 && markers[i+1].markertype == 1))
{ {
Printf(TEXTCOLOR_YELLOW"WARNING: duplicate %s marker found.\n", endmarker); Printf(TEXTCOLOR_YELLOW"WARNING: duplicate %s marker found.\n", endmarker);
@ -235,13 +235,16 @@ void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, name
if (i >= markers.Size()) if (i >= markers.Size())
{ {
Printf(TEXTCOLOR_YELLOW"WARNING: %s marker without corresponding %s found.\n", startmarker, endmarker); Printf(TEXTCOLOR_YELLOW"WARNING: %s marker without corresponding %s found.\n", startmarker, endmarker);
return; end = NumLumps;
}
else
{
end = markers[i++].index;
} }
end = i++;
// we found a marked block // we found a marked block
DPrintf("Found %s block at (%d-%d)\n", startmarker, markers[start].index, markers[end].index); DPrintf("Found %s block at (%d-%d)\n", startmarker, markers[start].index, end);
for(int j = markers[start].index+1; j < markers[end].index; j++) for(int j = markers[start].index + 1; j < end; j++)
{ {
if (Lumps[j].Namespace != ns_global) if (Lumps[j].Namespace != ns_global)
{ {