Commit graph

1463 commits

Author SHA1 Message Date
hendricks266
a51e91d4e9 SW: Fix keyboard input
git-svn-id: https://svn.eduke32.com/eduke32@8303 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/duke3d/src/config.cpp
#	source/duke3d/src/menus.cpp
#	source/mact/include/control.h
#	source/mact/src/control.cpp
#	source/sw/src/config.cpp
#	source/sw/src/menus.cpp
2019-11-26 18:03:13 +01:00
Christoph Oelckers
6782d817b7 - reformatting and deletion of unused code. 2019-11-26 17:43:31 +01:00
Christoph Oelckers
dce633de8b - use a floating point origin in the menu's implementation
Using fixed point here makes no sense, let's keep that to the code that still lives in the 90's.
2019-11-26 00:20:21 +01:00
Christoph Oelckers
a74a670c99 -- more work on the menu - episode and skill menus are working in DN3D. 2019-11-25 23:21:51 +01:00
Christoph Oelckers
d73f915c66 - episode menu setup. 2019-11-25 18:41:39 +01:00
Christoph Oelckers
556c61b60b - fixed compile errors.
(Include dependencies suck, it's time for modules to become an option.)
2019-11-25 17:19:48 +01:00
Christoph Oelckers
a9ee5940fc - localization wrappers
Currently a no-op, but if it's in it won't be forgotten later.
2019-11-25 00:28:59 +01:00
Christoph Oelckers
1f1e39fac0 - consolidation of texts for episode and skill menus
So far without localization capability - the engine cannot handle it yet.
2019-11-25 00:02:00 +01:00
Christoph Oelckers
28a05422fc Merge branch 'master' into menu_for_real 2019-11-24 22:31:53 +01:00
Christoph Oelckers
42b3d12630 - Ion Fury's main menu now looks correct. 2019-11-24 22:31:27 +01:00
Christoph Oelckers
a4fcf9ee2b - fixed savegame writing for Ion Fury.
The composite's writers may not be deleted, they are needed for creating the final savegame file.
2019-11-24 21:21:15 +01:00
Christoph Oelckers
57b542671c - Ion Fury main menu fixes. 2019-11-24 20:40:53 +01:00
Christoph Oelckers
a96f1b25f7 - fixed recursion issue with menu and CON scripting.
Curse all those busy loops in the engine.
2019-11-24 17:52:54 +01:00
Christoph Oelckers
52cfb7fb92 - completely disconnected the old menu from the rest of the game to allow rebuilding the new one.
Sadly this uncovered a few more places where script events are allowed too broad access to the game state.
2019-11-23 23:05:24 +01:00
Christoph Oelckers
326d0f5f76 - the new menu displays something. 2019-11-23 17:50:36 +01:00
Christoph Oelckers
9529adb3e1 - font tables moved. 2019-11-23 12:41:13 +01:00
Christoph Oelckers
f2fc3fc2cb - WIP commit. 2019-11-23 12:38:38 +01:00
Christoph Oelckers
ceb07280cf - more work on the menu.
Duke Nukem's menu title is getting rendered.
2019-11-22 22:52:11 +01:00
Christoph Oelckers
3e0075a34d - disabled the broken savegame pic code for the GL renderer.
I have no idea how this is supposed to work, but all it does is create corrupt images, so for now it reverts to the software renderer which generates working 320x200 images.
2019-11-15 19:07:24 +01:00
Christoph Oelckers
ab9c532d89 - save custom data as JSON.
This makes it a lot easier to debug and test than binary blobs.
2019-11-15 18:57:26 +01:00
Christoph Oelckers
ba117554b0 - fixed savegame issues.
Since the code is extremely volatile I changed the setup so that the save is a zip file with the regular snapshot plus all added data as separate entries.
This allows compressing everything properly without savegame breaking interference.

Blood does not yet load its savegames, need to check.
2019-11-14 21:07:43 +01:00
Christoph Oelckers
c6a38faf39 - add savegame support for the statistics and secret hint feature. 2019-11-13 18:23:45 +01:00
Christoph Oelckers
8055d10362 - hooked up the secret hint system 2019-11-13 00:44:33 +01:00
Christoph Oelckers
35bc7f56fc - added secret hint code.
Not hooked up yet.
2019-11-12 23:23:22 +01:00
Christoph Oelckers
dee1cba849 - hooked up Blood with the statistics code. 2019-11-12 22:59:51 +01:00
Christoph Oelckers
6ccef7201e - hooked up the statistics code with EDuke and RedNukem frontends.
Not sure about the end of game conditions, I wasn't able to test that part yet.
2019-11-12 22:45:11 +01:00
Christoph Oelckers
74ed8fd1d9 - added GZDoom's statistics code
Not hooked up yet.
2019-11-12 22:00:33 +01:00
Christoph Oelckers
22ccea8677 - reworked music interface a bit.
Conmsidering how hard it is in Duke Nukem based games to modify the level music, there is now a setting for this in mussetting.txt to make the job easier and even allow setting level music in Redneck Rampage without replacing game data.
2019-11-12 00:43:07 +01:00
Christoph Oelckers
51a5fecc02 - something can be heard, but it's crap.
This sound code is really strange.
2019-11-11 19:53:06 +01:00
Christoph Oelckers
29d16868c9 - fixed compile errors. 2019-11-11 17:51:30 +01:00
Christoph Oelckers
9f9748ede6 - initial ZMusic hookup. 2019-11-10 23:58:51 +01:00
Christoph Oelckers
5fc81d1bd4 - made brightmaps operational.
The logic is not yet optimal but at least it works.
2019-11-10 19:42:26 +01:00
Christoph Oelckers
21ac5e87b5 - added blend table translucency estimation instead of using a lame default.
- draw fullscreen blends below the console.
- moved all mouse event processing out of the SDL backend to D_PostEvent.
- removed all remaining code for dealing with mouse buttons directly.
2019-11-10 15:15:14 +01:00
Christoph Oelckers
a1a9770b44 - reworked the FPS display to use ZDoom's fstat class to get rid of the microscopic font it used.
- changed time display for rendering to exclude VSync and playsim times to get more meaningful information.
2019-11-10 11:42:25 +01:00
Christoph Oelckers
2997bb6292 - the keybinding menu is finally working.
Obviously the existing menu implementation from Duke Nukem needs to be tossed out at some point, but at least the functionality is there again.
2019-11-09 22:22:51 +01:00
Christoph Oelckers
94baca8b1e - same changes in RedNukem frontend. 2019-11-09 19:39:35 +01:00
Christoph Oelckers
299f596afc - Changed EDuke menu to receive all settings storage locations as CVARs.
With this out of the way the only part that needs a real replacement immediately is the keybinds menu.
2019-11-09 19:15:03 +01:00
Christoph Oelckers
0f74a5c3a4 - make the ImGui popup close on request. 2019-11-09 14:05:52 +01:00
Christoph Oelckers
fd4680c347 Merge commit '3061e3860cd212893e7d08a09223d4e9ad78b204' into Dear_ImGui 2019-11-09 13:42:59 +01:00
Christoph Oelckers
9aa275f996 - got rid of some editor-only code and the entire buildvfs header
Nearly all file write access now uses the FileWriter class, which is UTF-8-safe on all platforms - unlike stdio.
2019-11-08 02:02:54 +01:00
Christoph Oelckers
4fc56203c2 - implemented savegame compression
Unfortunately necessary because Ion Fury savegames store 120 GB(!!) of data, mostly zeros.

Unlike the old method, this compresses the entire savegame as one block using a ZLib stream so it should be a lot more efficient now.
2019-11-08 01:36:32 +01:00
Christoph Oelckers
a40be954f1 - same change for RedNukem front end. 2019-11-08 01:04:27 +01:00
Christoph Oelckers
47227fc90f - replaced FILE * with FileReader in savegame code.
FILE* is too inflexible, with FileReader I can plug in a transparent compressor.
2019-11-08 00:26:14 +01:00
Christoph Oelckers
2d46827ecc font
- Dear ImGUI test.
2019-11-07 20:32:49 +01:00
Christoph Oelckers
e4735fdff1 - dead code removal. 2019-11-07 00:49:19 +01:00
Christoph Oelckers
b6a3a60251 - console output is functional. 2019-11-06 23:40:10 +01:00
Christoph Oelckers
5d31119a49 - fixed the Shadow Warrior menu, but it doesn't do much good. The game appears to be thoroughly broken. 2019-11-06 19:22:14 +01:00
Christoph Oelckers
6ee807f225 - two things I forgot to save before committing. 2019-11-06 17:57:10 +01:00
Christoph Oelckers
cf6b4c64b1 - little bit of code cleanup
dead code removal and splitting app_main in two to separate its init part from the game loop
2019-11-06 14:12:50 +01:00
Christoph Oelckers
88bf056176 - added a class for cleaner savegame writing 2019-11-06 12:29:08 +01:00
Christoph Oelckers
e87642e197 - cleaned out the remains of the savegame compression hacks
This broke the savegame reader which still assumed it was working on compressed data. Everything will now take the uncompressed path.

In-stream optional compression is not a good idea anyway, this can and should be done better.

Also: Why  is the savegame format architecture dependent???
2019-11-06 01:01:16 +01:00
Christoph Oelckers
341ca9dd3a - removed the EDuke revision data and replaced it with Demolition's own. 2019-11-05 20:48:34 +01:00
Christoph Oelckers
8321bc6208 - removed most of the old OSD's hooks. 2019-11-05 20:25:57 +01:00
Christoph Oelckers
c46b22e52e - more cleanup of obsolete OSD code. 2019-11-05 20:16:53 +01:00
Christoph Oelckers
a4483f131d - Printf related cleanup. 2019-11-05 20:07:16 +01:00
Christoph Oelckers
570696fc09 - added ZDoom's CCMD code.
Not tested yet.
2019-11-04 23:01:50 +01:00
Christoph Oelckers
1ee4efebb0 - fixed compilation. 2019-11-04 17:58:18 +01:00
Christoph Oelckers
e7f4433df6 - consolidation of mouse code and obsolete code removal 2019-11-04 02:07:59 +01:00
Christoph Oelckers
0b6db7eede - cleanup of baselayer.cpp 2019-11-04 01:18:38 +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
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
c7af86bd00 - use proper key names. 2019-11-03 22:20:19 +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
b179767d4a - do not use the command line but the module filename to create the progdir path.
argv[0] is not guaranteed to contain anything usable and in cmd.exe it doesn't.
2019-11-03 13:39:42 +01:00
Christoph Oelckers
250fa0b847 - consolidation of exit and quit CCMDs. 2019-11-03 13:31:03 +01:00
Christoph Oelckers
59fce59a26 - fixed god mode being activated automatically, thanks to a variable that got initialized in the wrong place. 2019-11-03 12:46:53 +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
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
d25691881b - removed unused lz4 library.
It looks like this was already unused and a leftover.
2019-11-02 22:27:05 +01:00
Christoph Oelckers
7853a9db6c - do not use EDuke32's savegame identifiers.
The engine may be incopatible already and the format will certainly change in the future.
2019-11-02 22:22:57 +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
dc9d75685e - fixed keybind setup. 2019-11-02 20:13:00 +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
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
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
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
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
7f250fc3e8 - WIP on game data search. 2019-10-30 18:09:00 +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
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
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
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