Commit graph

4316 commits

Author SHA1 Message Date
sirlemonhead
6f64967d00 libsmackerdec: Fix incorrect version comparison (though it wasn't breaking anything) 2020-05-22 17:38:04 +02:00
sirlemonhead
e2569d9980 libsmackerdec: Implement GotoFrame() function
# Conflicts:
#	source/libsmackerdec/src/SmackerDecoder.cpp
2020-05-22 17:37:43 +02:00
NoOneBlood
9428c88e29 - Don't change statnum of thing converted to debris back to thing on impact trigger when firing with vector weapon.
- Change damage scale and min firedist for Custom Dude.
- Remove unnecessary checks in callback of tracking condition.
- Fix picWidth() function.
- Better initialization of modern stuff.
- kModernSeqSpawner: disable all other spawners with same TX ID when enabling current.
- Fix: sceneQav was not playing if resurrected with COUSTEAU cheat.
- kModernPictureChanger: remove kModernFlag01 feature (deprecated).
- kModernSectorFXChanger: add flags to control where exactly light effect should appear.
- kModernCondition:
 - add delay before sending command if condition is true.
 - take in account state, so kCmdState and kCmdNotState is useful.
 - fix wrong comparison result in some conditions.
 - add new various conditions.
- kModernPlayerControl:
 - fix start / stop playing qav scene when triggered with event command converted to sprite command.
 - add a way to resurrect / heal player.
 - add event commands to toggle inventory item status via trigger.
 - fix that Remote and Proximity detonators cannot be given.
 - add clear all screen effects option.
 - proper percents for changing movement / jumping.
- kModernRandomTX, kModernSequentialTX: change event redirection mode activation from kModernTypeFlag02 to kCmdLink.
- kModernSpriteDamager: treat damage value as percents by default, take in account god mode.
- kModernEffectGen: fix wrong cstat for effects.
- kModernPropertiesChanger: proper underwater status for sectors and players or enemies in it.
- Players: assign or update current player's sprite index for all conditions.

# Conflicts:
#	source/blood/src/nnexts.cpp
2020-05-22 17:36:37 +02:00
nukeykt
96c9ca657e Blood: poll player input at least once to prevent skips
Fixes #329
2020-05-22 17:35:39 +02:00
NoOneBlood
c000e2e3b3 - Removed link support for various upper / lower stacks (deprecated)
- Removed link support for path marker (deprecated)
- Removed link support for counter sector (deprecated)
- STD random for wind generator
2020-05-22 17:35:11 +02:00
MexMeRcUrY
142e611125 fixes #343 2020-05-22 17:35:01 +02:00
NoOneBlood
569fcc9542 - Custom start health fix
- Check for system reserved statnums in gModerMap
2020-05-22 17:34:54 +02:00
NoOneBlood
e3e805b24c - More compact code for event redirection
- Fix demo desync
- Fix MINGW compile warnings
- Move custom start health from data4 to sysData2 in gModern maps
- Proper respawn for custom dude

# Conflicts:
#	source/blood/src/dude.cpp
#	source/blood/src/dude.h
2020-05-22 17:34:33 +02:00
NoOneBlood
64de30209b - Player control: more strict rules for copying properties of xsprite
- Fix for custom health when respawning enemy
- Fix for custom dude when respawning it
- Conditions: added way to refresh sprite index in tracking conditions

# Conflicts:
#	source/blood/src/actor.cpp
#	source/blood/src/aiunicult.cpp
#	source/blood/src/aiunicult.h
#	source/blood/src/dude.cpp
#	source/blood/src/dude.h
2020-05-22 17:33:05 +02:00
Evan Ramos
8b0da35cb8 Avoid warnings when defining only extra in tilefromtexture
# Conflicts:
#	source/build/src/defs.cpp
2020-05-22 17:30:52 +02:00
Evan Ramos
26333dcaad Blood: Make voxels and models loaded via def inherit rotation automatically 2020-05-22 17:30:43 +02:00
nukeykt
1ef8df0a4c Blood: Fix model yoffset 2020-05-22 17:29:50 +02:00
NoOneBlood
f1f9fcff5c - Changes for conditions (WIP)
- Fix for picWidth();
2020-05-22 17:29:22 +02:00
NoOneBlood
71b110a75e - Double print in console fix for consoleSysMsg
- Changes for kModernCondition

# Conflicts:
#	source/blood/src/globals.cpp
2020-05-22 17:29:12 +02:00
NoOneBlood
c27f3b8d20 - Changes in damage scale for Custom Dude
- Conditions: added conditions for player and enemies (WIP)
2020-05-22 17:28:48 +02:00
NoOneBlood
014dfc346b - Added tracking type of conditions. Generally conditions is still WIP.
- Update aim for player while playing qav scenes.
- Fix compile warnings
2020-05-22 17:28:35 +02:00
Evan Ramos
4d7b37ca1a Rednukem: Remove redundant comment and fix formatting
# Conflicts:
#	source/rr/src/gameexec.cpp
2020-05-22 17:26:36 +02:00
nukeykt
b7294e45a1 Blood : Fix mirror issue
Fixes #334 and #338

# Conflicts:
#	source/blood/src/menu.cpp
2020-05-22 17:25:54 +02:00
MexMeRcUrY
aee64e8e34 fix #333 2020-05-22 17:24:42 +02:00
MexMeRcUrY
5faef5d6dd Blood: Caleb doesn't talk in multiplayer 2020-05-22 17:24:41 +02:00
MexMeRcUrY
f1421bd8ee Blood: Caleb doesn't talk in multiplayer 2020-05-22 17:24:41 +02:00
sirlemonhead
8f8f033956 Rednukem: Limit sprite shade change to Redneck Rampage games, and add guard for invalid array access. Fixes ASAN error. 2020-05-22 17:22:18 +02:00
sirlemonhead
19ab05655b Prevent invalid array index in polymost_spriteIsModelOrVoxel()
# Conflicts:
#	source/build/src/polymost.cpp
2020-05-22 17:22:18 +02:00
sirlemonhead
73a56f76af PCExhumed: Avoid some original memory read bugs and correct some bullet code branching. 2020-05-22 17:22:00 +02:00
sirlemonhead
02d4712e57 Rednukem: Fix MVE crash on Release gcc builds. 2020-05-22 17:21:03 +02:00
sirlemonhead
808d0591eb Rednukem: Add newline to end of playmve.h 2020-05-22 17:21:03 +02:00
sirlemonhead
b89c6da6b8 Rednukem: Playback support added for Rides Again intro movie. Closes #266
# Conflicts:
#	GNUmakefile
#	platform/Windows/rednukem.vcxproj
#	platform/Windows/rednukem.vcxproj.filters
#	source/rr/src/game.cpp
2020-05-22 17:21:03 +02:00
sirlemonhead
20cfbc1786 PCExhumed: Fix the timing of credits text when not using CD audio.
# Conflicts:
#	source/exhumed/src/exhumed.cpp
2020-05-22 17:17:54 +02:00
Evan Ramos
262f2234c6 Duke3D: Disable dead code in implementation of undocumented SE 128
Avoids warning: bitwise or with non-zero value always evaluates to true [-Wtautological-bitwise-compare]
2020-05-22 17:11:16 +02:00
Jordon Moss
49deeb350e Fix trains not moving spawn points with higher indexes than player count. 2020-05-22 17:11:16 +02:00
Richard C. Gobeille
d9b8f58558 Duke3d: make CON_GETFLORZOFSLOPE and CON_GETCEILZOFSLOPE TROR aware 2020-05-22 17:01:37 +02:00
Richard C. Gobeille
e2d79b4682 engine: add yax_getflorzofslope() and yax_getceilzofslope() 2020-05-22 17:01:36 +02:00
Richard C. Gobeille
5e677d6089 Duke3d: restore previous version of VM_ASSERT macro for compilers other than MSVC 2020-05-22 17:01:35 +02:00
Richard C. Gobeille
3ab314e95a engine: make cliptestsector() (used by clipmove(), etc) TROR aware
This is intended to help with issues where enemies get stuck in thin TROR layers.

# Conflicts:
#	source/build/src/clip.cpp
2020-05-22 17:00:55 +02:00
Richard C. Gobeille
14f3eb17f1 Duke3d: flip CON_USE_COMPUTED_GOTO dispatch macro logic around so the branch is taken less often 2020-05-22 17:00:12 +02:00
Richard C. Gobeille
34126a50be Duke3d: change random_angle hack in CON_MOVE to match CON_AI 2020-05-22 17:00:11 +02:00
Richard C. Gobeille
b0902f916a Duke3d: zero player return_to_center when setting horizRecenter to false 2020-05-22 17:00:10 +02:00
Richard C. Gobeille
2d4f6be147 Duke3d: convert several more VM error checks into VM_ASSERT statements
# Conflicts:
#	source/duke3d/src/gameexec.cpp
2020-05-22 17:00:09 +02:00
Richard C. Gobeille
7fbcab3dc1 Duke3d: VM_ASSERT fix 2020-05-22 16:57:34 +02:00
Richard C. Gobeille
86e2f4ec8a Revert "Duke3d: set .horizRecenter when handling SK_CENTER_VIEW"
This reverts commit ef06d8c3dba3e4ccf9388bf31404ab23ebdcb37e.
2020-05-22 16:57:01 +02:00
Richard C. Gobeille
1f82cfa3bf Duke3d: replace VM_CONDITIONAL macro with a lambda
# Conflicts:
#	source/duke3d/src/gameexec.cpp
2020-05-22 16:57:00 +02:00
Richard C. Gobeille
c0160065e4 Duke3d: this is intended to fix an issue where CON VM errors within a CON_FOR loop could cause an infinite loop 2020-05-22 16:56:24 +02:00
Richard C. Gobeille
8cf064b90c Duke3d: add a few missing VM_ASSERT checks 2020-05-22 16:56:23 +02:00
Richard C. Gobeille
1a1112b4c1 Duke3d: fix OOB memory access in CON_FOR 2020-05-22 16:55:37 +02:00
Richard C. Gobeille
dc9c6ce2e6 Duke3d: allow SE_14_SUBWAY_CAR to move STAT_PLAYER sprites
Fixes #18.
2020-05-22 16:54:12 +02:00
Richard C. Gobeille
23909f8ca1 Duke3d: hoist checks for ST_2_UNDERWATER outside of loops in SE_14_SUBWAY_CAR processing 2020-05-22 16:54:10 +02:00
Richard C. Gobeille
45fd214ffe Duke3d: remove interpolation fixups from subway
These aren't needed anymore after Striker's patch to improve overall interpolation.
2020-05-22 16:54:09 +02:00
Richard C. Gobeille
b19d258870 Duke3d: fix APLAYER radius damage distance calculation regression
Fixes #20.
2020-05-22 16:54:08 +02:00
Richard C. Gobeille
f5788c331e Clarify clipupdatesector() log message a bit
# Conflicts:
#	source/build/src/clip.cpp
2020-05-22 16:52:08 +02:00
Richard C. Gobeille
32ddabb12c Derp...
Probably actually fixes #4. Regardless, I want to note that this is really sub-optimal.

# Conflicts:
#	source/duke3d/src/m32def.cpp
2020-05-22 16:51:27 +02:00
Richard C. Gobeille
61d82c8152 Fix really stupid error with CON_NULLOP branch detection
Fixes #4.

# Conflicts:
#	source/duke3d/src/gamedef.cpp
#	source/duke3d/src/m32def.cpp
2020-05-22 16:50:28 +02:00
Richard C. Gobeille
94d098f8ef Fix a crash with tabledivide64()
Fixes #1.
2020-05-22 16:50:02 +02:00
Jordon Moss
79d2bb1bb8 Fix player sprite disappearing and chat indicator using the wrong sprite when typing. 2020-05-22 16:48:44 +02:00
Jordon Moss
658a96ce19 Re-added a check in VM_Move that probably should't have been removed. 2020-05-22 16:48:24 +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
Christoph Oelckers
bad17f29e0 - made some tweaks to the anti-z-fighting code in Polymost.
It now picks the minimum of the current formula and the one from before June 2017 - the current one was causing problems with sprites in the distance so now the old one is used as an upper bound.
2020-05-22 16:27:45 +02:00
Christoph Oelckers
683672a1be - added missing game specific autoload handler. 2020-05-22 01:24:40 +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
6fcb8f7a6a Add gethiq16angle and the getq16angle wrapper to the engine 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
alexey.lysiuk
2974af3178 - fixed a bunch of compilation errors with MSVC 16.6.0 2020-05-21 10:29:59 +03:00
Mitchell Richters
559539bed2 - bump save versions for SW following the massive amount of changes. 2020-05-20 14:43:03 +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
Mitchell Richters
9a144a9afb - bump save versions for Duke3D following changes to DukePlayer_t struct. 2020-05-14 15:15:59 +02:00
Mitchell Richters
10142eee6b RR: Move lastInputTicks from DukePlayer_t struct to PlayerData_t struct.
Better location for it since it never needs to be sent across the wire in a multiplayer situation. It's now also located where the other properties to do with input being tied to frame-rate are located.
2020-05-14 10:00:16 +02:00
Mitchell Richters
1f807792af Duke3D: Move lastInputTicks from DukePlayer_t struct to PlayerData_t struct.
Better location for it since it never needs to be sent across the wire in a multiplayer situation. It's now also located where the other properties to do with input being tied to frame-rate are located.
2020-05-14 10:00:16 +02:00
Mitchell Richters
22ae4182b5 RR: Properly reset pPlayer->lastInputTicks in G_EnterLevel() since all calls to P_ResetPlayer() are commented out.
Repairs issue with player spinning out of control when entering a new level.
2020-05-13 15:12:44 +02:00