Commit graph

99 commits

Author SHA1 Message Date
alexey.lysiuk
f25c7ef2d5 Unified implementation of ’directory as resource file' for POSIX targets 2017-12-03 14:57:34 +02:00
alexey.lysiuk
8129afdd1f Fixed compilation of non-Windows targets
These are quick hacks to be improved later
2017-12-03 10:11:54 +02:00
Christoph Oelckers
8627a48b34 - consolidation of 'stat' calls.
Since this is a non-standard function it's better kept to as few places as possible, so now DirEntryExists returns an additional flag to say what type an entry is and is being used nearly everywhere where stat was used, excluding a few low level parts in the POSIX code.
2017-12-02 16:07:09 +01:00
Christoph Oelckers
e15b23f132 - use FileWriter for writing zip files (i.e. savegames.) 2017-12-02 12:46:25 +01:00
Christoph Oelckers
14af7818b8 - use FileReader for all operations on external lumps. 2017-12-02 12:38:38 +01:00
alexey.lysiuk
50d39771c0 Fixed out of bound read in zip file loader 2017-10-23 12:31:39 +03:00
Christoph Oelckers
57d703236b - changed Doom source license to GPL in all subdirectories and fixed missing licenses in a few other files. 2017-04-17 12:27:19 +02:00
Christoph Oelckers
fec958cc0a - finally managed to get rid of the DWORD type.
This one was particularly nasty because Windows also defines a DWORD, but in Windows it is an unsigned long, not an unsigned int so changing types caused type conflicts and not all could be removed.
Those referring to the Windows type have to be kept, fortunately they are mostly in the Win32 directory, with a handful of exceptions elsewhere.
2017-03-10 19:46:22 +01:00
Christoph Oelckers
d2beacfc5f - except for DWORD, all homegrown integer types are gone - a handful were left where they represent genuine Windows types. 2017-03-09 19:54:41 +01:00
Christoph Oelckers
6dee9ff566 - replaced another large batch of homegrown type use. 2017-03-08 18:55:53 +01:00
Christoph Oelckers
c630b07011 - replaced SDWORD with int32_t globally.
This type wasn't used in the software rendering code so it could be removed already. The other homegrown types will have to be dealt with later.
2017-03-03 19:35:08 +01:00
Christoph Oelckers
59bd4d608c - fixed: Be a bit more paranoid about what to consider a mod with an empty top-level directory.
This should only be accepted if the subdirectory contains at least one identifiable game definition lump to avoid catching some patch mods with only a few files.
2017-03-02 10:00:22 +01:00
Christoph Oelckers
1e1194a669 - fixed: Dp mot strip the top level folder name in Zips if they only contain one entry or if the first entry isn't a directory. 2017-02-27 01:53:51 +01:00
Christoph Oelckers
8c30ca213d - allow loading of zips that have one root folder with all content contained within this folder. This top level's folder name will be stripped out from all file names, unless it is a special name that maps to a known namespace. 2017-02-26 22:55:36 +01:00
Christoph Oelckers
aaae52c60b - fixed: FResourceFile::OpenResourceFile did not close the opened file in case it contained invalid data. 2017-01-21 20:15:06 +01:00
Christoph Oelckers
d1f5d916c2 Merge branch 'master' into zscript 2016-11-23 14:39:14 +01:00
alexey.lysiuk
3b240b73e9 Fixed endianness issue with saved games
See http://forum.zdoom.org/viewtopic.php?t=54272
2016-11-19 16:42:16 +01:00
Christoph Oelckers
7bcd83f0c1 - parser for states flags. 2016-11-14 19:35:29 +01:00
Christoph Oelckers
32e0123e1b - fixed: FResourceLump::LumpNameSetup passed negative numbers to FString::Truncate for extension-less lump names. 2016-11-12 14:01:34 +01:00
Braden Obrzut
741c9edf42 - Clear out GCC 6.2 warnings (interestingly they now check for misleading indentation which found a good case in fragglescript/t_func.cpp even though I believe it was harmless) 2016-10-17 00:19:08 -04:00
Christoph Oelckers
5dfc396bb9 - read snapshots from zip. 2016-09-22 01:28:05 +02:00
Christoph Oelckers
88c27e2cc0 - allow the compact and pretty writers for JSON to coexist by wrapping the whole stuff into another class that calls the proper one as needed. Due to the implementation it is not possible to decide at run time how this should behave so there have to be two different objects for either mode.
- savegame code handles new format.
2016-09-21 21:57:24 +02:00
Christoph Oelckers
ac3c00883d - implemented saving of new format savegames as zips. The code for that was adapted from zipdir.c. 2016-09-21 17:37:56 +02:00
Christoph Oelckers
075e98c967 - use FCompressedBuffer to store level snapshots. FCompressedMemFile has been removed. 2016-09-21 01:48:23 +02:00
Christoph Oelckers
3a1191281f - some preparations for converting the player serialization code.
- converted sound and canvas texture serialization.
- refactored file_zip, so that it can be used to load loose zip files and extract their compressed data directly.
- added handling to FSerializer to generate and consume compressed Zip file entries.

If all goes well this will allow saving savegames as Zips when the rework is done, which will make analyzing them a lot easier.
2016-09-20 23:13:12 +02:00
Christoph Oelckers
e04055dbb2 - added multiple message levels for 'developer' CVAR so that the important stuff won't get drowned in pointless notification spam that's of no use to anyone.
- made 'developer' CVAR persist across launches and added some menu entries for it.
- added checks for 'developer' to ACS's CheckInventory function.
2016-08-28 09:55:04 +02:00
Christoph Oelckers
db86385cf6 - removed STACK_ARGS.
The only reason this even existed was that ZDoom's original VC projects used __fastcall. The CMake generated project do not, they stick to __cdecl.
Since no performance gain can be seen by using __fastcall the best course of action is to just remove all traces of it from the source and forget that it ever existed.
2016-04-11 10:46:30 +02:00
alexey.lysiuk
9b23b41021 Added detection for broken WAD files
Do not try to allocate nonsensical amount of memory and bail out when broken WAD is detected
See http://forum.drdteam.org/viewtopic.php?t=6844
2016-03-04 11:32:15 +01:00
Randy Heit
55142078d8 Normalize line endings 2016-03-01 09:47:10 -06:00
Randy Heit
a16f92c508 Convert "lump" names from directories to lowercase
- Zip and 7z already do this. Directories should too.
2016-03-01 08:49:43 -06:00
Christoph Oelckers
4d2a52418f - added an errorlog option.
This cuts down on as much message noise as possible, outputs everything to a file specified as a parameter and then quits immediately, allowing this to run from a batch that's supposed to check a larger list of files for errors.
Multiple outputs get appended if the file already exists.
2016-02-09 14:20:49 +01:00
alexey.lysiuk
262580c92f Updated LZMA SDK to version 15.14
Enabled support for PPMD compression method
2015-12-31 17:25:49 +02:00
Christoph Oelckers
6fc63daabd - fixed: Zips whose central directory cannot be read need to print an error message. 2015-04-13 22:08:44 +02:00
Christoph Oelckers
a81dd798a8 - fixed incorrect memset argument. 2015-04-11 14:35:32 +02:00
Christoph Oelckers
9b95c134a7 - fixed: Lumps from a directory need to store the full file path so that they still can be accessed when the internal path is changed due to a filter directory. 2015-04-09 09:14:53 +02:00
Christoph Oelckers
4971e7def1 - another GCC countof fix... 2015-04-06 21:40:14 +02:00
Christoph Oelckers
258822ef3b - redid autoload handler and resource file filtering to use the newly defined method with multi-part names.
As a result the old 'Group' property could be removed and all other means to get a section name were disabled.
As an example, if the code gets 'doom.doom2.commercial' it will use the following sections in this order:

global.autoload
doom.autoload
doom.doom2.autoload
doom.doom2.commercial.autoload.
2015-04-06 11:57:12 +02:00
Randy Heit
62d036a63e Added gametype-based filter
- For when IWADs are too specific, filter by the base gametype too.
- Minor small edits to the sndinfo.txt files so that zipdir will notice
  the changes, since it doesn't check path names when checking for
  file differences.
2015-04-05 20:24:49 -05:00
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