summaryrefslogtreecommitdiff
path: root/src/w_wad.c
AgeCommit message (Collapse)Author
2015-05-10Add back the Doom PWAD reload hack.Simon Howard
This was removed back in d190b596c566394717324296cbf6b46e67c64f5c; at the time I didn't understand what it was or how it was supposed to be used - it seemed like cruft left over from Doom's development. It is actually a potentially useful feature for level authors when developing their maps. See here: http://doomwiki.org/wiki/Reload_hack The reload hack is a relatively obscure feature of limited usefulness nowadays, but nonetheless a technical curiosity that ought to be preserved in Chocolate Doom. The reimplementation here is a lot cleaner than the original version from the source release: W_Reload() is based on a call to W_AddFile(), we don't reopen the reload file every time we want to read a lump, and we include a check in W_AddFile() that we are not trying to use the hack on more than one PWAD file. This fixes #539.
2014-10-16Fix crash caused by adding a new WAD file.Simon Howard
This fixes #442, a crash caused by adding a new WAD file after a lump has been loaded (and cached) from a previous WAD. This manifested when playing using the Freedoom IWADs and also loading a PWAD at the same time. The Freedoom IWADs have DEHACKED lumps that are loaded from within the IWAD file. The ultimate cause (thanks to Fabian Greffrath for uncovering it) is that lumpinfo is realloc()ed after each new WAD load to store the lumpinfo_t structures from the new WAD. If a lump has been read and cached from a previous WAD file, it may end up having an invalid 'user' pointer that points to somewhere in the old lumpinfo[] array, not the new one. I think this bug was masked because realloc() will often not move data if the previous location can simply be extended. The bug was discovered when loading BTSX as a PWAD, probably because it's a large WAD that contains a lot of lumps, and forced a move during realloc.
2014-05-05Clean up file headers.Simon Howard
This change rewrites and simplifies the copyright headers at the top of all source files: * Remove "Emacs style mode select" line; this line was included in the headers for the originally released source files and appears to be to set the file type for old versions of Emacs. I'm not sure entirely why it was required but I don't think it is any more. * Remove "You should have received a copy of..." text from copyright header. This refers to the old 59 Temple Place address where the FSF headquarters used to be located and is no longer correct. Rather than change to the new address, just remove the paragraph as it is superfluous anyway. This fixes #311. * Remove ---- separator lines so that the file headers are barer and more simplified.
2014-04-19Exit with error on startup if using the wrong IWAD.Simon Howard
Having multiple binaries can cause some confusion - some users try to run chocolate-doom with hexen.wad, thinking it is supported. Add a startup check that makes sure the user is not trying to start the game using the wrong IWAD file for the binary being run. This fixes #382.
2008-10-30Factor out Heretic and Hexen versions of m_misc.c. Make -file forSimon Howard
Heretic and Hexen use WAD path lookup. Subversion-branch: /branches/raven-branch Subversion-revision: 1368
2008-09-06Remove includes of doomdef.h where possible, move generic parts into topSimon Howard
level. Subversion-branch: /branches/raven-branch Subversion-revision: 1204
2008-05-04Remove Vanilla Doom reload hack.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1140
2008-05-02Memory-mapped WAD access.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1136
2008-05-02Add W_CacheLumpNum,Name API to WAD code for releasing a lump back toSimon Howard
cache when it is no longer needed. Switch existing code to use the new API instead of Z_ChangeTag. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1134
2008-05-02Add WAD I/O abstraction layer - first step for mmapped WAD access.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1133
2008-03-09Split out configuration file code from m_misc.c into m_config.c. MoveSimon Howard
screenshot code into v_video.c Add M_FileLength common function for finding the length of an open file. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1102
2007-08-31Use gcc packed attribute for all structures read/written to disk. ThisSimon Howard
fixes architectures where structure fields are aligned differently to optimise reads, causing the game to crash. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 960
2007-06-16Switch to djb2 hash function and shut up compiler warningsSimon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 908
2007-03-15Use SDL for endianness byte swapping. m_swap.c removed; m_swap.h renamedSimon Howard
to i_swap.h. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 857
2006-12-22Add definitions for PATH and directory separators.Simon Howard
Allow multiple directories to be specified in DOOMWADDIR, in the same way as PATH. Make -iwad search through all search paths for the specified IWAD. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 799
2006-11-10Fix for playing demos on PPC (actually, fix for loading single lumpSimon Howard
files on non-little-endian machines). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 749
2006-10-18Shut up warnings in w_wad.c.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 706
2006-10-18Strip out CVS logs, RCS Id tags.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 704
2006-09-20Fix code style :-)Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 630
2006-09-20add extra defines when buildingRussell Rice
don't crash if numlumps = 0 (which is caused when an iwad has an invalid path) Subversion-branch: /trunk/chocolate-doom Subversion-revision: 629
2006-09-02Add -nwtmerge option, which behaves the same as NWT's -merge option. What thisSimon Howard
does is load a PWAD, then search through the IWAD sprites list, removing lumps where there are lumps of the same name in the PWAD. The PWAD must then be loaded again with the normal -file option. This is needed to run TiC's Obituary TC: chocolate-doom -nwtmerge obtic2.wad -file obtic1.wad obtic2.wad -deh obtic1.deh Also add W_PrintDirectory debug function, W_AddFile changed to return handle. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 596
2006-06-16Add hash table for fast texture lookup; refactor P_GroupLines to use anSimon Howard
O(n) rather than O(n^2) algorithm: faster loading maps like sid.wad map03 Subversion-branch: /trunk/chocolate-doom Subversion-revision: 558
2006-03-24Ooops!Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 437
2006-03-24Generate a hash table for fast lump name lookups.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 436
2006-03-24Make memblock_t internal to z_zone.c. Adjust Z_ChangeTag #define toSimon Howard
cope with this. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 434
2006-02-03Support NWT-style WAD merging (-af and -as command line parameters).Simon Howard
Restructure WAD loading so that merged WADs are always loaded before normal PWADs. Remove W_InitMultipleFiles(). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 362
2006-01-24More endianness fixesSimon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 342
2006-01-10Shut up compiler warningsSimon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 280
2005-10-08Store the cache as part of the lumpinfo_t struct. Add W_AddFile prototypeSimon Howard
to header. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 167
2005-08-30More Windows fixesSimon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 58
2005-08-30Windows fixesSimon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 57
2005-08-04Silence compiler warningsSimon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 37
2005-08-04Loading diskSimon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 33
2005-07-23Use standard C file functions for WAD codeSimon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 15
2005-07-23Update copyright to GNU GPLSimon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 8
2005-07-23Initial revisionSimon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 4