Commit Graph

49 Commits

Author SHA1 Message Date
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
55f533b565 [PATCH] Add ST_MaxMatch function
Introduce a new string tree function, ST_MaxMatch. This will be our main
helper function for tab completion.

Given a partial string, this function will search a string tree for strings
who's prefix matches the partial string. It will then return a string which is
the maximum common prefix of the matching strings (i.e. can be longer than the
given partial string.

For now, if the match is unique, the returned string has a space appended. I'm
not sure if I want to keep it like that as it feels like a bit of a hack. It
will do for now.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:08:51 +09:30
Tyrann
7447181075 [PATCH] Track minimum string length in string trees
Keep track of the shortest string in our string trees. This info is helpful
for string completion.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:08:51 +09:30
Tyrann
c9021d1bfd [PATCH] Small GetCommandPos cleanup
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:08:50 +09:30
Tyrann
6d20b85e3c [PATCH] Re-factor enter key behaviour
Factor out the actions for when the enter key is pressed. This cleans up a few
references to key_lines[edit_line] by passing the buffer in question
instead. More cleanups like this will help with implementing command editing.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:08:50 +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
36483cd0be [PATCH] TyrQuake v0.49
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:08:00 +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
a33ace04ef [PATCH] Make completion work on commands after semicolon
Clean up command completion, making it properly look for the start of the
current command context. This allows command completion to work when we have
multiple commands on one line, separated by semicolons.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:07:58 +09:30
Tyrann
42fce180c8 [PATCH] New command "maplist"
Add a new command "maplist" which will list all the available maps in
the current search path. An optional argument specifies a prefix to
filter the maps listed.

Con_Init is moved to the end of the file to avoid unnecessary forward
declarations.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:07:58 +09:30
Tyrann
2cc2d51a29 [PATCH] Con_ShowTree
Introduce a new function Con_ShowTree. This behaves like Con_ShowList,
only it takes an string tree instead of an array as it's input. The
implementation actually makes use of ShowList, with a little
re-factoring.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:07:57 +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
b743cd0fec [PATCH] String Trees
This defines structures for an RB tree of strings. The intended use of
this is for quick insertion sort of filenames for tab completion and
any other uses. We use the temp hunk for (reasonably) efficient
allocations - at least a little better than loading up the zone with
hundreds of small allocations.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:07:56 +09:30
Tyrann
dd63643adf [PATCH] Hunk_TempAllocExtend
This patch implements a new memory allocation feature, which allows us
to use the "Temp" hunk as an expandable blob of storage space. The
first user of this will be some "string tree" functions, which build
up an RB tree of strings which will be used for sorting file lists.

We could just use Z_Malloc, but the zone isn't well suited to this
type of allocation (potentially hundreds of small struct + string
allocations) and is probably too small.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:07:55 +09:30
Tyrann
87523609fa [PATCH] Remove 'gross' proghack
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:07:55 +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
ba4374c382 [PATCH] Another attempt at glXGetProcAddress/libGL fixes
Okay, I see what's going on now. glXGetProcAddress was only part of
the very recently ratified GLX version 1.4, although Mesa has had it
for a while. glXGetProcAddressARB has been around for much longer and
is in fact part of the official Linux OpenGL ABI.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:07:52 +09:30
Tyrann
ae596a501b [PATCH] Small Makefile cleanups
* Clean up some unnecessary GCC version checking
* Don't ship with -Werror enabled

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:06:09 +09:30
Tyrann
c726211944 [PATCH] Update version number and readme
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:06:09 +09:30
Tyrann
cac8cc0637 [PATCH] Add device gamma setting in Windows
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:06:08 +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
Tyrann
e24ff3553f [PATCH] Use XF86 "Vidmode" gamma extension
This patch sets things up to make use of the XFree86 gamma manipulation
functions.

One issue is that the OpenGL blending substitute we set up is not really the
same as gamma correction because it only brightens pixels according to their
current values. This means black areas are not brightened using this method
(which I think is a good thing), but gamma correction adds "white" to every
area of the screen.

At the moment I've set up the "manual" OpenGL version as a fallback in case
the system gamma functions are not working or not available. I've also set
things up such that the system gamma is not used unless we are in fullscreen
mode since it affects the whole display.

The cvar _gl_allowgammafallback controls whether the fallback is used or not,
but I don't currently have a way to force it to use the "fallback" even if the
other gamma settings work. Most likely I'll separate out the two functions
into gamma and "intensity" similar to Quake 2 and later games.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:06:07 +09:30
Tyrann
0dc8ce064e [PATCH] Start separating cshift and gamma concepts
If we're doing hardware gamma, we probably don't want to be making adjustments
everytime an effect goes off (do we?) so it's only really for the "brightness"
slider (gamma cvar).

V_UpdatePalette seems to be wanting to mix together the colour shift effects
from damage, quad, etc. with gamma correction. For now, we'll remove the
colour shifting aspect from the gamma setting code (done with calls to
VID_ShiftPalette) and rely on the gl_polyblend mechanism for that.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:06:06 +09:30
Tyrann
332c2096e9 [PATCH] Remove unnecessary palette calculations
Remove some palette calculations from GLQuake, since the results are not used.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:06:05 +09:30
Tyrann
e06162fb31 [PATCH] Gamma correction for GLQuake
Implement hardware independent gamma correction for GLQuake. This comes at a
fill-rate cost since we cover the whole scene with an alpha blended poly.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:06:04 +09:30
Tyrann
fbe64f6157 [PATCH] GL_MAX_TEXUTRE_UNITS compat fix
Compatibility fix for GL_MAX_TEXTURE_UNITS (only defined since OpenGL
API version 1.3)

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:06:04 +09:30
Tyrann
7e2ff0ee90 [PATCH] gl_mesh cleanups
Cleanup path handling in gl_mesh.c.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:06:03 +09:30
Tyrann
d38c89376f [PATCH] CD volume control for Linux
Stolen from uHexenII (thanks Ozkan and Steven A)

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:06:02 +09:30
Tyrann
bc5f2818ec [PATCH] Set host_hunklevel before exec quake.rc
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:06:01 +09:30
Tyrann
fad8675cb6 [PATCH] Fix mousewheel handling in X
We may want to make the buttons configurable in the future, but this will be
correct for the vast majority of the time.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:06:01 +09:30
Tyrann
b01adb5ade [PATCH] Save mlook state in config.cfg
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:06:00 +09:30
Tyrann
4d16cd2a4c [PATCH] basedir cleanup
Use a com_basedir in NQ, as in QW.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:06:00 +09:30
Tyrann
572e72be3f [PATCH] Re-factor console list formatting
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:05:59 +09:30
Tyrann
87d896fa44 [PATCH] small cleanups in gl_vidlinuxglx.c
Remove some silly casts (even if the compiler does complain...) and
remove some unwanted whitespace.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:05:59 +09:30
Tyrann
41ca3bbe47 [PATCH] Workarounds for glXGetProcAddress quirks
Some people using the Nvidia binary driver on their systems are having
trouble with linking against libGL since glXGetProcAddress is not
defined. These systems seem to often have the Mesa GL headers
installed, so I can't detect this problem at compile time. Apparently
glXGetProcAddressARB is part of the Linux OpenGL ABI, so it should be
safe to always use that.

I've implemented this as a workaround in the Makefile in the hope that
the situation will resolve itself in the various libGL implementations
eventually and I'll be able to just use the headers reliably. If I
really have to make it a portable binary, I'll just have to do some
dlopen magic in the future.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:05:58 +09:30
Tyrann
04a7a84053 [PATCH] Dead code removal
Remove some dead code and a small whitespace fix.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:05:57 +09:30
Tyrann
bd9dcd087d [PATCH] APIENTRY cleanup
APIENTRY is usually defined by windows.h - this seems to be the easiest way to
deal with it as long as it's only ever a #define elsewhere and not a typedef
or something wierd like that.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:05:57 +09:30
Tyrann
04fbd7465e [PATCH] char signedness fixes
Fix some of the more sensible char signedness warnings thrown out by GCC-4.0

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:05:56 +09:30
Tyrann
fef654d729 [PATCH] Missing semicolon in cl_input.c
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:05:55 +09:30
Tyrann
9da55bab84 [PATCH] Cleanup dlight colour handling
Keep all the standard colours in one place to make changes easier.
Change the dlight colour to a pointer.
Try to set the colour properly everywhere.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:05:55 +09:30
Tyrann
f2c3f40032 [PATCH] GCC4 - socklen_t fixes
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:05:54 +09:30
Tyrann
2e90f72759 [PATCH] in_klook is static
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:05:53 +09:30
Tyrann
9dcac1721d [PATCH] Colour for all dlights
This patch adds a colour field to NQ dlights, removing one more difference
between the NQ and QW source bases.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:05:53 +09:30
Tyrann
130e22195a Import v0.47 sources 2006-09-10 19:02:51 +09:30