Commit Graph

262 Commits

Author SHA1 Message Date
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
Kevin Shanahan
c025057452 common: move MAX_NUM_ARGVS define to common.h
Remove the definition from QW/common/common.c and add it to common.h and
include the header. Remove the definitions from quakedef.h files.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-25 13:51:18 +10:30
Kevin Shanahan
ad6ee08925 fix warnings about printf style format strings
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-24 20:50:37 +10:30
Kevin Shanahan
899bd1ba83 console: add cvar completion support for QW skins
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-24 18:50:39 +10:30
Kevin Shanahan
48a0621852 common: Check paths correctly when scanning pak files
Previous implementation of COM_ScanDirPak completely ignored any path
component in the pak filename. Switch to snprintf in COM_ScanDir as well
while we're at it.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-24 18:50:38 +10:30
Kevin Shanahan
0697ae6dc3 gl: move gl_rmisc.c to the common directory
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-24 09:06:17 +10:30
Kevin Shanahan
b079d4c699 gl: Eliminate remaining differences between the gl_rmisc.c implementations
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-24 09:03:06 +10:30
Kevin Shanahan
57aebdcd64 gl: Rename some variables to improve readability
Improve readability and consistency with the NQ function:
  inwidth -> instride
  tinwidth -> inwidth
  tinheight -> inheight

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-24 08:44:07 +10:30
Kevin Shanahan
d56610dc51 gl: factor out gl texture resampling for skins
Factor out the texture resampling routines for the player skins. QW
needs the extra "stride" parameter because it only uses a
sub-rectangle of the full skin texture.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-24 08:38:44 +10:30
Kevin Shanahan
d2c2c6059c Implement a type-checking clamp macro
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-23 14:27:57 +10:30
Kevin Shanahan
25b7b14943 Use qmin macro to clamp size of player skin
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-23 13:04:46 +10:30
Kevin Shanahan
017cdf3369 Remove unused code from R_TranslatePlayerSkin
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-23 13:03:57 +10:30
Kevin Shanahan
4351d34924 qw: Simplify early-return test in R_TranslatePlayerSkin
Reduces the indentation of the rest of the function by one tab stop
and makes it easier to see the real differences between the qw and nq
implementations.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-23 12:21:28 +10:30