249 Commits

Author SHA1 Message Date
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
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
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
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
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
Kevin Shanahan
f94f9cbc78 net: switch from winsock to winsock2
Nothing really to change except the headers included and the library to
link against. Switched on WIN32_LEAN_AND_MEAN, so had to add a few extra
includes for that.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-01-17 08:39:50 +10:30
Kevin Shanahan
9c8f935017 net: constify qpic_t usage
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-22 16:28:28 +10:30
Kevin Shanahan
8e1cb8076d sbar: constify qpic_t usage
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-22 16:26:09 +10:30
Kevin Shanahan
f568a9ab75 menu: constify qpic_t usage
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-22 16:25:06 +10:30
Kevin Shanahan
825410fd21 skin: consolidate error paths in Skin_Cache
Also sanity check skin filename string buffer.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-22 15:43:58 +10:30
Kevin Shanahan
e4e756bb88 common: return void * from COM_Load*File
Remove unneccessary casts from callers.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-22 15:43:10 +10:30
Kevin Shanahan
725e244599 sbar: constify Sbar_DrawString and make static
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-22 14:57:18 +10:30
Kevin Shanahan
2383fae7ac common: constify basedir parm and remove cachedir
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-22 14:45:16 +10:30
Kevin Shanahan
0d36840690 menu: remove unused declaration of M_CachePic
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-22 14:35:18 +10:30
Kevin Shanahan
11cdcce576 client: constify svc_strings (and make static)
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-22 14:19:18 +10:30
Kevin Shanahan
83a33111a6 net: constify returned string on NET_AdrToString
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-22 07:27:17 +10:30
Kevin Shanahan
1e822c0205 trivial: whitespace
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-20 16:03:23 +10:30
Kevin Shanahan
e154c566f3 trivial: whitespace and comment cleanup
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-20 08:50:35 +10:30
Kevin Shanahan
92adc9f0c7 trivial: remove unnecessary snprintf buffer termination checks
Lost my mind for a while there - snprintf always terminates the
buffer. A couple of minor tidy ups in nearby code while I was looking
over all the calls.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-19 12:19:08 +10:30
Kevin Shanahan
ee389ca9a3 common: make COM_StripExtension work in-place
Rather than needing external checks on the output buffer, or adding a
"max length" parameter and needing to check for overflow, etc., make
COM_StripExtension modify the existing string.

Callers updated as needed.

A personal note that I finally realised that snprintf always zero
terminates the output buffer! So that should tidy up existing code a
little more and makes it an even better replacement for strncpy in
almost every case.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-19 11:50:17 +10:30
Kevin Shanahan
6ea7d078bb common: trivial MSG_ReadString cleanups
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-19 09:36:45 +10:30
Kevin Shanahan
5ca9e3f44c client: tidy up snprintf handling in CL_ProcessUserInfo
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 21:18:25 +10:30
Kevin Shanahan
0ebd2471f1 client: clean up handling of MSG_ReadString buffers in cl_parse.c
Generally try to consistently handle buffers where MSG_ReadString is
concerned. Scary the number of places where buffer sizes are
incorrectly handled.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 21:13:37 +10:30
Kevin Shanahan
f2a0768356 client: protect against lightstyle overflow
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 20:27:29 +10:30
Kevin Shanahan
644367c3ef client: remove temp buffer from A2C_CLIENT_COMMAND
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 20:17:21 +10:30
Kevin Shanahan
bd2a7d493e cmd: make Cbuf_AddText accept printf formatted strings
Reduces a bit of the extra buffer copying and reliance on va(). Buffer
length checks for a few cases now consolidated into one place.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 15:35:38 +10:30
Kevin Shanahan
7a9781d91e client: remove stufftext debugging printf
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 13:27:56 +10:30
Kevin Shanahan
bdef5d75ba screen: move screen.c file to common dir
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 08:55:52 +10:30
Kevin Shanahan
5a740d010c screen: merge differences between screen.c files
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 08:55:05 +10:30
Kevin Shanahan
72f8fd974d screen: remove duplicate definition of sb_lines
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 08:18:22 +10:30
Kevin Shanahan
3fb9f56f03 screen: move gl_screen.c file to common dir
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-16 21:30:35 +10:30
Kevin Shanahan
47405f3b05 screen: merge differences between gl_screen.c files
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-16 21:29:45 +10:30
Kevin Shanahan
731442d51a common: replace some use of SZ_Print with MSG_WriteString
SZ_Print is really meant for occasions where we need to build up a
string via strcat into the sizebuf - MSG_WriteString is more
appropriate in the cases fixed here, usually following a
MSG_WriteByte() anyway, so nothing to append to. Use the
MSG_WriteStringf variant where appropriate to reduce reliance on the
va() buffers.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-14 09:38:49 +10:30
Kevin Shanahan
6ae4787957 common: make use of MSG_WriteString{,v}f
Gets rid of a few randomly sized intermediate buffers and potential
overruns.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-13 15:54:54 +10:30
Kevin Shanahan
e227a1da93 qw: get rid of simple_crypt obfuscation
Presumably a simple anti-cheat precaution to stop people running "strings"
on the binaries in the days before the source was available. The
de-obfuscated strings are sent over the wire in the net protocol anyway.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-13 07:08:46 +10:30