Commit graph

1727 commits

Author SHA1 Message Date
Brian Koropoff
5870c2cbce Nuked some code obsoleted by reference counting. 2003-01-31 21:47:16 +00:00
Bill Currie
05fb5f9fb2 partial cleanup. more to come later :) 2003-01-31 20:51:04 +00:00
Brian Koropoff
48c3e5a6c3 Fixed a stupid, stupid bug. 2003-01-31 20:36:39 +00:00
Bill Currie
93b767d4e0 reduce the heavy pointer dereferencing needed to access the sound plugins 2003-01-31 20:19:42 +00:00
Bill Currie
c103d77157 make SND_ClearBuffer get called directly by Block/UnblockSound and remove
S_ClearBuffer from the api
2003-01-31 19:55:21 +00:00
Bill Currie
881e7918c2 cut some overhead on sound rendering 2003-01-31 19:14:12 +00:00
Bill Currie
570a72497f patches from the FreeBSD ports that are still applicable 2003-01-31 18:19:55 +00:00
Bill Currie
c788a2ea57 remove a redundant call to S_Init_Cvars and call S_ClearBuffer when sound
is blocked and unblocked.
2003-01-31 17:56:05 +00:00
Brian Koropoff
b0e6f46b7e GIB: Even more bugfixes. 2003-01-31 05:22:20 +00:00
Bill Currie
3e693cbce5 change the default of sys_dead_sleep to 0 2003-01-31 04:51:35 +00:00
Bill Currie
fdb74e1aba win32 doesn't like random 2003-01-31 04:40:40 +00:00
Brian Koropoff
47d35f3e2d GIB: Added ifnot, fixed several bugs, updated zoom.gib yet again. 2003-01-31 03:43:56 +00:00
Brian Koropoff
580ca17546 GIB: Added proper reference counting on parse trees, got threads working
again, added a few new builtins and renamed some others, made misc. fixes
and enhancements.
2003-01-30 23:26:43 +00:00
Brian Koropoff
4ee0c42dcc Made GIB var substitution use cvars as a last resort. 2003-01-30 20:43:57 +00:00
Brian Koropoff
15687970b3 Fix a braino that caused COM_execute_sets to work improperly. 2003-01-29 22:46:24 +00:00
Bill Currie
8a9cd78072 fix up a couple of error cases (and catch them!) 2003-01-29 20:32:44 +00:00
Brian Koropoff
1f5cabcba9 A few GIB bugfixes, cleanups, and enhancements. Still more to come. 2003-01-29 04:34:23 +00:00
Brian Koropoff
06cd013fc6 Fix for older compilers that only allow variables to be declared at the top
of a program block.
2003-01-28 23:55:21 +00:00
Brian Koropoff
1668dd5c1a Whoops, missed these. 2003-01-28 22:37:34 +00:00
Ragnvald Maartmann-Moe IV
979ee7b2f8 Fix misleading comment and cvar documentation. 2003-01-28 21:31:55 +00:00
Brian Koropoff
59fbd48a81 Overhauled GIB to parse scripts in advance, among other design and language
changes.  There still remains some bugs to be squashed, a feature or two to
add, and some polishing to be done.  However, it seems to be in a workable
state.
2003-01-28 21:16:21 +00:00
Bill Currie
ba12255550 get the qfs variable substitution more-or-less working 2003-01-27 21:56:30 +00:00
Bill Currie
fd5695eb03 hash.[ch]:
add Hash_Free to ease freeing of hash table entries.
quakefs.c:
	beginnings of proper variable subtitution in qfs. not yet working but
	it compiles.
2003-01-27 18:16:15 +00:00
Bill Currie
55bec57b18 get -game working again (well enough for "nq-x11 -game slide" to work,
anwyay:)
2003-01-22 20:00:46 +00:00
Bill Currie
1342533234 make the PF_Find search field error more informative 2003-01-20 21:28:36 +00:00
Bill Currie
c5eb7d6e94 bring back the screen saver code 2003-01-16 21:44:42 +00:00
Bill Currie
341b6a1d68 this /should/ fix the windows server input problems. based on Timmmm's fix. 2003-01-16 16:11:28 +00:00
Bill Currie
d63cde4103 import the GL_ARB_texture_cube_map defines 2003-01-15 18:26:58 +00:00
Bill Currie
0ea15c3f82 sw and gl fisheye patches from Arkadi Shishlov (arkadi@it.lv). I don't
think /I/ can play that way (dizzy:)
2003-01-15 16:53:34 +00:00
Bill Currie
761a7546dd re-arrange things so __attribute__ and __builtin_expect are properly
autoconfiscated so rcsid will continue to work with gcc 3.3
2003-01-15 15:31:36 +00:00
Bill Currie
a4dfef63c3 make all files with rcsid include config.h 2003-01-14 20:18:29 +00:00
Bill Currie
9323f359db move the default GameCode definitions from qw:* and nq:* to QuakeWorld and
Quake as that seems to be a more logical place for them.
2003-01-13 17:32:00 +00:00
Bill Currie
c9204e3237 forgot the path for nq games 2003-01-13 16:46:13 +00:00
Ragnvald Maartmann-Moe IV
e2d199cfb2 Try to open graphics at desktop bit depth, rather than 8bpp. Might explain some very grainy windows screenshots... 2003-01-12 16:58:31 +00:00
Bill Currie
3b9e7db882 fix the skins dowload location issue (not really to my satisfaction, but it
will do for now)
2003-01-10 23:07:04 +00:00
Bill Currie
2e0ed3377c basic (very!) implementation of the new filesystem directory struture code.
All the details of game directories will be fully configurable (search
paths and gamecode file name currently supported). Downloading of skins to
qw/skins only currently broken (will download to $gamedir/skins for now).
2003-01-10 22:47:18 +00:00
Bill Currie
f8eda03b63 fix a const correctness issue 2003-01-09 17:06:27 +00:00
Bill Currie
0926ab64ec make the plugin cvars rom rather than archive 2003-01-08 22:42:55 +00:00
Ragnvald Maartmann-Moe IV
34d4483424 white noise, er space. 2003-01-08 01:46:28 +00:00
Ragnvald Maartmann-Moe IV
d2820cd857 Reduce code duplication, kill a function used by only one caller.
Also disables a workaround for "interpolation seams" that I believe to be an old DRI bug. If anyone has skybox (not dome!) seams, try altering the ftc `if 0` to `if 1`.
2003-01-07 22:12:54 +00:00
Bill Currie
9538e009b7 small bit of cleanup 2003-01-07 20:02:30 +00:00
Bill Currie
e7d138e727 string const correctness 2003-01-06 21:41:46 +00:00
Bill Currie
ca720c26a5 blah, forgot about no-asm :P 2003-01-06 19:05:51 +00:00
Bill Currie
71196fedf6 make gcc more anal about prototypes, string constants and function
visibility (ie, global functions must have a prototype)
2003-01-06 18:28:13 +00:00
Bill Currie
6b705adc31 fix a missed libasm -> libvid_asm change 2003-01-04 03:08:32 +00:00
Brian Koropoff
c522970a88 Added a GIB event system for registering GIB callback functions to be
started when a named event occurs.  Added a few test events to the qw
client and server.  Cleaned up the range GIB builtin a bit.
2003-01-03 04:30:38 +00:00
Brian Koropoff
79a638198d Fix a memory leak. 2003-01-03 04:15:32 +00:00
Brian Koropoff
091e9d3f3d A few cleanups, and made assignment/incremement/decrement operations
return a value.
2003-01-03 04:10:50 +00:00
Bill Currie
8a2fbf43a7 alphageek's crosshair patch modified so it's crosshair 3 (need to port this
to the sw renderer's:/)
2003-01-03 03:36:45 +00:00
Bill Currie
f75c88b247 work around a gcc (GCC) 3.1 20020420 (prerelease) bug in darwin (ppc?) 2002-12-20 23:49:11 +00:00
Bill Currie
dbd5b16883 rename the convenience libs to avoid problems with libx11 vs libX11 on
darwin (damn case insensitive file systems :P)
2002-12-20 23:40:47 +00:00
Bill Currie
1130eed85a make the "no mouse" error message a little more informative 2002-12-19 16:58:44 +00:00
Bill Currie
c85fd3bd56 fix a potential underflow and plug a memory leak 2002-12-18 20:53:49 +00:00
Bill Currie
637de7b687 chage PL_ObjectForKey to take a plitem directly and typecheck the item 2002-12-18 16:09:47 +00:00
Brian Koropoff
f03cc28b7d Fixed dsvprintf to work with different implementations of vsnprintf. 2002-12-17 22:35:14 +00:00
Bill Currie
a84b6bba5d make stuff static that can be and nuke some useless stuff 2002-12-16 23:26:14 +00:00
Bill Currie
ee868367d5 we don't currently support scitech's mgl 2002-12-16 21:57:36 +00:00
Bill Currie
d332a9f5ae remove useless file 2002-12-16 21:09:25 +00:00
Bill Currie
86ed9e1130 add some missing ()s 2002-12-16 19:39:02 +00:00
Bill Currie
1c4b40c291 similar cleanups to vid_svgalib.c 2002-12-16 19:36:46 +00:00
Bill Currie
80146121dc require an 8 bpp mode 2002-12-16 19:36:14 +00:00
Ragnvald Maartmann-Moe IV
4b32916298 Legibility. Whitespace. Stuff like that. 2002-12-16 19:26:53 +00:00
Bill Currie
e381d2a0fc remove vid_mode and the mode description commands 2002-12-16 19:23:41 +00:00
Bill Currie
1311773a90 make -svga mode selection consistent with -x11 etc and also fix the mode
matching algo so it actually works
2002-12-16 18:50:09 +00:00
Ragnvald Maartmann-Moe IV
f053f3b70f Whitespace. Grr. 2002-12-16 17:59:45 +00:00
Brian Koropoff
2c643cde47 Reworked _dvsprintf a bit to make it cleaner and fix a segfault when
appending to large strings.
2002-12-15 07:01:50 +00:00
Brian Koropoff
19ac57dafc Fixed a bug with aliases and updated cb.gib a bit. 2002-12-14 20:34:20 +00:00
Bill Currie
b8216807fe fix a warning 2002-12-14 01:56:37 +00:00
Brian Koropoff
32e5e6ef0b Numerous GIB bug fixes and optimizations. Fixed/updated some GIB scripts
as well.
2002-12-13 23:36:05 +00:00
Bill Currie
31969b67ad a couple of missed cleanups from the screen merge 2002-12-12 05:12:09 +00:00
Bill Currie
37c5bb6ec6 merge the bulk of the three screen files into r_screen.c so all common code
is shared.
2002-12-11 17:34:48 +00:00
Bill Currie
bf3fa3dc76 remove some dead code and a lot of unnecessary diffs 2002-12-11 16:45:40 +00:00
Bill Currie
ca55210c6e remove some redundant steps 2002-12-11 05:46:42 +00:00
Bill Currie
88f7b9ae84 it's rgb, not rbg 2002-12-11 05:33:54 +00:00
Bill Currie
15655c23cd get snaps working properly 2002-12-10 18:24:38 +00:00
Bill Currie
c158f0028b fix gl_stub so it works again and also get the gl functions being looked up
properly
2002-12-10 15:30:16 +00:00
Bill Currie
7da551d044 the output is rather mangled but the client no longer crashes 2002-12-10 05:04:30 +00:00
Brian Koropoff
74ee0cfd0e Changed the behavior of field::get with a null field separator to match
that of for loops.  Added support for var++, var--, var += foo, var -= foo,
var *= foo, and var /= foo.
2002-12-10 00:04:15 +00:00
Bill Currie
de7299a64f don't crash when doing a remote screenshot 2002-12-09 17:47:12 +00:00
Brian Koropoff
91266619f3 Added the sqrt and abs math functions and the continue GIB builtin. I
changed where a loop program gets copied back into its buffer so that the
continue builtin would work.
2002-12-08 20:55:40 +00:00
Brian Koropoff
0a8ff6a8cf In addition to .gib files, anything exec'ed from within a GIB buffer is now
put in a new buffer on the stack and stripped of comments.  Fixed an
instance of a function name that I forgot to change in cb.gib.
2002-12-03 05:54:13 +00:00
Ragnvald Maartmann-Moe IV
46a093faba Change sv_use_curses default to 0, until curses has scrollback support. 2002-12-02 20:03:12 +00:00
Bill Currie
92ea1de504 apply Kaare Slettnes' key name extention patch (Closes: #62) 2002-12-02 16:26:18 +00:00
Brian Koropoff
714f2ced4c Fixed several GIB bugs, optimized Cbuf_Execute_Stack a bit, changed QW
clients to use a separate buffer for stufftext commands.
2002-12-01 07:22:42 +00:00
Brian Koropoff
f1279be1e5 Fixed a segfault with very high resolutions. 2002-11-23 05:47:17 +00:00
Brian Koropoff
a62a92c1be Fixed regex::extract to start at the correct argument when setting the
value of variables.
2002-11-21 00:20:39 +00:00
Bill Currie
ee30860cef fix a bunch of ;; typos 2002-11-20 21:44:04 +00:00
Bill Currie
d78f34e795 fix some spelling errors 2002-11-20 21:21:22 +00:00
Bill Currie
261dcfe2a3 FreeBSD patch from q (see what happens for the other BSDs) 2002-11-20 17:20:52 +00:00
Brian Koropoff
854f6d9054 Created gib_regex.[ch] to manage regular expressions in GIB. Regexs are
now cached and only recompiled when compile flags change.  Changed regex
builtins to take an options string argument after the regular expression.
2002-11-19 06:24:29 +00:00
Bill Currie
1251cbda9e gee, you'ld think gnu would get pointer <-> int portability right :P 2002-11-19 05:40:04 +00:00
Bill Currie
a17673bb69 fix some warnings 2002-11-19 04:34:44 +00:00
Brian Koropoff
0e0d8bd542 Added support for enclosing embedded commands in $() and cleaned up the
parser a bit to accomodate this.  Backslashes in double quotes are now only
removed if they escape a character that can't be written normally, or
another backslash.  Removed start position support from string::findsub
since variable slices can be used instead.  Added support for regular
expressions in the form of regex::match, regex::replace, and
regex::extract.  Checked in regex.c from GNU regex 0.12 for platforms that
do not have regex functions in their standard library. Two minor changes
were made to this file to fix gcc warnings.  Prepared the path transform
function for a change to a filesystem rooted at fs_userpath instead of the
current gamedir, but these changes are commented out pending security
considerations.
2002-11-19 04:15:36 +00:00
Brian Koropoff
acbd838b09 Fixed a format string and added a cast to some pointer arithmetic. This
fix compile problems on non-intel archs.
2002-11-17 00:12:14 +00:00
Brian Koropoff
d4b1c74866 Added the string::findsub builtin. Added a reset function to the cbuf
interpreter struct so that custom cbuf data can be reset after an error.
This fixes a bug where GIB would think it was still waiting for a return
value after an error occurred in an embedded command.
2002-11-16 20:56:04 +00:00
Brian Koropoff
ac8169ba54 Changed file::find to take the path and glob as one argument. Made some
miscellaneous file access cleanups.
2002-11-16 03:52:07 +00:00
Bill Currie
f26ec7377c fix an uninitialized variable 2002-11-16 02:03:39 +00:00
Brian Koropoff
78785a90f8 Added a primitive interactive mode to carne and modified the file::read
GIB builtin to use Qopen instead of COM_LoadHunkFile.  This makes it work
properly in carne.
2002-11-15 23:27:07 +00:00
Bill Currie
06df342655 fix a stray ; 2002-11-15 14:56:57 +00:00
Bill Currie
2ad18a404b don't double print Sys_Error messages when the print function is still
the default
2002-11-14 22:17:25 +00:00
Bill Currie
d1199f23da get categories working in the runtime :) 2002-11-14 20:42:48 +00:00
Bill Currie
e544c1247f fix a clobbered by longjump warning 2002-11-14 15:37:09 +00:00
Brian Koropoff
625e1e36d6 Added Sys_PathType, which reports whether a path is absolute, relative
below, or relative above (uses .. to ascend the filesystem). Changed
file functions in GIB to use this.  GIB can now be initialized in a
non-sandboxed mode, which at the moment means that GIB scripts run with
carne can access the entire filesystem.
2002-11-14 05:28:54 +00:00
Brian Koropoff
7b0c24a386 Added carne, the stand-alone GIB interpreter. Made a few changes to GIB
to accommodate it.  Added the strict flag to cbufs, which causes an error
to be generated when a command is not found instead of just warning the
user.  GIB buffers have the strict flag set by default.
2002-11-14 02:10:55 +00:00
Bill Currie
6ce0abe536 more alpha compile fixes. Closes: #60 because while it started out for
0.1.1 it developed into an alpha compile issue for 0.5.2
2002-11-13 20:20:50 +00:00
Bill Currie
836c469737 sys.[ch]:
handle SIGFPE and allow the registered signal handler to do recovery
	rather than bail
progs.h, pr_exec.c, pr_load.c:
	if pr_faultchecks is 1 (0 is default), handle division by 0 gracefully
	by loading the maximum representable number into the answer
	Closes: #58
the rest:
	kill the SIGFPE stuff
2002-11-13 19:26:44 +00:00
Brian Koropoff
cef0d957e2 Added useful error messages to the math parser, cleaned up implied
multiplication a bit, and added some whitespace to cbuf errors for
readability.
2002-11-13 03:03:37 +00:00
Brian Koropoff
0f71b02fd7 Changed the name of GIB builtins from string.length to string::length, etc.
Made a few miscellaneous cleanups and enhancements to builtins and changed
all the GIB scripts in CVS to reflect the new naming conventions.
2002-11-11 01:57:34 +00:00
Bill Currie
aa5ad0f0f9 don't use glXGetProcAddressARB to look up the glX functions. hopefully fixes
the nvidea segfault
2002-11-10 23:31:19 +00:00
Bill Currie
498bdcc406 compile fixes for alpha linux 2002-11-10 02:50:42 +00:00
Bill Currie
5f606a2829 \r terminates a line only if followed by \n or the end of the buffer 2002-11-09 07:58:34 +00:00
Brian Koropoff
b40400d59c Moved GIB into libs/gib and made util no longer depend on it. Cleaned up
some cruft from a previous incarnation of GIB.
2002-11-09 07:13:52 +00:00
Bill Currie
1dfbf4ba7e win32 compile fixes 2002-11-08 23:13:52 +00:00
Bill Currie
a5ead00f8e small bit of cleanup 2002-11-08 17:13:23 +00:00
Bill Currie
3d44623b57 change Cmd_Exec_File's api so it can conditionally use normal or quake
file system accesses. fixes the map.cfg exec problem
2002-11-08 16:39:28 +00:00
Bill Currie
d46b37f940 use COM_CompressPath 2002-11-08 03:35:22 +00:00
Bill Currie
ec0273e3dc do a pre and post pass for maps/mapname.cfg and use maps_default.cfg if
maps/mapname.cfg doesn't exist.
2002-11-08 02:43:04 +00:00
Bill Currie
71e95ee26f stop lying about responding to Delete events 2002-11-06 17:09:01 +00:00
Bill Currie
eeb4e4f9a9 how that got past my compile tests is beyond me 2002-11-06 14:56:39 +00:00
Bill Currie
ca4b3acd6c big protototype cleanup. Now, except for a few cases, all non-static
prototypes are in headers files.
2002-11-05 19:12:51 +00:00
Bill Currie
1a6a9f177d make error reporting a little saner (hopefully) 2002-10-31 23:00:13 +00:00
Bill Currie
7a195bb910 revert my fs code subversion (2001/07/17 22:10:20 utc commit) as it's no
longer necessary with the new progs loading code
2002-10-30 03:35:20 +00:00
Bill Currie
37e2aa8ad5 remove some dead functions 2002-10-30 02:43:23 +00:00
Bill Currie
912db0336e clean out the cmdlib crap from quakefs.c and nuke qfcc's last dependency
on cmdlib.h (and nuke qfcc's cmdlib.h itself:)
2002-10-30 02:31:29 +00:00
Bill Currie
98563c15d6 fix vorbis include handling when --with-vorbis is needed 2002-10-30 02:03:24 +00:00
Bill Currie
aa36b85ba6 add PR_StringValid and PR_EdictValid to check the validity of progs string
and entity values without crashing.
2002-10-29 05:07:10 +00:00
Brian Koropoff
99e18513f0 Added support for escape characters of the form \### where ### is the
decimal value of the desired character.
2002-10-26 03:09:38 +00:00
Brian Koropoff
01a7740f1b Added bind.get builtin that returns the command currently bound to a key.
Fixed gib_builtin.h to include another needed header.
2002-10-25 06:33:16 +00:00
Bill Currie
8b46193e4d seeking to 1 byte before the beginning of the file doesn't seem to be such
a good idea
2002-10-24 22:36:15 +00:00
Bill Currie
012cc58eb4 move the debug related stuff from pr_exec.c to pr_debug.c 2002-10-23 20:42:02 +00:00
Bill Currie
3a3da6a1c4 nuke PR_InitEdicts as it's redundant and only used in the tools due to
forgetting to remove it
2002-10-23 15:55:38 +00:00
Bill Currie
a4a5bb2d72 split out the parsing code 2002-10-23 04:57:08 +00:00
Brian Koropoff
20d47cde2f Added the global.delete builtin to clean up old global variables. Updated
cb.gib to use it.
2002-10-23 03:56:57 +00:00
Bill Currie
80e85226b9 pr_xstatement now always reflects the currently executing statement making
debugging easier in the event of a segfault
2002-10-22 15:07:54 +00:00
Brian Koropoff
9fd055e183 A null ifs now causes every character to be considered a separate field in
a for loop. You can now pass a field separator string to a for loop that
will override the value of ifs.  Added the field.get command that returns
a single field from a list.  It also can take a field separator string that
overrides ifs.
2002-10-22 05:34:59 +00:00
Bill Currie
1d96156936 make sure files loaded by the progs engine can be freed safely 2002-10-22 04:30:20 +00:00
Bill Currie
6203d450eb resture pr_xstatement on return from PR_ExecuteProgram so recursive calls
don't mangle things with the new semantics of builtin calls
2002-10-22 02:51:57 +00:00
Bill Currie
aad04efe25 move the correct amount of bytes (I keep forgetting the * 4 :P) 2002-10-21 16:38:45 +00:00
Bill Currie
b345f510fa provide Hash_Buffer so buffers can be hashed 2002-10-20 03:30:22 +00:00
Bill Currie
4810046f39 copy the correct number of bytes 2002-10-17 19:33:06 +00:00
Bill Currie
4da662eb47 implement pr_obj_msg_sendv 2002-10-16 22:17:26 +00:00
Bill Currie
be4b8096d4 two new instructions: move and movep: basicly memmove. qfcc support coming
as soon as I get it working :)
2002-10-16 06:44:41 +00:00
Brian Koropoff
8c2afef44c Changed GIB_Arg* into macros. Cleaned up GIB file access a bit and added
file.move and file.delete builtins.  Added Qremove to quakeio.[ch]. Did
a little cleaning and commenting in gib_parse.c.  Added support for \t
and \r escape characters.
2002-10-16 04:59:34 +00:00
Bill Currie
68b41f9b44 make dstring_adjust `grow' in increments of 1024. this should speed up
multiple appends nicely.
also create davsprintf and dasprintf to /append/ the printed strings to the
dstring rather than overwriting it as is done with dvsprintf and dsprintf.
2002-10-15 19:52:46 +00:00
Bill Currie
1f0b6e84a5 change pr_obj_msgSend and pr_obj_msgSend_super so they either call builtin
methods directly or setup the progs struct for a normal function call to
call a progs method rather than recursively calling PR_ExecuteProgram. This
will reduce method call overhead (both cpu and stack usage), fix the loss
of tracing when calling a method and makes it possible to break out of the
progs engine simply if threaded progs are ever implemented.
2002-10-15 18:53:33 +00:00
Bill Currie
99350cf4f1 cleanup some bitrot that caused qf to seg when using the null sound driver 2002-10-15 17:32:47 +00:00
Brian Koropoff
72e1ab0c57 Added the sleep console command that waits for a specified amount of time.
Note that this isn't a GIB-specific command but is very useful in GIB
threads.  Fixed the range GIB command to respect the ifs local variable.
2002-10-13 19:46:47 +00:00
Brian Koropoff
70c1fee4c9 Fixed some missing commas that resulted in garbled cbuf error messages. 2002-10-13 19:18:10 +00:00
Brian Koropoff
8b31103e6f Var substitution is now handled in the same pass as embedded return values.
This prevents var substitution from being performed on the return value
of a function.  The local variable ifs can now be set to specify a custom
field separator for use in for loops.  file.find will also insert ifs
between file names instead of a space if it is set.  file.find will also
no longer put . and .. in a list of file names.
2002-10-13 05:52:06 +00:00
Bill Currie
652907bc58 X overlays crash fix from Vincent Cojot 2002-10-11 21:32:17 +00:00