Commit Graph

432 Commits

Author SHA1 Message Date
Kevin Shanahan
c6ed47fe67 pmove: rename the physent info member and make it serveronly
Only used by QWSV, so exclude it from the client completely and rename
it to something more indicative of its purpose.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 16:48:02 +10:30
Kevin Shanahan
e09b9c59c9 trivial: comment/whitespace changes
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 16:16:45 +10:30
Kevin Shanahan
b55c68e41b pmove: restore old rounding method in NudgePosition
This change of rounding method seems to have caused some 'sticky'
movement across surfaces in certain orientations. Don't understand why
as yet, but revert for now.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 16:09:33 +10:30
Kevin Shanahan
ff03c42507 client: place physents on local stack in Host_Frame
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 16:05:12 +10:30
Kevin Shanahan
f2849a49be client: pass physents into CL_SetUpPlayerPrediction & CL_EmitEntities
Eliminates direct references to the global state from cl_ents.c.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 15:54:51 +10:30
Kevin Shanahan
2a7e41d0b1 client: pass physents into CL_Predict{Move,Usercmd}
Removes direct references to the global state from cl_pred.c

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 15:37:36 +10:30
Kevin Shanahan
97c419e5fd client: pass the physents into CL_SendCmd for Cam_Track
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 15:04:04 +10:30
Kevin Shanahan
c3a4ac3a34 client: pass physents into Cam_Track
Need the physents stack so we can properly test visiblity when trying
to place the camera.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 14:59:15 +10:30
Kevin Shanahan
503fc4ae8d server: rename the debugging AddAllEnts... func as well
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 14:14:49 +10:30
Kevin Shanahan
120eb4d336 server: make the server physent stack local to SV_RunCmd
No more direct users on the server side, so just pass it down on the stack.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 14:12:00 +10:30
Kevin Shanahan
9872e25238 pmove: finally remove the global pmove struct
pmove becomes local storage allocated on the stack in CL_PlayerMove
and SV_RunCmd.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 13:51:30 +10:30
Kevin Shanahan
dcce856672 client: pmove not actually required for Cam_Track
There is still a reference to the global physent stack hidden in
Cam_DoTrace, but at least we can get rid of all references to pmove.

Renamed some local variables for better clarity and replaced the
re-implementation of vector length vlen() with Length() from mathlib.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 13:36:30 +10:30
Kevin Shanahan
e9548a73ab client: small cleanups to CL_PredictMove
Use some extra variables to shorten long pointer/array chasing lines.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 12:28:22 +10:30
Kevin Shanahan
a804d5d87e client: remove old header hack from cl_prec.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 11:58:33 +10:30
Kevin Shanahan
69c01b8a2c client: get rid of unused CL_NudgePosition
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 11:56:20 +10:30
Kevin Shanahan
2758af8a77 pmove: pass the physent stack into PlayerMove
Eliminates direct references to the global pestack from pmove.c. As a
bonus, all passed in references are const.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 11:45:00 +10:30
Kevin Shanahan
557844b800 pmove: pull out the list(stack) of physents from playermove_t
The information	about physents is kind of separate from	the rest of
the player move information - it is also set up before doing
movement/prediction and should be read-only during those calculations.

Most places now	    get a pointer to the "pestack" (kind of a stack due to
adding player entities to the top and popping them off again) passed
in rather than referring to the global data directly.

Still kind of a mess, but should be able to clean up further from
here.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 11:13:53 +10:30
Kevin Shanahan
c4e6d836eb pmove: fix NudgePosition error introduced in fb3991887
To quick to put in the VectorMA where it doesn't belong.
Still, this makes me curious why the nudge is necessary so often...

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 17:12:03 +10:30
Kevin Shanahan
c60949d2ad client: lift CL_SetSolidEntities up into Host_Frame()
On each invocation of CL_SetSolidEntities, the previous state gets
overwritten, so only the last call matters. So it should be safe to
lift out from CL_ParseServerMessage, then out of the loop in
CL_ReadPackets and finally up into Host_Frame in cl_main.c.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 16:39:29 +10:30
Kevin Shanahan
0331c19ce9 client: pass pmove into CL_SetSolidEntities/Players
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 16:36:52 +10:30
Kevin Shanahan
18510bc987 client: rename loop variable in CL_LinkPlayers for better readability
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 16:35:33 +10:30
Kevin Shanahan
89362d80da client: make CL_ReadPackets static, whitespace cleanups
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 16:07:16 +10:30
Kevin Shanahan
a695d4e8b5 client: remove unused framecount from CL_ParseServerMessage
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 15:57:32 +10:30
Kevin Shanahan
fa2f3d7018 client: clean up setup of move.physents in CL_SetSolidEntities
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 15:53:00 +10:30
Kevin Shanahan
1c33398b47 pmove: pass pmove into PlayerMove()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 15:34:10 +10:30
Kevin Shanahan
50bbd77f7d client: separate recursive command splitting from move
Put the playermove outside the recursive function, so the stack is
clearly separate.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 15:32:43 +10:30
Kevin Shanahan
f7f0cca4e8 pmove: remove unused sequence member from playermove_t
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 15:14:04 +10:30
Kevin Shanahan
fb39918875 pmove: pass only origin into NudgePosition, instead of pmove
Slightly modified the behaviour of this function. Previously it would
always round to the nearest 1/8th coordinate towards zero, whereas now
I round to the nearest coordinate. Also, there would previously always
be at least one nudge, but I test the position once before starting
that process.

Hopefully, haven't broken any weird behaviour that depends on
this. Got to be careful when dealing with the physics of Quake!

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 14:38:43 +10:30
Kevin Shanahan
3f1e96767c cam: pass pmove into Cam_Track
Now cl_cam.c does not refer to the global pmove, and Cam_Track is the
single point of entry. Now to see what other dependencies might be
hiding around the palce - maybe it can be localised further...

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 13:44:53 +10:30
Kevin Shanahan
0b33f5ef99 cam: pass pmove into Cam_IsVisible
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 13:40:11 +10:30
Kevin Shanahan
d904c9ab8d cam: pass pmove into InitFlyby/Cam_TryFlyby
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 13:38:20 +10:30
Kevin Shanahan
8cdc1a7f16 cam: roll up loop in InitFlyby
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 13:29:30 +10:30
Kevin Shanahan
bbde1656a4 cam: constify player_state_t pointers
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 13:23:51 +10:30
Kevin Shanahan
92acc7b47d cam: pass playermove_t into Cam_DoTrace
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 13:18:57 +10:30
Kevin Shanahan
a1bc3136f7 pmove: start disentangling global playermove_t state
Now only PlayerMove() within pmove.c refers to the global, the rest
get the struct passed in.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 13:11:19 +10:30
Kevin Shanahan
f02bbd42aa pmove: make player_mins/maxs const
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 12:45:43 +10:30
Kevin Shanahan
f57d9c8b4f pmove: various whitespace, comment housekeeping
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 12:45:19 +10:30
Kevin Shanahan
6ba1901f3f pmove: calculate anglevectors locally, remove global forward/right/up
Some inefficiency due to extra unneeded calculations, but at least
reducing the global state dependencies. Will optimise later.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 12:42:15 +10:30
Kevin Shanahan
d0e466a2bd pmove: make pmove.c local functions static
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 11:54:26 +10:30
Kevin Shanahan
9eb42be7a7 pmove: use same MOVE_CLIP_* flags as sv_phys.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 11:46:12 +10:30
Kevin Shanahan
3ceb51f1d0 pmove: move player_mins/maxs declaration to pmove.h
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-20 11:33:02 +10:30
Kevin Shanahan
7cf8d49d86 pmove: replace the use of pmtrace_t with shared trace_t from model.h
All the Quakeworld client pmove trace functions seem to be pretty much
identical to the server ones originally from world.c, so shared all
the bits which are common and remove that duplicated code.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-19 21:07:05 +10:30
Kevin Shanahan
5560a9ce5f server: switch pmove to using Mod_HullPointContents and Mod_CreateBoxhull
This neatly cleans up a makefile hack since now all targets use the
ASM implementation of Mod_HullPointContents. Removes a bunch of
duplicated code and also make Pmove_Init unneccessary.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-19 16:33:28 +10:30
Kevin Shanahan
cf33822658 model: make planes and clipnodes members of hull_t const
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-19 14:54:00 +10:30
Kevin Shanahan
1c99bbbfd4 server: make local functions/variables static in sv_user.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-17 20:28:56 +10:30
Kevin Shanahan
193a229fcf server: move sv_phys.c to common directory
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-16 18:46:57 +10:30
Kevin Shanahan
af6973e6ab server: perpare sv_phys.c for merging
Quite a bit of churn here, but mostly nothing non-obvious. The only part I
probably changed more than I should have for this changeset was
SV_PushMove, since QW had factored out SV_Push from that. However, a quick
test of both NQ and QW seems to have everything working as normal.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-16 18:44:38 +10:30
Kevin Shanahan
98d99cecd5 sv: define enum for movetypes and use consistently with SV_Move()
Replace all uses of 0, 1, 2, true and false with the proper enum value for
SV_Move type.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-16 16:19:05 +10:30
Kevin Shanahan
e180d3fb00 sv: make SV_Impact static and constify arguments
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-16 13:26:18 +10:30
Kevin Shanahan
4b31f51458 misc: try to keep angle ranges consistent
Try to avoid cases where -180 != 180 or 0 != 360 by ensuring that we
use the ranges (closed->open) of [0, 360) or [-180, 180).

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-28 13:23:41 +10:30