Commit Graph

274 Commits

Author SHA1 Message Date
Kevin Shanahan
7ff23f9704 model: hack around remaining client/server differences
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 13:14:21 +10:30
Kevin Shanahan
205bcef939 model: add leaf overflow check to QWSV
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 12:53:52 +10:30
Kevin Shanahan
e74e08e909 world: move world.c to common directory
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 09:27:45 +10:30
Kevin Shanahan
55d20d27b5 world: hack around remaining world.c differences
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 09:27:12 +10:30
Kevin Shanahan
ffd6dd4590 world: copy paranoid check into QWSV code
Update the comment while I still remember what that was (probably) about.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 09:17:26 +10:30
Kevin Shanahan
d33296695c world: re-order header includes for merging
Also include the correct model file for SW vs. GL.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 09:14:05 +10:30
Kevin Shanahan
79a44f2fd3 world: fake SV_Error so we can share NQ/QWSV code
Also update one error string on the QWSV side - makes all error messages
identical.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 08:53:04 +10:30
Kevin Shanahan
e63df56984 progs: move pr_edict.c to the common directory
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 16:31:21 +10:30
Kevin Shanahan
4afe9347b6 progs: hack around the remaining differences in pr_edict.c
PR_LoadProgs got a bit messy, but there's still plenty of common code to
make this worthwhile.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 16:30:01 +10:30
Kevin Shanahan
c139514d85 progs: carry over NQ fix for keynames with trailing spaces
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 14:51:05 +10:30
Kevin Shanahan
c41d98ca6e progs: fix arg check in ED_PrintEdict_f
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 14:48:15 +10:30
Kevin Shanahan
c0d8595212 progs: cleanup QWSV edict print debug code
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 14:36:42 +10:30
Kevin Shanahan
8667c0e907 progs: reorder includes in pr_edict.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 14:29:23 +10:30
Kevin Shanahan
6158521300 progs: normalise error strings in pr_edict.c files
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 14:10:12 +10:30
Kevin Shanahan
02795c7686 progs: update an old comment about type_size
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 14:02:17 +10:30
Kevin Shanahan
6fc65c506e progs: NUM_FOR_EDICT's argument can be const
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 13:58:32 +10:30
Kevin Shanahan
49ffa951e0 world: remove some #if 0'd debugging code
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 12:00:11 +10:30
Kevin Shanahan
b29d95b927 world: check for overflow of sv_areanodes
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 11:51:45 +10:30
Kevin Shanahan
8585d004ad world: move world.h to shared include directory
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 11:46:38 +10:30
Kevin Shanahan
e27da6be75 world: merge remaining differences between world.h files
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 11:44:29 +10:30
Kevin Shanahan
5b54008603 world: move SV_AddLinksToPmove to world.c
Removes visibility of the areadnode_t structure from world.h and makes
sv_areanodes private again.  pmove_mins and pmove_maxs no longer need to
be globals in sv_user.c either.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 11:25:30 +10:30
Kevin Shanahan
b8d76716fc world: remove AddLinksToPmove dependence on global pmove_mins/maxs
Apart from this function, sv_areanodes are private to world.c, so prepare
this function to be moved across.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 11:07:50 +10:30
Kevin Shanahan
db9f66ed5b progs: merge progs.h headers and move to include dir
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 09:22:48 +10:30
Kevin Shanahan
500e5325f4 progs: remove unneeded includes from qwsv progs.h
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 09:15:42 +10:30
Kevin Shanahan
d269f32cc6 progs: merge progdefs.h header and move to include directory
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 09:13:27 +10:30
Kevin Shanahan
8e2e532958 progs: move the qcc generated qw progs to progdefs-qw.h
Create the progdefs.h file similar to NQ.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 08:34:00 +10:30
Kevin Shanahan
de501c4b8a model: better include stdint.h header here
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-11 19:18:24 +10:30
Kevin Shanahan
cb8d3fcf4b model: trivial cleanups
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-11 19:12:59 +10:30
Kevin Shanahan
eb908191e0 model: calculate mipadjust in the same way as client
Not referenced by the server anyway, so just make the calculation
consistent.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-11 19:01:07 +10:30
Kevin Shanahan
7beeca27aa model: server bug fixes for loading huge maps
Import fixes related to signed/unsigned shorts from the client BSP model
loading code. Would in theory allow the QW server to load huge maps with
e.g. > 32767 marksurfaces or clipnodes.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-11 18:58:01 +10:30
Kevin Shanahan
0a84c30a7f model: consistently use the function name in error messages
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-11 18:56:36 +10:30
Kevin Shanahan
91a20cca52 model: import Mod_LoadBrushModel improvements into qwsv
Pull in improvements from the client code and minimise syntactic
differences.

- Tidy up the header byte swapping
- Tighter checks on lump sizes and bounds against each other and the size
  of the file
- Zero the flags field
- Calculate the model radius

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-11 18:48:30 +10:30
Kevin Shanahan
e71e7cc26e net: Replace nq's qsockaddr with same netadr_t structure used in qw
The struct qsockaddr used in NQ assumes some things about the binary
comptibility with the OS struct sockaddr_in, which caused some problems
with the networking on at least OpenBSD.  Use the same netadr_t structure
that we currently have in QW.

Would have been nice to split this into smaller sub-patches, but it just
got messy each time I tried to do that.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-11 13:34:49 +10:30
Kevin Shanahan
1d748f806f model: remove some unused code from both model.c files
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-03 20:55:31 +10:30
Kevin Shanahan
6fab3eb423 model: merge modelgen.h files and fix #include fallout
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 16:47:27 +10:30
Kevin Shanahan
41b71e27a5 model: pass loadmodel down into GL_SubdivideSurface
Last external user of loadmodel, so can mark it static

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 11:59:02 +10:30
Kevin Shanahan
c43e6e594e model: mark a whole bunch of functions/globals static
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 11:50:17 +10:30
Kevin Shanahan
3917847936 sys: Make Win32 SleepUntilInput function static
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 09:10:20 +10:30
Kevin Shanahan
845f993b2b sys: remove now unused Sys_File* functions
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 07:34:14 +10:30
Kevin Shanahan
2f5771dfd8 common: remove handle member from pack_t struct
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 07:20:14 +10:30
Kevin Shanahan
457d823b4b trivial: rename a file handle variable
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 07:05:02 +10:30
Kevin Shanahan
dcd2dd68f0 common: convert COM_FindFile to COM_FOpenFile
COM_FindFile now just calls COM_FOpenFile, so rename it and get rid of
the former. Remove use of Sys_FileOpen integer handles and use FILE *
instead. Fix the comment above the funcion in both nq and qw.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 06:59:05 +10:30
Kevin Shanahan
c544ac402c common: convert COM_CopyFile to FILE * APIs 2012-10-26 13:53:23 +10:30
Kevin Shanahan
57fc9dab14 common: Replace COM_Open/CloseFile with standard FILE * operations
Instead of interger handles from sys_*, use standard C FILE * operations,
same as we do for qw already.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-26 13:40:26 +10:30
Kevin Shanahan
5a8ddb7577 common: re-order some includes / declarations
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-26 08:08:10 +10:30
Kevin Shanahan
21b78472c9 common: add -dibonly to qw safe argvs
It's the same video drivers anyway...

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-26 08:06:48 +10:30
Kevin Shanahan
caf91335fb trivial: properly encode non-ascii characters in string
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-25 18:37:13 +10:30
Kevin Shanahan
e833a57537 trivial: another couple of missed trigraphs
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-25 18:25:55 +10:30
Kevin Shanahan
6904db836d common: STRUCT_FROM_LINK is just container_of()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-25 14:18:52 +10:30
Kevin Shanahan
0d9124f631 common: Fix circular include dependency and remove forward declaration
No problem with circular dependency anymore. Also folded in some whitespace
changes to reduce the QW/NQ diff.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-25 14:10:34 +10:30