327 Commits

Author SHA1 Message Date
Kevin Shanahan
2920f920bf trivial: add a couple of FIXME comments for later
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-13 15:54:54 +10:30
Kevin Shanahan
cb67d25fa4 qwsv: annotate SV_Error() with printf format attribute
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-13 15:54:54 +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
Kevin Shanahan
b2f52af711 menu: fix keybindings in menu
The menu files hadn't been updated for the now expanded keysets.

Reported-by: Sander van Dijk <a.h.vandijk@gmail.com>
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-11 21:29:01 +10:30
Kevin Shanahan
a185e4e7d3 sys: actually move the sys_win.c file to the common dir
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-10 10:12:09 +10:30
Kevin Shanahan
4619518f32 sys: hack^Wmerge differences between NQ/QW sys_win.c files
Re-order things, and generally force this squarish peg into the round
hole. Will want to factor out some of the fundamental differences into
different files later to reduce the #ifdef tangles, but at least some
benefit to be gained by having the common code shared.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-10 10:06:37 +10:30
Kevin Shanahan
526cff6ec8 sys: actually move the QW sys_win.c file to common dir
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-09 21:27:54 +10:30
Kevin Shanahan
19f50bb7b0 sys: merge differences between QW client/server sys_win.c
Re-arrange order of functions, where functions are similar add a few
ifdefs to share common code and then add the client/server independent
bits to each file.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-09 20:58:05 +10:30
Kevin Shanahan
e4989d544b input: fix hang on "Are you sure you want to start a new game?" with sdl
When using SDL video/input, the game hangs when we select "New Game" from
the menu and the "Are you sure you want to start a new game?" prompt is
displayed, because we stop processing input events.

This is a bit of a hackish workaround, but will try to untangle this a bit
more later.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-08 07:04:13 +10:30
Kevin Shanahan
d94d220399 client: store topcolor and bottomcolor separately in NQ player_info struct
Simplifies access to the player colors later. Update the sbar usage of
colors to be consistent between NQ/QW as well.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-06 06:10:32 +10:30
Kevin Shanahan
22862ed021 trivial: whitespace - fix some poorly chosen line breaks
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-04 10:16:26 +10:30
Kevin Shanahan
3ee8a28ede sys: return a proper value from main() routines
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-03 20:10:24 +10:30
Kevin Shanahan
49230d2685 sys: move sys_linux.c to common directory
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-02 15:49:15 +10:30
Kevin Shanahan
a0ec7135f1 sys: prepare sys_linux.c files for merging
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-02 15:47:32 +10:30
Kevin Shanahan
10c8aab1c6 sys: remove unused Sys_LineRefresh()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-02 15:04:24 +10:30
Kevin Shanahan
f2df706e27 keys: make global keybindings[] strings const
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-29 09:14:13 +10:30
Kevin Shanahan
0d3ecc861f keys: make Key_KeynumToString return value const
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-29 09:04:16 +10:30
Kevin Shanahan
7173e0191a keys: move Key_KeynumToString to keys.h
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-29 09:03:14 +10:30
Kevin Shanahan
ea6e63220c common: move common.c to common directory
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-28 20:23:33 +10:30
Kevin Shanahan
ea0171a76d common: prepare common.c for merging
A big chunk of stuff here is QW only... to be moved later.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-28 20:22:04 +10:30
Kevin Shanahan
a11dca8d24 common: use consistent filehandle name f in COM_LoadFile
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-28 19:37:32 +10:30
Kevin Shanahan
da63c11562 common: remove -cachedir option from NQ
Used only during development of the game when working over slow
connections remotely  - doesn't seem relevant to doing development
today.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-28 19:30:30 +10:30
Kevin Shanahan
b0720156b8 common: create unified version of COM_Parse for merging
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-28 17:37:16 +10:30
Kevin Shanahan
9574035063 common: fix possible access outside sizebuf in SZ_Print
Bug fixed in QW, copy fix over the NQ and tidy up both functions.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-28 17:05:18 +10:30
Kevin Shanahan
05b99087b9 common: move common.h to shared include directory
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-28 16:52:51 +10:30
Kevin Shanahan
f65962caba common: prepare common.h for merging
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-28 16:52:05 +10:30
Kevin Shanahan
e3fdf97b12 common: make SZ_GetSpace static
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-28 15:48:08 +10:30
Kevin Shanahan
3f535f8856 common: constify COM_Parse and everything that follows...
...which is a lot! This ended up touching a lot of code, especially
when it spread to Cmd_Argv, etc. Mostly just propogating the correct
const qualifiers on pointers, but in some cases it was appropriate to
copy the buffer to e.g. lowercase filename in SV_BeginDownload_f or
re-write parts of functions where the buffer modifications was not
strictly needed (e.g. the *Say* functions).

I guess of note is that I now accept a const pointer into Z_Free,
which shouldn't be a problem since it doesn't modify the data pointed
to at all, just marks it as free.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-28 09:46:42 +10:30
Kevin Shanahan
055aec1f1c common: constify common.[ch] function prototypes
Make as many arguments to functions in common.h as possible const so
the compiler knows we shouldn't be modifying some buffers/strings
passed down here.

Also fixed (but not tested) the COM_BlockSequenceCheckByte function in
QW/common/common.c which has been #if 0'd for a while. Probably won't
keep it around, but fixed for completeness.

I skipped COM_Parse in this patch, will be constified in the following
patch.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-28 07:27:59 +10:30
Kevin Shanahan
fe81ad30b9 sbar: copy qw check for negative sb_weapons array index to nq
Use the qmax macro to clamp the negative values in both cases.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-27 12:01:26 +10:30
Kevin Shanahan
e7839fa7db mathlib: make vector math macros more robust
Wrap the vector macros that don't return a value in do {} while (0)
and fix a couple of missing semicolons detected in the process.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-27 11:03:16 +10:30
Kevin Shanahan
9e1d471f02 entities: clean up long lines and comments in CL_ParsePacketEntities
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-26 20:50:41 +10:30
Kevin Shanahan
18a2aec115 entities: tidy up multi-line ternary experssions in CL_ParsePacketEntities
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-26 20:49:29 +10:30
Kevin Shanahan
a475651b54 entities: push down constness of entities where possible
Pass over the source and make as many references to entities as possible
const. This makes it much more obvious where we are actually making
modifications to the entity_t structure.

Mostly trivial, the only place where I did something other than add the
keyword "const" was in R_DrawBrushModel where we were working around the
reversed pitch bug.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-25 15:49:46 +10:30
Kevin Shanahan
01631f879d entities: only save origins of visedicts for QW object trails
QW was saving the whole visedicts list to scan for origins of objects
during the previous frame so that particle trails can be placed correctly
behind rockets, grenades, etc.

Save the origins and keynums in a simpler struct and remove the double
buffering of the cl_visedicts array.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-25 14:08:20 +10:30
Kevin Shanahan
62d2945013 trivial: whitespace change in cl_pred.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-25 12:45:33 +10:30
Kevin Shanahan
472ca8b59b view: fix weapon position with qw style sbar
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-25 11:10:49 +10:30
Kevin Shanahan
090e2f4c6b screen: make screenshot message consistent
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-25 06:41:22 +10:30
Kevin Shanahan
6f414bc844 screen: remove duplicated max viewsize check
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-25 06:25:02 +10:30
Kevin Shanahan
1d336ef01c screen: remove duplicated viewsize check
oldscr_viewsize was a duplicated check for changes in the scr_viewsize
cvar. Remove it and make the check consistent across all screen.c files.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-25 06:09:08 +10:30
Kevin Shanahan
c2abd3df01 client: remove unused bitcounts profiling data
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-24 11:40:37 +10:30
Kevin Shanahan
6a2940940b entities: fix for handling of lightning/beam temp entities
Unintended re-use of loop variable 'i'.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-23 09:00:43 +10:30
Kevin Shanahan
acfc75321e model: remove gl_model.h and use model.h everywhere
Gets rid of a bunch of conditionals throughout the .c files as well.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-19 13:22:30 +10:30
Kevin Shanahan
344cc52e52 model: hand off skin data loading to helper
Have the helper struct do the renderer specific alias model skin
processing. Will probably want to relocate the code to a more appropraite
place later, but just get the factoring done for now.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-19 05:50:04 +10:30
Kevin Shanahan
1a128ddfbf model: create a model loading helper
Create a model loader structure which can be used to pass callbacks down
from the renderer code. This will allow us to have the render do some
processing on the loaded data at appropriate points and let us make the
actual loading code generic.

In the first instance, pass down the aliashdr_t padding value required by
the renderer.

Note that to remove a circular dependency introduced in the headers, I had
to stop including render.h in model.h/gl_model.h and that change
propogated some more changes to includes across the tree...

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-18 18:32:30 +10:30
Kevin Shanahan
ea72041593 trivial: remove whitespace between type and varable for casts
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-16 12:59:49 +10:30
Kevin Shanahan
2cf6c1576f common: make COM_LoadFile static
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-16 09:09:26 +10:30
Kevin Shanahan
77f4bb3da3 build: allow qwsv to use x86 optimised assembly routines
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 17:57:19 +10:30
Kevin Shanahan
d3c4dff990 trivial: remove unaligned defs since not used anymore
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 16:09:17 +10:30