Commit Graph

2556 Commits

Author SHA1 Message Date
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 768a75b712 - fixed video startup.
Make sure that SDL is initialized as the first thing and that the validmodecnt variable does not get cleared
2019-11-02 17:26:40 +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 1d7bfe14dc - removed kplib's compression code.
Its only use in savegames has already been disabled in favor of a format restructuring.
2019-11-02 11:29:23 +01:00
Christoph Oelckers ab28697c18 - undid the very pointless pow2char (de)optimization by substituting the real array with an empty struct containing an inlined [] operator.
I think this shows a fundamental misunderstanding of what constexpr means, even when declared as such it requires a constant argument to be treated as a constant.
But since nearly all uses of this were not using constants, the compiler was emitting actual memory accesses to the array each time this was used.
2019-11-02 10:45:41 +01:00
Christoph Oelckers fca3c2f5b5 - removed the directory scan code from compat.cpp.
It is only used by the user map menus which I had to disable already and on top of that is blissfully incapable of dealing with Unicode.
2019-11-02 10:39:31 +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 24edfbe03b - removed the pointless double loading of CON files.
The condition for this was no longer present anyway so it was never done.
2019-11-01 09:40:29 +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 39bfd64fe9 - a bit more cleanup in app_init. 2019-11-01 08:24:10 +01:00
Christoph Oelckers 6c5d9c3507 - moved the net init code out of the game frontends to avoid having to call atexit for their deinit function.
When doing this during startup it can be done by regular cleanup measures.
This also moves two larger chunks of networking code out of game.cpp.

Nevertheless, the fact that enet is a very dirty library which directly depends on Windows types is a big problem because it bleeds Windows definitions everywhere thanks to poor abstraction in all relevant layers.
2019-11-01 07:26:49 +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 535c68fac1 - fixed Shadow Warrior startup.
It runs to the menu, unfortunately key input is broken.
2019-10-30 20:13:43 +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
CommonLoon102 bc6c1bbc3c Fix the game on non-Windows (#240) 2019-10-30 18:54:56 +01:00
hendricks266 d410694e40 SW: Fix 3D Realms and ANM palettes
git-svn-id: https://svn.eduke32.com/eduke32@8272 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/duke3d/src/astub.cpp
#	source/sw/src/anim.cpp
#	source/sw/src/colormap.cpp
#	source/sw/src/common_game.h
#	source/sw/src/game.cpp
2019-10-30 18:50:23 +01:00
hendricks266 d679603cab SW: Fix MIDI music
git-svn-id: https://svn.eduke32.com/eduke32@8271 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/sw/src/config.cpp
#	source/sw/src/config.h
#	source/sw/src/game.cpp
#	source/sw/src/menus.cpp
#	source/sw/src/sounds.cpp
2019-10-30 18:45:53 +01:00
hendricks266 dcba445f4e SW: Fix file loading and init sequence
git-svn-id: https://svn.eduke32.com/eduke32@8269 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/duke3d/src/common.cpp
#	source/duke3d/src/game.cpp
#	source/sw/src/common.cpp
#	source/sw/src/common_game.h
#	source/sw/src/game.cpp
#	source/sw/src/jnstub.cpp
2019-10-30 18:38:43 +01:00
Christoph Oelckers ea10e01cc3 - adjustments for last commit. 2019-10-30 18:27:52 +01:00
hendricks266 797c79d4a5 Move registry reading to engine
git-svn-id: https://svn.eduke32.com/eduke32@8268 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/duke3d/src/common.cpp
2019-10-30 18:27:40 +01:00
Christoph Oelckers 418ec0d829 - adjustment to cherry-picked commit. 2019-10-30 18:21:59 +01:00
hendricks266 9b21fe0c28 Move VDF parsing to engine
git-svn-id: https://svn.eduke32.com/eduke32@8267 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/include/common.h
#	source/duke3d/src/common.cpp
2019-10-30 18:15:00 +01:00
hendricks266 de3215bcab Add sound and music code for Ken-Build
Patch from Nuke.YKT.

git-svn-id: https://svn.eduke32.com/eduke32@8266 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	GNUmakefile
#	platform/Windows/kenbuild.vcxproj
#	platform/Windows/kenbuild.vcxproj.filters
#	source/kenbuild/src/config.cpp
#	source/kenbuild/src/game.cpp
#	source/kenbuild/src/sound_stub.cpp
2019-10-30 18:10:54 +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 5148fc877d - consolidate the 3 instances of input.cpp.
Some stuff had to be disabled to make it work but that's hardly relevant considering that the goal is to transition off MACT for input handling.
2019-10-28 18:32:05 +01:00
Alexey Khokholov 954d3b14dc Delete _oplmidi.h 2019-10-28 17:51:38 +01:00
Alexey Khokholov 6bb7cb8531 Delete oplmidi.h 2019-10-28 17:51:14 +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
Christoph Oelckers 113b5d9037 - added an input state class which will contain all game-facing input data state.
Having this grouped in a single object will make refactoring a lot easier.
Access functions have been provided to avoid changing client code for the reorganization.
2019-10-28 00:24:09 +01:00
Christoph Oelckers 68b64d2091 - fixed compilation. 2019-10-27 23:18:44 +01:00
CommonLoon102 43da4b68a2 feature: show player names (#234)
# Conflicts:
#	source/blood/src/config.cpp
#	source/blood/src/config.h
#	source/blood/src/menu.cpp
#	source/blood/src/osdcmd.cpp
2019-10-27 22:24:30 +01:00
Christoph Oelckers 19b9e34726 - removed empty #includes. 2019-10-27 22:17:21 +01:00
Christoph Oelckers d962a7810d - deleted unused headers 2019-10-27 22:15:21 +01:00
Christoph Oelckers cee194fd05 - removed the MACT scriplib after completing the config transition. 2019-10-27 17:31:23 +01:00
nukeykt aebd22eea8 This makes more sense 2019-10-27 16:54:25 +01:00
nukeykt 5a087b1768 Add gModernMap guard 2019-10-27 16:54:24 +01:00
Christoph Oelckers bfea07570a - mapped the remaining Shadow Warrior options to the CVARs. 2019-10-27 16:53:00 +01:00
Christoph Oelckers 2e7ba30068 - a bit more config cleanup. 2019-10-27 14:09:56 +01:00
Christoph Oelckers 5386366ec4 - fix for last commit. 2019-10-27 13:48:03 +01:00
CommonLoon102 441bd25ca5 feature: option to show voxels instead of sprites for showing weapon (#233)
# Conflicts:
#	source/blood/src/controls.cpp
#	source/blood/src/menu.cpp
#	source/blood/src/osdcmd.cpp
2019-10-27 13:47:01 +01:00
Christoph Oelckers c0d5ca8ab8 - Config work almost done.
The only thing still referencing the old config file is Shadow Warrior's config read function.
2019-10-27 13:40:24 +01:00
Christoph Oelckers 038c1ba4ba - more CVARs. 2019-10-27 09:53:09 +01:00
Christoph Oelckers cdc5044f07 - converted noautoload and forcesetup flags to CVARs. 2019-10-27 09:38:55 +01:00
Christoph Oelckers 4b5ec2aabb - transitioned the combat macros to the new config and made them independent for all games, so that everything can use the original text. (But considering that they are a multiplayer feature I'm not sure how much that is worth.)
- sort the config output alphabetically.
- do not use [=] as key names for the bindings.
2019-10-27 08:14:58 +01:00
Christoph Oelckers 7023e1e992 - store game vars in the new config file. 2019-10-27 00:29:46 +02:00
Christoph Oelckers 249f6e9d62 - consolidated the joystick and mouse setup code. 2019-10-26 23:45:55 +02:00
Christoph Oelckers b2d7179dbe - consolidated the 4 sets of mouse and joystick configuration variables. 2019-10-26 21:50:49 +02:00
Christoph Oelckers 70a7d1bd82 - save all bound keys, not only the one with commands that have both slots assigned. 2019-10-26 21:16:23 +02:00
Christoph Oelckers db1a9a9363 - the config finally get saved.
Still with a few errors, though.
2019-10-26 20:47:37 +02:00
ny00123 731671c401 Make the secondary backslash key of the standard 102-keys PC keyboard layout, also known as a "less than" key, usable. This is the key generally sitting in-between the left shift and Z keys, for the 102-keys QWERTY layout.
git-svn-id: https://svn.eduke32.com/eduke32@8265 1a8010ca-5511-0410-912e-c29ae57300e0
2019-10-26 19:29:13 +02:00
Christoph Oelckers f53c9f6947 - save stuff to the new config. 2019-10-26 19:24:46 +02:00
Christoph Oelckers 288b230ab8 - only let the CON script access the defaults of CVARs, not their actual value.
That allows using them for initialization but not for messing around with user settings.
2019-10-26 18:39:52 +02:00
Christoph Oelckers cd47582632 - disabled the settings.cfg console script so that the newly added config code can take over its duties.
- write the console log to the folder returned by M_GetDocumentsPath and not to the root game directory.
- removed G_ExtPreInit because it has become redundant. The search path setup will have to be redone anyway.
2019-10-26 13:41:42 +02:00
Christoph Oelckers 1e0d49f947 - game starts again. 2019-10-26 13:16:32 +02:00
CommonLoon102 bcf3385ddf randomize ejecting brass and shell angle on the ground (#230) 2019-10-26 10:35:15 +02:00
Grind Core 3cd44c89f5 Commented system message in OperateSprite() 2019-10-26 10:35:14 +02:00
Grind Core b6ad64ee54 Refactor: xsector, xwall and xsprite structs
- Added QAV scene player (playing user animation instead of weapon)
- Added trigger event intiator for sprites (WIP and experimental)

# Conflicts:
#	source/blood/src/actor.h
#	source/blood/src/player.h
2019-10-26 10:35:13 +02:00
Christoph Oelckers 1c29169492 -perform a proper exit, i.e. make sure that the deinit code can run, by throwing a special exception and actually catching it in the main function. 2019-10-26 10:30:08 +02:00
Christoph Oelckers 0d878a8604 - some needed cleanup on the control code before testing can start. 2019-10-26 10:16:39 +02:00
Christoph Oelckers 5abc034540 - added a set of left handed key bindings because neither of the offerings is really good for that. 2019-10-26 09:22:49 +02:00
Christoph Oelckers 47acdae8e6 - moved binding files to subdirectory
- fixed search/replace error.
2019-10-26 09:05:17 +02:00
Christoph Oelckers cfaafcede7 - everything compiles again (not tested yet.) 2019-10-26 00:32:49 +02:00
Christoph Oelckers c3dc4f35be - cleanup and license added. 2019-10-25 19:07:14 +02:00
Christoph Oelckers 6f6c850d80 - fixed some search&replace errors 2019-10-25 19:02:27 +02:00