- moved the "??? lumps" messages out of the single resource file handlers into the calling function and did a bit of include cleanup.

This commit is contained in:
Christoph Oelckers 2020-04-11 13:23:21 +02:00
parent 7d83dfa03a
commit 83befa7686
14 changed files with 29 additions and 42 deletions

View file

@ -23,6 +23,18 @@ typedef int32_t fixed_t;
typedef uint32_t angle_t; typedef uint32_t angle_t;
#if defined(__GNUC__)
// With versions of GCC newer than 4.2, it appears it was determined that the
// cost of an unaligned pointer on PPC was high enough to add padding to the
// end of packed structs. For whatever reason __packed__ and pragma pack are
// handled differently in this regard. Note that this only needs to be applied
// to types which are used in arrays or sizeof is needed. This also prevents
// code from taking references to the struct members.
#define FORCE_PACKED __attribute__((__packed__))
#else
#define FORCE_PACKED
#endif
#ifdef __GNUC__ #ifdef __GNUC__
#define GCCPRINTF(stri,firstargi) __attribute__((format(printf,stri,firstargi))) #define GCCPRINTF(stri,firstargi) __attribute__((format(printf,stri,firstargi)))

View file

@ -40,18 +40,6 @@ typedef TMap<int, PClassActor *> FClassMap;
#define NOVTABLE #define NOVTABLE
#endif #endif
#if defined(__GNUC__)
// With versions of GCC newer than 4.2, it appears it was determined that the
// cost of an unaligned pointer on PPC was high enough to add padding to the
// end of packed structs. For whatever reason __packed__ and pragma pack are
// handled differently in this regard. Note that this only needs to be applied
// to types which are used in arrays or sizeof is needed. This also prevents
// code from taking references to the struct members.
#define FORCE_PACKED __attribute__((__packed__))
#else
#define FORCE_PACKED
#endif
#include "basics.h" #include "basics.h"
#include "printf.h" #include "printf.h"

View file

@ -39,8 +39,7 @@
#include "resourcefile.h" #include "resourcefile.h"
#include "cmdlib.h" #include "cmdlib.h"
#include "v_text.h" #include "printf.h"
#include "w_wad.h"
@ -314,8 +313,6 @@ bool F7ZFile::Open(bool quiet, LumpFilterInfo *filter)
} }
} }
if (!quiet && !batchrun) Printf(", %d lumps\n", NumLumps);
GenerateHash(); GenerateHash();
PostProcessArchive(&Lumps[0], sizeof(F7ZLump), filter); PostProcessArchive(&Lumps[0], sizeof(F7ZLump), filter);
return true; return true;

View file

@ -38,7 +38,7 @@
#include "resourcefile.h" #include "resourcefile.h"
#include "cmdlib.h" #include "cmdlib.h"
#include "doomtype.h" #include "printf.h"
#include "findfile.h" #include "findfile.h"
@ -183,7 +183,6 @@ int FDirectory::AddDirectory(const char *dirpath)
bool FDirectory::Open(bool quiet, LumpFilterInfo* filter) bool FDirectory::Open(bool quiet, LumpFilterInfo* filter)
{ {
NumLumps = AddDirectory(FileName); NumLumps = AddDirectory(FileName);
if (!quiet) Printf(", %d lumps\n", NumLumps);
PostProcessArchive(&Lumps[0], sizeof(FDirectoryLump), filter); PostProcessArchive(&Lumps[0], sizeof(FDirectoryLump), filter);
return true; return true;
} }

View file

@ -34,8 +34,7 @@
*/ */
#include "resourcefile.h" #include "resourcefile.h"
#include "w_wad.h" #include "printf.h"
#include "doomtype.h"
//========================================================================== //==========================================================================
// //
@ -118,7 +117,6 @@ bool FGrpFile::Open(bool quiet, LumpFilterInfo*)
fileinfo[i].NameWithZero[12] = '\0'; // Be sure filename is null-terminated fileinfo[i].NameWithZero[12] = '\0'; // Be sure filename is null-terminated
Lumps[i].LumpNameSetup(fileinfo[i].NameWithZero); Lumps[i].LumpNameSetup(fileinfo[i].NameWithZero);
} }
if (!quiet && !batchrun) Printf(", %d lumps\n", NumLumps);
GenerateHash(); GenerateHash();
delete[] fileinfo; delete[] fileinfo;
return true; return true;

View file

@ -34,8 +34,7 @@
#include "resourcefile.h" #include "resourcefile.h"
#include "cmdlib.h" #include "cmdlib.h"
#include "w_wad.h" #include "printf.h"
#include "doomtype.h"
//========================================================================== //==========================================================================
// //

View file

@ -33,8 +33,7 @@
*/ */
#include "resourcefile.h" #include "resourcefile.h"
#include "w_wad.h" #include "printf.h"
#include "doomtype.h"
//========================================================================== //==========================================================================
// //
@ -103,8 +102,6 @@ bool FPakFile::Open(bool quiet, LumpFilterInfo* filter)
Lumps.Resize(NumLumps); Lumps.Resize(NumLumps);
if (!quiet && !batchrun) Printf(", %d lumps\n", NumLumps);
for(uint32_t i = 0; i < NumLumps; i++) for(uint32_t i = 0; i < NumLumps; i++)
{ {
Lumps[i].LumpNameSetup(fileinfo[i].name); Lumps[i].LumpNameSetup(fileinfo[i].name);

View file

@ -35,8 +35,7 @@
#include "resourcefile.h" #include "resourcefile.h"
#include "templates.h" #include "templates.h"
#include "w_wad.h" #include "printf.h"
#include "doomtype.h"
//========================================================================== //==========================================================================
// //
@ -151,7 +150,6 @@ bool FRFFFile::Open(bool quiet, LumpFilterInfo*)
Lumps = new FRFFLump[NumLumps]; Lumps = new FRFFLump[NumLumps];
if (!quiet && !batchrun) Printf(", %d lumps\n", NumLumps);
for (uint32_t i = 0; i < NumLumps; ++i) for (uint32_t i = 0; i < NumLumps; ++i)
{ {
Lumps[i].Position = LittleLong(lumps[i].FilePos); Lumps[i].Position = LittleLong(lumps[i].FilePos);

View file

@ -37,7 +37,6 @@
#include "resourcefile.h" #include "resourcefile.h"
#include "v_text.h" #include "v_text.h"
#include "w_wad.h" #include "w_wad.h"
#include "gi.h"
#include "engineerrors.h" #include "engineerrors.h"
//========================================================================== //==========================================================================
@ -176,7 +175,13 @@ bool FWadFile::Open(bool quiet, LumpFilterInfo*)
char n[9]; char n[9];
uppercopy(n, fileinfo[i].Name); uppercopy(n, fileinfo[i].Name);
n[8] = 0; n[8] = 0;
// This needs to be done differently. We cannot simply assume that all lumps where the first character's high bit is set are compressed without verification.
// This requires explicit toggling for precisely the files that need it.
#if 0
Lumps[i].Compressed = !(gameinfo.flags & GI_SHAREWARE) && (n[0] & 0x80) == 0x80; Lumps[i].Compressed = !(gameinfo.flags & GI_SHAREWARE) && (n[0] & 0x80) == 0x80;
#else
Lumps[i].Compressed = false;
#endif
n[0] &= ~0x80; n[0] &= ~0x80;
Lumps[i].LumpNameSetup(n); Lumps[i].LumpNameSetup(n);
@ -202,8 +207,6 @@ bool FWadFile::Open(bool quiet, LumpFilterInfo*)
if (!quiet) // don't bother with namespaces in quiet mode. We won't need them. if (!quiet) // don't bother with namespaces in quiet mode. We won't need them.
{ {
if (!batchrun) Printf(", %d lumps\n", NumLumps);
SetNamespace("S_START", "S_END", ns_sprites); SetNamespace("S_START", "S_END", ns_sprites);
SetNamespace("F_START", "F_END", ns_flats, true); SetNamespace("F_START", "F_END", ns_flats, true);
SetNamespace("C_START", "C_END", ns_colormaps); SetNamespace("C_START", "C_END", ns_colormaps);

View file

@ -119,7 +119,6 @@ bool FWHResFile::Open(bool quiet, LumpFilterInfo*)
NumLumps = i; NumLumps = i;
Lumps.Clamp(NumLumps); Lumps.Clamp(NumLumps);
Lumps.ShrinkToFit(); Lumps.ShrinkToFit();
if (!quiet) Printf(", %d lumps\n", NumLumps);
return true; return true;
} }

View file

@ -37,8 +37,7 @@
#include "file_zip.h" #include "file_zip.h"
#include "cmdlib.h" #include "cmdlib.h"
#include "templates.h" #include "templates.h"
#include "v_text.h" #include "printf.h"
#include "w_wad.h"
#include "w_zip.h" #include "w_zip.h"
#include "ancientzip.h" #include "ancientzip.h"
@ -338,8 +337,6 @@ bool FZipFile::Open(bool quiet, LumpFilterInfo* filter)
NumLumps -= skipped; NumLumps -= skipped;
free(directory); free(directory);
if (!quiet && !batchrun) Printf(TEXTCOLOR_NORMAL ", %d lumps\n", NumLumps);
GenerateHash(); GenerateHash();
PostProcessArchive(&Lumps[0], sizeof(FZipLump), filter); PostProcessArchive(&Lumps[0], sizeof(FZipLump), filter);
return true; return true;

View file

@ -37,10 +37,6 @@
#include <zlib.h> #include <zlib.h>
#include "resourcefile.h" #include "resourcefile.h"
#include "cmdlib.h" #include "cmdlib.h"
#include "w_wad.h"
#include "gi.h"
#include "doomstat.h"
#include "doomtype.h"
#include "md5.h" #include "md5.h"

View file

@ -377,6 +377,8 @@ void FWadCollection::AddFile (const char *filename, FileReader *wadr, bool quiet
if (resfile != NULL) if (resfile != NULL)
{ {
if (!quiet && !batchrun) Printf(", %d lumps\n", resfile->LumpCount());
uint32_t lumpstart = LumpInfo.Size(); uint32_t lumpstart = LumpInfo.Size();
resfile->SetFirstLump(lumpstart); resfile->SetFirstLump(lumpstart);

View file

@ -1,6 +1,8 @@
#ifndef __W_ZIP #ifndef __W_ZIP
#define __W_ZIP #define __W_ZIP
#include "basics.h"
#pragma pack(1) #pragma pack(1)
// FZipCentralInfo // FZipCentralInfo
struct FZipEndOfCentralDirectory struct FZipEndOfCentralDirectory