Commit Graph

170 Commits

Author SHA1 Message Date
Christoph Oelckers bbf0a73471 - input works again. 2019-11-04 20:29:07 +01:00
Christoph Oelckers 25341c7221 - hook up the buttons.
This is still just glue code, the Build implementation suffers from poor support for multiple keys bound to a single button so they are due for replacement as soon as input is working again.
2019-11-04 18:17:14 +01:00
Christoph Oelckers 1ee4efebb0 - fixed compilation. 2019-11-04 17:58:18 +01:00
Christoph Oelckers 29b7e1cf79 - moved all mouse button handling to the input state
Yet again an unbelievable piece of code working around how input works on modern systems to keep the old 90's code alive.
2019-11-04 01:01:54 +01:00
Christoph Oelckers b4f91de7d3 - major refactoring on the input code.
* moved the ASCII conversion hackery in SDLayer to a subfunction because this made things just messy.
* integrated the keyboard callback's functionality directly into inputState for consolidation purposes. This was yet another independent layer in the keyboard management.
* hook up D_PostEvent as the central place to dispatch keyboard input. This is now the only function that is getting called from the backend and a major prerequiside for swapping out the backend for GZDoom's.

Todo: Route mouse input through that, too.
2019-11-04 00:55:49 +01:00
Christoph Oelckers b747df60ee - moved all keyboard related code into the InputState class, so that looking for this stuff is easier.
Sadly there's 1ß00 lines of code using this...
2019-11-04 00:53:55 +01:00
Christoph Oelckers 1b958a7f9f - removed more backing data for the old keybinding code.
Unfortunately this means that the keybinding menus in all games except Blood are shot to shit right now because of how they passed the data on to its destination.
These menus are not fixable, this will have to wait until the replacement is up.
2019-11-03 20:58:10 +01:00
Christoph Oelckers eb049abc3a - it compiles again (safety commit) 2019-11-03 20:24:50 +01:00
Christoph Oelckers 73e64ff0b2 - added ZDoom's keybinding class and some needed support code.
Not hooked up yet with the game.
2019-11-03 18:19:29 +01:00
Christoph Oelckers 12a02cb456 - fixed: lump filters without any dot in the name did not work. 2019-11-03 15:54:18 +01:00
Christoph Oelckers 3c7151810f - made the game interfaces classes instead of function pointer lists because that is far better at error catching.
- fixed: Blood's monster flag is a 'have_monsters', not 'nomonsters' flag. As a result none were spawned.
2019-11-03 12:32:58 +01:00
Christoph Oelckers d7e7c516a0 - fixed: In case no game data can be found, the config needs to be written, to ensure there is one for editing. 2019-11-03 10:51:47 +01:00
Christoph Oelckers 94aa556953 - some work on a generic cache manager.
For main resource data this is probably unnecessary - most resources are never cached with the exception of sounds and textures, which are loaded permanently anyway.
But for hardware textures this is different. Due to the poor precaching it is impossible to selectively evict hardware textures that are not needed any longer, so for this an MRU cache is really needed so that they do not accumulate and congest the video RAM in the process.
2019-11-03 10:00:19 +01:00
Christoph Oelckers e24b1e8903 - replaced all uses of xxhash with SuperFastHash.
That's one more third party dependency down.
Not only are two hashing algorithms redundant, there was also a large size discrepancy: SuperFastHash is 3 kb of source code while xxhash is 120kb and generally extremely awful code.
It was easy to make a choice here. None of the use cases require this kind of performance tweaking, the longest hashed block of data is a 768 byte palette.
2019-11-02 22:52:13 +01:00
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