Commit graph

773 commits

Author SHA1 Message Date
Christoph Oelckers
15eaf86f5a - preparations for the image scroller menu. 2020-10-08 18:02:25 +02:00
Mitchell Richters
f35bec4a5d - Fix interpolation issues and do other minor fixes following shift to fixedhoriz and binangle.
* When interpolating on the initial setup, when binangle reached an overflow point when going lower than zero, the engine was spinning the player around clockwise to the new angle (2047, for instance).
* Interpolating after casting as uint64_t with a workflow similar to the original games, the issue went away.
* Cleaned up other interpolation functions to be of a consistent workflow.
* Scale keyboard input turning down to degree speeds.
* Uplift some remaining Q16.16 code in `applylook()` to full BAM precision.
* Move static calculations of aim and look speeds for `sethorizon()` back into function since GameTicRate isn't set right before calculation is done.
* Simplify the angle target setup back to a basic value like before.
* Repair SW interpolation issues of weapon sprite drawer when rotating left/right.
* Fix SW death horizon constant values following change of horizon center to 0.
2020-10-08 21:12:21 +11:00
Mitchell Richters
9bcdeae6cd - InputPacket: Change q16avel to avel, changing type from fixed_t to float. 2020-10-08 14:47:30 +11:00
Mitchell Richters
e53d58bd42 - gamecontrol: Clean up remainder of legacy angle code. 2020-10-08 14:29:50 +11:00
Christoph Oelckers
56eae0b42d - got the basics working for Exhumed's main menu. 2020-10-08 00:21:07 +02:00
Christoph Oelckers
a953404331 - SW's text menus done.
This also copies the Build texture animation info into the texture manager so that the 2D code can access it through existing interfaces.
2020-10-07 23:22:29 +02:00
Christoph Oelckers
789eb6d51d - Most of Duke's menus work again. 2020-10-07 20:32:43 +02:00
Christoph Oelckers
2bb38f7d67 - get load and save game menus and related CCMDs working again. 2020-10-07 18:32:57 +02:00
Mitchell Richters
40cb64cdcf - applylook(): Remove some forgotten debug lines. 2020-10-07 23:40:41 +11:00
Mitchell Richters
babd7b9556 - InputState: Proposed new sensitivity dividers now that mouse input is based on true pitch and true angle. 2020-10-07 23:25:36 +11:00
Mitchell Richters
fca846272e - gamecontrol: Initial setup of PlayerAngle struct and deployment within Duke.
* Struct made up of binangle class units.
* Create signed clone of binangle for use with look_ang and rotscrnang.
* Append currently outgoing function names with `2` at the end to avoid conflict.
2020-10-07 23:13:29 +11:00
Mitchell Richters
0c55a533be - PlayerHorizon: Change struct functions to declarations and define code in gamecontrol.cpp to reduce binary size. 2020-10-07 18:25:50 +11:00
Mitchell Richters
6a30d6880e - InputPacket: Change q16horz to horz, changing type from fixed_t to float. 2020-10-07 18:22:07 +11:00
Mitchell Richters
d16b4651bb - gamecontrol: Remove old horizon code left behind while cutting over each game. 2020-10-07 18:12:09 +11:00
Mitchell Richters
6da756cc9f - Exhumed: Cut q16horiz over to PlayerHorizon struct. 2020-10-07 17:40:59 +11:00
Mitchell Richters
f39939d114 - gamecontrol: Initial setup of PlayerHorizon struct and deployment within Duke.
* Started with the most complicated game first.
* Struct made up of fixedhoriz class units.
* Append currently outgoing function names with `2` at the end to avoid conflict.
2020-10-07 17:12:48 +11:00
Mitchell Richters
082336e5f8 - buildhoriz: Implementation of pitch and BAM conversion code.
* Determined maximum horizon able to be handed by engine in Q16.16 format is 280039127.
* Re-did pitch math to work on this known maximum and standardised pitch around -90/90 degrees as it should be.
* Because pitch is now -90/90 and not ~-188/188, m_sensitivity_y probably requires re-scaling.
2020-10-07 13:29:04 +11:00
Mitchell Richters
09a05f354c - Re-standardise horizon around 0 and not 100.
* Blood had this right. It makes sense that the horizon be based around as it's easier to work with.
* Removed all associated game math to deduct default horizon of 100 when doing weapon zvel etc, meaning actual horizon can just be used.
* Re-did return to center function to work on the already converted pitch. Return speed should be 1:1 with previous code.
2020-10-07 13:28:45 +11:00
Christoph Oelckers
38ddbfe65f - activated most of the support code for programmatically created menus again.
Blood's regular menu screens mostly work again
2020-10-07 01:31:41 +02:00
Christoph Oelckers
5726b693bd - added back the menu transition, although it cannot be used yet, and all game specific menu CCMDs. 2020-10-07 01:12:57 +02:00
Christoph Oelckers
0968a9d97e - renamed the Customizer to 'Delegate' because this works very much like a delegate in Objective-C.
- route menu sound calls through the delegate to better deal with differences between games.
2020-10-07 01:00:43 +02:00
Christoph Oelckers
603c3b50ec - reimplemented Blood's menu items. 2020-10-07 00:50:26 +02:00
Christoph Oelckers
06b00887f5 - added a menu control for Blood's dripping blood. 2020-10-06 23:49:34 +02:00
Christoph Oelckers
1ea6084478 - Exhumed also done.
Also using proper assets now.
2020-10-06 22:35:25 +02:00
Christoph Oelckers
17a68bc60a - SW's caption done, too.
In this case the font is squashed to be more narrow because otherwise many texts would not fit anymore.
2020-10-06 22:01:20 +02:00
Christoph Oelckers
bec1f67178 - implemented the menu caption for Duke et.al. 2020-10-06 20:49:55 +02:00
Christoph Oelckers
d22bdf9dc7 - use an alias for the menu bar texture in Blood.
Direct tile access has been disabled for now, hopefully this can be buried deep in the engine for all eternity.
2020-10-06 20:05:51 +02:00
Christoph Oelckers
1e131eda9e - implemented Blood's menu caption 2020-10-06 00:34:35 +02:00
Christoph Oelckers
3dbb8cbb11 - safety commit 2020-10-05 21:47:53 +02:00
Christoph Oelckers
29a4955f79 - missing global variables. 2020-10-05 20:44:30 +02:00
Christoph Oelckers
9606b09ddd - update of language code from GZDoom. 2020-10-05 00:46:24 +02:00
Christoph Oelckers
f670d35ba1 - added a game-module wide lump filter for Duke and related games. 2020-10-05 00:20:33 +02:00
Christoph Oelckers
16431e9f0a - SetupMenuColors restored. 2020-10-04 22:21:11 +02:00
Christoph Oelckers
6a4b72cfef - removed obsolete calls from menudef.cpp. 2020-10-04 22:14:20 +02:00
Christoph Oelckers
f233345ba1 - move most of the menu code into the backend. 2020-10-04 21:57:35 +02:00
Christoph Oelckers
26a31a626d - option menus are working, although all colors are still wrong and the captions are not displayed. 2020-10-04 21:42:40 +02:00
Christoph Oelckers
7f6b02c451 - merged string table and system callbacks. 2020-10-04 21:15:51 +02:00
Christoph Oelckers
5d76cbcbdb - game compiles and starts again (without menu, of course)
Now it's time to rebuild the menu.
2020-10-04 20:53:37 +02:00
Christoph Oelckers
b0301d6fc9 - progress. 2020-10-04 20:11:04 +02:00
Christoph Oelckers
82612a1330 - it compiles again (with lots of code commented out.) 2020-10-04 20:11:02 +02:00
Christoph Oelckers
f8caf88089 - backend update. 2020-10-03 17:04:45 +02:00
Christoph Oelckers
89d5d18b9e - these parts were missed somehow. 2020-10-02 22:42:54 +02:00
Christoph Oelckers
e0717e30b4 - savegame version change for the new member in spritetype. 2020-10-02 22:19:32 +02:00
Christoph Oelckers
4e67197838 - added back the hijacked 'detail' member to spritetype.
This changes the Blood map loader to not use the in-game sprite structure for loading a level and moves the qsprite_filler array back into the sprite.
2020-10-02 22:18:08 +02:00
Christoph Oelckers
49642c3b3c - removed the slowdown killswitch from the ANM player.
This did not play well with SW and is generally not needed.
2020-09-30 00:28:17 +02:00
Christoph Oelckers
e8cd336f86 - same procedure for Blood.
This time there were 3 additional texts and the notify display, though, except for multiplayer content that wasn't touched yet.
The result is the same: No need to extend the tiny font with international characters
2020-09-29 22:20:25 +02:00
Christoph Oelckers
4c2ff2950a - for Duke/RR, when not using English force use of the regular text font for drawing the map label on the automap.
This essentially removes the tiny font which is simply too small to ever be able to receive a proper international extension from the equation for localization because the level name display was the only remaining relevant content using this font.
The only other screen where this font is still being used to draw text requiring translated content is the multiplayer summary which will have to be redesigned anyway if multiplayer becomes functional again.
2020-09-29 21:47:32 +02:00
Christoph Oelckers
a558703740 - bumped up the vertical mouse movement factor to 1/5 from 1/8.
1/8 was far too low for an average mouse
2020-09-29 18:14:22 +02:00
Mitchell Richters
0bb9904338 - Tune mouse input following changes in b57e13ff62.
* Reduce `hidInput->mouseturny` to previous scaling (0.25 of incoming input).
* Change `hidInput->mouseturnx` to be 0.5 of incoming input (33% slower than b57e13ff62, but matches what other ports by providing a 2:1 scale).
* Remove further divisions beyond m_side and m_forward and adjust code in `processMovement()` accordingly.
* Change scaling for `mousevelscale` in `processMovement()` to be 1/160th of keymove. Slightly lower for Duke and a lot faster for Blood where it's needed.
2020-09-29 21:02:36 +10:00
Christoph Oelckers
b57e13ff62 - mouse code update.
May still need some tweaking of the factors.
2020-09-28 22:36:43 +02:00
Christoph Oelckers
0ddf53a3ef Merge branch '0.7' 2020-09-28 21:26:43 +02:00
Christoph Oelckers
1a65be3ddc - 0.7.1 2020-09-27 20:45:54 +02:00
Christoph Oelckers
47c1c22ff7 - do not stop the music in the cross-game level-end handler.
Some maps require that it continues playing here.
2020-09-27 20:42:55 +02:00
Christoph Oelckers
9764c9de0b - use the proper variable for timer frequency only.
MinFPSRate was an obsolete leftover.
2020-09-27 16:12:52 +02:00
Christoph Oelckers
af5e3dd1b8 - render backend update from GZDoom, mostly minor stuff. 2020-09-27 16:12:51 +02:00
Christoph Oelckers
03a0cf943e -minor cleanup and backporting of con_pulsetext from Raze. 2020-09-27 16:12:49 +02:00
Christoph Oelckers
af8b7679b6 - bumped version numbers for 0.7. 2020-09-26 17:50:19 +02:00
Christoph Oelckers
3210dd5782 - fixed the noisiest value truncation warnings after shortly re-enabling them in the compiler, plus a few places where the warning pointed to incorrect code. 2020-09-26 11:59:24 +02:00
Christoph Oelckers
1e12bca0a6 - route World Tour's texts through the string table by adding an indirection option
This way they can be translated into all languages without duplicating all relevant content.
The original text files are no longer being used.
2020-09-26 10:08:48 +02:00
Christoph Oelckers
8b9853ad28 - print cheat prompts to the regular message display. 2020-09-25 22:41:17 +02:00
Christoph Oelckers
3344e73fed - fixed some crashes in the .def parser and texture initialization code. 2020-09-25 20:51:02 +02:00
Christoph Oelckers
89bc194035 - added shareware checks to the "start game" menus. 2020-09-25 19:36:50 +02:00
Mitchell Richters
e9326fffe3 - processMovement(): Slightly adjust some ratios to provide proper average values. 2020-09-25 23:07:38 +10:00
Mitchell Richters
9b12675f4e - processMovement(): Re-arrange parameter variables somewhat so game-specific parameters are at the end and to allow some common defaults so they don't need specifying. 2020-09-25 22:26:50 +10:00
Mitchell Richters
73f52b2cee - SW: Fix turn scaling while pp->sop_control and specify !pp->sop to processMovement()s allowstrafe bool instead of an unconditional true. 2020-09-25 22:17:21 +10:00
Rachael Alexanderson
410d392ba8 - enable fly cheat for shadow warrior. in other games it is currently ignored, but I think Redneck Rampage and Blood both need it at some point too 2020-09-25 13:50:29 +02:00
Mitchell Richters
ce269808dc - Remove leftover Ion Fury stuffs causing log errors like "Script error, 'D:/Program Files (x86)/Steam/steamapps/common/Ion Fury/fury.grpinfo" line 10: Warning: GRP without game defined. Ignoring'". 2020-09-25 18:06:06 +10:00
Mitchell Richters
71d667cdc9 - ApplyGlobalInput(): Fix const issue. 2020-09-25 13:33:44 +10:00
Mitchell Richters
67c8187d62 - processMovement(): Attenuate hidInput->dyaw when using for strafing. 2020-09-25 12:03:56 +10:00
Mitchell Richters
6aa494285d - processMovement(): Add scaling for Exhumed's keymove. Input was far too slow and didn't match the others. 2020-09-25 00:57:48 +10:00
Mitchell Richters
aa14ee1232 - InputState: Scale dyaw/dpitch with regards to ticrate. All testing on initial uplift was with Duke at 30Hz. SW running at 40Hz therefore is not at the same speed as the others. 2020-09-25 00:25:49 +10:00
Mitchell Richters
04af1d9ce8 - All Games: Unify processMovement(). 2020-09-24 22:32:37 +10:00
Christoph Oelckers
5a76dce5f8 - reinstated setuptile.
Apparently this is needed by some hires packs to fudge the sprite offsets.
Fortunately, setting sprite offsets is the only thing this was ever used for so it's relatively uninvasive.
2020-09-23 18:18:22 +02:00
Christoph Oelckers
5e6317b8b9 Merge remote-tracking branch 'remotes/Github_private/Blood_InputReworking' 2020-09-22 23:32:28 +02:00
Christoph Oelckers
880b811e0d - rewrote map loader to work independently of data structure sizes.
This is needed to extend a few fields that are too narrow - e.g. the texture offset fields have no room for interpolating scrolling textures.
Blood not done yet, will also need to be changed to get rid of the limits.
2020-09-22 22:40:53 +02:00
Christoph Oelckers
b06fe35c56 - removed redundant null entry in 'give' types. 2020-09-22 08:40:33 +02:00
Mitchell Richters
d40a2d3e95 Merge branch 'back_to_basics2' into Blood_InputReworking
# Conflicts:
#	source/blood/src/hudsprites.cpp
#	source/exhumed/src/status.cpp
#	source/games/duke/src/game_misc.cpp
#	source/sw/src/draw.cpp
2020-09-22 07:34:39 +10:00
Mitchell Richters
9859571ded - DrawCrosshair(): Factor in Blood's adjustable horizon which defaults to 90.
* Fixes https://forum.zdoom.org/viewtopic.php?f=340&t=69920.
2020-09-22 07:29:52 +10:00
Mitchell Richters
59e4fae064 - Game input: Fix miscellaneous issues.
* Duke/RR: Fix `SB_CENTERVIEW` not clearing while `cl_syncinput 1`.
* Duke/RR: Remove superfluous call to `apply_seasick()`.
* RR: Change two calls from `playerSetAngle()` to `playerAddAngle()` Updated version of `playerSetAngle()` doesn't stop setting angle until target is reached, a bit too strict for this and compromised vehicle turning.
* `applylook()`: Remove dead flag. Was only used with Duke, no other game called the function when dead anyway. Since the input helpers are processed outside of `applylook()` now this is not needed.
* `applylook()`: Extend function with a bit of commentary.
2020-09-21 17:12:53 +10:00
Mitchell Richters
f806cdcec6 - Blood/Duke/RR/SW: Unify the player's angle/horizon helper functions. 2020-09-21 17:12:51 +10:00
Mitchell Richters
7bf1cacc7f - Blood/Duke/RR/SW: Unify the player's angle function.
* For Blood/SW, exposes `SB_LOOK_LEFT`/`SB_LOOK_RIGHT` to games, hooking up `q16look_ang` and `q16rotscrnang` within.
* For SW, use Duke & Blood's return to center function and remove `PF_TURN_180` bit.
* For RR, replace a few misused bits with some bools inside of `player_struct`.
* Since bulk of functionality is sourced from Duke (30Hz), apply proper scaling so SW speed matches (40Hz).
2020-09-21 17:12:26 +10:00
Christoph Oelckers
78be8f866b - always use the containing sector's fog when rendering sprites.
This is for consistency, otherwise sprites with a palette translation would stand out. Also use shade dependent fog density instead of a single global value.
Currently this only has an effect in true color rendering mode.
2020-09-20 20:39:11 +02:00
Mitchell Richters
0ab3b33a6c - Blood/Duke/RR/SW: Unify the player's horizon function.
* For Duke/SW, we continually apply `SB_CENTERVIEW` only if it was previously a toggled action, similar to Blood.
* For SW, we remove two SW-specific bits (`PF_LOCK_HORIZ` and `PF_LOOKING`) that are no longer needed.
* For Duke, we remove `return_to_center` and just use the `SB_CENTERVIEW` action bit as required.
* For `sethorizon()`, feature set and adjustment speeds are an averaged out accumulation across Duke/SW:
** GameTicRate is factored in for adjustment decisions to provide consistency for SW being the faster game.
** Adjustment amounts are half way between Duke/SW.
2020-09-20 20:01:36 +10:00
Mitchell Richters
1900cf1fcc - Move Duke's getincangle() function to the backend, create Q16.16 variant (getincangleq16()) and replace Shadow Warrior's discrete implementations shared versions.
* Need SW's input helpers available for Blood but therefore also need an angle delta function that does not seem to exist in Blood.
* Realise that gamecontrol.h/cpp might not be the most appropriate place, but it's a shared location and these will go into binaryangle.h when its utilisation can be more realised.
* Because SW's logic was reversed, in that param #1 was the new angle and param #2 was the current, all calls have been reversed.
* By happenstance, also fixes an issue with multiple 180° turns in quick succession.
2020-09-20 16:21:13 +10:00
Mitchell Richters
20c73e1249 - Blood: Remove r_horizcenter and standardise horizon in game to that of the default in the backend (currently 100).
* The use of this will go when the input is re-factored to operate on the standard horizon of 100, not 0.
2020-09-20 16:20:08 +10:00
Christoph Oelckers
d8639a9a64 - fixed bad checks for uncapped frame rate. 2020-09-18 23:18:42 +02:00
Christoph Oelckers
005f8feceb - properly use the correct delay for an ANM's final frame. 2020-09-18 22:49:51 +02:00
Mitchell Richters
4370686c81 - SW: Allow disabling melee weapon blurring. 2020-09-16 19:18:08 +02:00
Christoph Oelckers
b0090b07fc - do not fade screen jobs in when in the menu.
This doesn't work properly because the timer is stopped, leading to visual artifacts with the fading.
2020-09-16 19:13:21 +02:00
Christoph Oelckers
6776508239 - widescreen asset setup and consolidation of .def file loading. 2020-09-16 19:13:06 +02:00
Christoph Oelckers
5c777eeb38 - moved implementation of 'animtilerange' into buildtiles.cpp. 2020-09-16 19:13:05 +02:00
Christoph Oelckers
616838dd0a - little bit of cleanup on tileImport. 2020-09-16 19:13:05 +02:00
Christoph Oelckers
d74d65bece - clear the 2D drawers in the correct place. 2020-09-15 21:52:02 +02:00
Christoph Oelckers
8babdd6296 - fixed "pointers to temporary" errors reported by XCode 2020-09-15 21:45:54 +02:00
Christoph Oelckers
2c3041081d - remove indirection in picanm access. 2020-09-15 21:17:08 +02:00
Christoph Oelckers
d1293da8dc - connecting the dots for Blood's special tile features. 2020-09-15 01:27:24 +02:00
Christoph Oelckers
bc5d3eea88 - split the worker part for tileImportTexture out of the parser. 2020-09-15 01:21:17 +02:00
Christoph Oelckers
42d4e112a1 - clear the message display unconditionally when restarting the game.
It was only done when the level was reloaded.
Fixes #400
2020-09-14 21:32:36 +02:00
Christoph Oelckers
0e58203d92 - fixed rintersect and removed some unused bits from engine.cpp. 2020-09-13 20:15:46 +02:00
Christoph Oelckers
6ad8046b47 - dual license d_net.cpp and i_net.cpp
The same source was available under both in GZDoom, so keep it.
2020-09-13 19:38:31 +02:00
Christoph Oelckers
b289e6bc5e - cleanup. 2020-09-13 19:27:05 +02:00
Christoph Oelckers
4f0856c02b - fixed a typo. 2020-09-13 19:21:08 +02:00
Christoph Oelckers
a4754d7f34 - rewrote the map hack parser using sc_man.
This unexpectedly turned out a complete rewrite so now it is under my own license.
Also moved the remaining parts of map hack loading into the engine.

Overall I have to say that the feature is not what I expected, it's merely used to fudge the positioning of model sprites and for adding Polymer lights.
2020-09-13 13:01:44 +02:00
Christoph Oelckers
9e81fa89a8 - fixed some of the issues with palette emulation
* the palette shader was not bound.
* the palette textures were not bound.
* palette mode still used regular lighting on top of the palette emulation

This works a lot better than before but is still not complete.
2020-09-12 21:23:14 +02:00
Christoph Oelckers
222f82304d - fixed savegame image generation.
There were two errors:
1. The postprocessor was not run on the generated scene so that the target framebuffer never got set.
2. The generated PNG was not finalized and failed the integrity check of the savegame menu.

Fixes #48
2020-09-12 01:11:32 +02:00
Christoph Oelckers
807dd17165 - forgotten debug output removed. 2020-09-11 21:20:44 +02:00
Christoph Oelckers
1646e302d2 - fixed screenjob fadeout. 2020-09-11 20:55:58 +02:00
Christoph Oelckers
38cc094ac3 - adapt ClearAllInput to new globalized code. 2020-09-10 23:35:42 +02:00
Christoph Oelckers
d5b9a9ee43 Merge remote-tracking branch 'remotes/Github_private/InputStuffs' into back_to_basics2 2020-09-10 23:25:43 +02:00
Christoph Oelckers
52cbb5c9dc - implemented reloading from the last saved game, like in GZDoom.
Fixes #352
2020-09-10 22:45:42 +02:00
Christoph Oelckers
59eb923c11 - fixed replacement of hires textures.
Fixes #107
2020-09-10 20:52:40 +02:00
Christoph Oelckers
41a2a63efd - moved the VP8 decoding loop into the movie player class and got rid of animvpx.
This allowed significant simplification of code data and many of the error checks could also be simplified because this player doesn't really need it all.
Also use nanoseconds to count frame delays, not milliseconds, as milliseconds can cause timing anomalies with common frame rates very easily.
2020-09-10 17:54:27 +02:00
Christoph Oelckers
83eba019b8 - added support for Megaton's widescreen assets.
Fixes #386
2020-09-10 00:05:10 +02:00
Mitchell Richters
ee5689b07e Merge branch 'back_to_basics2' into InputStuffs 2020-09-09 21:04:42 +10:00
Christoph Oelckers
2fc058e487 - don't autosave just after starting a new game. 2020-09-08 23:00:31 +02:00
Mitchell Richters
b72a3326d0 Merge branch 'back_to_basics2' into InputStuffs
# Conflicts:
#	source/core/d_net.cpp
2020-09-09 06:56:27 +10:00
Christoph Oelckers
d011a16c5b - added a menu option for WT's music switch.
Fixes #370
2020-09-08 22:37:21 +02:00
Christoph Oelckers
298949ceb8 - more compat.h cleanup
Its elimination is getting closer. :)
2020-09-08 18:48:18 +02:00
Christoph Oelckers
ec1c42b04a - got rid of common.h
All still relevant content was moved to places closer to its use.
2020-09-08 18:39:47 +02:00
Christoph Oelckers
8d2d36457f - consolidated the map name display on startup
Fixes #275
2020-09-08 18:28:41 +02:00
Christoph Oelckers
d1f1bf2ae1 - fixed icorrect validation of give ccmd
Fixes #379
2020-09-08 16:18:17 +02:00
Mitchell Richters
92443806af Merge branch 'back_to_basics2' into InputStuffs 2020-09-08 06:26:32 +10:00
Christoph Oelckers
703b142bad - added a CVAR to disable WT's ogg music and a fallback for when it cannot be found.
Fixes #354
2020-09-07 21:26:07 +02:00
Christoph Oelckers
e4fa695b57 - fixed the movement factor for automap panning.
Fixes #363
2020-09-07 20:39:07 +02:00
Christoph Oelckers
9bb99e5c05 - fixed 361 - togglerotate CCMD still had some bugs. 2020-09-07 19:56:28 +02:00
Mitchell Richters
6e6373deda - SW: Remove camq16* variables from game and backend code that supported them.
* `cl_syncinput 0` is very raw at the moment.
2020-09-07 08:40:14 +10:00
Mitchell Richters
fa9fa88fce Merge branch 'back_to_basics2' into InputStuffs
# Conflicts:
#	source/core/gamestruct.h
#	source/games/duke/src/duke3d.h
#	source/sw/src/input.cpp
#	source/sw/src/player.cpp
2020-09-07 07:51:37 +10:00
Christoph Oelckers
e63e134195 - fixed automap follow mode and added some menu entries for the new options and key bindings. 2020-09-06 23:12:47 +02:00
Christoph Oelckers
2d547a4ef1 - re-added the sprite drawer for Duke's automap. 2020-09-06 21:31:05 +02:00
Christoph Oelckers
9d39f770d4 - reimplemented player sprite display on Blood's automap. 2020-09-06 21:15:59 +02:00
Christoph Oelckers
18b39fd952 - first stage of generic automap code.
Lines and textures get rendered, not all colors are correct - sprites yet to do...
2020-09-06 20:49:43 +02:00
Christoph Oelckers
e8452a79e8 - implemented the automap serializer.
Also optimized the base64 encoder to avoid creating endless memory copies, thanks to using std::string which is a really poor container for this kind of stuff when workig with larger blocks of data.
2020-09-06 13:39:57 +02:00
Christoph Oelckers
809f8b5d4b - hooked up the new automap framework. 2020-09-06 12:44:58 +02:00
Mitchell Richters
290e615807 - Move Duke's input scaling for unsynchronised input to backend as InputScale(). 2020-09-06 20:19:26 +10:00
Mitchell Richters
722537a1f0 - InputState: Make CONTROL_GetInput() return an object instead of accepting a pointer and provide to games as a function parameter.
* Provide read-only/const results from `CONTROL_GetInput()` so games can't change received input.
* Change non-descript `info` to `hidInput` (Human Interface Device).
* Remove a few unused prototypes.
2020-09-06 20:18:26 +10:00
Christoph Oelckers
a6c92aec64 - removed all automap code from SW and the flat drawer from the backend.
This should have been the last parts of automap code.
Now on to rebuild this thing in a cleaner fashion...
2020-09-06 12:14:08 +02:00
Christoph Oelckers
8f6f368445 - cleaned out the remaining parts of automap handling in Duke and Exhumed. 2020-09-06 10:42:39 +02:00
Christoph Oelckers
c1a995822d - took all automap related code out of Duke's game module. 2020-09-06 10:08:47 +02:00
Christoph Oelckers
36b9ac54b7 - added a parser for World Tour's language files. 2020-09-05 21:33:04 +02:00
Christoph Oelckers
8dfb7967e2 - use a more precise timer for Exhumed's text scroller. 2020-09-05 20:31:45 +02:00
Christoph Oelckers
a7b198d7ee - Stop music when ending a level, or when going back to the menu in Blood. Also play the sound on Blood's summary screen as an UI sound.
Fixes #349
2020-09-05 19:20:25 +02:00
Christoph Oelckers
f36ac1dc90 - fixed issues with console on top of intermissions not appearing. 2020-09-05 18:41:18 +02:00
Christoph Oelckers
443ddf670b - let the ANM player wait until the sound has finished if it has reached the last frame before the sound ends.
In Shadow Warrior there's a few where the sound plays a bit longer than the video.
Fixes #341
2020-09-05 18:14:50 +02:00
Christoph Oelckers
27acd430aa - reset the screen job clock when advancing.
Fixes #347
2020-09-05 17:37:37 +02:00
Christoph Oelckers
fa50cde93f - fixed skill selection in Duke.
Screw these old shadowing menu variables. Well, the one for skill is gone now.
Fixes #344
2020-09-05 16:31:01 +02:00
Christoph Oelckers
9af093b818 - fixed screen job timer when paused
Fixes #343
2020-09-05 16:21:53 +02:00
Christoph Oelckers
e0b4dde3cd - fixed: A screen job that fades out was not rendering its final (black) frame which could result in visual glitches.
Fixes #320
2020-09-05 15:59:32 +02:00
Christoph Oelckers
c1786001b2 - route all game state changes through game actions.
This is to avoid problems with the main loop not calling Ticker and Render in sync.
2020-09-05 15:43:34 +02:00
Christoph Oelckers
7a5dca7d5d - renamed startgame CCMD to levelstart. 2020-09-05 14:02:07 +02:00
Christoph Oelckers
32ec9ff369 - consolidated crosshair drawing and added ZDoom's crosshair code.
For Exhumed this is the default, for the other games it is an option.
Fixes #269.
2020-09-05 13:57:26 +02:00
Christoph Oelckers
b23424485a - re-implemented VP8 support.
Since the decoder cannot handle sound, there's two options:

1: Use the same sounds as the video it replaces.
2: If an identifiable streamable sound with the same base name is found, it will be played along with the video.
Fixes #133
2020-09-05 11:58:19 +02:00
Christoph Oelckers
80cea90854 - implemented zoom by mouse wheel for the automap.
Fixes #121
2020-09-05 09:10:24 +02:00
Christoph Oelckers
adbedd30c4 - consolidated the 4 functions for handling the automap zoom. 2020-09-05 00:58:25 +02:00
Christoph Oelckers
cdd2329b63 - fixed levelwarp for games with linear level counting.
Fixes #337
2020-09-05 00:00:55 +02:00
Christoph Oelckers
d2de11cd99 - hide the message display on intermission screens.
Fixes #336
2020-09-04 23:56:04 +02:00
Christoph Oelckers
2e8b808683 - added a C_ClearMessages function for the console and fixed game restart after death.
Fixes #322
2020-09-04 22:23:38 +02:00
Christoph Oelckers
1eb99f69c2 - transitioned Exhumed to level change events. 2020-09-04 21:59:38 +02:00
Christoph Oelckers
8114309e89 - compat.h cleanup.
* use static_assert directly. Raze is C++17, no need for that macro shit.
* removed CONSTEXPR - I seriously fail to see the use here, many of the functions marked as CONSTEXPR cannot possibly even be constant evaluated so the declaration makes no sense. Removed most of these and replaced the valid ones with the official constexpr keyword.
* got rid of EDUKE_PREDICT_FALSE - this makes zero sense in script parsing code, at best it will save a few microseconds. Clean code wins.
* replaced Blrintf with xs_CRoundToInt. Shitty name is shitty name, even if derived from POSIX.
* replaced Bstr*casecmp with str*icmp. As these get defined in the CMake project based on actual compiler checks they are preferable here.
* removed lots of other stuff that is not needed with a minimum compiler requirement of C++17.
2020-09-04 21:24:48 +02:00
Christoph Oelckers
5bc80d2468 - macro cleanup 2020-09-04 21:17:24 +02:00
Christoph Oelckers
3eef0db6f6 - check if a map file exists before starting it. 2020-09-04 20:47:40 +02:00
Christoph Oelckers
97f395bd72 - transitioned Blood to the new level change messaging system 2020-09-04 20:46:44 +02:00
Christoph Oelckers
77f96a1c75 - fixing some issues. Level transitions in Duke are working now. 2020-09-04 19:43:36 +02:00
Christoph Oelckers
e5e8c02f1d - WIP level transition refactored to a game independent event system. 2020-09-04 19:43:35 +02:00
Christoph Oelckers
b253ae123f - run screen jobs with uncapped frame rate.
Fixes #325
2020-09-03 18:36:37 +02:00
Christoph Oelckers
fb334e7f1a - transitioned Blood's give command and changed SW's not to call the cheat handler. 2020-09-03 16:31:31 +02:00
Christoph Oelckers
3e5e956b72 - run most cheats through the network.
The remaining excpetions are the "give" CCMD and any level change action.
Unfortunately the implementation of most cheats is not multiplayer safe so right now it'd only be useful for demo recording (assuming that worked to begin with... ;))
2020-09-03 01:32:51 +02:00
Christoph Oelckers
a0874a26a7 - noclip cheat and splitting of Exhumed's cheat code into its own file. 2020-09-03 00:41:32 +02:00
Christoph Oelckers
66bf8113b8 - implemented the 'god' cheat as a network command.
This was mainly chosen as something simple to get the basics set up.
2020-09-03 00:29:17 +02:00
Christoph Oelckers
66d8eae8e1 - implemented the framework for freeform network commands.
Unlike ZDoom this uses callbacks for implementation to keep game specific parts encapsulated to the game code.
2020-09-02 23:27:02 +02:00
Christoph Oelckers
b3d89a6a0b - removed the old main loop. 2020-09-02 23:03:48 +02:00
Christoph Oelckers
b49e050baf - transitioned Exhumed to the new main loop.
Fixed #301
2020-09-02 22:55:57 +02:00
Christoph Oelckers
b1a3080671 - migrated Exhumed to a local ticker as well.
gameclock is history - all games now run on a timer that increments once per tick under their own control and not independently of the ticker routine.
2020-09-02 21:42:12 +02:00
Christoph Oelckers
a222a7d7c9 - transitioned Shadow Warrior to new main loop.
Problem: Does not work yet with cl_syncinput = 0. Something about those angle and horizon settings is not right yet.
2020-09-02 20:58:37 +02:00
Christoph Oelckers
621a1e0b3d - removed the packet averaging code.
This is also part of the backend code and won't be needed here anymore.
2020-09-02 20:57:03 +02:00
Christoph Oelckers
aabbbcb2ff - reset the network timer after lengthy operations.
This includes loading a level and busy-waiting for a sound to play.
Also block these loops and the sounds they wait for in network games to avoid problems from longer delays here.
The problem seems to be directly inherited from ZDoom which shows the same issue with screen wipes.

Fixes #297
2020-09-02 10:00:07 +02:00
Christoph Oelckers
e5612b82c7 - fixed: The tile manager created its backup arrays before loading .def files.
This could let such textures disappear with the new main loop.
2020-09-02 00:36:49 +02:00
Christoph Oelckers
8d63e735d0 - transitioned Blood to the new main loop.
Mostly working but interpolation is not correct yet and for some strange reason the numbers on the HUD are gone.
2020-09-01 23:34:04 +02:00
Mitchell Richters
1354d52c05 - Major cleanup of Q16.16 utilisation within games and engine.
* Remove fix16.h/cpp and utilise library from m_fixed.h.
* Extend m_fixed.h with two inline functions for int to/from float operations.
* Replace fix16_floor operations with those from xs_Float.h
* Replace multiple Q16.16 conversions from 0 to just be 0.
* Replaced all found in-game bit-shifts and multiplications/divisions with inline functions from m_fixed.h
* Replaced many casts of FRACUNIT as double in SW's panel.cpp as it is converted to double by way of type promotion.
* Fixed missed precision fixes in SW's panel.cpp where some types weren't declared correctly.
* Replaced 100+ `Cos()/Sin() >> 16` operations for Blood with inline functions `CosScale16()/SinScale16()`.
2020-09-01 23:00:47 +10:00
Christoph Oelckers
3204a3e5fc - negated the meaning of SB_AIMMODE.
This is because 'classic' aim mode will reset the view if the mouseaim key is not pressed.
The problem with this is that an empty input packet will trigger a view reset. If the meaning is inverted the default aim mode is free mouse view which doesn't try to alter any view state and is therefore preferable for an empty packet.

Fixes #292
2020-08-31 20:51:22 +02:00
Christoph Oelckers
923833ccec - animated menus without frame rate cap
The frame rate cap is only deactivated if there's actual animations running so that leaving the game in the menu won't make the engine run at high frame rates.
Fixes #288.
2020-08-31 19:56:13 +02:00
Christoph Oelckers
54d65bfcfc - fixed some warnings 2020-08-31 19:28:05 +02:00
Christoph Oelckers
2bf368d49b - redid the timer for the automap zoom
Add more precision and uncouple from the game timer
2020-08-31 19:18:53 +02:00
Christoph Oelckers
03aad6559b - added a global leveltimer variable to Duke.
This timer only gets incremented by the main game ticker when the playsim is running.

This timer gets used for all playsim-related timing and animations so that these are decoupled from imprecisions in the global timer.
2020-08-31 00:33:41 +02:00
Christoph Oelckers
007c6e122d - gameclock abstraction
This may need more work to have a reliable timer
2020-08-31 00:16:43 +02:00
Christoph Oelckers
7684f9e3e6 - fixed duplicate symbol error on macOS 2020-08-31 00:15:48 +02:00
Christoph Oelckers
2f05a93547 Merge branch 'Packet' into back_to_basics2
# Conflicts:
#	source/core/gamestruct.h
#	source/games/duke/src/gameloop.cpp
#	source/games/duke/src/player_d.cpp
2020-08-31 00:09:56 +02:00
Christoph Oelckers
b8258da997 - cleaning out some trash from compat.h.
The header from hell...
2020-08-30 23:34:40 +02:00
Christoph Oelckers
98557947da - gameclock must also be set before calling gi->Render.
This runs at the display's frame rate so the timer value from the Ticker call is not precise enough to do all the work.
2020-08-30 22:52:20 +02:00
Mitchell Richters
5daaa1fc06 - fix issues with cl_syncinput 0. 2020-08-31 05:24:29 +10:00
Mitchell Richters
6f653da0fc - DBaseStatusBar: Create function DBaseStatusBar::CalcMagazineAmount() for use with calculating magazine values when drawing the HUD. 2020-08-30 20:24:37 +02:00
Mitchell Richters
aeb807bea1 - gamecvars.cpp: Create CVAR cl_showmagamt. 2020-08-30 20:24:37 +02:00
Mitchell Richters
e32cd81cc7 - Unify stat fps for all games. 2020-08-30 20:24:36 +02:00
Christoph Oelckers
3a7b23f655 remove unused stuff 2020-08-30 20:23:48 +02:00
Christoph Oelckers
765f211e05 - things are mostly working again.
Rendering produces an image again, input gets properly processed, but unsynchronised mouse input isn't properly applied yet.
2020-08-30 19:59:46 +02:00
Christoph Oelckers
ffe5b114f3 - the engine starts on the new main loop and is capable of running the intros and the menu, but not the game yet. 2020-08-30 12:49:21 +02:00
Christoph Oelckers
d59284c96b - transitioned Duke to the new main loop.
Everything compiles, but hasn't been tested. Doing a safety commit first.
2020-08-30 12:02:32 +02:00
Christoph Oelckers
0c455acaa2 - more work to switch over to the new loop.
Mainly separation of ticker and render calls
2020-08-30 10:42:44 +02:00
Christoph Oelckers
367b4ce051 - this should be all we need from GZDoom to hook up the main loop. 2020-08-30 09:32:34 +02:00
Christoph Oelckers
49106c5b5e - Duke: Do not reset the global ticker.
The new main loop code cannot handle that. Instead set a start value for gameclock so that gameclock can be based on an arbitrary time value instead of directly representing global time.
2020-08-30 08:04:33 +02:00
Christoph Oelckers
34510ae9b3 - added ticker stub to the game interface. 2020-08-30 08:03:03 +02:00
Christoph Oelckers
d49aedacea - continued work on main loop - added a few new entry points to the game interface. 2020-08-30 00:55:49 +02:00
Christoph Oelckers
c0ebe3e08b - hooked up ZDoom's d_net.cpp file.
Still not active but this contains some code needed to do a proper main loop that can work with the networker.
2020-08-29 23:24:18 +02:00
Christoph Oelckers
fab561d757 - cleaned up Duke's main GameTicker function.
* moved the part that alters the input before queuing it to GetInput
* moved moveloop into the main function
* reshuffled a few things for better grouping by task.
2020-08-29 21:20:10 +02:00
Christoph Oelckers
e3839b01bc - removed in_mousesmoothing.
This not only was redundant with m_filter, even worse, it was in the wrong place.
Control_GetInput is used to read the current input state from the backend and can get called at uneven intervals, or even multiple times during the same frame, so smoothing the movement here can lead to erratic behavior.
With this change CONTROL_GetInput will return the same data unless it gets updated between calls.
2020-08-29 18:37:22 +02:00
Christoph Oelckers
56d0647412 - migrated the last 3 remaining UI controls to CCMDs. 2020-08-29 17:49:15 +02:00
Christoph Oelckers
eb34b41716 - fixed keyboard look in Blood. 2020-08-29 17:07:25 +02:00
Christoph Oelckers
694444b62a - converted the remaining input bits.
Looks like it is working in all games except Blood (not that it surprises me that it's Blood again which has issues...)
2020-08-29 13:32:55 +02:00
Christoph Oelckers
7659107b75 - removed SW's SK_AUTO_AIM for good.
When networking becomes a thing again this can be done as a server CVAR without such a messy approach.
2020-08-29 02:19:41 +02:00
Christoph Oelckers
3a9bcb0b64 - moved Exhumed's cheat bits back into the game module.
They are no longer part of the packet interface.
2020-08-29 02:17:28 +02:00
Christoph Oelckers
dc1f56e8f9 Merge remote-tracking branch 'remotes/Github_private/back_to_basics2' into Packet
# Conflicts:
#	source/core/inputstate.cpp
#	source/exhumed/src/exhumed.h
2020-08-29 01:19:48 +02:00
Christoph Oelckers
fe7f3a2f9e - handle the run key. 2020-08-29 00:57:07 +02:00
Christoph Oelckers
b9e0f493b2 - transitioned the 5 primary action keys: Open, Jump, Crouch and Fire/AltFire. 2020-08-28 23:25:08 +02:00
Christoph Oelckers
847fa48724 - cleaned out the remaining parts of baselayer.h
In particular this means to remove the option to disable widescreen aspect ratios. The way this was handled makes no sense with the current render backend.

The aspect ratio code will have to be redone entirely to properly obey the backend's settings.
2020-08-28 09:06:49 +02:00
Christoph Oelckers
536e7455f2 - moved I_StartFrame to the top of the loop and cleaned up baselayer.hj 2020-08-28 08:44:44 +02:00
Christoph Oelckers
d73bf62465 Revert "- Set frame-time as close to the buffer swap as possible, and calculate smoothratio for Duke/SW as late as possible."
This reverts commit 97feb483ab.
2020-08-28 08:25:51 +02:00
Mitchell Richters
97feb483ab - Set frame-time as close to the buffer swap as possible, and calculate smoothratio for Duke/SW as late as possible.
* Micro-optimisation, but was getting a very occasional jitter in Duke 3D that seems to have gone with this.
2020-08-28 15:27:16 +10:00
Christoph Oelckers
d62d2eaec7 - processed all remaining local input CCMDs and removed some bits only needed for multiplayer.
These MP bits should be reimplemented as network commands later, they only take up valuable space in the bit field.
2020-08-28 00:03:35 +02:00
Christoph Oelckers
ee7d558282 - removed the remains of sending pause with the input packets.
None of this was really working anymore, but will have to be rethought once a network stream exists again.
But even then, this is better sent as a separate command, and in MP only.
2020-08-27 22:38:52 +02:00
Christoph Oelckers
447573aa36 - consolidation of invprev, invnext and invuse. 2020-08-27 22:19:24 +02:00
Christoph Oelckers
43de0d8312 - consolidation of inventory item activation through hotkeys.
This also adds hotkeys for Exhumed which never implemented them.
2020-08-27 21:25:09 +02:00
Mitchell Richters
8bb13bc4c2 - InputState: Exclude volume keys from setting AnyKeyStatus to true. 2020-08-27 13:05:05 +02:00
Christoph Oelckers
10df3e094a - rework of weapon input to use common features in shared code.
This also adds stubs for all unimplemented features in the games for easier addition.
2020-08-27 00:53:35 +02:00
Christoph Oelckers
f597f7c265 - made the GameFunc constants global again.
With most of the more specific features being migrated to CCMDs the list is relatively clean now, with merely 2 buttons that are game specific.
2020-08-27 00:25:59 +02:00
Christoph Oelckers
4b299fa412 - Exhumed also handled. 2020-08-27 00:58:21 +02:00
Christoph Oelckers
99486cba7e - gave Blood the same treatment. 2020-08-27 00:21:11 +02:00
Christoph Oelckers
c7e667a17a - transition weapon selection in SW.
Thanks to the macro insanity for trivial operations in this code base this turned out to be a lot more troublesome than Duke...
2020-08-27 00:06:59 +02:00
Mitchell Richters
55f688b13f - SW: Rename q16horz to q16horiz and q16aimvel to q16horz for consistency and to avoid confusion down the track. 2020-08-27 08:00:50 +10:00
Christoph Oelckers
e768a2bf24 - use new bitmask for weapon selection in Duke. 2020-08-26 23:02:55 +02:00
Christoph Oelckers
36d676ca20 - renamed ESyncBits so that the replacement can take that name later. 2020-08-26 22:39:15 +02:00
Christoph Oelckers
4e846f8d66 - do not print game init messages to the notify display. 2020-08-26 20:19:54 +02:00
Christoph Oelckers
f90d953ab5 default cl_smoothsway to false. 2020-08-26 17:23:08 +02:00
Christoph Oelckers
abf715eace - unified the packet structures of all games.
Currently the bit fields are still separate and they have to be merged, but for now the added memory does not matter.
Having this structure in the common parts will allow work on consolidating the input code, though.
2020-08-26 17:12:48 +02:00
Christoph Oelckers
c7f5f05e14 - cleaned up gamecvars.cpp and deleted a large amount of unused ones. 2020-08-26 17:05:17 +02:00
Mitchell Richters
4fcec5f6d3 - SW: Alt implementation for preparing a nuke.
* Given the original code in `pNukeAction()` (poorly named), the intent appeared to be that the weapon should go off-screen for preparation, returning once weapon initialised.
* Commit restores that behaviour behind a CVAR.

# Conflicts:
#	source/core/gamecvars.cpp
#	source/core/gamecvars.h
2020-08-26 17:00:19 +02:00
Christoph Oelckers
b76168f673 - moved the main event processing functions into the global main loop.
Now, with all the Build timer stuff removed these calls were all identical between games.
2020-08-26 16:59:41 +02:00
Mitchell Richters
a9f556c1bd - SW: Restore random element to player's weapon left/right bobbing behind a CVAR.
# Conflicts:
#	source/core/gamecvars.cpp
#	source/core/gamecvars.h
2020-08-26 16:45:42 +02:00
Mitchell Richters
88a49b0d22 - Duke: Restore RPG harsh recoil behind a CVAR.
# Conflicts:
#	source/core/gamecvars.cpp
#	source/core/gamecvars.h
2020-08-26 16:45:41 +02:00
Mitchell Richters
62388e30be - fix C_SetNotifyFontScale() for RR.
Fixes #264.
2020-08-26 22:33:19 +10:00
Christoph Oelckers
cc5e6d19c3 - fixed sound updating by moving the engine's UpdateSound call into the main loop.
This needs to be called unconditionally for every frame being rendered, not all of the game modules did that.
Placing this call here ensures that it is independent of anything the games do.
2020-08-26 04:10:16 +02:00
Christoph Oelckers
de871c9ab9 - use the game timer, not the Build timer for the sound eviction delay.
This is supposed to wait for two game frames to be on the safe side.
2020-08-26 03:50:07 +02:00
Mitchell Richters
ef728429e0 - Core: Remove legacy smoothratio calculator CalcSmoothRatio(). 2020-08-26 09:49:47 +10:00
Mitchell Richters
e0aaaf1f60 - All Games: Move gameclock and lastTic to gamecontrol. 2020-08-26 09:49:44 +10:00
Mitchell Richters
76776d24d7 - All Games: Remove use of ClockTicks and replace with int. 2020-08-26 09:49:42 +10:00
Mitchell Richters
1c8b0a20fb - Build: Remove all timer code. 2020-08-26 09:49:40 +10:00
Mitchell Richters
b883204f6a - All Games: Remove remaining use of totalclock and associated timing code. 2020-08-26 09:49:34 +10:00
Christoph Oelckers
6b0e1baf02 - added a timerUpdateClock call to the main loop so that Blood and Exhumed work again.
This may only be removed when nothing uses totalclock anymore. We're not there yet.
2020-08-25 21:24:45 +02:00
Christoph Oelckers
a323591d5a - call C_RunDelayedCommands() from a centralized place. 2020-08-25 21:16:37 +02:00
Christoph Oelckers
fd12ad382f - add shadows to the statistics display.
Fixes #256
2020-08-25 20:58:32 +02:00
Christoph Oelckers
5df0a7241f - disabled a few menu options for unsupported features in Exhumed.
Fixes #255
2020-08-25 20:40:30 +02:00
Christoph Oelckers
8256b54005 - applied a few fixes:
* removed the timer callback stuff that came back through the backdoor.
* do not use gameclock in the UI code - use the underlying timer directly.
* UpdateSounds must still use totalclock, until this can be refactored in its entirety.
2020-08-25 20:20:35 +02:00