Commit Graph

439 Commits

Author SHA1 Message Date
Kevin Shanahan
163fafc39b pmove: use more appropriate types for pmove/pstate onground member
Make the playermove onground member a pointer to the physent - the
server wants to know which entity (edict) the player is standing
on. Make the onground member of the player_state_t a boolean, since
nobody cares what you're standing on, only if you are air/water bourne
or not (view.c).

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 11:53:17 +10:30
Kevin Shanahan
bd1d35f052 pmove: store physent pointers in the touch array
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 11:19:59 +10:30
Kevin Shanahan
acefc149c2 pmove: make embedded usercmd_t a const pointer instead
The usercmd is not modified, so just make it a const pointer
instead. Probably should be passed as a separate argument instead...

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 08:37:22 +10:30
Kevin Shanahan
b039baa5f3 pmove: update player state with proper button changes 2013-03-22 08:31:27 +10:30
Kevin Shanahan
f5882fce17 pmove: move onground, watertype/level into playermove_t
Get rid of global state and track using playermove_t. Software NQ gets
a little fix by reading the onground state from the view_message
(player_state_t) rather than the global onground value.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 20:27:46 +10:30
Kevin Shanahan
741ea57ed2 pmove: remove unused pmplane struct
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 19:52:10 +10:30
Kevin Shanahan
251b474324 pmove: touchindex member of playermove_t is server only
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 18:12:53 +10:30
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