Commit graph

5901 commits

Author SHA1 Message Date
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
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
0c4fe5f91b - Blood: Fix remaining issues such as starting horizon, remove q16look and clean up some remaining bits in nnexts.cpp. 2020-09-20 16:21:40 +10:00
Mitchell Richters
f7957fc237 - Blood: Factor in game's tic-rate when aiming/looking up/down.
* Doesn't matter for Blood, but will matter for SW in a unified approach. Might as well get it right here.
* Appreciate the literal doubles in lieu of the enums isn't great, but this function will go into the backend in due course.
2020-09-20 16:21:38 +10:00
Mitchell Richters
d2501007f2 - Blood: Adapt uplifted DoPlayerHorizon() from SW to Blood.
* Horizon now standardised on 100 like the other games.
* Need to determine where/why/how the player's horizon is starting out at 0 and get it to init at 100 like the other games.
2020-09-20 16:21:36 +10:00
Mitchell Richters
f2b48fe79c - SW: Uplift DoPlayerHorizon() with changes to serve as basis for standardised backend player horizon function.
* Pre-requisite to make it possible to stop using Q16.16 for horizon input.
* Perform look up/down and aim up/down using true pitch without the need for a helper.
* Adapt SW's return to center function to work based on true pitch (Duke's is a bit too fast for my liking).
* Duke's aim up/down and look up/down is 6 & 12 respectively, SW's is 8 & 16 respectively. Let's go half-way at 7 & 14.
2020-09-20 16:21:35 +10:00
Mitchell Richters
6a091deb67 - Blood: Re-apply input scaling removed in 495c522096e0c9b31bdf6952e612bc3d03030da2 until the entire return to centre function is standardised across games. 2020-09-20 16:21:31 +10:00
Mitchell Richters
40bbb61239 - Blood: Get death chase-cam going while unsynchronised using input helpers. 2020-09-20 16:21:28 +10:00
Mitchell Richters
6e4ee9e975 - Blood: Forbid unsynchronised input if dead. 2020-09-20 16:21:26 +10:00
Mitchell Richters
85e81c94c7 - Blood: Bring in SW's input helpers and hook up within input code. 2020-09-20 16:21:23 +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
db7793bf54 - Blood: Clean up remainder of control.cpp in-line with Duke/SW.
* Split input bits and movement into separate functions.
* Reordered movement to be more like Duke/SW for ease of comparison.
* Removed a global.
* Removed a few includes.
2020-09-20 16:20:20 +10:00
Mitchell Richters
9c56dfffe0 - Blood: Apply horizon input outside of pPlayer->q16look and fix some incorrectly declared types.
* Looking up/down is a bit rough at first as q16look is disproportionate to where the player is currently looking.
* Won't be an issue with a unified horizon algorithm in the backend.
2020-09-20 16:20:18 +10:00
Mitchell Richters
eb0bd9638b - Blood: Re-implement unsynchronised q16horiz. 2020-09-20 16:20:16 +10:00
Mitchell Richters
ae5b6b6a91 - Blood: Re-implement unsynchronised q16ang. 2020-09-20 16:20:14 +10:00
Mitchell Richters
547bf110b2 - Blood: Create high-precision Sinf() and Cosf() inlines and use for player's horizon, using calcSinTableValue() from the backend, bypassing game's costable[]. 2020-09-20 16:20:12 +10:00
Mitchell Richters
c38c1cb1f1 - Blood: Re-do interpolating code in viewDrawScreen() in preparation for returning unsynchronised input.
* Changed config so `cl_interpolate` bool doesn't apply to player's overall movement. While it might be handy for debugging moving sector objects, I see no valid reason why there'd be a need to ever un-interpolate the player's position.
2020-09-20 16:20:10 +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
Mitchell Richters
4d47fe7e85 - Blood: Remove bVanilla. 2020-09-20 16:20:06 +10:00
Mitchell Richters
c835d9cadc - Blood: Revert upstream unsynchronised input implementation. 2020-09-20 16:20:04 +10:00
Mitchell Richters
20f94c5895 - Blood: Use backend input scaling. 2020-09-20 16:20:00 +10:00
Mitchell Richters
5e484bddad - Blood: Make gInput static within controls.cpp. 2020-09-20 16:19:58 +10:00
Christoph Oelckers
a27211dc34 - added support for SSI containers to the file system. 2020-09-19 10:07:53 +02:00
Christoph Oelckers
2bf5933923 - fixed weapon sprite translation index when in paletted mode. 2020-09-19 00:06:07 +02: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
Christoph Oelckers
29a10cabcb - fixed most issues with palette emulation.
Brightness is now correct - I have no idea why this factor of 1/0.85 is needed - something must reduce the brightness of the entire scene but I have no idea what.
2020-09-18 22:29:13 +02:00
Christoph Oelckers
7b879f6fe7 - removed now unused SavegameLoaded variable. 2020-09-18 01:11:38 +02:00
Christoph Oelckers
77a2bcb958 - SW: make ambients start properly.
This fell victim to some fudging code that was needed to avoid crashes with the original game loop.
All that fudging could easily be removed now because nothing of it is needed anymore.
2020-09-18 00:33:18 +02:00
Christoph Oelckers
af298411df - added widescreen titlepic for Duke Nukem 3D:
Also made some tweaks to the intro sequence drawer so that it recognizes image formats not depending on the game palette.
2020-09-17 23:20:50 +02:00
Christoph Oelckers
f5d14f826a - added the SHOOT event and fixed some issues with poor code generation for the game data accessors.
They created different code depending on the passed index, this was changed to always emit the optional parameter, even when not needed, so that the interpreter does not need to second-guess.
2020-09-17 23:06:54 +02:00
Christoph Oelckers
8fa5d3d9d2 - added the remaining CON features from EDuke 2.x
Not everything will do something, though. This was some incredibly careless code operating without a safety net allowing uncontrolled write access to the map structure.
Most of the critical fields have been made read-only, which has been the only mode of access in the mods I checked.

Note that this does not enable scripting of the weapon sprite drawer, only the gameplay related features were done.
2020-09-17 23:06:54 +02:00
Mitchell Richters
e1ee9bc83c - Duke: Fix camera advancing angle by 16 instead of 8 under circumstances. 2020-09-17 18:31:09 +10:00
Mitchell Richters
71a06b7cdd - SW: Fix quake intensity. 2020-09-17 09:01:19 +10:00
Christoph Oelckers
4dc7f8b142 - undid some formatting screwups from the merge. 2020-09-16 19:28:51 +02:00
Christoph Oelckers
942beea1ff Merge branch 'back_to_basics2' 2020-09-16 19:26:23 +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
2095e9e3c6 - code changes for last commit - they were not picked up automatically.
# Conflicts:
#	source/build/src/defs.cpp
2020-09-16 19:13:05 +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
Mitchell Richters
ce82eaf899 - Duke/RR: Address weapon drawer interpolation concerns raised in #403. 2020-09-16 21:01:09 +10:00
Christoph Oelckers
b26a5b800e - make sure that changing the texture filter mode does not clobber the global state
Need to rebind the samplers after modifying them to avoid undefined behavior.

Fixes #397
2020-09-15 22:00:15 +02:00
Christoph Oelckers
867b8f006f Reverted key input changes from yesterday.
At least the SW version did not work right so let's take no chances here.
2020-09-15 21:54:10 +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
e7ddc4178a - fixed bad Printf formatting directives in swcustom parser. 2020-09-15 21:45:05 +02:00
Christoph Oelckers
c98f7d304b - added a list compare function to FScanner. 2020-09-15 21:21:16 +02:00
Christoph Oelckers
2c3041081d - remove indirection in picanm access. 2020-09-15 21:17:08 +02:00