Commit graph

156 commits

Author SHA1 Message Date
Christoph Oelckers
3530c52264 - no need to have 2 CRC32 implementations.
Just let Bcrc32 point to zlib instead of having its own implementation.
2019-11-02 22:10:53 +01:00
Christoph Oelckers
cfbcf33c8c - fixed CVAR saving.
- do not use snd_enabled for temporarily hacking the sound state. userConfig.noSound is better suited for such antics.
2019-11-02 21:21:48 +01:00
Christoph Oelckers
e35a5bac79 - fixed: 0 is a valid resource ID for Blood.
Unfortunately this means that looking up ID 0 can be a bit more costly than the rest because all ID-less entries in RFF files also use 0.
For other file types -1 is used.
2019-11-02 20:37:15 +01:00
Christoph Oelckers
dc9d75685e - fixed keybind setup. 2019-11-02 20:13:00 +01:00
Christoph Oelckers
4cf62fca77 - do not load subdirectories of the game directory. They cannot contain anything useful because the original assets never used subdirectories.
- fixed RRRA game flags.
2019-11-02 19:12:01 +01:00
Christoph Oelckers
c5838df0c8 - fixed addition of main directory. 2019-11-02 18:46:11 +01:00
Christoph Oelckers
395ba5541c - fixed startup and sound issues with Redneck Rampage. 2019-11-02 18:28:50 +01:00
Christoph Oelckers
63d4fc1e1b - fixed flag parsing for grpinfo. 2019-11-02 18:03:41 +01:00
Christoph Oelckers
536c7d61a0 - Duke Nukem starts again.
Now for the other frontends.
2019-11-02 17:41:38 +01:00
Christoph Oelckers
d246ff1212 - fixed file system hasher. 2019-11-02 16:52:22 +01:00
Christoph Oelckers
e4ecc5d8df - some reshuffling on OSD code.
* moved the binding commands to osd.cpp. They were in the global namespace already and this way everything to be tossed out is in the same place when the time comes.
* removed support for the OSDs native CVARs. The only ones left were some internal ones I won't need until this code can be replaced.
* same for the custpmization code the games added. Duke Nukem was the only one anyway to have a decent font for it.
2019-11-02 14:25:35 +01:00
Christoph Oelckers
906e56a2b1 - fixed some startup errors. 2019-11-02 13:27:40 +01:00
Christoph Oelckers
8fb54b51c3 - rewrote the screenshot code to use m_png as its backend.
Mainly to finally get rid of kplib. There's really no use to keep such code around if alternatives are already present.
2019-11-02 12:59:59 +01:00
Christoph Oelckers
edcfad6e11 - updated m_png.cpp from GZDoom. 2019-11-02 12:07:15 +01:00
Christoph Oelckers
f44d309558 - made some adjustments to the RFS parser for the file system.
It's still not active but now should produce correct results when working inside the file system.
What it is missing is a file scanner that picks the data it needs to process.
2019-11-02 10:20:32 +01:00
Christoph Oelckers
c54ae1be83 - removed the remaining parts of cache1d. The only thing left is the dummy cacheAllocateBlock function that needs to stick around until a working cache is present.
- disabled the user maps menu because it is hopelessly dependent on functionality that cannot be fixed. Better wait until the menu refactor to do it right - it'd be a waste of time fixing the current menus.
2019-11-02 01:30:21 +01:00
Christoph Oelckers
1149b4f4aa - various fixes and improvements related to file location management:
* saving of demos and savegames no longer mindlessly writes to the mod directory. All such access is now being rerouted through the special paths interface so that the game data can reside in write protected locations.
* refactored all occurences of klistpath except fnlist_getnames.
* do not allow CON scripts to write to arbitrary files. This is a massive exploit and can be used to cause real damage if someone knows how to play this thing - it's far easier than people may think! It will now write any such data to a special section in the main config which is safe and cannot be manipulated to write to random locations on the hard drive.
2019-11-02 00:38:30 +01:00
Christoph Oelckers
cfca8060ba - gutted cache1d. The old file system is gone, excepr for klistpath, which still gets used in a few places.
- consolidated the 3 identical S_OpenAudio implementations. The replacement code is disabled for the time being because it needs a rewrite. The replacement logic is uses is a bit too volatile.
- removed the old GRP scan code.
2019-11-01 22:17:15 +01:00
Christoph Oelckers
2d7c0e26d2 - cleanup of the old file system initialization.
The real fun part is yet to come, i.e. removing the remaining dependencies on the old file system code.
2019-11-01 19:25:42 +01:00
Christoph Oelckers
8d5e665caa - various initialization related changes
* reroute several error conditions to I_Error.
* removed some soon-to-be obsolete GRP loading code.
* explicitly trigger the SetDefaults script events which depended on side effects from the config implementation.
* removed the nonsensical file system switch. All this does is create instabilities because it is non-obvious from where data is loaded. If a resource is mounted, it should be checked for content no matter what. While this may affect the stray weird mod out there it is a necessity if we want to allow transparent project repackaging.
2019-11-01 09:30:28 +01:00
Christoph Oelckers
67acad3984 - startup cleanup. 2019-11-01 00:32:56 +01:00
Christoph Oelckers
57f879fa8b - moved the startup dialog out of the game front ends, now that there is a global cross-game list of playable configurations. 2019-10-31 23:25:21 +01:00
Christoph Oelckers
ba00fe4e66 - hooked up the file system with Blood's resource access. 2019-10-31 20:17:49 +01:00
Christoph Oelckers
d7e183d46d - fixed compilation of file system code. 2019-10-31 18:06:05 +01:00
Christoph Oelckers
8ef40c5083 - merged most of Blood's resource manager into the file system 2019-10-31 17:13:48 +01:00
Christoph Oelckers
261af9e401 - rework of the file system code.
Made more efficient by basing the lookup on names, not strings and some additions for acting as a stand-in for Blood's resource manager.
2019-10-31 01:48:10 +01:00
Christoph Oelckers
693095bffb - added access wrappers to the two fields of DICTNODE that are accessed from the outside.
The idea here is to completely merge the resource management into the file system so that Blood's DICTNODE is merely an alias to the internal FResourceLump.

A two-tiered resource system is not something I consider worthwile, it made sense to get around Builds crappy cache but in the long term this is not a good solution for a multi-game port to have a resource management system in the backend and another one put over it in the front end, both with their own caching logic that might interfere with each other. Better merge it into one that can handle everything.
2019-10-31 00:50:45 +01:00
Christoph Oelckers
c6753a3fec - tested and fixed game list loader. 2019-10-31 00:41:56 +01:00
Christoph Oelckers
2a7beeff69 - cleaned out some chunks of unused or useless code, most importantly the Build cache which was only used by the sound code for permanently loading the data into memory. 2019-10-30 21:51:04 +01:00
Christoph Oelckers
5b1036093c - fixed startup. 2019-10-30 19:55:03 +01:00
Christoph Oelckers
266dc9e04e - added SW search paths to new code and cleaned up the init code. 2019-10-30 19:26:55 +01:00
Christoph Oelckers
ea10e01cc3 - adjustments for last commit. 2019-10-30 18:27:52 +01:00
Christoph Oelckers
418ec0d829 - adjustment to cherry-picked commit. 2019-10-30 18:21:59 +01:00
Christoph Oelckers
3e5d5a9a3d - it's "loadgrp". 2019-10-30 18:09:38 +01:00
Christoph Oelckers
7f250fc3e8 - WIP on game data search. 2019-10-30 18:09:00 +01:00
Christoph Oelckers
5e76fd659a - search path WIP. 2019-10-29 23:57:28 +01:00
Christoph Oelckers
b56dae0e9a - changed path scanner to return only absolute paths and fixed the directory iterator to construct the proper path.
Also avoid collecting duplicate paths.
2019-10-29 21:06:14 +01:00
Christoph Oelckers
ac87665972 - use std::filesystem for directory traversal.
So far implemented for scanning search paths
2019-10-29 19:53:46 +01:00
Christoph Oelckers
35342526a5 - WIP search path code
The Steam/GOG path getters were taken out of the frontends.
This also switches the Windows directory reader touse the wide string version to get Unicode file names.
Some paths were added to the config file instead of hard coding them.
2019-10-29 01:00:44 +01:00
Christoph Oelckers
cfd9edbe71 - added the main FileSystem class. 2019-10-29 00:15:36 +01:00
Christoph Oelckers
82c844e405 - added GZDoom's resource management classes. 2019-10-28 23:46:15 +01:00
Christoph Oelckers
762f174743 - moved the command line parser out of the game frontends.
Some part are not done yet, and the file system data is currently ignored - there's no way to properly set this up with the file system code Build came with.
2019-10-28 22:19:50 +01:00
Christoph Oelckers
a72863112b - fix compilation 2019-10-28 17:50:08 +01:00
Christoph Oelckers
21f6178ade - avoid writing directly to a backend status variable 2019-10-28 07:10:56 +01:00
Christoph Oelckers
901b86577e - more cleanup
Moving init code and key binding getter to backend
2019-10-28 07:05:32 +01:00
Christoph Oelckers
4f4fc1a8d4 - Cleanup 2019-10-28 07:02:42 +01:00
Christoph Oelckers
c589a6ab82 - replaced KEY_PRESSED globally
This was just a redundant name getting in the way.
2019-10-28 07:01:01 +01:00
Christoph Oelckers
065721c62b - simplified the button state maintenance
This removes all unused parts of the implementation and moves the rest to the InputState class for easier replacement later. All MACT is doing now here is to call the UpdateStatus function, the internal workings are no longer relevant.
2019-10-28 07:00:31 +01:00
Christoph Oelckers
f8203ac766 - fixed the compile errors and consolidated the key binding CCMDs. 2019-10-28 06:47:49 +01:00
Christoph Oelckers
e7f75cbf4d WIP 2019-10-28 01:12:31 +01:00