Commit Graph

1118 Commits

Author SHA1 Message Date
Bill Currie ce1c2e0bd1 sort the sources list 2002-04-25 19:39:26 +00:00
Jeff Teunissen 7c134a6f95 Fix up the watervis stuff. Whoops! :) 2002-04-25 14:34:15 +00:00
Jeff Teunissen 5b069de40c Redo r_wateralpha so that it doesn't force its value based on the watervis
serverinfo. Instead, create a new cl_wateralpha float variable that is set to
r_wateralpha->value in Host_Frame, and use that float during rendering.
2002-04-25 12:51:04 +00:00
Bill Currie da994c16e5 rewrite R_SplitEntityOnNode to be itterative rather than recursive (using
a static `stack') to avoid the function call overhead. this cuts about 40%
of the execution time from this function.

No matter what I tried, best results were obtained using __builtin_expect,
so make sure non-gcc compilers do the right thing when they encounter it.
2002-04-25 04:32:55 +00:00
Brian Koropoff bf323c3f0a Cleaned up Cmd_Args. It is no longer uselessly built up in
Cmd_TokenizeString since I realized the code was just pulling it apart and
putting it back together.  Added Cmd_Argsu to access the unprocessed
command.  Added support for else following if in such a way that
if/else if/else structures work.  Added support for unary operators in
EXP and added the ! (not) operator.  The ifnot command will be kept
for variety.
2002-04-24 22:33:04 +00:00
Bill Currie e4975cd675 very minor load-time optimisation 2002-04-23 17:23:18 +00:00
Brian Koropoff 7f295d61ee Added the getserverinfo command to return the value of a server info key
to GIB.  Fixed a bug in dstring_replace that was causing too much data to
be copied when the incoming string was larger than what was being replaced.
Very minor reorganization in cmd.c (1 function moved around I think).
cmd.c should probably get broken up into separate files soon.
2002-04-23 07:47:24 +00:00
Brian Koropoff 349fbf7150 Fixed a bug with escaped braces and quotes and added the strlen and streq
commands to GIB.
2002-04-22 04:23:36 +00:00
Bill Currie 4ccc9d6322 dstring.c dstring.h:
add dstring_replace. this replaces a string of lenth rlen at position
	pos with data of lenth len, growing, shrinking and shuffling data as
	appropriate. At this rate, the dstring `class' will get buffer gap
	editing capabilities :)
cmd.c:
	Cmd_TokenizeString builds cmd_active_buffer->line again.
	Cmd_Process bails out instantly if cmd_active_buffer is a legacy buffer
	and uses dstring_replace to modify the parameters in
	cmd_active_buffer->line. This last change results in drastic
	simplification (and accuracy) of the commandline reconstruction code,
	both in Cmd_TokenizeString and Cmd_Process.
2002-04-19 22:54:27 +00:00
Bill Currie ef81af9245 the "two birds with one stone" commit
1) when /not/ building static plugins, the plugin info name is, once again,
   PluginInfo, but is still type_name_PluginInfo for static plugins. This
   allows plugins to be symlinked (highly desirable for the debian packages,
   and likely others). This also requires plugins to /not/ be loaded with
   RTLD_GLOBAL.
2) because of 1, snd_alsa_0_9 has to explicitly load libasound itself. This
   just happens to fix my segfault on shutdown in RedHat 6.2.
2002-04-19 20:08:54 +00:00
Bill Currie e34ab5541c munmap the sound buffer when closing the device. This might help with some
hangs on shutdown.
2002-04-17 21:15:19 +00:00
Brian Koropoff 4cb89c69b2 Moved commands from bound keys into a separate buffer, changed the syntax
of for loops to be like that of C, changed math expressions to be
enclosed in #{} instead of #().
2002-04-17 07:05:43 +00:00
Brian Koropoff fafb014bbe Oops. Fixed a stupid bug that broke having more than one embedded command
in a token.
2002-04-17 01:15:10 +00:00
Brian Koropoff cb79de3584 Completely redid the way embedded functions are subroutines in general are
handled, meaning that execution can be paused at any time without a hitch.
Warning: This is a major change to the architecture (or lack thereof) of
GIB.  Please test for bugs!  Also, there are a few ugly bits of code that
need to be cleaned up, but that work for now.
2002-04-16 23:56:21 +00:00
Jeff Teunissen a4f3973ef1 Add multitexture support for Alias models, and disable the multitexture
support for BSP models, until they can be fixed. gl_multitexture should now
actually be a speedup!

NOTE: Some OpenGL implementations have trouble with the texture function
used. 3Dfx Voodoo 1/2 are known to have this trouble. I don't know how to fix
this, or even if it can be fixed. :/
2002-04-16 16:51:35 +00:00
Bill Currie 55a5c39187 Turns out that on PPC, va_list is an array (effectivly typedef struct
__va_list_tag va_list[1];) which causes grief when attempting to reuse
va_list variables (eg, in vsnprintf retry loops). This is the reason for
MisterP's crashes as the pointers in va_list no longer point to valid data.

acinclude.m4:
	shamelessly steal the va_list, va_copy and __va_copy macros from
	cdda2wav but modified so AC_DEFINE includes the description (so
	acconfig.h can remain gone)
configure.ac:
	use AC_TYPE_VA_LIST, AC_FUNC_VA_COPY and AC_FUNC_VA__COPY
dstring.c:
	stash the incoming va_list args in a temp var before calling vsnprintf
	then restore them each time before retrying, but only if va_list is an
	array (hopefully this is ok for when va_list is a structure)
2002-04-15 22:17:02 +00:00
Chris Ison 347cdc5e33 some small performance optimizations with textures and animations 2002-04-15 03:26:08 +00:00
Bill Currie 49deaf2661 that wasn't meant to get checked in. it came from an aborted change to
how commands get register.
2002-04-14 22:52:52 +00:00
Brian Koropoff c3da90fce0 You can now assign to local variables with var = value. You can also
index into variables in either substitution (i.e. $bob[25]) or assignment
(i.e. bob[25] = 'q') When using assignment into an index of a var, the
current character is removed and replace with the new value.  That means
that if the new value is longer than one character, the string will grow.
A feature that may be done in the future is indexing between two values
to get a substring, ie bob[25..30] = newstr.
2002-04-14 22:35:56 +00:00
Bill Currie 403af77038 give qc access to Cmd_Return 2002-04-14 01:25:24 +00:00
Brian Koropoff 503dab1aee The tokenizer will now not break tokens appart within quotes or braces.
This means things like echo ~{somefunc arg1 arg2} will get parsed properly
without having to enclose it in quotes.  Exported the Cmd_Return function
so that anything can return values to GIB (such as quakec).
2002-04-14 01:12:19 +00:00
Bill Currie b4c8546169 add the keyhelp command. think xev 2002-04-13 04:56:00 +00:00
Bill Currie 8220ddd83d and the command api to csqc and use it to bind menu_load and menu_save. F2
and F3 now work in nq :)
2002-04-12 17:19:49 +00:00
Bill Currie a974eb2333 move buildnum.c to util and make nq and qw init more similar 2002-04-11 18:42:55 +00:00
Bill Currie ba9ad15ebd it he's if I understand that Draw_CachePic puts the pic into the cache... 2002-04-10 06:56:25 +00:00
Bill Currie 0855e018dd d'oh, bloody gcc 2.95 builtin prototypes 2002-04-10 01:38:21 +00:00
Bill Currie 15e17acc1c the draw api now uses a `real' qpic_t rather than loading the pic every time 2002-04-09 21:38:41 +00:00
Bill Currie 76d004f9cf fix confim_quit 2002-04-09 17:00:39 +00:00
Bill Currie 47a94ed6af clear out the string hash resources completely 2002-04-09 16:21:27 +00:00
Bill Currie 8588d2d1cd fix a silly braino in the resources code that was causing the resource
structs to not get linked into the chain
2002-04-09 16:06:05 +00:00
Bill Currie 9dd7deb798 better catching of invalid inputline pointers 2002-04-09 15:29:48 +00:00
Bill Currie 4f65a313fd oops :) 2002-04-07 04:57:42 +00:00
Bill Currie 197db0aca7 more signed char indeces 2002-04-07 04:54:19 +00:00
Bill Currie ea9c1fc4ac setenv isn't as portable as one could wish... 2002-04-07 04:45:02 +00:00
Bill Currie 9885aa5916 fix some signed char index warnings 2002-04-07 03:41:10 +00:00
Bill Currie db75da7733 this should fix compiling snd_sun on solaris 2002-04-07 03:24:29 +00:00
Bill Currie b322835767 fix a missing \n 2002-04-03 18:50:36 +00:00
Brian Koropoff 93c9f96416 Added embedded commands with ~{} and the return command, created a token
structure to help tidy the command buffer struct up a bit, fixed a few
bugs and probably created 100 more.  A lot of things were changed to
allow embedded commands:
- Old buffers on the stack are left alone for Cbuf_ExecuteStack to
clean up.  This is so return values can be extracted from them.
- The imperative flag has been added.  An imperative buffer and all buffers
following it can not be paused with the wait command.
- The returning flag and retval dstring have been added.  If a buffer
returned something, the flag will be set.
- The return command was added so there was something to use in the
substitution.  Return nukes all loop buffers since they don't really count
as independent functions, sets the return value on the top buffer, and
clears it.
- Who knows what else.
2002-03-29 07:43:02 +00:00
Brian Koropoff 676bf39d9d Beautified GIB, improved looping and backtraces slightly. Old buffers are
now recycled, not freed.  Fixed some bugs in exp.c.  Ready to add embeded
functions (read: function calls with return values) and for loops.
Probably some other misc. fixes, I tend to go on debugging streaks.
2002-03-27 06:24:19 +00:00
Brian Koropoff 807e7de22e Fixed a bug with comments that don't have a newline after them. 2002-03-24 06:55:52 +00:00
Brian Koropoff 7c4cecd700 Fixed a stupid bug in Cmd_Exec_f that was causing map commands inside
executed files to crash the server.
2002-03-23 23:13:15 +00:00
Brian Koropoff 73f32465c5 Fixed a double free in exp.c, and made math error reports slightly more
useful.
2002-03-22 07:11:05 +00:00
Brian Koropoff e1b61d2116 Changed how looping works, fixed echo to work with taniwha's Cmd_Args
changes, added the != operator for math evaluation, added break command
to break out of loops early, added ifnot command, and who knows what else.
2002-03-22 00:22:03 +00:00
Bill Currie 961a716942 minor oops 2002-03-21 21:56:59 +00:00
Bill Currie 5a30278e77 whitespace 2002-03-21 21:56:22 +00:00
Bill Currie d00d6a539a add dstring_insertsubstr 2002-03-21 21:53:52 +00:00
Bill Currie 619a77b2f7 fix a couple of brainos that broke quotes entirely 2002-03-21 21:45:00 +00:00
Bill Currie c1deee9955 rework cmd_buffer_t->line and cmd_buffer_t->args building so quotes are
preseved
2002-03-21 21:17:31 +00:00
Bill Currie b7fc784718 add dstring_appendsubstr 2002-03-21 21:16:26 +00:00
Bill Currie 6f1b68aeb4 sys.h:
define SYS_CHECKMEM macro to ease memory allocation failure detection
cmd.c:
	loads of whitespace
2002-03-21 19:47:31 +00:00