Commit Graph

451 Commits

Author SHA1 Message Date
Kevin Shanahan
2237b21ec7 server: make QW localmodels local to sv_init.c
And make the strings automatically size for MAX_MODELS.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-23 09:06:49 +10:30
Kevin Shanahan
4502b06f7e server: remove host_client and sv_player from QW completely
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-23 08:48:21 +10:30
Kevin Shanahan
5af236fa2f server: host_client cleanups in SV_UpdateToReliableMessages
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-23 08:42:28 +10:30
Kevin Shanahan
f5dbf8001c server: host_client cleanups in SV_SaveSpawnparms
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-23 08:41:52 +10:30
Kevin Shanahan
b254afaf19 server: pass the client into SV_BeginRedirect for RD_CLIENT
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-23 08:38:39 +10:30
Kevin Shanahan
1cfdfd5cf0 server: cleanup SV_ExecuteClientMessage
Various local variable renames, re-arranging code with overly long
lines and getting rid of references to the global host_client and
sv_player pointers.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 20:39:10 +10:30
Kevin Shanahan
716fe234a9 server: replace instances of sv_player in SV_Begin_f/SV_Kill_f
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 20:38:38 +10:30
Kevin Shanahan
a5eedded2a server: pass the client pointer into user command functions
Change the spec of user command functions to always take a pointer to
the client struct of the executing client. Gets rid of *lots* of
references to the global host_client pointer.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 20:06:06 +10:30
Kevin Shanahan
93d5f53beb server: replace SV_SetPlayer with SV_GetClient and update callers
Make the callers pass in the client id number and for now get them to
also set the global host_client and sv_player variables.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 14:07:47 +10:30
Kevin Shanahan
5b5bfb347b server: make local functions/vars static in sv_ccmds.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 13:01:31 +10:30
Kevin Shanahan
c5068bf779 server: pass current player into SV_AddLinksToPhysents
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 12:50:54 +10:30
Kevin Shanahan
869ac7711a server: do recursive split of long usercmd, same as client
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 12:40:09 +10:30
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