Commit Graph

262 Commits

Author SHA1 Message Date
Tyrann
2ee8c94948 Fix 64-bit compiler warning
Structure member offset is never going to overflow an integer, but may
as well clean up the compiler warning.
2011-12-28 10:18:50 +10:00
Tyrann
59471f9841 [PATCH] Remove a few cosmetic differnces between the view.c files 2009-09-13 17:12:07 +09:30
Tyrann
a342b0708d [PATCH] Remove old (and broken) support for stereoscopic shutter glasses 2009-09-13 13:37:16 +09:30
Tyrann
8557d125e6 [PATCH] Remove unneeded extern declaration
scr_vrect is not referenced anywhere in this file.
2009-09-13 13:36:24 +09:30
Tyrann
2d07433378 [PATCH] Fix a few 32/64 bit warnings
Signed-off-by: Tyrann <tyrann@disenchant.net>
2009-07-05 15:10:55 +09:30
Tyrann
094e9ff554 [PATCH] qwsv: Fix execution of command line parameters
Quakeworld server command line parameters were not getting executed because by
calling the Cmd_StuffCmds() function directly, the cmd_argc variable was not
getting set correctly - causing Cmd_StuffCmds to just print the help text!

Thanks to Frank Haeseler <cryptus@cryptus.de> for reporting the breakage.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2009-01-11 16:34:26 +10:30
Tyrann
4a513d70f6 [PATCH] Fix "end titles" bug in software renderer
Fix a bug in the software renderer where we write past the end of the
rendering context if the end of episode text extends off the bottom of the
screen. The bug had actually been fixed in QW but not NQ, so this patch fixes
both consistently. Thanks to Sander van Dijk <a.h.vandijk@gmail.com> for both
reporting the problem and finding the cause.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2008-06-09 20:56:23 +09:30
Tyrann
27126992b1 [PATCH] pr_cmds.c static functions and variables
Most functions and variables in the {NQ,QW/server}/pr_cmds.c files don't need
to be in the global scope.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2008-04-26 18:38:34 +09:30
Tyrann
7b6a5da600 [PATCH] Mark Host_Error and Host_Endgame with noreturn attribute
Host_Error and Host_Endgame never return, so mark them as such and cleanup a
few unnecessary statements previously used to quiet compiler warnings.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2008-04-26 18:38:34 +09:30
Tyrann
440d9d3d17 [PATCH] __func__ cleanups (cl_parse.c, cl_ents.c)
Signed-off-by: Tyrann <tyrann@disenchant.net>
2008-04-26 18:38:34 +09:30
Ozkan Sezer
968abce535 [PATCH] vid only lives in vid_* files.
viddef_t vid resides in vid_* files and since it's a global it is *not*
supposed to live in multiple files. fixed that stupidity.

Signed-off-by: O.Sezer <sezero@users.sourceforge.net>
Signed-off-by: Tyrann <tyrann@disenchant.net>
2008-04-21 19:20:36 +09:30
Tyrann
e91ce02db8 [PATCH] Increase MAX_MOD_KNOWN consistently
MAX_MOD_KNOWN had already been raised from 256 -> 512 in glquake, but not in
the software renderer or in qwsv. Some maps/mods hit the 256 limit these days
(Contract Revoked was reported to have problems - thanks Sander).

Reported-by: Sander van Dijk <a.h.vandijk@gmail.com>

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-12-09 10:32:39 +10:30
Ozkan Sezer
d2ae079f8a [PATCH] Neater fix for Sys_ConsoleInput
Since we're resetting len to 0, may as well shorten the string in the text
buffer too. Patch from O.Sezer <sezero@users.sourceforge.net>.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-12-09 10:32:19 +10:30
Tyrann
be99f34793 [PATCH] More careful checking of model name buffers
Do some more careful checking on model names string length.
Based on a patch from O.Sezer <sezero@users.sourceforge.net>.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-10-21 19:04:00 +09:30
Ozkan Sezer
d61b29ce1b [PATCH] Fix possible buffer overrun in Sys_ConsoleInput()
Signed-off-by: O.Sezer <sezero@users.sourceforge.net>
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-10-21 19:03:34 +09:30
Tyrann
bc4eefac61 [PATCH] Remove some dead code in QW sys_{win,linux}.c
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-10-02 05:35:15 +09:30
Tyrann
2e2b43826b [PATCH] Printf format/usage fixes
Fix a bunch of incorrect uses and type mismatches in our printf-like functions,
revealed by the previous gcc attribute patches.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-10-01 22:39:39 +09:30
Tyrann
be6880b044 [PATCH] Add gcc "format" attribute to our printf style functions
Annotate our varargs "printf" style functions with the gcc "format" attribute.
This shows up a whole bunch of incorrect usage in our code, so we'll start to
clean that up in subsequent patches. We've also constified the format string
arguments here.

Based on a patch from O.Sezer <sezero@users.sourceforge.net>

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-10-01 22:39:38 +09:30
Tyrann
3e70a0279b [PATCH] Use Con_Printf from console.h for QW server
Seems silly to have the Con_{D,}Printf functions duplicated in different
headers, so just use the definition from console.h. QW server actually
implements the functions in sv_send.c, so this is a little messy, but I still
see it as a small improvement.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-10-01 22:39:38 +09:30
Tyrann
b9ef6b0793 [PATCH] Add gcc "noreturn" attribute to a few functions
Annotate a few functions (BOPS_Error, Sys_Error, Sys_Quit and SV_Error) with
the gcc attribute "noreturn" and clean up a few lines of dead code which were
only there previously to quiet the corresponding compiler warnings.

Based on a patch from O.Sezer <sezero@users.sourceforge.net>

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-10-01 22:39:38 +09:30
Tyrann
508265836f [PATCH] Merge and move pr_exec.c files into common dir
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-16 16:17:46 +09:30
Tyrann
671b49e4e6 [PATCH] Resolve trivial differences in pr_exec.c files
Prepare pr_exec.c for merging - all differences are either trivial whitespace
or just differences in the error functions called.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-16 16:17:46 +09:30
Tyrann
41f4854b20 [PATCH] Grow progs strings table dynamically
Use the new Z_Realloc function to grow the progs string table dynamically as
needed. Some large maps need significantly more than the 2048 entries I had
allocated statically before.

Based on the uHexenII implementation.
Thanks to O.Sezer <sezero@users.sourceforge.net>.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-16 15:29:49 +09:30
Tyrann
25f8800333 [PATCH] Rename min/max macros to qmin/qmax and move to common dir
min/max clashes with another macro in the mingw headers, so just rename ours
to qmin/qmax. Move the definitions to mathlib.h so they can be shared between
QW and NQ.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-16 15:29:48 +09:30
Tyrann
950999685a [PATCH] Hide progs string table internals
Hide the internal workings of the progs string table so we can play with the
implementation.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-16 15:29:48 +09:30
Tyrann
cd64a4ecea [PATCH] Remove nonsensical use of num_prstr from SV_Status output
What possible relevance could this ever have had???

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-16 15:29:48 +09:30
Tyrann
4129f62e63 [PATCH] Merge vid_win.c files and move to common dir
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-09 22:07:41 +09:30
Tyrann
e7d7697f62 [PATCH] Add old "Intellimouse" wheel compat code to NQ
AFAICT this little snippet of code is for compatability with the first
"Intellimouse" drivers, back when mouse wheels were just new. There still
seems to be something wrong with mouse wheel handling in NQ during gameplay
(works in the menu for setting the bindings and on the console for scrolling
the text - just not in the game...)

Anyway, with this patch both vid_win.c files are identical, ready for
merging...

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-09 22:07:34 +09:30
Tyrann
cf9220cde7 [PATCH] Release mouse in NQ/vid_win.c when game loses key focus
Copy over the mouse grab/release code from QW's vid_win.c, which releases the
mouse cursor when the console is down or when the menu is active. This
interacts badly with the way VID_HandlePause() is done, so disable that for
now (I do plan to fix it again later though).

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-09 21:52:15 +09:30
Tyrann
d3b2d0df24 [PATCH] Use window_visible helper function in vid_win.c
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-09 21:52:09 +09:30
Tyrann
a8b64f4992 [PATCH] Make MINIMUM_MEMORY a variable in QW, in line with NQ
Working towards merging vid_win.c, hence the {NQ,QW}_HACK ifdefs for the
includes. NQ assigns a different minimum memory depending on whether we're
playing one of the "official" mission packs. Most likely I should just remove
this special case in the long run, but for now just do the same in QW.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-09 21:52:01 +09:30
Ozkan Sezer
1627407229 [PATCH] Move sound init call site
Moved the sound init call from VID_Init() to Host_Init() in all versions.
while there, removed the unnecessary linux ifdef from the quakeworld init
sequence and made it to use a uniform one.

Signed-off-by: O.Sezer <sezero@users.sourceforge.net>
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-09 21:51:40 +09:30
Tyrann
0b77541f75 [PATCH] Remove silly check for non-zero buffer address
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-09 09:50:02 +09:30
Tyrann
84d52679a5 [PATCH] Fix pr_strings_size calculation
Well, it turns out that progs->numstrings is actually the number of bytes
dedicated to storage of the progs strings, not the number of strings.
Consequently, our attempt to calculate the strings size was completely bogus.
To avoid futher confusion, we'll rename the numstrings member in the progs
header.

Thanks to O.Sezer <sezero@users.sourceforge.net> for pointing this out :)

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-09 09:49:30 +09:30
Ozkan Sezer
5b5a327a47 [PATCH] fixed a minor bug in SV_Map_f of quakeworld
Signed-off-by: O.Sezer <sezero@users.sourceforge.net>
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-08 21:17:39 +09:30
Tyrann
a43160a9c8 [PATCH] Remove unused variable in net_wins.c::NET_Init
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-08 21:16:00 +09:30
Tyrann
ae4977c388 [PATCH] Remove old QW help command
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-08 21:10:26 +09:30
Ozkan Sezer
78654bfc24 [PATCH] Remove unneeded fields from model struct
removed the clipbox, clipmins and clipmaxs members of the model structure:
the header says it to be 'solid volume for clipping (sent from server)',
but the server doesn't do that and cl_ents does a bogus check for clipbox
in CL_SetSolidEntities which is removed now.

Signed-off-by: O.Sezer <sezero@users.sourceforge.net>
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-01 20:24:17 +09:30
Ozkan Sezer
5503f2ecbd [PATCH] Clean up glBlendFunc calls
the default blendfunc is GL_SRC_ALPHA/GL_ONE_MINUS_SRC_ALPHA, no need to
specify unless we use something else.

Signed-off-by: O.Sezer <sezero@users.sourceforge.net>
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-01 20:24:17 +09:30
Ozkan Sezer
e1041e6b90 [PATCH] Fix some argument checking in QW
Signed-off-by: O.Sezer <sezero@users.sourceforge.net>
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-28 19:46:32 +09:30
Tyrann
8f1b328430 [PATCH] QW menu code cleanup
Remove a bunch of unneeded stuff from the QW menu code. Would be nice if the
main menu wasn't just a hard coded image, but oh well.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-18 17:46:41 +09:30
Tyrann
60eccb99e4 [PATCH] Increase the size of the available modes list in Windows
Modern cards have a lot more available modes than just the 30 previously
allowed.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-12 22:24:57 +09:30
Tyrann
ee1e810a1e [PATCH] Incorrect ioctl argument type in QW/common/net_wins.c
NQ already has this correct - must have missed it here.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-12 22:24:51 +09:30
Tyrann
58310474ef [PATCH] Make bsps with more than one sky texture work properly in glquake
Some assumptions about the sky texture in a BSP being unique prevented bsps
with more than one sky texture working properly. Indeed, this could also cause
bad memory corruption when a face with the non-primary sky texture, having
extents greater than the maximum was dynamically lit. The blocklights array is
only sized appropriately for areas <= 256 texels.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-12 14:36:09 +09:30
Tyrann
17e9beeced [PATCH] Add viewsize change test back into QW GL client
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-12 11:12:20 +09:30
Tyrann
ab3fd63b08 [PATCH] Fix a typo from the "whitespace" cleanup patch
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-12 11:12:14 +09:30
Tyrann
2ab43662eb [PATCH] Whitespace cleanups for {NQ,QW/client}/{gl,}screen.c
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-12 09:16:19 +09:30
Tyrann
6c2e13c3de [PATCH] Screenshot code cleanup
Rename pcxname variable to tganame, since the function is actually writing a
Targa file, not PCX. Also, another printf converted to use __func__.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-12 09:16:12 +09:30
Tyrann
1d38ad9de0 [PATCH] Use FLT_MAX macros when bounds checking
Just in case some wierd model or other file is thrown at us where the surface
extents or similar are outside of (-9999, 9999), use the FLT_MAX macro to
ensure we catch everything. I'm yet to see this actually happen in a compiled
BSP, but I do remember being bitten in the qbsp compiler code a while back.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-12 09:16:05 +09:30
Tyrann
0a18302ca2 [PATCH] Make some more net functions static
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-12 09:15:49 +09:30
Tyrann
f176fd9955 [PATCH] Trivial __func__ string cleanups
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-12 09:15:43 +09:30
Tyrann
c01a2e3d31 [PATCH] Remove unused net_send_socket
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-12 09:15:34 +09:30
Tyrann
3a2a6e76e9 [PATCH] Remove unused "IsClientLegal" checks
This code never gets executed, and besides - I like being able to start a
server and client together on my laptop :)

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-12 09:15:20 +09:30
Tyrann
503ee8428b [PATCH] Net address and ioctl cleanup
Attempt to tidy up types used for network addresses - using the standard
"struct in_addr" instead of ints or longs. Also, for our socket ioctl calls to
set non-blocking options, we can use ints - this is apparently the correct
type for this call, according to the IOCTL_LIST(2) man page on my system.

Based on a patch from O.Sezer <sezero@users.sourceforge.net>

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-06 19:56:13 +09:30
Tyrann
04f96ded00 [PATCH] Port QW pr_strings handling to NQ
Copy over the PR_GetString/PR_SetString infrastructure from QW into NQ and
convert all pr_strings users to work via the provided functions. As a happy
side effect I get to remove a very long standing FIXME for dynamically
allocating pr_string_temp, which I added as a workaround so long ago I can't
even remember.

Big thanks to O.Sezer <sezero@users.sourceforge.net> for providing me with the
initial patch which pushed me to get this stuff done!

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-07-30 20:41:55 +09:30
Tyrann
28ea79a6be [PATCH] Implement stricter prog strings checking
When loading progs we calculate the memory used by the strings. Then, in
PR_SetString, we check for strings outside this range (not just on the
negative side). This causes edict strings to end up in the pr_strtbl too, so
need to make it a bit larger (this will be made to grow dynamically later on).

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-07-30 20:41:48 +09:30
Tyrann
c1703fb44f [PATCH] Use stdint types in md4.c
This fixes a map checksum issue for 64-bit.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-07-30 20:41:44 +09:30
Ozkan Sezer
02592e19cc [PATCH] Map command cleanup
removed non-functional mapstring from client_static structure. kept
a copy of the current map name in naked form.  made the map console
command much more informative. made it to return in case no mapname
is given.

Signed-off-by: O.Sezer <sezero@users.sourceforge.net>
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-07-17 21:35:30 +09:30
Ozkan Sezer
d3b02a1b72 [PATCH] Fix loop termination condition in COM_FileBase
fixed COM_FileBase so that it never goes hunting through all memory for '/'

Signed-off-by: O.Sezer <sezero@users.sourceforge.net>
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-07-17 21:34:14 +09:30
Tyrann
3cbf67b0f6 [PATCH] Calculate BSP model checksum only once
When calculating the checksum of the various lumps in the BSP model, the
checksum is being calculated twice for the same data. Just cache the result
from the first pass and use that.

This patch also brings the qwsv code into line with the others and removes an
unused global variable "model_checksum".

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-02-14 18:55:14 +10:30
Tyrann
c50f5630fc [PATCH] Use fixed size integer types for on disk progs structures
The only one that really makes a difference here for systems I'm ever likely
to use is the sizeof(void *) removal, but it's probably a good idea to start
moving towards use of fixed size integer types for all the on-disk structures
throughout the source.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-24 18:30:06 +09:30
Tyrann
13cdaa6d9f [PATCH] Remove unused function Sys_EditFile
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-10 10:21:09 +09:30
Tyrann
8bb4b4946d [PATCH] Fix vsnprintf typos
Fix two instances where I needlessly limited the output length of vsnprintf to
"sizeof(buffer) - 1". Also, fix a typo where I used the incorrect argument for
the buffer size. Reported by Ozkan.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-10 10:20:55 +09:30
Ozkan Sezer
8944c2ee07 [PATCH] Restore game/desktop gamma on focus changes (windows)
Expose the game's gamma ramps so that the video driver can restore the gamma
when it gets focus in/out events from the windowing system. Add calls to
save/restore gamma to the gl_vidnt driver.

Signed-off-by: Ozkan Sezer <sezero@users.sourceforge.net>

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-07 21:34:09 +09:30
Tyrann
a9be5adde0 [PATCH] Add -developer command line argument
It would be nice to be able to use Con_DPrintf a little earlier in the
initialisation process (i.e. before config files are exec'd). Add a
"-developer" command line argument to set this just after the cvar is
registered.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-07 19:05:52 +09:30
Tyrann
138145c9bd [PATCH] vsprintf -> vsnprintf conversions
Convert all instances of un-checked vsprintf calls into vsnprintf. Most
functions switched to MAX_PRINTMSG length buffers instead of 1024. This means
we now silently truncate messages, rather than crashing (preferrably, I
think). This patch is based on some changes proposed by Ozkan.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-07 19:05:47 +09:30
Tyrann
b77e04a80c [PATCH] Compile fix for qwsv on Windows
QW/server/sys_win.c wasn't including sys.h, so didn't get the MAX_PRINTMSG
define. Including the file revealed a couple of inconsistencies in function
prototypes, so fixed those up as well.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-07 19:05:42 +09:30
Tyrann
6f63d878c2 [PATCH] Use MAX_PRINTMSG more consistently
Make the buffer sizes used in various print functions consistently use the
MAX_PRINTMSG define. This patch covers Sys_Printf, Sys_Error, Sys_DebugLog,
Con_Printf, Con_DPrintf and Con_SafePrintf. Note that the NQ/sys_win.c version
of Sys_Error does things a bit differently to the rest.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-07 19:05:38 +09:30
Tyrann
88e38e107f [PATCH] Share common MAX_PRINTMSG definition
Move MAXPRINTMSG to sys.h so it can be shared between the various
users. Rename to MAX_PRINTMSG for consistency with other MAX_ defines.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-07 19:05:34 +09:30
Tyrann
a29672daa8 [PATCH] Free memory from unbound keys
Free up a little extra zone memory by not allocating empty strings for
unbound keys. Thanks to Ozkan for the idea.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-07 07:32:37 +09:30
Tyrann
57a4875a7f [PATCH] Set default basedir at compile time
Allow the default basedir to be set at compile time. This is to help packagers
who want to have the binaries automatically use Quake game data installed on
the system under /usr/local/games/quake or similar.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-24 15:42:06 +09:30
Tyrann
b94bc4d09d [PATCH] Compile fix for FreeBSD
<netinet/in.h> requires <sys/types.h>

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:10:08 +09:30
Tyrann
f090139fe1 [PATCH] Add home directory gamedir overlay
If the HOME environment variable is set, include $HOME/.tyrquake/<gamedir> in
searchpath. This directory will also be used as the location for file writes
(config.cfg, glquake cachedir) as well if available and writeable.

Thanks to Alejandro Pulver for providing the original patch, which I used as a
basis for this implementation.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:10:06 +09:30
Tyrann
25240417d8 [PATCH] Provide multiple buffers for va
Provide multiple buffers for the va function, so one function that uses va can
be called from another. I don't think there's any problem with the current
callers, but I'll need this shortly.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:10:05 +09:30
Tyrann
9d1f4d845a [PATCH] Move Windows CD message handler
Rename the Windows CDAudio_MessageHandler to CDDrv_MessageHandler, as it's
part of the driver, not the generic CD layer. Move the declaration to the
winquake header.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:10:02 +09:30
Tyrann
0c283b87ca [PATCH] Misc include cleanups
Remove unnecessary include of sys/vt.h from gl_vidlinuxglx.c and sys/shm.h
from {NQ,QW/client}/sys_linux.c. Also, it looks like the __linux__ test in
QW/server/sys_unix.c should be __unix__ to get FreeBSD support working. In
that case, why not just remove the conditional altogether.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:09:54 +09:30
Tyrann
20ca0c9e21 [PATCH] Add mcache command to QW
Add the mcache command to the QW client as well, since the Mod_Print function
is already there. Makes more sense to place this command in a client file,
since the models are logically cached client side, so cl_main.c will do for
now.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:59 +09:30
Tyrann
174089405c [PATCH] Move gl_model.h to include dir
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:58 +09:30
Tyrann
68eb9f700a [PATCH] Prepare gl_model.h files for merge
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:58 +09:30
Tyrann
48f49961ff [PATCH] move model.h to include dir
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:57 +09:30
Tyrann
c207d40c1e [PATCH] Prepare model.h files for merge
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:57 +09:30
Tyrann
87a466332b [PATCH] Move model.c to common directory
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:56 +09:30
Tyrann
8e68a12953 [PATCH] Prepare model.c for merge
Differences between the NQ/QW model.c implementations are now trivial to
separate.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:55 +09:30
Tyrann
74fbea2eca [PATCH] Fix sprite cache error
Only alias models should be setting anything in the mod->cache.data field, and
only through Mod_Extradata(). Stop the sprite loading code from setting this
field. This fixes a bug that could occur if an alias model was to replace an
unloaded sprite in the model cache.

Also, set mod->flags back to zero in a couple of places for QW, same as NQ.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:55 +09:30
Tyrann
100a09affa [PATCH] model needload cleanup
Simplify the NQ model cache a little bit, taking on the behaviour of the QW
version. I can't see any real advantage to the extra flags in NQ.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:54 +09:30
Tyrann
e48df16197 [PATCH] model.c trivial cleanups
Minor changes to reduce the NQ/QW model.c diff

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:54 +09:30
Tyrann
c2837f0916 [PATCH] Variable sized structures cleanup
Change over a few variable sized structures to use the array[0] notation
instead of [1] or [4], etc. The ones fixed are glpoly_t, aliashdr_t and
sfxcache_t.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:53 +09:30
Tyrann
6865194f8c [PATCH] menu.c cleanups
Various minor changes to remove spurious differences between QW/NQ menu.c
files. Just whitespace changes and a few const and static keywords added.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:52 +09:30
Tyrann
d5d7c864c6 [PATCH] Fix "Use Mouse" option in menu for NQ/Linux
The "Use Mouse" option was not present in the menu in Linux. Add it back
again. While we're at it, replace all the MS_WINDOWED checks with the generic
VID_IsFullScreen(), to eliminate some platform dependencies from this file.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:51 +09:30
Tyrann
dadcfcafe8 [PATCH] remove unused r_worldmodelorg
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:49 +09:30
Tyrann
a46240e94b [PATCH] Move r_bsp.c into common dir
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:49 +09:30
Tyrann
27840e5e9d [PATCH] Prepare r_bsp.c files for merge
Remove unnecessary differences between the two r_bsp.c files. A few missed
statics in NQ, numerous whitespace/comment formatting differences and one hack
for the cl_entities[0] vs. r_worldentity disparity.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:48 +09:30
Tyrann
aa84c0d8f7 [PATCH] remove _gl_lightmap_sort cvar
Benchmarking didn't show any noticable difference, so removing this cvar and
code path.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:48 +09:30
Tyrann
aba56091ac [PATCH] Remove _gl_sky_mtex cvar
The multitexture sky drawing routines are working fine, so remove the cvar
that turns it on/off and always use it if multitexture is available.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:47 +09:30
Tyrann
c3a1b3a547 [PATCH] Merge d_polyse.c
NQ and QW versions of d_polyse are now identical, so move it to the common
source directory.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:47 +09:30
Tyrann
6b6ff200e3 [PATCH] D_RasterizeAliasPolySmooth merge
Reconcile the differences between NQ and QW implementations of the
D_RasterizeAliasPolySmooth function.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:46 +09:30
Tyrann
6e22425edc [PATCH] Remove unused code in d_polyse.c
Remove some #if 0'd code and an unused function from d_polyse.c

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:44 +09:30
Tyrann
5103e777a2 [PATCH] Remove "unreachable" ifdef'd code
There's some x86 asm conditional code in D_PolysetCalcGradients, but
the function is only defined when not using asm. Cleanup the unused
portion.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:44 +09:30
Tyrann
e9baf553c3 [PATCH] Some extra statics in d_polyse.c
There's a few more things in d_polyse.c which can be made static. Some
of it is a bit more complicated due to dependencies on x86 asm being
on or off. Leave a comment for some of those to be done later.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:43 +09:30
Tyrann
e30996ce3a [PATCH] Use glGenTextures for texture handles
Rather than just assuming that the texture handles that we generate are okay
to use, use the proper glGenTextures function. Note that we're still leaking
textures all over the place (every map load, etc.) - proper texture management
is still needed.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:42 +09:30
Tyrann
3f74b76822 [PATCH] Separate particle logic and rendering
Separate out the particle update code from the rendering code.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:42 +09:30
Tyrann
28c1620932 [PATCH] Obsolete gl_texsort option
Always draw using the texture sorted routines. Remove (obsolete) the
gl_texsort cvar. Removes a bunch of code only used on the non-texsort
rendering path.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:41 +09:30
Tyrann
933761a62c [PATCH] Fix particle z-buffer bug
Disable depth mask before drawing particles to prevent artifacts when
drawing over other semi-transparent textures (e.g. water with alpha).

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:14:03 +09:30
Tyrann
a964026ab9 [PATCH] Fix QW options menu
Fix some logic errors causing the "use mouse" option in the menu to be
unusable. This also fixes potential crash where the NULL vid_menudrawfn could
accidently get called (by not skipping over the disabled menu entry properly).

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:14:02 +09:30
Tyrann
ed3a3265f0 [PATCH] Replace id386 define
It seems the old trick of undef'ing __i386__ was no longer working under
gcc-4.1, so replace the id386 define (controlled by header files) with
USE_X86_ASM (controlled by Makefile).

The checks for id386 in the assembly files are now gone (if you don't want
them, they shouldn't be compiled) and a few extra whitespace cleanups crept
in.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:14:02 +09:30
Tyrann
646f5976f3 [PATCH] Build system update
This is a fairly big change to the makefile system. It does two main things:

- It removes the need to edit the Makefile to build the different
executables. At the moment, it's still necessary to edit the Makefile to
change to/from a debug build or to exclude x86 assembly.

- It removes the need to make clean every time you want to build another
executable. However, the header dependencies are still absent, so you need
to be careful when editing headers, as the object files won't get refreshed
automatically (yet).

All object files now get placed in a 'build' directory, with each
application's object files kept in it's own subdirectory. We also no longer do
a recursive make invocation in each of the application directories.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:13:54 +09:30
Tyrann
737c73e901 [PATCH] Consistent naming and versions
Try to be consistent with:
* the applications name - TyrQuake
* the version number - TYR_VERSION

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:13:52 +09:30
Tyrann
c3893f7b4e [PATCH] Restore QuitMessage in QW
Prefer to use QuitMessage rather than the attribution box in QW, to
bring it into line with NQ.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:13:51 +09:30
Tyrann
628747f95e [PATCH] Define bitfields using shifts
To make the item bitfields a little more readable, define them using
shifts. Tidy up the spacing (tab vs. space) of these particular defines.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:13:51 +09:30
Tyrann
9308c81030 [PATCH] Fix type deplicate -> duplicate
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:13:50 +09:30
Tyrann
da641d0102 [PATCH] world.c cleanups
Mostly whitespace cleanups in the world.c's, and a little one in pmovetst.c
since it's largely copied from world.c. This is mainly to keep the differences
between NQ/QW versions as small as possible.

The only (minor) code changes are a little cleanup of SV_TestEntityPosition
(should be semantically the same) and changing the "backup past 0" message to
be developer only.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:13:23 +09:30
Tyrann
e03177a838 [PATCH] Allow up to 65520 clipnodes
The BSP file format's original design limits us to having 32767 clipnodes by
having the offsets stored as 16-bit signed values. Negative values are to
signify leaf nodes and refer to the CONTENTS_xxx flags defined in bspfile.h.

Since only a handful of values are required for the CONTENTS_xxx flags, we can
make use of all the space on the negative side be being a bit more careful
about how we handle these offsets.

Essentially, we can treat the offset as unsigned and instead of checking for a
value < 0 to signify contents, we check that the value large enough to be
contents. This is binary compatible with existing maps.

I added a helper function clipnode_child() to extract a 32-bit signed integer
value from the dclipnode_t structure. If the child index is large enough to be
a contents flag, we return the negative value. Otherwise, we return the index
between 0 and 65520 (0xfff0).

Hopefully my attempt at updating the asm code looks okay - this part of the
patch is the result of a 1-day crash course in x86 asm.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:13:23 +09:30
Tyrann
b4fcf3d9af [PATCH] move cmd.h to shared include directory
No code changes.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:13:22 +09:30
Tyrann
e062f49aeb [PATCH] Move cmd.c to common directory
No code changes, just move the file and remove the duplicate.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:13:22 +09:30
Tyrann
3127fd10f7 [PATCH] Align cmd.h for merge
May as well merge the header if we've alreay done the source file.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:13:21 +09:30
Tyrann
feaaf9184b [PATCH] Align cmd.c for merge
There's a few more HACKs in this than I would normally like, but there's
enough common code to warrant merging. I'll try to shake out some of the HACKs
later.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:13:21 +09:30
Tyrann
5bfd94281e [PATCH] Old completions cleanup, part 2
Remove all inserts for the old completion tree and remove the rest of the api
and functions from shell.[ch].

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:34 +09:30
Tyrann
6d46449731 [PATCH] Add Cmd_CommandCmplet{ions,e}
Analogous to the arg completion functions, these find the command completions
by looking through the cmd, cmdalias and cvar trees. This will replace usage
of find_completions in the next patch.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:33 +09:30
Tyrann
0178c21f8a [PATCH] Remove old style *_exists commands
Replace the usages of the old style *_exists commands:
cmd_exists()   -> Cmd_Exists()
alias_exists() -> Cmd_Alias_Exists() (new function)
cvar_exists()  -> Cvar_Find()

This allows us to remove the rb_find_exact functions.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:32 +09:30
Tyrann
eae1c79f12 [PATCH] Cmd_FindCompletions fix
Check that the command actually has a completion function before trying to
call it...

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:31 +09:30
Tyrann
7b26558765 [PATCH] STree_InsertAlloc API change
The option of having the node supplied by the caller wasn't ever being used,
so removed. However, there are cases where it's not necessary to duplicate the
string, so add an option for that. All callers updated.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:30 +09:30
Tyrann
ad94cdf3df [PATCH] cmdalias list removal
Use the string tree for all traversals.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:30 +09:30
Tyrann
3caaa7e014 [PATCH] Cmd STree
Replace the linked list for the cmd_function struct with an STree. All uses of
this list were to find a specific function, so they've all been replaced by
Cmd_FindCommand. This means I was able to rip out the ->next member straight
away.

Also, constified stree_node->string in the process.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:27 +09:30
Tyrann
6384ec7f8f [PATCH] Alias STree
Add an STree node to the cmdalias struct. Implement an alias find function and
use it to replace to instances of list walking.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:26 +09:30
Tyrann
66db021e1c [PATCH] Rename string tree API functions
Straight substitution for ST_ functions -> STree_

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:21 +09:30
Tyrann
a8b3b6a2c0 [PATCH] Rename string tree structures
rb_string_root -> stree_root
rb_string_node -> stree_node

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:20 +09:30
Tyrann
596553f6fc [PATCH] Fix error reporting in NET_GetPacket
strerror won't work here, so just return the integer value. At least
we can look that up. Also, I have experienced a couple of instances of
connection reset problems, so I added a check for that.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:19 +09:30
Tyrann
404acc3da2 [PATCH] Update weapon change bindnames
Rename "change weapon" to "next weapon" (because that's what it really
does), and add a bindname for "prev weapon". Thanks to Stephen A.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:18 +09:30
Tyrann
0ffb99b941 [PATCH] Save r_wateralpha value to config.cfg
Even though it's not used in software Quake, it's probably still a good idea
to save it. Thanks to Stephen A.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:18 +09:30
Tyrann
334ef33b38 [PATCH] Remove some printfs from common file functions
Remove some generally not that useful Sys_Printf's from NQ/QW common.c.
Thanks to Stephen A for the initial patch.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:17 +09:30
Tyrann
bfcf3a7bff [PATCH] Fix NQ SZ_GetSpace overflowed flag
Set the overflowed flag on the sizebuf _after_ it is cleared. Otherwise, the
setting is just lost. This fix was alreay in QW. Also following QW's lead on
the printf thing...

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:16 +09:30
Tyrann
40d598f186 [PATCH] Move r_sprite.c to common directory
No code changes, just move the file and remove the duplicate.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:16 +09:30
Tyrann
ef9a3048bb [PATCH] Align r_sprite.c for merge
After adding the static declarations I must have missed at some point, the
files are almost identical. Further inspection reveals a typo only fixed in
one file - we got away with it for now because sizeof(float *) ==
sizeof(float) on 32 bit arches.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:15 +09:30
Tyrann
ff54174fdd [PATCH] Move r_alias.c to common directory
No code changes, just move the file and remove the duplicate.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:15 +09:30
Tyrann
acc2cca951 [PATCH] Align r_alias.c files
Ready to merge these two files.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:13 +09:30
Tyrann
1ced2bc4a1 [PATCH] Move sv_move.c to common directory
No code changes, just move the file and remove the duplicate.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:12 +09:30
Tyrann
8c94ce97e6 [PATCH] Align sv_move.c files
Only very small differences between these files. NQ doesn't even need
quakedef.h, so remove that. Then, guard the unique includes with XX_HACK.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:12:12 +09:30
Tyrann
262b7b7da4 [PATCH] Argument completion for playdemo and timedemo commands
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:08:54 +09:30
Tyrann
feb721761d [PATCH] Map command argument completion
Something I've always wanted to be able to do; allow the user to type
'map x<TAB>' and complete the map name starting with x, if unique. If not
unique, give the common prefix. Press TAB twice for a list of maps starting
with x.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:08:53 +09:30
Tyrann
f9125a82bf [PATCH] Command argument completion callback
Add an argument completion callback to the command struct. Defaults to NULL.

If set, when tab completion is requested on the argument of a valid command,
the callback will be invoked, passing in the partial argument. The callback
then returns a (possibly partially) completed string.

The initial targets for this will be commands like map, playdemo, etc.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:08:52 +09:30
Tyrann
e3aeea570e [PATCH] small Cbuf_AddText cleanup
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:08:49 +09:30
Tyrann
adc34b0359 [PATCH] Various cosmetic changes
Mostly just removing redundant comments and trying to keep the NQ/QW diffs to
a minimum. Also removed a couple of mostly useless Con_DPrintfs and properly
exported Con_ShowTree in console.h.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:08:49 +09:30
Tyrann
2edc0da51b [PATCH] Misc constification
Sprinkling a few const modifiers about the place. Removes some inconsitencies
between similar QW/NQ function prototypes (probably introduced by me at some
point...)

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:08:48 +09:30
Tyrann
c03978c4a8 [PATCH] Increase Sys_Printf buffer
This is a temporary band-aid to fix a problem where the NVidia OpenGL driver
extension string is too big for the current buffer. Will think about doing
something more dynamic later.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:07:59 +09:30
Tyrann
1163a77dbe [PATCH] COM_ScanDir
Introduce a new helper function: COM_ScanDir.

The function populates a string tree with the filesnames found in the
given folder. An optional prefix and file extension can be specified
to filter the results. File extensions can be optionally stripped.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:07:57 +09:30
Tyrann
dd3d6a5ac6 [PATCH] Constify COM_CheckExtension
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:07:56 +09:30
Tyrann
03201f77eb [PATCH] view.c cleanups
* Minor re-formatting
* Remove some cruft, stale comments, etc.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:07:54 +09:30
Tyrann
c2a060dcf8 [PATCH] common.c cleanups
Remove unused function memsearch and make the searchpath variables static.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:07:53 +09:30
Tyrann
de9cc93ee8 [PATCH] Add helper for file extension test
Implement COM_CheckExtension which does a case insensitive test of a
given filename for a particular file extension.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:07:53 +09:30
Tyrann
603a91dae0 [PATCH] gl_rmain minor cleanups
Mostly whitespace edits to removed some unnecessary differences between the
NQ/QW gl_rmain.c files. Fixes a typo (frustom -> frustum) and I ended up using
6144 for the depth of field for both NQ/QW in the MYgluPerspective function.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:06:08 +09:30