Commit graph

799 commits

Author SHA1 Message Date
Christoph Oelckers
188b2d2daa - ammo and weapon display ported. 2020-08-13 20:14:53 +02:00
Christoph Oelckers
b50bdb1ca1 - SW: started transition of the status bar. 2020-08-13 18:45:55 +02:00
Christoph Oelckers
dc653bbdc0 - thinning out some crap. 2020-08-13 18:19:44 +02:00
Christoph Oelckers
d7f8d1a5bf - replaced the border drawing code in SW with Blood's. 2020-08-13 17:54:17 +02:00
Christoph Oelckers
0b6f299d0e - removed the bot code.
This would become a refactoring hassle, maybe re-add it later?
2020-08-13 00:45:50 +02:00
Christoph Oelckers
4538068bcc - more SW cleanup, removed two more files. 2020-08-13 00:04:55 +02:00
Christoph Oelckers
bb6972abb4 - SW: get rid of redundant common_game.h 2020-08-12 23:43:21 +02:00
Christoph Oelckers
aef59ef523 - migrated SW cheats to the generic system, removed the more pointless of SWP's cheats and filled in a few blanks. 2020-08-12 22:24:51 +02:00
Evan Ramos
81f85ee480 SW: Fix regression causing the last heat seeker to be a normal missile
It was caused by the fix for crashing when firing outside the map.

Also port said fix to the bunny rockets.
2020-08-12 19:16:25 +02:00
Christoph Oelckers
d3df4e580c - do not restart one-page image scrollers with Enter
Instead go back one menu level.

Fixed #129
2020-08-10 01:12:53 +02:00
Christoph Oelckers
4b69a181c3 - use symbolic constants for some statnums 2020-08-06 20:54:51 +02:00
Christoph Oelckers
9060abbafd - 8 more SW headers gone. 2020-08-06 00:18:45 +02:00
Christoph Oelckers
72806e27eb - cleanup work on SW
* consolidating smaller headers to reduce number of files
* remap all unmapped keyboard checks to corresponding buttons
2020-08-05 22:36:38 +02:00
Christoph Oelckers
4fef66c78a - SW script parser cleanup 2020-08-05 22:36:37 +02:00
NY00123
22b492a5b3 SW: If a saved load is loaded at a point which is right after killing
a boss, ensure that FinishTimer and FinishAnim are appropriately
updated. This commit bumps GameVersion.
Additionally, the set of FinishAnim to 0 in NewLevel had
to move to a different location (InitLevelGlobals2), so
it doesn't override the value stored in the saved game.

# Conflicts:
#	source/sw/src/game.cpp
2020-08-04 20:11:37 +02:00
Mitchell Richters
157933e902 - fixed regression from b9eef9c6a3 where the angle wouldn't apply if horizon was specified. 2020-08-04 23:13:22 +10:00
Mitchell Richters
b9eef9c6a3 - make ang and horiz optional on each game's warptocoords CCMD as suggested in commentary for 1dc6edfa56. 2020-08-04 22:33:17 +10:00
Mitchell Richters
a9b05eff86 - fix coolie death issues raised in https://forum.zdoom.org/viewtopic.php?f=340&t=69254 in manner suggested by OP. 2020-08-04 19:02:26 +10:00
Mitchell Richters
3e44d850b3 - fix issues with Exhumed and SW warptocoords CCMDs when cherry-picking from public branch. 2020-08-04 18:04:44 +10:00
Mitchell Richters
1dc6edfa56 - create SW dynamic CCMD warptocoords. 2020-08-04 17:53:34 +10:00
Christoph Oelckers
4bab061bd0 - removed some dead code from SW. 2020-08-03 20:53:00 +02:00
Christoph Oelckers
d526c6401f - use the generic cheat system for Blood. 2020-08-03 20:51:31 +02:00
Mitchell Richters
f0e0a3db41 - quick and dirty fix to get SW menu input cranking again (mostly for testing PR #77 under SW since it's the only game with a clock of 120/3). 2020-07-31 16:26:16 +10:00
Christoph Oelckers
218a9c84fd - removed the last remaining Blood helpers from the file system, also deleted a few short files whose contents could be moved. 2020-07-27 19:38:41 +02:00
Christoph Oelckers
f9d48e1f68 - removed all the intermediate variables for the status bar size.
hud_size now gets used directly by the status bar code.
2020-07-25 13:26:56 +02:00
Christoph Oelckers
6227f9f7fd - optimizations for better savegame performance. 2020-07-21 21:32:38 +02:00
Christoph Oelckers
29e107ad24 - use CCMDs for weapon and inventory selection, courtesy of ZDuke. 2020-07-17 20:56:10 +02:00
Christoph Oelckers
a0cd407632 - cleanup on pausing code. 2020-07-15 18:10:31 +02:00
Christoph Oelckers
99161e2e4a - made ps an array of player_struct like it originally was. 2020-07-15 00:26:58 +02:00
Christoph Oelckers
1e9679aceb - removed faketimerhandler and the last static remains of EDuke's netcode. 2020-07-14 21:15:37 +02:00
Christoph Oelckers
1a0b388570 - removed a few tabledivide uses in the game modules 2020-07-14 14:08:59 +02:00
Christoph Oelckers
aa01adb2f1 - removed osd.h as it was merely a minimal wrapper around c_dispatch, giving some alias names.
Nothing that's needed when cutting ties to upstream.
2020-07-14 14:00:27 +02:00
Christoph Oelckers
34874d1a21 - migrated displayrest and took the opportunity to un-fuck the palette management. 2020-07-07 04:54:12 +02:00
Christoph Oelckers
8a1206edbc Merge remote-tracking branch 'remotes/origin/master' into back_to_basics2 2020-07-05 11:55:41 +02:00
Mitchell Richters
c70cc474a0 - change mouse input from int to float and adjust games accordingly.
* Calculate game-side mousex/mousey divisions into the calculations performed in `InputState::GetMouseDelta()`.
* Fix mouse speed when `in_mousesmoothing` is true (wasn't factoring in / 3.f division used in non-true vector.
* Standard mouse forward/side movement speeds in Exhumed & SW with that of other games.
* Remove `strafeyaw` code from Duke/Exhumed/RR as it's not necessary and was leading to situations where the player would continually keep moving sideways even without input.
* Change mouse forward/side velocities to -= current value as is done with controller input and the player's angle/aim velocities.
2020-07-04 18:28:00 +02:00
Christoph Oelckers
2e98b2f8da - quote cleanup. 2020-06-30 22:53:15 +02:00
Christoph Oelckers
67fa7f8275 - work on Duke intro sequence.
Now without any Build drawing code, it goes directly to DrawTexture now. :)
2020-06-28 00:32:28 +02:00
Christoph Oelckers
e0ad1aa0cd - cleanup of animlib.
* operate on a parameter-specified data structure instead of a global one
* moved error checks into the library code.
2020-06-27 11:47:31 +02:00
Mitchell Richters
8c723f52d1 - make controller input identical across all games.
* Convert axes in ControlInfo struct from int32_t to float as what's received from the backend.
* Remove all the scale up/down math since we don't need that with floats and replace with float constants that match old behaviour.
* Store q16mlook scaling as a constant for use with mouse and upcoming controller code.
* Add required controller code to Blood as the only game not to have working controllers.
* Fix typos in (gInput.forward > input.forward) for `ctrlGetInput()` in Blood.
* Remove use of `scaleAdjustmentToInterval()` on Exhumed and Shadow Warrior as they only process forward/side velocities within the game's ticrate.
* Repair angvel/aimvel scaling mistakes from d79a5d256d.
* Scale dyaw and dpitch by 25% for Shadow Warrior as the game runs 25% faster than the other games, leading to faster input.
2020-06-24 20:08:56 +02:00
Mitchell Richters
91cc97ced0 Change Next/Previous Weapon button handling for Shadow Warrior.
- Makes consistent with Duke 3D, RR and Blood.
2020-06-22 07:47:58 +02:00
Christoph Oelckers
990cb2acb8 -'shoot' replaced.
# Conflicts:
#	source/build/src/palette.cpp
2020-06-21 23:24:49 +02:00
Christoph Oelckers
198ed45357 - clean up redundancy 2020-06-20 10:58:47 +02:00
Christoph Oelckers
2c2b871083 - fixed texture validation checks. 2020-06-17 12:26:02 +02:00
Christoph Oelckers
2a29dbf793 - use backend independent code to render the camera textures. 2020-06-14 21:57:21 +02:00
Christoph Oelckers
946da7d622 - moved the textures used for the animations into the texture manager.
This is to allow giving them a texture ID so that they can be used from ZScript which has no access to naked textures.
This also consolidates AnimTexture and VpxTexture.
2020-06-14 20:27:13 +02:00
Christoph Oelckers
d4cdb31464 - backend update to make the ZScript compiler work. 2020-06-14 18:58:30 +02:00
Mitchell Richters
d79a5d256d - fix joystick scaling for all games.
* Repairs https://forum.zdoom.org/viewtopic.php?f=340&t=67239 and https://forum.zdoom.org/viewtopic.php?f=340&t=67933
* Values that come from GZDoom backend are too low to be suitable for the Build games which were dividing by 'analogExtent'.
* Remove definition of analogExtent from all games and define in inputstate.h, then define joyaxesScale as 75% of analogExtent to provide a bit of headroom and not have a scale of 1.0 be full speed.
* Invert the returned results of GetAxes() as the returned floats are reversed for build games.
* Leverage scaleAdjustmentToInverval() on game-side code to consistently scale the input irrespective of frame rate, vsync etc.
2020-06-12 16:44:08 +02:00
Christoph Oelckers
22aad4999c - use the engine backend to render the scene 2020-06-11 22:26:46 +02:00
Christoph Oelckers
f0d208bf56 - fixed compile error. 2020-06-07 10:46:35 +02:00
NY00123
1a1039a2d3 Fix a possible jitter upon changing the player's action
(e.g., beginning to jump, or landing on ground);
Reproduced with the input being tied to framerate
while SO interpolation is toggled on.

This involves the following modifications:
- PF2_INPUT_CAN_TURN and PF2_INPUT_CAN_AIM are now additionally set
from various DoPlayerBegin* functions, allowing the player to continue
turning/aiming as usual (right before the next call to domovethings),
even in specific instances of player action changes.
- If PF2_INPUT_CAN_TURN/PF2_INPUT_CAN_AIM was set before and
after calling pp->DoPlayerAction from domovethings altogether,
ensure that the player's oq16ang/oq16horiz is updated by
making an appropriate call to DoPlayerTurn/DoPlayerHorizon. This
is done in case a call to DoPlayerTurn/DoPlayerHorizon is missed.
This change is not applied for a dead player, though.
2020-06-07 10:19:49 +02:00
NY00123
039458d14d sw/src/draw.cpp:drawscreen: Removing the PF_DEAD test
in 1a3c9e3a15ba788607dfd96ebcc75a2198be6d69 was a mistake.
The interpolation should still apply, albeit not while
the viewing angle is changed via the player's own input.
We should also continue interpolating in coop view.
2020-06-07 10:19:48 +02:00
NY00123
ce2aee49df SW: This should hopefully be a better way of fixing the lack of
interpolation of player turning/aiming/movement, while being carried
by a sector object, without SO interpolation. This is a continuation of
73a0aa394e906a65633d61f3c749c9b9b7e66aaa and bf31bc2987a3eccd31d343622327bd4ee0f9c5a1,
aiming to fix a jitter in case the player is continuously
getting pushed by a wall (e.g., on the boat in level 5).

Basically, this moves the relevant assignments from track.cpp:MovePlayer
and MovePoints to player.cpp:DoPlayerMove. Unless a call to one of these
functions has been missed, pushwall and clipmove can be called from
player.cpp in the following instances, which should be covered:
- Via DoPlayerMove, which is the function getting the fix now.
- Via DoPlayerSlide, which is called in the beginning of DoPlayerMove.
- Via DoPlayerCurrent when called from DoPlayerCrawl/DoPlayerWade,
followed by DoPlayerMove.
- Via DoPlayerCurrent when called from DoPlayerDive,
followed by DoPlayerMove if the player doesn't stop diving.

# Conflicts:
#	source/sw/src/track.cpp
2020-06-07 10:19:48 +02:00
Christoph Oelckers
cf6855904d - took projection and view matrix out of the render state.
This is a preparation to migrate to GZDoom's HWViewpointUniforms buffer.
2020-06-04 18:46:44 +02:00
Christoph Oelckers
68c97e3c25 Merge branch 'master' of https://github.com/coelckers/Raze
# Conflicts:
#	source/core/gamecontrol.h
#	source/duke3d/src/game.cpp
#	source/exhumed/src/exhumed.cpp
#	source/rr/src/game.cpp
2020-05-31 23:30:10 +02:00
Mitchell Richters
33b6b85d57 SW: Amend how game pauses.
- Pausing game with Pause key now works again.
2020-05-31 23:19:54 +02:00
Christoph Oelckers
efa1cd3048 - moved video files to 'common'.
# Conflicts:
#	source/blood/src/screen.cpp
2020-05-31 09:19:16 +02:00
Christoph Oelckers
1e2a3da5fd - video base code unified.
# Conflicts:
#	source/core/rendering/v_video.cpp
2020-05-31 09:18:43 +02:00
Christoph Oelckers
edb2cb31ee - backend update with GZDoom model code. 2020-05-31 08:55:00 +02:00
NY00123
8a812cc329 SW: Call OSD_DisplayQueued in DemoPlayback,
so OSD commands can have an effect from here
2020-05-30 23:28:24 +02:00
NY00123
9bf5ee046e SW: Remove TitleLevel (probably dating back to 1995 prototype builds)
# Conflicts:
#	source/sw/src/game.cpp
2020-05-30 23:28:24 +02:00
NY00123
6aeb366a93 SW: Remove DemoOverride, ScenePlayBack and SceneLevel
# Conflicts:
#	source/sw/src/demo.cpp
#	source/sw/src/game.cpp
2020-05-30 23:28:04 +02:00
NY00123
6920ef8fc3 SW - interpso.cpp: Imperfect hack for jittery coolies in level 1's train
(with SO interpolation turned on). It would be nicer to have something
better structured than the given hack, but this currently seems to work,
while not breaking the sprites on the boat in the beginning of level 5.
2020-05-30 23:27:18 +02:00
NY00123
217bf454f4 sw/src/interpso.cpp:so_dointerpolations:
Move ratio calculation out of inner loop.
2020-05-30 23:27:18 +02:00
Christoph Oelckers
193b940eef - palette code cleanup. 2020-05-27 22:19:02 +02:00
Christoph Oelckers
29db3febb8 - updated the platform code to be mostly identical with GZDoom 2020-05-26 00:08:26 +02:00
Christoph Oelckers
55a3c62b59 - use GZDoom's 2D drawer.
Console and menu font colors are not ok yet, aside from that it works.
2020-05-25 17:11:32 +02:00
Christoph Oelckers
a70b7fa698 - use the texture manager to handle texture data. 2020-05-24 23:26:47 +02:00
Christoph Oelckers
266364fc2e - properly implement texture offsets 2020-05-24 13:26:45 +02:00
Christoph Oelckers
cbeb481d59 - what is it with passing data to subfunctions through global variables? :( 2020-05-24 09:04:25 +02:00
Christoph Oelckers
00e7b2fa25 - simple stuff from the texture manager inclusion commit.
To get this out of the way first...
2020-05-24 00:27:24 +02:00
Christoph Oelckers
ae6403a205 - added a level of abstraction to the lookup table code to ease later refactoring. 2020-05-23 22:43:05 +02:00
Christoph Oelckers
f929419a0a - refactoring of the lookup tables. 2020-05-23 22:43:04 +02:00
Christoph Oelckers
b971bc2717 - avoid using global palette settings when drawing 2D content with a custom palette.
Instead pass the palette info with the render call to avoid stale global state.
2020-05-23 22:43:01 +02:00
Christoph Oelckers
8d3199514d - removed some 'pragma' cruft. 2020-05-23 13:08:10 +02:00
Christoph Oelckers
8bd5f12b42 - matching sound backend code with GZDoom.
# Conflicts:
#	source/core/sound/s_soundinternal.h
2020-05-23 12:59:11 +02:00
Christoph Oelckers
6a8efb7520 - update of music code, in particular separating the engine-specific lookup from the backend.
# Conflicts:
#	source/core/music/music.cpp

# Conflicts:
#	source/build/src/palette.cpp
2020-05-23 12:37:47 +02:00
Christoph Oelckers
d0406e27b6 - all base palette data has been transitioned to GPalette. 2020-05-23 12:31:05 +02:00
Christoph Oelckers
6f9ee4b60f - store palettes in the palette container. 2020-05-23 12:31:05 +02:00
NY00123
cf22b4da0a sw/src/demo.cpp:DemoPlayBack: Add a call to timerUpdateClock, which
is now required. Previously, it would be called from faketimerhandler,
which in turn is called from the engine.
2020-05-22 23:41:13 +02:00
NY00123
a69f738287 sw/src/copysect.cpp: Temporarily disable interpolation of sector object
if any of its sectors is impacted by CopySectorWalls. Fixes
a possible flicker with the drill at the end of level 2.
2020-05-22 23:41:11 +02:00
NY00123
ccf6722b70 SW: Don't interpolate a sector object if the corresponding lasttic value is 0 2020-05-22 23:41:10 +02:00
NY00123
37c3f1cc46 SW: Add the macro SO_EMPTY and use it instead of
separate checks of the form sop->xmid == INT32_MAX
2020-05-22 23:41:09 +02:00
NY00123
d510b9b95a sw/src/sync.cpp:SOSync: Remove commented out code 2020-05-22 23:41:08 +02:00
NY00123
d43bffd118 SW: Remove unused DoubleInitAWE32 variable 2020-05-22 23:41:07 +02:00
NY00123
f94b38b138 SW: Modify getinput to update oq16ang/oq16horiz with the same amount
of change that camq16ang/camq16horiz gets. Such an update is possible
after making sure that UpdateInputs (faketimerhandler) is
never called from domovethings.

# Conflicts:
#	source/sw/src/game.cpp
2020-05-22 23:41:05 +02:00
NY00123
6b5cf9525b sw/src/network.cpp: Remove from UpdateInputs the checks of totalclock
and ready2send and the call to timerUpdateClock, which are now done
before calling UpdateInputs itself from RunLevel.

# Conflicts:
#	source/sw/src/network.cpp
2020-05-22 23:40:00 +02:00
NY00123
ae2bcdd1a6 Rename faketimerhandler -> UpdateInputs and keep an empty
faketimerhandler stub in SW. This basically deprecates
the usage of faketimerhandler in the game.
2020-05-22 23:39:45 +02:00
NY00123
6daf42a959 sw/src/game.cpp:RunLevel: Call faketimerhandler in a loop, based on code
from EDuke32-OldMP. Main difference from EDuke32-OldMP is that this is
done even while staying in the menu; Behaviors will otherwise break.
We should also call timerUpdateClock() before the loop, especially
after removing the call to this function from faketimerhandler soon.
2020-05-22 23:39:43 +02:00
NY00123
25b5d69cab SW: Remove commented out code accessing non-existing variable
# Conflicts:
#	source/sw/src/network.cpp
2020-05-22 23:39:42 +02:00
NY00123
7e2484f603 SW: Remove FAKETIMERHANDLER and calls to faketimerhandler via this macro
# Conflicts:
#	source/sw/src/sprite.cpp
2020-05-22 23:39:28 +02:00
NY00123
916cd01550 SW: While not exactly a favorite of mine, this fixes the floorz updates
of the secret rotating pillar in level 1 with SO interpolation.
The drill in level 2 is also covered. So far, SetVatorActive seems
to be the only place where interpolation of ceiling/floorz
may be set, outside of the SO interpolation code.
2020-05-22 23:39:12 +02:00
Christoph Oelckers
f53b348782 - stop the railgun's active sound if another weapon is selected. 2020-05-22 23:02:25 +02:00
Evan Ramos
71dc4ff5a4 SW: Fail gracefully from WarpToArea instead of aborting 2020-05-22 18:29:21 +02:00
Evan Ramos
f318d2282a SW: Clear the background during cinematics
# Conflicts:
#	source/sw/src/anim.cpp
2020-05-22 18:29:20 +02:00
Mitchell Richters
d98813f00f SW: Allow sector object interpolations to be disabled for debugging.
New code is causing some issues. Upstream allow it to be toggled, so let's do that also.
2020-05-22 16:43:34 +02:00
Mitchell Richters
45cc95401f SW: Make game compile after upstream backports. 2020-05-21 18:47:37 +02:00
Evan Ramos
0ab81904c2 SW: Allow Strafe Left and Right to turn vehicles 2020-05-21 18:47:37 +02:00
Evan Ramos
9d11c7dfb1 SW: Add FOV support. 2020-05-21 18:47:37 +02:00
Evan Ramos
edccdccfb4 SW: Fall back gracefully if map mirror tags are not fully correct 2020-05-21 18:47:37 +02:00
Evan Ramos
e6dd2741f3 SW: Instrument Saveables with debug_break 2020-05-21 18:47:37 +02:00
Evan Ramos
9eefd3d892 SW: Add PanelSpriteFunc values to saveables 2020-05-21 18:47:37 +02:00
NY00123
024d4e7297 SW: Afraid that we should disable almost all kinds of SOs in multiplayer
for now, due to possible jitters. Currently leaving remote-controlled SOs.
2020-05-21 18:47:37 +02:00
NY00123
ab99b3b79d SW: Call FunctionKeys from getinput only if the latter is called
from faketimerhandler. This should fix the timing of playing an
RTS file's sound and sending the corresponding message.
2020-05-21 18:47:37 +02:00
NY00123
75c76f073a SW: Fix aiming in coop view 2020-05-21 18:47:37 +02:00
NY00123
5baba6b9f3 SW: Don't interpolate a non-remote sector object controlled
by the player. Make sure looking up/down is still smooth.
2020-05-21 18:47:37 +02:00
NY00123
bdacab366a SW: Disable interpolation of sector objects that
don't move as smooth as possible in multiplayer
2020-05-21 18:47:37 +02:00
NY00123
f3654d80e7 Store sector object interpolation data in saved game 2020-05-21 18:47:37 +02:00
NY00123
27675d9f4f Remove the preceding sprite interpolation functions, not needed anymore 2020-05-21 18:47:37 +02:00
NY00123
221172311c SW: Let's make use of interpso.*. Still need to do a few more things. 2020-05-21 18:47:37 +02:00
NY00123
2b1e32bf3d SW: Add the currently-unused interpso.* files, enabling interpolation
of sector objects as whole groups of points and sprite angles.

The following goals are intended to be achieved with this code:
- Make it easy to let the user toggle sector object interpolation.
- Interpolate the angles of sprites carried by sector objects.
- Use the right amount of samples for interpolating a sector object,
depending on the players' locations, as done in the checks within
DoSector. Unfortunately, modifying DoSector itself to
unconditionally call MoveSectorObjects(sop, synctics) technically
changes the way sectors move (in the logical sense), and was
found out to make a specifically constructed user map unbeatable.
- Make it easy to disable interpolation of a whole sector object in
case of a need. This is especially important if such an object
is controlled by a player in multiplayer, mostly since this
isn't compatible with the way player prediction is working.
2020-05-21 18:47:37 +02:00
NY00123
f6a5572775 SW: Add the currently unused InterpolateSO option.
A known issue, which also applies to existing settings like the voxel
toggle, is that its value gets written to the saved game, and when such
a game is loaded, the its value gets overwritten by the one in the
saved game. Options should move to settings.cfg later, anyway.
2020-05-21 18:47:37 +02:00
NY00123
890a737152 SW: Add the oangdiff field to USER struct as suggested by Hendricks,
and use it in MovePoints. This will be used for interpolating
the angles of sprites carried by SOs soon.
2020-05-21 18:47:37 +02:00
NY00123
d467ce3eb8 SW: Interpolate the player's bob_z, based on suggestion by Striker.
Using pp instead of ppp seems to work better with prediction.
2020-05-21 18:47:37 +02:00
NY00123
10e4c3e121 sw/src/draw.cpp: Import from Duke3D the Polymost shadow drawing hacks 2020-05-21 18:47:37 +02:00
NY00123
33043b3b05 sw/src/network.cpp: Fix waitforeverybody in Master/Slave
modes. This uses SVN r1135 and r1143 as a reference.
2020-05-21 18:47:37 +02:00
NY00123
dea7c83361 sw/src/network.cpp: Fix sending of messages in Master/Slave.
Thanks Dynamo for spotting the bug.
2020-05-21 18:47:37 +02:00
NY00123
63743eea67 sw/src/draw.cpp:analyzesprites: Interpolate other players' sprites, in a
similar manner to what's done in Duke3D (with the addition of the angle).

There seem to be some jitters with this, mostly in Master/Slave mode.
Decreasing PAKRATE in mmulti.cpp might also increase the frequency
of this occuring in Peer-2-Peer mode.
2020-05-21 18:47:37 +02:00
NY00123
5a6dd2224f sw/src/jsector.cpp:JS_DrawCameras: Make camera oscilation
less dependent on the frame rate.
It would probably be better to update this from the game loop side,
like in Duke3D, but it's still better than the preceding situation.
2020-05-21 18:47:37 +02:00
Mitchell Richters
471f0df69d SW: Q16.16 refinements in DoPlayerDeathFollowKiller. 2020-05-21 18:47:37 +02:00
Mitchell Richters
14273dd200 SW: Add GetDeltaQ16Angle. 2020-05-21 18:47:37 +02:00
NY00123
36e6dee64c Add PedanticQ16AngleFloor to sw/src/game.h and use it in DoPlayerTurn 2020-05-21 18:47:37 +02:00
NY00123
b84975e406 SW: Remove drive_oangvel from PLAYERstruct. We can use local variables instead. 2020-05-21 18:47:37 +02:00
NY00123
6aecd46dbc SW - Hopefully a better way to decide if getinput should call
DoPlayerTurn/DoPlayerHorizon while input is tied to the frame rate:
Introduce the new player flags PF2_INPUT_CAN_TURN and PF2_INPUT_CAN_AIM.
Set PF2_INPUT_CAN_TURN if DoPlayerTurn can be called outside
of getinput. Similarly set PF2_INPUT_CAN_AIM if DoPlayerHorizon
can be called in this manner.
getinput will only call DoPlayerTurn/DoPlayerHorizon
if PF2_INPUT_CAN_TURN/PF2_INPUT_CAN_AIM is set. These flags are reset
right before the call to the player's current DoPlayerAction function.

For one example in which this assists, it's not always the
case that DoPlayerDeathFollowKiller may call DoPlayerTurn,
even if we assume that pp->input.q16angvel is never zero.
2020-05-21 18:47:37 +02:00
NY00123
e3197d206d SW: Temporarily lock angle and horiz right upon player death 2020-05-21 18:47:37 +02:00
NY00123
bfd79d8bc2 sw/src/draw.cpp:drawscreen: Don't interpolate while the game is paused 2020-05-21 18:47:37 +02:00
NY00123
656e059c86 sw/src/game.cpp: Remove unused ReloadPromptMode variable 2020-05-21 18:47:37 +02:00
NY00123
8d748c19e4 Minor SW cleanup: Have a single declaration of
GamePaused within game.h. Do the same with ReloadPrompt.
2020-05-21 18:47:37 +02:00
NY00123
5a0e54b63e SW: Migrate the player's RevolveAng field to Q16.16 format.
This fixes truncations of q16ang in MovePlayer. One known
fixed issue is a minor micro-shaking effect, reproduced
while standing on a non-moving SO (e.g., the bus in level 1).
The latter is also related to the use of camq16ang.

Based in idea on patch from mjr4077au.
2020-05-21 18:47:37 +02:00
NY00123
ef85bc58c3 sw/src/draw.cpp:drawscreen: Use GetQ16AngleFromVect for pointing
at a remote-controlled SO. In case PedanticMode == FALSE, this
leads to small improvements with aiming at the car in EXAMPLE.MAP.
2020-05-21 18:47:37 +02:00
NY00123
207240f277 Add GetQ16AngleFromVect wrapper function to sw/src/game.h 2020-05-21 18:47:37 +02:00
NY00123
e2a789b8cc SW: Lock angle and horiz right after teleporting to sprite 2020-05-21 18:47:37 +02:00
NY00123
8e9130c31a sw/src/draw.cpp:drawscreen: Removing the check that pp->sop_control
is non-null seems to resolve the newly introduced interpolation
issue for looking up/down while controlling a sector object.
We can also remove the PF_DEAD test, since
game.cpp:getinput should lock any kind of aiming.

src/src/game.cpp:getinput: We now, however, need to further
lock turning here while controlling a sector object.
2020-05-21 18:47:37 +02:00
NY00123
4c73c11255 SW: Ensure the player's rendering angle is in sync with a rotating
sector. This re-introduces the angle interpolation in drawscreen
while sector object interpolation is in use.

A side-effect of this is that looking up/down is now less smooth
while controlling a sector object (e.g., a turret).
2020-05-21 18:47:37 +02:00
NY00123
0c4deb9298 sw/src/track.cpp:MovePlayer: We also need to update pp->camq16ang here.
Note that this angle is currently not interpolated,
as done for the sector.
2020-05-21 18:47:37 +02:00
NY00123
fd6df8e509 sw/src/track.cpp:MovePlayer: Missed this in preceding interpolation fixes 2020-05-21 18:47:37 +02:00
NY00123
1d1aa4581b sw/src/track.cpp: If interpolation is enabled, also cover
the SO's midpoint. Fixes aiming at a remote controlled SO.
2020-05-21 18:47:37 +02:00
Mitchell Richters
979c4846a4 SW: Fixes and cleanups following backporting upstream's input changes. 2020-05-20 14:43:03 +02:00
Mitchell Richters
2c0ad0dd12 SW: Fix compilation after backporting upstream's input changes. 2020-05-20 14:43:03 +02:00
NY00123
3913a05713 Use pragma pack in sw/src/network.h instead of the locally defined
PACKED macro. This is more consistent with the current Duke3D codebase,
and further fixes build with older versions of MinGW GCC, in which
attribute packed is broken without specifying -mno-ms-bitfields.
2020-05-20 14:43:03 +02:00
NY00123
ff49bc2209 SW: Remove unused wfe_Clock variable 2020-05-20 14:43:03 +02:00
NY00123
b0318afbdb Fix usage of possibly wrong address in sw/src/player.cpp:DoPlayerHorizon 2020-05-20 14:43:03 +02:00
NY00123
10a5120e40 sw/src/network.cpp: I think that it's safe to enable
the sync check on the slave side in Master/Slave mode.
2020-05-20 14:43:03 +02:00
NY00123
0f761cdc77 SW: This hopefully resolves issues with leaving multiplayer games 2020-05-20 14:43:03 +02:00
NY00123
7749b0f7b9 SW: Interpolate sector objects in non-demo, single player games.
Let's see if this is breaking anything.
2020-05-20 14:43:03 +02:00
NY00123
25be14ccc0 Another change modifying saved game format in SW:
Increase MAXINTERPOLATIONS from 1024 to MAXSPRITES.
2020-05-20 14:43:03 +02:00
NY00123
bf0ace3748 SW change breaking compatibility with existing saved games:
Remove startofdynamicinterpolations and short_startofdynamicinterpolations.
2020-05-20 14:43:03 +02:00
NY00123
18602d41c9 SW: Reset the number of interpolations on level load 2020-05-20 14:43:03 +02:00
NY00123
47ac981a3a SW: Let's replace the macro PEDANTIC_MODE with variable PedanticMode 2020-05-20 14:43:03 +02:00
NY00123
cc4f1f21f9 Interpolation fixes for SW:
draw.cpp: Fix the lack of interpolation while walking on a sector
object, like the bus roof or the floor of the train in Seppuku Station.
track.cpp: Make sure the player's location and angle aren't mistakenly
interpolated while standing on a moving sector object as a consequence.
2020-05-20 14:43:03 +02:00
NY00123
eaefc2576c SW: Rename q16avel -> q16angvel and q16horz -> q16aimvel.
While it is understandable that avel and horz came from Duke3D,
having both q16horiz and q16horz in the updated SW_PACKET struct
can be confusing, and the alternative notation is more consistent
with the original struct field names of angvel and aimvel, as well
as the differing uses of the name angvel still present in player.cpp.
2020-05-20 14:43:03 +02:00
NY00123
952c578957 SW (DoPlayerTurn): The 180-degrees turns should be clockwise 2020-05-20 14:43:03 +02:00
NY00123
d07470ec4a sw/src/player.cpp:PlayerAutoLook: Modify function to
test for PF_MOUSE_AIMING_ON only if PEDANTIC_MODE == FALSE
2020-05-20 14:43:03 +02:00
NY00123
6d9c657b11 SW: This is a better place for a slave which quits to set QuitFlag 2020-05-20 14:43:03 +02:00
NY00123
d50410f06b SW: With the input tied to frame rate, disable aiming while the
player is dead, and also disable horizontal aiming while on a ladder.
2020-05-20 14:43:03 +02:00
NY00123
820e9ef5f9 SW: Use the old interpolation path in drawscreen if player is dead 2020-05-20 14:43:03 +02:00
NY00123
701b33da0d SW: Make horiz centering a bit less immediate again 2020-05-20 14:43:03 +02:00
Mitchell Richters
cba38c5cfc SW: Tie player input to frame rate. 2020-05-20 14:43:03 +02:00
Mitchell Richters
8b10f53450 SW: Add and use elapsedInputTicks and scaleAdjustmentToInterval
as one more step before tying input to frame rate.
2020-05-20 14:43:03 +02:00
NY00123
8085c8473d SW: Add the q16ang and q16horiz fields to SW_PACKET. These
will be filled by faketimerhandler with the current player's
most recent camq16ang and camq16horiz values, respectively.
2020-05-20 14:43:03 +02:00
NY00123
de0ed067f5 SW: Modify DoPlayerTurn/DoPlayerHorizon to make it possible
for them to modify the player's camq16ang/camq16horiz field
instead of q16ang/q16horiz. Additionally, pass to them the
change in angle/horiz via a parameter, as an alternative
to direct access to the corresponding player input field.
2020-05-20 14:43:03 +02:00
NY00123
1f9e319d39 SW - First step in tying player input to frame rate:
Add the camq16ang and camq16horiz fields to the player struct.
With the exception of DoPlayerTurn and DoPlayerHorizon, whenever
code in player.cpp updates player's q16ang/q16horiz, also write
the updated values to camq16ang/camq16horiz. These variables'
preceding values are never used in these functions.
2020-05-20 14:43:03 +02:00
NY00123
b447feef91 sw/src/game.cpp:LoadLevel: Rename q16ang -> ang 2020-05-20 14:43:03 +02:00
NY00123
a2a1642f3d SW: We can revert the change of siang to q16 now 2020-05-20 14:43:03 +02:00
NY00123
1d2aadd229 sw/src/draw.cpp:drawscreen: We can set the pp->si* fields just once,
a bit later.
2020-05-20 14:43:03 +02:00
NY00123
2d4766555c SW: Revert commented out horiz->q16horiz renames in DSPRINTF strings 2020-05-20 14:43:03 +02:00
NY00123
a8a47a9eb0 SW: Fix typo in DoPlayerTeleportToSprite, following the migration to q16 angles 2020-05-20 14:43:03 +02:00
NY00123
4a8ad9b550 Fix multiplayer desync after the change to q16 angle and horiz.
Note that this includes non-portable unaligned accesses, but this
already applies to surrounding code. Just add comments for now.
2020-05-20 14:43:03 +02:00
NY00123
6faa73286f SW: Trim q16 angle and horiz during demo playback/recording.
This uses the newly introduced PEDANTIC_MODE macro.
2020-05-20 14:43:03 +02:00
NY00123
8284fcba9a sw/src/player.cpp:DoPlayerTurn: Increase turning precision
with q16 angle. This uses the new NORM_Q16ANGLE macro.
2020-05-20 14:43:03 +02:00
NY00123
1a46afaf27 Fix compatibility with existing demo files after the migration
to q16 angle and horiz. The original SW_PACKET structure,
named OLD_SW_PACKET here, is used while accessing demo files.
2020-05-20 14:43:03 +02:00
Mitchell Richters
0431f5ffed SW: Refinements for Q16.16 implementation. 2020-05-20 14:43:03 +02:00
Mitchell Richters
a4fdabd860 SW: Use Q16.16 for angle. 2020-05-20 14:43:03 +02:00
Mitchell Richters
2bf2055c65 SW: Use Q16.16 for horiz. 2020-05-20 14:43:03 +02:00
NY00123
c32a8cab29 SW: Revert the changes from JFSW commit 7d0deafe81b0ffa30d77cfe242e454f8b4487a1f
related to the definitions of RANDOM_NEG in bunny.cpp, ripper.cpp
and ripper2.cpp. Do so in a way that isn't re-introducing compiler
warnings. This partially fixes compatibility with demos made for SW 1.2.
Additionally, replace the 3 separate definitions of RANDOM_NEG
with a common one within game.h.

From-SVN: r8798
2020-05-20 14:43:03 +02:00
NY00123
00daf6295e SW: Fix a few memory access errors related to demo support
From-SVN: r8797
2020-05-20 14:43:03 +02:00
NY00123
6d537f6d75 Pack the struct SW_PACKET. While this makes demo playback
functional with existing demo files, the code is known
to be incompatible with demos made for SW 1.2.

From-SVN: r8792
2020-05-20 14:43:03 +02:00
Mitchell Richters
83936bf5eb Revert "SW: Improve main game loop."
This reverts commit e878c5bab8.

Revert "SW: Use Q16.16 for horiz."

This reverts commit f07a0ae01e.

Revert "SW: Use Q16.16 for angle."

This reverts commit 1ecc74c2ec.

Revert "SW: Minor repairs for Q16.16 implementation."

This reverts commit d78d046bad.

Revert "SW: Process input at frame rate."

This reverts commit c162014dab.

Revert "SW: Amendments to accommodate changes in master."

This reverts commit eaa51138ad.

Revert "SW: Fix incorrectly declared function input type."

This reverts commit 1cdd5b08d8.

Revert "SW: Amend scaleAdjustmentToInterval() with correct value for SW."

This reverts commit d4dd737cd5.

Revert "SW: Refinements to new input code."

This reverts commit 5ebc65a1fb.

Revert "SW: Adjust look and snap up/down keys and slightly tune PLAYER_TURN_AMOUNT."

This reverts commit 2852536dbf.

Revert "SW: Get PLAYER_TURN_SCALE to be just right."

This reverts commit 4630c8a0b7.

Revert "SW: Make map follow mode work better."

This reverts commit 8e94c48eff.

Revert "SW: Remove line accidentally left from 'MoveScrollMode2D()'."

This reverts commit 5db8047b41.

Revert "Fix multiplayer desync after the change to q16 angle and horiz."

This reverts commit 3bc46078b8.

Revert "SW: Revert commented out horiz->q16horiz renames in DSPRINTF strings"

This reverts commit 537313f620.

Revert "sw/src/draw.cpp:drawscreen: We can set the pp->si* fields just once,"

This reverts commit d2e9595980.

Revert "sw/src/game.cpp:LoadLevel: Rename q16ang -> ang"

This reverts commit a178961a3e.

Revert "SW: Minor tweaks."

This reverts commit 377ba68344.

Revert "SW: Further refine turning and optimise horizon adjustment."

This reverts commit 039022d9ac.

Revert "SW: Don't process input at frame rate if ScrollMode2D is true."

This reverts commit 1aa1e62c4d.

Revert "SW: Use a bit more Q16.16 in places."

This reverts commit 40ca656f38.

Revert "SW: Use the old interpolation path in drawscreen if player is dead"

This reverts commit 2d73466425.

Revert "SW: Smooth out 180 degree turn landing and replace some fix16_min/max with fix16_clamp."

This reverts commit 0996e87f79.

Revert "Change Next/Previous Weapon button handling for Shadow Warrior."

This reverts commit f6b8ca6a22.

Revert "SW: Make "Center_View" key return smoothly."

This reverts commit 23c401fbc2.

Revert "SW: Use the old interpolation path in drawscreen if player is dead"

This reverts commit 43ec16eb55.

Revert "Interpolation fixes for SW:"

This reverts commit ac8a7ecfbd.

Revert "SW: Reset the number of interpolations on level load"

This reverts commit 04bf8499e7.

Revert "Another change modifying saved game format in SW:"

This reverts commit e80888523e.

Revert "SW: Interpolate sector objects in non-demo, single player games."

This reverts commit 996ab77cf4.

Revert "- fixed merge errors in SW."

This reverts commit b8cfa94568.

Revert "- fix interpolation stutters when opening console for SW."

This reverts commit 99fdbfb6cb.

Revert "- reset buttonMap button states after returning from pause for SW (stops keys acting stuck down if down prior to pausing)."

This reverts commit 693b6955da.

Revert "SW: fix stupid input scaling bug"

This reverts commit 1c79e6e17c.

Revert "SW: Make vehicle input better."

This reverts commit 670a53c402.

Revert "SW: Change fix16_from_float() to fix16_from_int() that was changed in 4630c8a0b7 but should have been reverted in 377ba68344e34495638c6fa7685ff78c9a0ed6f8."

This reverts commit 423c9da071.

Revert "SW: Remove ScrollMode2D extern boolean and move into PLAYERp struct."

This reverts commit 31eb55c1fa.
2020-05-20 14:43:03 +02:00
Mitchell Richters
31eb55c1fa SW: Remove ScrollMode2D extern boolean and move into PLAYERp struct. 2020-05-19 12:55:32 +02:00
Mitchell Richters
423c9da071 SW: Change fix16_from_float() to fix16_from_int() that was changed in 4630c8a0b7 but should have been reverted in 377ba68344. 2020-05-19 12:55:32 +02:00
Mitchell Richters
670a53c402 SW: Make vehicle input better.
- Define new boolean 'on_vehicle' in PLAYERp struct for use with interpolating while on vehicle and other checks.
- Move horizon code back into separate DoPlayerHorizon() function. Adjusting horizon while in vehicle must come at the end of the DoPlayerOperate*() function.
- Make DoPlayerHorizon() accessible in game.cpp.
- Change code in DoPlayerHorizon() to process according how 'pp->on_vehicle' is set.
- Make scaleAdjustmentToInterval available outside of getinput().
- Don't process input at frame-rate while on a vehicle. Vehicle code is too difficult to process outside of the game's clock.

Partially based on NY00123's upstream implementation of tying player input to frame-rate.
2020-05-19 12:55:32 +02:00
Mitchell Richters
58bb2e149b SW: Fix broken interpolation pathway following changes in 43ec16eb55.
What 43ec16eb55 intends to do was already done via 2d73466425, however I applied the if statement in the opposite order so when it was cherry-picked again, the pathway was actually reversed - interpolating when alive and not when dead.

Rather than re-apply the opposite order, I've made the if statement match upstream for more consistency and to avoid further conflicts.
2020-05-15 15:00:58 +02:00
Richard C. Gobeille
1c79e6e17c SW: fix stupid input scaling bug 2020-05-11 21:27:29 +02:00
Mitchell Richters
8730bd9dda - allow game's clock to keep running while paused (restores interpolations/animations in menus). 2020-05-08 21:23:02 +02:00
Mitchell Richters
ca994b31c9 SW: Set certain sync keys prior to checking them in the same function.
- Ensures action occurs within the requested frame and not the next.
2020-05-08 10:51:59 +02:00
Mitchell Richters
693b6955da - reset buttonMap button states after returning from pause for SW (stops keys acting stuck down if down prior to pausing). 2020-05-06 10:51:08 +02:00
Mitchell Richters
99fdbfb6cb - fix interpolation stutters when opening console for SW. 2020-05-06 10:51:08 +02:00
Christoph Oelckers
b8cfa94568 - fixed merge errors in SW. 2020-05-04 00:04:54 +02:00
NY00123
996ab77cf4 SW: Interpolate sector objects in non-demo, single player games.
Let's see if this is breaking anything.

# Conflicts:
#	source/sw/src/draw.cpp
#	source/sw/src/game.cpp
#	source/sw/src/game.h
#	source/sw/src/interp.cpp
#	source/sw/src/track.cpp
2020-04-16 00:03:05 +02:00
NY00123
e80888523e Another change modifying saved game format in SW:
Increase MAXINTERPOLATIONS from 1024 to MAXSPRITES.

# Conflicts:
#	source/sw/src/interp.cpp
#	source/sw/src/interp.h
2020-04-16 00:03:04 +02:00
NY00123
04bf8499e7 SW: Reset the number of interpolations on level load 2020-04-16 00:03:04 +02:00
NY00123
ac8a7ecfbd Interpolation fixes for SW:
draw.cpp: Fix the lack of interpolation while walking on a sector
object, like the bus roof or the floor of the train in Seppuku Station.
track.cpp: Make sure the player's location and angle aren't mistakenly
interpolated while standing on a moving sector object as a consequence.

# Conflicts:
#	source/sw/src/track.cpp
2020-04-16 00:03:03 +02:00
NY00123
43ec16eb55 SW: Use the old interpolation path in drawscreen if player is dead
# Conflicts:
#	source/sw/src/draw.cpp
2020-04-16 00:03:02 +02:00
Mitchell Richters
23c401fbc2 SW: Make "Center_View" key return smoothly. 2020-04-14 00:00:22 +02:00
Mitchell Richters
db428a4f03 All Games: Make more precise use of 'scaleAdjustmentToInterval()'.
- Inline function returns a double, therefore we should use it and not potentially truncate the mantissa.
- Use divisors to get true numbers of some floats (3.333 -> 10/3, etc).
- Remove a few brackets/parentheses where possible from what are already exceedingly bracketed lines.
2020-04-14 00:00:21 +02:00
Mitchell Richters
f6b8ca6a22 Change Next/Previous Weapon button handling for Shadow Warrior.
- Makes consistent with Duke 3D, RR and Blood.
2020-04-13 23:59:49 +02:00
Mitchell Richters
0996e87f79 SW: Smooth out 180 degree turn landing and replace some fix16_min/max with fix16_clamp. 2020-04-13 23:59:17 +02:00
NY00123
2d73466425 SW: Use the old interpolation path in drawscreen if player is dead 2020-04-13 23:59:16 +02:00
NY00123
120abb1029 SW: With the input tied to frame rate, disable aiming while the
player is dead, and also disable horizontal aiming while on a ladder.
2020-04-13 23:59:15 +02:00
Mitchell Richters
40ca656f38 SW: Use a bit more Q16.16 in places. 2020-04-13 23:59:14 +02:00
Christoph Oelckers
156a225ff4 - renamed global palookup variable.
Since the same word gets used in text messages and local variables in the game code it is easier this way to search for it and facilitate its transition to the translation table management in PaletteContainer.
2020-04-13 23:58:46 +02:00