- Restored the previous level flag values to avoid needlessly breaking some

savegames at this point in time.
- Fixed: R_ClearPlanes() did not clear skybox planes for a full clear.
- Streamlined zip file loading by delaying the processing of the local file
  header until it is actually needed.


SVN r247 (trunk)
This commit is contained in:
Randy Heit 2006-07-12 03:35:55 +00:00
parent 2e02a4fa36
commit 18af8a57cf
5 changed files with 65 additions and 26 deletions

View File

@ -1,3 +1,10 @@
July 11, 2006
- Restored the previous level flag values to avoid needlessly breaking some
savegames at this point in time.
- Fixed: R_ClearPlanes() did not clear skybox planes for a full clear.
- Streamlined zip file loading by delaying the processing of the local file
header until it is actually needed.
July 11, 2006 (Changes by Graf Zahl) July 11, 2006 (Changes by Graf Zahl)
- Changed the additive scrollers option into a compatibility flag so that it can - Changed the additive scrollers option into a compatibility flag so that it can
be changed from the menu. be changed from the menu.

View File

@ -93,19 +93,19 @@
#define LEVEL_LAXMONSTERACTIVATION UCONST64(0x400000000) // Monsters can open doors depending on the door speed #define LEVEL_LAXMONSTERACTIVATION UCONST64(0x400000000) // Monsters can open doors depending on the door speed
#define LEVEL_LAXACTIVATIONMAPINFO UCONST64(0x800000000) // LEVEL_LAXMONSTERACTIVATION is not a default. #define LEVEL_LAXACTIVATIONMAPINFO UCONST64(0x800000000) // LEVEL_LAXMONSTERACTIVATION is not a default.
#define LEVEL_CAVERNS_OF_DARKNESS UCONST64(0x1000000000) // to translate the special sector types of CoD. #define LEVEL_CAVERNS_OF_DARKNESS UCONST64(0x2000000000) // to translate the special sector types of CoD.
#define LEVEL_KEEPFULLINVENTORY UCONST64(0x2000000000) // doesn't reduce the amount of inventory items to 1 #define LEVEL_KEEPFULLINVENTORY UCONST64(0x4000000000) // doesn't reduce the amount of inventory items to 1
#define LEVEL_MUSICDEFINED UCONST64(0x4000000000) // a marker to disable the $map command in SNDINFO for this map #define LEVEL_MUSICDEFINED UCONST64(0x8000000000) // a marker to disable the $map command in SNDINFO for this map
#define LEVEL_MONSTERFALLINGDAMAGE UCONST64(0x8000000000) #define LEVEL_MONSTERFALLINGDAMAGE UCONST64(0x10000000000)
#define LEVEL_CLIPMIDTEX UCONST64(0x10000000000) #define LEVEL_CLIPMIDTEX UCONST64(0x20000000000)
#define LEVEL_WRAPMIDTEX UCONST64(0x20000000000) #define LEVEL_WRAPMIDTEX UCONST64(0x40000000000)
#define LEVEL_CROUCH_NO UCONST64(0x40000000000) #define LEVEL_CROUCH_NO UCONST64(0x80000000000)
#define LEVEL_CROUCH_YES UCONST64(0x80000000000) #define LEVEL_CROUCH_YES UCONST64(0x100000000000)
#define LEVEL_PAUSE_MUSIC_IN_MENUS UCONST64(0x100000000000) #define LEVEL_PAUSE_MUSIC_IN_MENUS UCONST64(0x200000000000)
struct acsdefered_s; struct acsdefered_s;

View File

@ -456,9 +456,10 @@ extern int ConBottom;
void R_ClearPlanes (bool fullclear) void R_ClearPlanes (bool fullclear)
{ {
int i; int i, max;
for (i = 0; i < MAXVISPLANES; i++) // new code -- killough max = fullclear ? MAXVISPLANES : MAXVISPLANES-1;
for (i = 0; i <= max; i++) // new code -- killough
for (*freehead = visplanes[i], visplanes[i] = NULL; *freehead; ) for (*freehead = visplanes[i], visplanes[i] = NULL; *freehead; )
freehead = &(*freehead)->next; freehead = &(*freehead)->next;

View File

@ -1031,6 +1031,7 @@ void R_RenderSegLoop ()
short bottom = floorclip[x]; short bottom = floorclip[x];
if (top < bottom) if (top < bottom)
{ {
assert (bottom <= viewheight);
floorplane->top[x] = top; floorplane->top[x] = top;
floorplane->bottom[x] = bottom; floorplane->bottom[x] = bottom;
} }

View File

@ -96,10 +96,10 @@ struct FWadCollection::LumpRecord
enum enum
{ {
LUMPF_BLOODCRYPT = 1, // Lump uses Blood-style encryption LUMPF_BLOODCRYPT = 1, // Lump uses Blood-style encryption
LUMPF_COMPRESSED = 2, // Zip-compressed LUMPF_COMPRESSED = 2, // Zip-compressed
LUMPF_ZIPFILE = 4, // Inside a Zip file - used to enforce use of special directories insize Zips LUMPF_ZIPFILE = 4, // Inside a Zip file - used to enforce use of special directories insize Zips
LUMPF_NEEDFILESTART = 8, // Still need to process local file header to find file start inside a zip
}; };
class FWadCollection::WadFileRecord : public FileReader class FWadCollection::WadFileRecord : public FileReader
@ -535,7 +535,6 @@ void FWadCollection::AddFile (const char *filename, const char * data, int lengt
FZipFileInfo * zip_fh = (FZipFileInfo*)dirptr; FZipFileInfo * zip_fh = (FZipFileInfo*)dirptr;
char name[256]; char name[256];
char base[256]; char base[256];
FZipLocalHeader localHeader;
int len = LittleShort(zip_fh->wFileNameSize); int len = LittleShort(zip_fh->wFileNameSize);
strncpy(name, dirptr + sizeof(FZipFileInfo), MIN<int>(len, 255)); strncpy(name, dirptr + sizeof(FZipFileInfo), MIN<int>(len, 255));
@ -592,7 +591,6 @@ void FWadCollection::AddFile (const char *filename, const char * data, int lengt
uppercopy(lump_p->name, base); uppercopy(lump_p->name, base);
lump_p->name[8] = 0; lump_p->name[8] = 0;
lump_p->fullname = copystring(name); lump_p->fullname = copystring(name);
lump_p->position = LittleLong(zip_fh->dwFileOffset) + sizeof(FZipLocalHeader) + LittleShort(zip_fh->wFileNameSize);
lump_p->size = zip_fh->dwSize; lump_p->size = zip_fh->dwSize;
// Map some directories to WAD namespaces. // Map some directories to WAD namespaces.
@ -637,13 +635,9 @@ void FWadCollection::AddFile (const char *filename, const char * data, int lengt
} }
} }
// Now it gets ugly: We must retrieve the actual offset where the data begins. // The start of the file will be determined the first time it is accessed.
// Thanks to some bad file format design this has to do some additional steps. lump_p->flags |= LUMPF_NEEDFILESTART;
lump_p->position = LittleLong(zip_fh->dwFileOffset);
// Read the local file header, which contains the correct extra field size (Info-ZIP!).
wadinfo->Seek(LittleLong(zip_fh->dwFileOffset), SEEK_SET);
wadinfo->Read(&localHeader, sizeof(localHeader));
lump_p->position += LittleShort(localHeader.wExtraSize);
lump_p++; lump_p++;
} }
// Resize the lump record array to its actual size // Resize the lump record array to its actual size
@ -1663,7 +1657,26 @@ FWadLump FWadCollection::OpenLumpNum (int lump)
l = &LumpInfo[lump]; l = &LumpInfo[lump];
wad = Wads[l->wadnum]; wad = Wads[l->wadnum];
wad->Seek (l->position, SEEK_SET);
if (l->flags & LUMPF_NEEDFILESTART)
{
// This file is inside a zip and has not been opened before.
// Position points to the start of the local file header, which we must
// read and skip so that we can get to the actual file data.
FZipLocalHeader localHeader;
int skiplen;
wad->Seek (l->position, SEEK_SET);
wad->Read (&localHeader, sizeof(localHeader));
skiplen = LittleShort(localHeader.wFileNameSize) + LittleShort(localHeader.wExtraSize);
l->position += sizeof(localHeader) + skiplen;
wad->Seek (skiplen, SEEK_CUR);
l->flags &= ~LUMPF_NEEDFILESTART;
}
else
{
wad->Seek (l->position, SEEK_SET);
}
if (l->flags & LUMPF_COMPRESSED) if (l->flags & LUMPF_COMPRESSED)
{ {
@ -1713,6 +1726,23 @@ FWadLump *FWadCollection::ReopenLumpNum (int lump)
l = &LumpInfo[lump]; l = &LumpInfo[lump];
wad = Wads[l->wadnum]; wad = Wads[l->wadnum];
if (l->flags & LUMPF_NEEDFILESTART)
{
// This file is inside a zip and has not been opened before.
// Position points to the start of the local file header, which we must
// read and skip so that we can get to the actual file data.
FZipLocalHeader localHeader;
int skiplen;
int address;
address = wad->Tell();
wad->Seek (l->position, SEEK_SET);
wad->Read (&localHeader, sizeof(localHeader));
skiplen = LittleShort(localHeader.wFileNameSize) + LittleShort(localHeader.wExtraSize);
l->position += sizeof(localHeader) + skiplen;
l->flags &= ~LUMPF_NEEDFILESTART;
wad->Seek (address, SEEK_SET);
}
if (l->flags & LUMPF_COMPRESSED) if (l->flags & LUMPF_COMPRESSED)
{ {