Commit graph

61 commits

Author SHA1 Message Date
Randy Heit
6da887c34f Use Truncate to chop off extension in LumpNameSetup.
- Left() always creates a new string. Truncate() can reuse the old one if
  it only has one reference.
2015-04-04 18:20:05 -05:00
Randy Heit
4315423200 Rename ns_invalid to ns_hidden
- Also use ns_hidden by name in LumpNameSetup().
2015-04-04 18:20:04 -05:00
Randy Heit
2103fe2a14 Make FResourceLump::LumpNameSetup's argument an FString 2015-04-04 18:20:03 -05:00
Christoph Oelckers
1fddd1859e - fixed: FResourceFile::FilterLumps must use a proper copy of the filename to pass to LumpNameSetup instead of a pointer to the file name's stringbuffer, because that function will overwrite the variable it is taken from. 2015-04-05 00:38:29 +02:00
Christoph Oelckers
6e45c565a0 - fixed: FResourceLump::LumpNameSetup's iname parameter can point to the FullName variable's stringbuffer so any assignment to that variable must be done indirectly. 2015-04-04 20:52:55 +02:00
alexey.lysiuk
8b92c45f84 Fixed crash in lump filtering caused by uninitialized variables 2015-04-04 12:38:37 +03:00
Randy Heit
7b4d6e2f87 Add lump filtering for archive resources
- Multi-directory archives (e.g. zips) now support filtering lumps
  depending on the loaded IWAD. The search rules are the same as for the
  Autoload entries in the user's ini. For instance, if you are playing
  Doom 2, the following filters will be applied:
  * "filter/doom2/*"
  * "filter/doom/*"
  They will be renamed to strip out the "filter/doom2/" and "filter/doom/"
  parts and will be ordered so they take precedence over any files not
  inside a filter/ directory. Any files inside another filter/ directory
  (e.g. "filter/hexen/*") will be ignored.
2015-04-03 22:42:22 -05:00
Randy Heit
fc6f983c13 Fix memory leak when passing directories to -file 2015-04-03 21:50:08 -05:00
Randy Heit
efa82cf38b Consolidate archive sorting into FResourceFile base class 2015-04-03 20:22:18 -05:00
Randy Heit
966d0b7034 Use FString for FResourceLump::FullName 2015-04-03 20:00:58 -05:00
Randy Heit
308a036955 Ignored "compressed" lumps when running demo/shareware IWADs.
- The demo hexen.wad has this bit set for some lumps, which made it completely unplayable.
2015-03-08 17:40:58 -05:00
alexey.lysiuk
cce5066bea Improved check for skins and maps in the same WAD
The corresponding warning is shown for Doom I mods too. Good example of it is Hyena TC: http://www.doomworld.com/idgames/index.php?file=levels/doom/Ports/megawads/hyena.zip
Reduced chance of false positive for the mentioned warning
2015-01-31 13:14:30 +02:00
alexey.lysiuk
9df56216b3 Reworked check for embedded WADs put inside directory within archive
Any WAD from directory named the same as archive are treated as embedded
Fixed the issue with archive filename that wasn't taken into account
2015-01-12 11:28:40 +02:00
alexey.lysiuk
7ae3678abc Extended check for embedded WADs with one special case
Added loading of embedded WAD file if `myfile.wad` is placed in `myfile` directory inside `myfile.zip`
This helps with an unpleasant and very annoying fashion to zip a folder instead of just .wad and .txt files.
Recent examples include
Monster Hunter Ltd.: http://www.doomworld.com/idgames/?id=17601 and http://www.doomworld.com/idgames/?id=17625
Hell Awakened 2 Episode 1: http://www.doomworld.com/idgames/?id=17795
Bauhaus: http://www.doomworld.com/idgames/?id=17954
2015-01-11 11:43:43 +02:00
Randy Heit
7280d278d9 Fix VC2005 warning in F7ZFile::Open 2014-07-28 21:03:41 -05:00
Braden Obrzut
cb9877e7ff - Using USE_WINDOWS_DWORD on other platforms can cause problems. 2014-06-26 17:52:26 -04:00
Christoph Oelckers
270541f942 fixed compilation with latest LZMA SDK on Windows.
LZMA SDK recently added an #include <windows.h> to its headers, meaning it's no longer safe to include its headers globally in platform independent files.
The following changes were necessary:

- rename DWORD type in zipdir.c
- add USE_WINDOWS_DWORD and reorder includes in file_7z.cpp
- wrap LZMA decoder stream into a local struct that's declared anonymously in files.h and adjust files.cpp for this change.
2014-06-26 09:43:51 +02:00
Christoph Oelckers
ca4179caa3 - allow texture lookup by full path names. Due to technical limitations this may result in double textures if the same graphics lump is also referenced by its short texture name. 2014-05-13 20:51:16 +02:00
Christoph Oelckers
ea7fb936a8 - fixed: memory allocation for file names in 7z archives was broken. Changing it to use TArray instead of alloca makes it work. 2014-05-08 10:33:32 +02:00
alexey.lysiuk
3af7d8a245 Added support for LZMA2 compression method in .7z archives
Updated LZMA SDK to version 9.20
http://www.7-zip.org/sdk.html
http://downloads.sourceforge.net/sevenzip/lzma920.tar.bz2
2014-04-27 13:05:40 +03:00
alexey.lysiuk
6b26b710b8 Added simple check for unsupported compression method in .7z files 2014-04-27 10:23:20 +03:00
alexey.lysiuk
3fa89b4e9f Fixed crash on attempt to load corrupted data file
Instance of FileReader is no longer destructed when header of data file is valid but complete loading of file fails
Loading of truncated .zip file is the simplest test case
2014-04-27 10:18:50 +03:00
alexey.lysiuk
878dcdc0a4 Fix loading of lumps from directory on OS X
Use POSIX-compliant opendir() / readdir() functions instead fts_open() / fts_read()
Unlike Linux version, on OS X fts_read() inserts extra slash character between source directory and traversed entry paths
2014-04-06 12:56:51 +03:00
alexey.lysiuk
5c05f1f3cd - Ignored dehacked.exe from *.zip files to enable loading of *.deh files. 2013-08-02 10:17:06 +03:00
Christoph Oelckers
db562142f0 - Fix c++11 literal suffix warnings / patch by Edward-san. 2013-07-22 22:25:44 +02:00
Braden Obrzut
478bfa6cf1 - Fixed: file_directory tried to free it's input parameter.
SVN r4174 (trunk)
2013-03-07 22:16:09 +00:00
Randy Heit
3eb9953930 - Fix type conversion warning in file_wad.cpp.
SVN r3992 (trunk)
2012-12-21 22:48:40 +00:00
Braden Obrzut
d833a6015d - Fixed some compiler warnings.
SVN r3901 (trunk)
2012-10-22 23:47:09 +00:00
Braden Obrzut
cd2c1f6816 - Remove 255 character length restriction on lump names.
- Removed directory checking for big endian wads since the header check should be sufficient.

SVN r3899 (trunk)
2012-10-22 21:58:52 +00:00
Braden Obrzut
4b218c1c18 - Added support for compression in wads and big endian wads (which basically means the Jaguar Doom wad can be loaded as a pwad although it's pretty ugly since the graphic formats aren't supported).
SVN r3898 (trunk)
2012-10-22 19:54:13 +00:00
Randy Heit
fd784b05c2 - Fix some GCC 4.7.1 warnings.
SVN r3747 (trunk)
2012-07-07 03:43:11 +00:00
Randy Heit
de8bf651f2 - Fix warnings reported by gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)
SVN r3293 (trunk)
2011-09-14 23:24:32 +00:00
Randy Heit
2add3fb381 - Merge voxels back into trunk. Even if it needs further tweaking, it should at least be stable now.
SVN r3086 (trunk)
2011-01-02 18:02:27 +00:00
Randy Heit
b53baf5f46 - Added support for Blood's ambient sounds, because I thought it would be an easy way to
test the new ambient sound range parameters. (Hahaha! If I hadn't had to fix all the
  Build/Blood stuff first, it would have been.)

SVN r2223 (trunk)
2010-03-18 05:01:10 +00:00
Randy Heit
aedb646a52 - Fixed: Blood sound effect namespacing was broken.
SVN r2220 (trunk)
2010-03-18 03:55:51 +00:00
Randy Heit
8e104d0a28 - Fixed: RFF files constructed incorrect full names for the files they contained.
SVN r2217 (trunk)
2010-03-18 01:48:48 +00:00
Randy Heit
054e5411bd - Fixed: Checking for BUILD maps only worked if they came from unencrypted and
uncompressed sources.

SVN r2216 (trunk)
2010-03-18 01:07:50 +00:00
Christoph Oelckers
90ea0c3f6f - added initial support for a GAMEINFO lump in PWADs. When the game is started
all files loaded with '-file' are scanned for this lump. This lump is read
  before any WAD initialization takes place, in particular the IWAD is not yet
  loaded at this time. This allows PWADs the option to specify an IWAD they 
  want to run with and optionally autoload external resource WADs.
- Fixed a few places where FixPathSeperator was called with a locked FString buffer.
  It's better to use the FString version of this function instead.


SVN r2073 (trunk)
2010-01-01 15:31:00 +00:00
Christoph Oelckers
9aa1e20c77 - Added Blzut3's Solaris patch.
SVN r2070 (trunk)
2010-01-01 09:21:04 +00:00
Randy Heit
a0d6a47daf - Maps inside zips can now satisfy the map checks for IWAD detection.
- Fixed: F7ZFile did not delete its Archive when destroyed.


SVN r1967 (trunk)
2009-11-10 02:29:18 +00:00
Randy Heit
c24c31cc9f - Added directory detection to the -file parameter. This obsoletes -dir, so
that parameter is now gone.
- Removed automatic ".wad" appending from FWadCollection::InitMultipleFiles()
  since it isn't needed and prevented files without extensions from being
  loaded. D_AddFile() already takes care of adding the extension if the
  name as-given does not exist.
- Fixed: Loading single files did not print a newline in the startup text.


SVN r1784 (trunk)
2009-09-02 03:47:48 +00:00
Randy Heit
78902b2009 - Fixed: Some dmadds wads used zero-length sprites as placeholders. When you
ran dmadds to combine it with the IWAD's sprites, they would be replaced by
  the IWAD's sprites, so when loading such wads, we should ignore those as
  valid sprites. (Thanks to entryway for finding this.) See 22ventry's
  22sprite.wad for an example.


SVN r1782 (trunk)
2009-09-02 02:17:11 +00:00
Randy Heit
93202a5488 - Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
  for being able to use strict aliasing rules? I dunno. It's still slower
  than a VC++ build.
  
  I did run into two cases where TAutoSegIterator caused intractable problems
  with breaking strict aliasing rules, so I removed the templating from it,
  and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
  (in particular, dobject.h when not compiling with VC++).


SVN r1743 (trunk)
2009-08-02 03:38:57 +00:00
Randy Heit
e69f90076d - 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)
2009-06-11 22:58:06 +00:00
Christoph Oelckers
14cdab7e39 - Applied patch for fixing directory reading on Linux.
SVN r1628 (trunk)
2009-06-01 06:43:32 +00:00
Christoph Oelckers
627838f379 - Added loading directories into the lump directory.
- fixed: The Dehacked parser could not parse flag values with the highest bit
  set because it used atoi to convert the string into a number.

SVN r1624 (trunk)
2009-05-31 10:49:47 +00:00
Christoph Oelckers
2effc9b803 - Rewrote IWAD detection code to use the ResourceFile classes instead of
reading the WAD directory directly. As a side effect it should now be
  possible to use Zip and 7z for IWADs, too.


SVN r1621 (trunk)
2009-05-30 09:53:38 +00:00
Randy Heit
b7dab65754 SBARINFO patch:
- Fixed: SBarInfo's string drawing sometimes used the wrong variable.

SVN r1594 (trunk)
2009-05-20 01:42:47 +00:00
Randy Heit
2e87ebff22 - Added input buffering to the Implode and Shrink routines for a marked
speedup.
- Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with
  ones of my own devising, based solely on the specs in the APPNOTE.


SVN r1590 (trunk)
2009-05-17 03:05:26 +00:00
Christoph Oelckers
c0d2f78b2a - fixed: FZipLump passed the uncompressed lump size to ShrinkLoop as size of the input data but this must be the compressed size.
SVN r1589 (trunk)
2009-05-16 10:06:39 +00:00