Commit graph

1377 commits

Author SHA1 Message Date
Bill Currie
74597018ec heh, forgot to ifdef the call to R_InitVars 2002-06-10 22:52:13 +00:00
Bill Currie
3551b82a50 compile fix for when vidmode isn't available 2002-06-10 22:30:30 +00:00
Brian Koropoff
b70ffbf871 Fixed a warning message. Changed writefile to file_write. Added file_find
which searches a directory for files matching a pattern and returns a \n-
separated list.
2002-06-10 22:03:51 +00:00
Bill Currie
a7f1e1185b Patch to get oss sound working in BSD thanks to Alexander Leidinger
<Alexander@Leidinger.net>
2002-06-10 15:36:33 +00:00
Bill Currie
a4b06b1074 blah, enums and switch... (at least gcc 3.1 is warning about that again:) 2002-06-09 16:31:08 +00:00
Ragnvald Maartmann-Moe IV
9bca381c41 Remove R_Init_Entity. Never used, and probably doesn't belong in the renderer. 2002-06-07 23:38:53 +00:00
Bill Currie
5c943d4ca9 this should speed up progs a little bit 2002-06-07 19:41:13 +00:00
Bill Currie
3de07df3d2 *sigh*, I'm having a real problem this morning :P 2002-06-07 15:11:59 +00:00
Bill Currie
c0888ae8e4 I really hate the way cvs won't let you undo a poorly thought out removal 2002-06-07 15:09:57 +00:00
Bill Currie
ebfdbd9285 the fpu manipulation stuff seems to be better off in the one place that
actually uses it...
2002-06-07 15:09:20 +00:00
Bill Currie
4e07810f0d a little cleanup of unneeded lines 2002-06-07 14:44:02 +00:00
Ragnvald Maartmann-Moe IV
ceb73449bb Order of operations cleanup, QSG2 alpha is now colormod[3] in entities. 2002-06-07 11:25:47 +00:00
Ragnvald Maartmann-Moe IV
46949068a2 Check return value on R_AllocDlight. Small optimization, people cutting r_dlight_max heavily should like it. 2002-06-05 22:07:38 +00:00
Ragnvald Maartmann-Moe IV
0552d31b0b Minor optimization. 2002-06-05 06:46:21 +00:00
Ragnvald Maartmann-Moe IV
0bce2d0f2e Add QSG2 colormod, alpha, and scale for sprites. Probably not used by anything, but there you go. 2002-06-05 05:56:13 +00:00
Bill Currie
0f9adc182d win32 compile fixes 2002-06-04 16:17:10 +00:00
Jeff Teunissen
1ba994fd13 This is a test hack, to see if chopping off some of the integer realtime's
data helps in lengthening the amount of time a server can be up without Weird
Stuff(tm) happening.
2002-06-03 23:29:34 +00:00
Bill Currie
4039452297 more sys cleanup. server consoles may be broken for non-curses. 2002-06-03 19:11:48 +00:00
Bill Currie
0f94fd64e7 blah, forgot to #ifdef them :P 2002-06-03 17:26:09 +00:00
Bill Currie
54b299a7e2 set the type and size of the fpu control word vars 2002-06-03 17:04:47 +00:00
Bill Currie
d7c7ac7891 don't add -version-info for static plugins 2002-06-03 16:34:46 +00:00
Bill Currie
b4e8e0750c well, that's one way to confuse anybody
fixes the floating point exception
2002-06-03 07:23:41 +00:00
Bill Currie
ad08ff7492 there, finally got it right. ugh 2002-06-03 06:01:19 +00:00
Bill Currie
3ffec9e8c1 d'oh, forgot to set up my GOT base register in all the functions :P 2002-06-03 04:58:42 +00:00
Bill Currie
07c7c05f64 finish making sys_ia32.S PIC friendly 2002-06-03 04:06:25 +00:00
Bill Currie
f00e892d4e mingw gcc 3.1 is freaking weird 2002-06-02 05:27:32 +00:00
Bill Currie
321dbc87d2 missed a couple of global accesses 2002-06-02 04:07:18 +00:00
Brian Koropoff
13d6898fe0 Changed aliases to be handled by the command registering system in
preparation of separating GIB into its own module.  Command-related
functions will stay in util, but the buffer handling code and interpreter
will be moved out of cmd.c.
2002-06-01 22:13:14 +00:00
Bill Currie
9630a23391 more Sys_* cleanup 2002-06-01 03:00:13 +00:00
Bill Currie
fc0bb7e175 move Sys_DebugLog 2002-05-31 22:50:43 +00:00
Bill Currie
55fcead77c look for the .this field but don't complain if not found 2002-05-31 17:21:38 +00:00
Bill Currie
a8e177652a initialize the meta class super class pointer correctly 2002-05-31 14:58:42 +00:00
Bill Currie
2ee3aec19b reverse the order of linking 2002-05-31 06:52:48 +00:00
Bill Currie
ea3c6995fd actually /use/ method_list.method_next and chain the class methods onto the
instance methods for root classes.
2002-05-31 06:01:47 +00:00
Brian Koropoff
d85a238af2 Modified cmd.c to prepare for more file access functions and changed
the bind system to keep a restricted flag on binds to prevent the
server from executing restricted commands by binding them to keys.
2002-05-31 05:38:06 +00:00
Bill Currie
381bdb2323 it seems some GL libs can return a null extension list (ie, null pointer) 2002-05-31 03:38:01 +00:00
Bill Currie
9134e05aec return lists of multiple matching elements 2002-05-30 21:56:57 +00:00
Bill Currie
8a762bdaaf hack to work around the gl lighting fix breaking sw 2002-05-30 21:39:21 +00:00
Bill Currie
4e67f8d155 remove an extern 2002-05-30 18:38:57 +00:00
Bill Currie
a7b5b56a2c implement Z_Realloc, PR_Zone_Realloc and pr_obj_realloc 2002-05-29 20:58:53 +00:00
Brian Koropoff
8025dfd2ce "runLength-- > 0" made runLength negative, even though the test failed.
Skins should work again.
2002-05-28 23:34:02 +00:00
Bill Currie
9b7b059d5c speed up LoadPCX a bit 2002-05-28 06:05:36 +00:00
Bill Currie
bebf3f9599 massive speedup to noise_diamondsquare (not that it /really/ matters:) 2002-05-28 05:34:06 +00:00
Bill Currie
7a3b63418b `adequate' temporary fix for r_lightmap_components 1 2002-05-28 04:11:40 +00:00
Bill Currie
f3132162ae speedup r_lightmap_components 3 by ~4.2% in null-render 2002-05-28 03:49:13 +00:00
Bill Currie
101d38bd0c two win32 fixes for gcc 3.1 2002-05-28 03:33:03 +00:00
Bill Currie
acdd37b381 this seems to give ~2.9% speed boost to overkill for null-render 2002-05-28 00:04:01 +00:00
Bill Currie
6fbf011073 rpm building fixes 2002-05-27 20:28:10 +00:00
Ragnvald Maartmann-Moe IV
802bcc2762 Another 0.657% speedup for greyscale lighting. Unfortunately, at a price of considerable code duplication. But this is necessary for other planned changes. 2002-05-26 08:56:48 +00:00
Ragnvald Maartmann-Moe IV
6c8e2c24aa *grumbles about old gcc* 2002-05-26 07:07:10 +00:00
Brian Koropoff
75ec7de2f5 This better actually fix the lightmap code. 2002-05-25 21:55:34 +00:00
Brian Koropoff
ddd96312b1 Removed useless dereferencing. With any luck I understand what despair's
code is supposed to do this time.
2002-05-25 20:04:42 +00:00
Ragnvald Maartmann-Moe IV
f1f942dfd1 Hacking my way towards working r_lightmap_components 1.
Users of r_lightmap_components 1, should set `int mod_lightmap_bytes = 1` at the start of `quakeforge/libs/models/brush/gl_model_brush.c`.
2002-05-25 15:29:22 +00:00
Ragnvald Maartmann-Moe IV
b7900a2c43 Undo snax's order of operation breakage, and fix the typo that broke lightmap merging for r_lightmap_components 1.
The real problem with greyscale lighting, is in brush model loading. It'll probably take me a while to sort it out, since taniwha didn't get to it before taking off for the weekend. Sorry...
2002-05-25 15:01:23 +00:00
Brian Koropoff
11a14c077e Small order-of-operations fix. 2002-05-24 23:32:34 +00:00
Ragnvald Maartmann-Moe IV
2fe76b39e7 Smarter lightmap handling code. Still considerable optimization possible, at expense of duplicate code. 2002-05-24 17:12:41 +00:00
Bill Currie
25ebab2e09 only call Cbuf_ExecuteStack when the buffer has anything to execute. this
gives an ~1.1% boost to overkill.
2002-05-23 05:42:51 +00:00
Bill Currie
33e055209e Semi-major (more than minor:) progs convenience macro cleanup. There will
be more to come.
2002-05-22 22:35:37 +00:00
Bill Currie
ea36fceec5 fix a few missed initializations 2002-05-22 21:45:15 +00:00
Bill Currie
34ec521198 vararg functions can now be imlemented in qc using @argc (number of params
passed through ...) and @argv (array of vectors, one for each ... param)
2002-05-22 20:43:29 +00:00
Bill Currie
018b3ae536 more runtime implementation 2002-05-22 19:02:26 +00:00
Bill Currie
43e609241c initial stab at supporting most of the obj runtime 2002-05-22 17:32:44 +00:00
Bill Currie
33daf1e724 provide temporary stubs for most of Object's methods 2002-05-21 23:39:21 +00:00
Bill Currie
3815d4be7e blah, unitialized variable 2002-05-21 22:27:41 +00:00
Bill Currie
05c8cad2d1 grr, really should make compat.h include string[s].h
also, partially implement the messaging functions
2002-05-21 22:13:05 +00:00
Bill Currie
9820c5d45a start working in the obj runtime. any and all functions named ".ctor" will
be run in the order found.
2002-05-21 21:29:49 +00:00
Bill Currie
a8c3fa8ffc correct the function names in PR_EnterFunction and PR_LeaveFunction 2002-05-21 21:14:32 +00:00
Bill Currie
1b550c80b1 finally get Sys_Error `right' 2002-05-21 21:03:46 +00:00
Brian Koropoff
25969dbad7 Added a temporary hack to make quake.rc, config.cfg, and default.cfg work
in some mods that would generate mismatched quotes otherwise.
2002-05-21 02:02:20 +00:00
Brian Koropoff
ee5d0b7a99 Added r_farclip to control the far clipping plane. 2002-05-20 05:11:12 +00:00
Brian Koropoff
347962cc33 Fixed a bug introduced by my optimizations. 2002-05-19 06:32:57 +00:00
Bill Currie
f78f921285 search for .self' before self' 2002-05-18 00:49:16 +00:00
Brian Koropoff
967d39541a Optimized GIB a bit. 2002-05-17 21:38:37 +00:00
Bill Currie
057aa61bd3 `document' the type sizes 2002-05-17 16:44:47 +00:00
Bill Currie
9d59915fdc it's a little hacky, but this might do better with keeping vid_gamma_avail
straight.
2002-05-17 03:17:33 +00:00
Brian Koropoff
4cb3a5087b Whoops. Fixed some GIB bugs. 2002-05-15 22:39:37 +00:00
Brian Koropoff
58e8a997f8 GIB: Added the writefile, legacy and eval commands and created the
beginnings of a GIB security model for console access by the server.
Fixed a bug in zoom.gib.
2002-05-15 22:14:17 +00:00
Bill Currie
8f0661f5be correct the copyright year 2002-05-14 23:07:38 +00:00
Bill Currie
6a5bbf6f0a memory allocation checking cleanup 2002-05-14 06:37:28 +00:00
Bill Currie
1e0611e156 Sys_Error now makes sure all messages are terminated with a \n 2002-05-14 06:14:53 +00:00
Bill Currie
44dcf74627 strip the \n from all(?) of the Sys_Error calls (Sys_Error itself will be
adding \n).
2002-05-14 06:12:29 +00:00
Bill Currie
91779b04f7 new tool: qfprogs. currently only disassembles progs, but the idea is for it
to become a progs oriented nm, objdump etc
2002-05-13 19:37:36 +00:00
Brian Koropoff
09366866f7 GIB segfault fix 2002-05-12 20:28:19 +00:00
Brian Koropoff
f6697e0ef0 Fixed an oversight in Cmd_FreeBuffer in GIB and made a few misc. fixes 2002-05-11 20:44:59 +00:00
Brian Koropoff
6d37a9e48a Fixed up zoom.rc, renamed it to zoom.gib. Made alias with only one
argument print the contents of that alias.  Added the sleep command,
which works like wait but pauses for a certain number of seconds.
2002-05-11 06:09:50 +00:00
Brian Koropoff
56d033efa4 Auditted cmd.h and cmd.c to fix a bug, a few bits of useless code, and to
add some preliminary comments about all the functions.  I also rearranged
a lot of the functions to be more logically grouped.
2002-05-11 03:00:14 +00:00
Brian Koropoff
3fffa26fb4 Added thread support to GIB and cleaned up escape characters yet again.
With any luck it should actually work this time.  Added the getimpulse
command so that GIB scripts can check if an impulse command is pending
before sending their own.  Fixed all the memory leaks I could find.
QuakeC and GIB seem to be clean except for maybe one or two sneaky leaks
I can't track down.
2002-05-11 00:36:12 +00:00
Bill Currie
73e6cf062c implement type encoding 2002-05-10 23:19:57 +00:00
Brian Koropoff
e4f740bf02 Buffers created for embedded commands are now marked with a special flag.
This allows Cmd_Return_f to decide which buffer it should return a value
to.  End result: you can put blocks of code with a return statement inside
an embedded command statement.  I hope nobody minded me using my
quakeforge.net account to code a bit :P
2002-05-09 20:12:12 +00:00
Brian Koropoff
4074999b9b Numerous enhancement and fixes to GIB, including index ranges, fixed
escape characters, and more.
2002-05-08 23:01:07 +00:00
Bill Currie
44f9700ed2 two spelling correctsions are remove a redundant VectorCopy 2002-04-30 16:37:11 +00:00
Bill Currie
93febb90c9 search for .gz first 2002-04-30 04:39:03 +00:00
Brian Koropoff
942b3c2744 Floating point value of fov is now used. 2002-04-29 22:03:33 +00:00
Bill Currie
08f12355c5 this /should/ fix CoolMoDee's autoconf 2.53 issues 2002-04-29 19:19:26 +00:00
Bill Currie
a1fef28b60 fix the sw32 fov caps so it maches sw and gl 2002-04-29 17:21:52 +00:00
Brian Koropoff
601736719d Fixed the use of double quotes in chat messages and removed single quotes
as an option to enclose tokens.
2002-04-29 01:04:29 +00:00
Jeff Teunissen
2711cbbe7c Don't restore gamma if it's never been initialized. :) 2002-04-28 09:03:50 +00:00
Brian Koropoff
ff901a312f Added argument-list functions to EXP with trig and inverse trig functions
to start.  More will follow.  Switched to doubles from floats and allowed
numbers with exponents to be parsed properly.  Also changed the number of
significant digits printed to 10.  Changed fov so it is now capped at 1,
not 10.  The float value of fov is now used instead of int, so more
precision can be attained at small values.
2002-04-28 08:30:54 +00:00
Bill Currie
a59e509033 Multi_key (K_COMPOSE) and Menu (K_MENU) are now supported 2002-04-27 00:25:40 +00:00
Bill Currie
a5dc496c38 support the printscr key in X 2002-04-27 00:07:47 +00:00
Brian Koropoff
7121891895 Fixed Cmd_If_f so that embedded commands work again. 2002-04-26 22:09:28 +00:00
Jeff Teunissen
411ade4ce2 Fix gamma again. Also some minor whitespace and slight code cleanup. 2002-04-26 20:25:01 +00:00
Bill Currie
ac73653741 XPutImage returns 0 for success, not error 2002-04-26 18:55:37 +00:00
Bill Currie
9399b35b02 alpha compile fix 2002-04-26 17:15:00 +00:00
Bill Currie
89f7604d40 VID_GetGamma neither compiles nor is needed :) 2002-04-25 21:54:07 +00:00
Chris Ison
54ed05e52b changed sig handling to allow for core dumps etc, like x11 and glx 2002-04-25 21:51:47 +00:00
Jeff Teunissen
b75d50d088 X11 gamma restoration now works properly for systems with a normal gamma that
uses all three components (red, green, blue).

Next up: three-component internal gamma.
2002-04-25 20:53:15 +00:00
Jeff Teunissen
c877ba7fbd System gamma is now restored properly in X11. 2002-04-25 20:28:15 +00:00
Bill Currie
45e98d80d9 redo the cvar vector reading code to produce more useful results 2002-04-25 20:08:18 +00:00
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
Brian Koropoff
388ff7b597 Some bug fixes and memory leak fixes. Local variables break randomly,
probably due to my misuse of hash tables.  Anyone have any ideas?
2002-03-20 22:57:26 +00:00
Brian Koropoff
d5fad096c0 Added local variables and replaced %-substitution with local variables.
Made variable substitution recursive, so ${${foo}} will be the value of
the variable whose name is contained in foo.  Added setl command to
manipulate local variables.  The only other place they can be used is in
variable substitution.
2002-03-20 04:24:31 +00:00
Robin Redeker
18082533d5 Fixed some memory problems in my string-hashes. 2002-03-19 18:08:07 +00:00
Robin Redeker
489bc7291a Playermenu working now fine.
Added some api-functions to complete playermenu.
(Playermenu isn't still finished)
2002-03-19 17:07:56 +00:00
Bill Currie
504ee0014f and another one :/ 2002-03-19 17:03:52 +00:00
Bill Currie
7816644fc3 missed a place for enter_hook 2002-03-19 16:59:25 +00:00
Brian Koropoff
1683633042 Changed to an execution stack system for aliases and config files, and
added error backtraces.
2002-03-18 23:39:03 +00:00
Bill Currie
b01cda716f callback hooks for entering/leaving menus 2002-03-18 20:20:56 +00:00
Bill Currie
5f2dea43f6 break the dependency between cmd.h and dstring.h 2002-03-18 16:47:04 +00:00
Brian Koropoff
46cc4ac9dd Fixed some bugs and generalized the command buffer interface. Allowed for
buffers to be linked into execution stacks and changed aliases and script
files to be run in a new stack frame.  Cbuf_Execute executes the stack from
the top down, so wait commands are handled properly.
2002-03-18 04:12:09 +00:00
Brian Koropoff
f4180e7ad8 Added math evaluation, the ability for commands to span multiple lines
within braces, and put support for comments back in (oops).  To use math
evaluation, put a math expression inside $().  If you have spaces in your
expression, you'll need to enclose the entire thing in quotes so it doesn't
get split up into multiple tokens.
2002-03-17 06:57:03 +00:00
Brian Koropoff
aa00b7742c Changed the token finder to be recursive, added if and while commands, and
allow tokens within braces to continue across newlines.
2002-03-17 03:31:03 +00:00
Brian Koropoff
e9ca911e34 Added the ability to use curly braces to enclose tokens. Tokens in braces
won't be processed except for escape characters, so that escaped braces
can be used within.  If an uneven number of curly braces are within a
token, it will be misparsed, so escaped braces are important if you
don't want them to be considered in the parsing of the token.  Ideally,
braces within quotes within braces should not need to be escaped, but this
would require a redesign of the parser to be recursive.  Maybe I will do
this later.
2002-03-16 21:17:01 +00:00
Robin Redeker
adca50e52b Did further working on the menu code.
Added a _unfinished_ Player options-submenu, for setting
the name, top-/bottomcolor.
Added Draw_Fill and such to the progs api.
Added some comments.
2002-03-16 20:22:01 +00:00
Robin Redeker
757556022b 1. general menu code cleanup
2. added lots of comments to my menu code
3. wrote a string hash api (key -> value assignment list)
Hm, nothing else afaik. ;)
2002-03-16 15:52:17 +00:00
Bill Currie
51805ebd92 nothing much, just give wildcode a 30% speed boost. Basicly, stop binding
a texture for every single brush poly: due to texsort, they will come in
batches.
2002-03-16 09:25:06 +00:00
Brian Koropoff
2a3e1869ac Bug fixes! Fixed escape character detection, use of str = dstr->str
without considering that realloc could result in dstr->str being
changed.  Also made variable substitution of non-existant variables be
replaced with a null string rather than being left alone, to prevent
errors in scripts from causing weirdness as strings get passed through
the parser several times.
2002-03-16 06:31:59 +00:00
Brian Koropoff
0a90ddc51f Fixed an error in extract line that caused escaped quotes to be parsed as
normal quotes and made it so executed files are always inserted into the
console buffer so that class config files in TF can use the new parser
features, even though the exec command is run in the legacy buffer
2002-03-15 01:45:15 +00:00
Bill Currie
180c517771 signal handling improvements 2002-03-13 19:20:57 +00:00
Bill Currie
6cefb63e2e get back to work on creating a good command line pak file util. currently
only dumps the file names/sizes and segs if it's used incorrectly, but it's
a start.
2002-03-12 23:45:36 +00:00
Bill Currie
f0609f04f3 forgot about the need for the proto itself 2002-03-12 17:44:45 +00:00
Bill Currie
adbb59c5dd fix missing prototype for fnmatch on some systems 2002-03-12 17:36:17 +00:00
Bill Currie
1d420edcd0 start work on instrumenting GLstub.so 2002-03-11 23:55:50 +00:00
Bill Currie
d5fe4e3130 make file open a little more secure 2002-03-11 19:01:13 +00:00
Bill Currie
5a2538faaf dstring.[ch]:
create dsprintf and dvsprintf to do formated prints to dynamic strings.
rest
	Use the new functions :)
2002-03-08 23:11:42 +00:00
Bill Currie
538515bee6 forgot to nuke this 2002-03-06 04:17:50 +00:00
Bill Currie
8f7f646d19 white space 2002-03-05 22:36:04 +00:00
Brian Koropoff
e0e9084ad7 Merged in the new command parser. No major bugs or incompatibilities could
be found.
2002-03-05 21:51:12 +00:00
Bill Currie
544ca8118a "gib" never got all that useful, and with the new command parser coming in
and csqc, it's pretty obsolete, too.
2002-03-05 21:47:03 +00:00
Brian Koropoff
066c2c8a02 The final checkin before merging. Hopefully no showstopping bugs remain. 2002-03-05 21:26:37 +00:00
Brian Koropoff
669ca72e4f Added a bonus feature: %i evaluation in aliases. Just put %i in an alias
and it will get replaced with the ith argument to the alias, 0 being the
name of the alias itself.  %% will get replaced by %, out of range
numbers will simply be removed, and non-numbers will be ignored.
2002-03-04 02:37:40 +00:00
Brian Koropoff
7241d69036 Fixes to echo, correct use of cmd_source and src_command, and change nq to
use cmd_legacybuffer for stufftext.
2002-03-04 01:11:05 +00:00
Brian Koropoff
8d124f9c2b Implemented variable substitution and did various cleanups to the parser.
Changed Cmd_TokenizeString to accept a flag that controls the application
of filters (tags, variables, escape characters) to the tokens and modified
a few places in the source that called it.  Added a secondary command
buffer that is parsed without filters for legacy command support.
Currently, it is only used for commands stuffed into the console from the
server.  It is hacky, and I hope to eventually generalize the console
interface to support any number of buffers and audit the rest of the code
to recognize it.  For now, the legacy buffer at least keeps escape
character parsing from destroying info strings.
2002-03-03 23:28:57 +00:00
Brian Koropoff
f78ec56975 Added escape characters, the <i> tag to ignore tags enclosed within it, and
generally cleaned the parser up.  If a line begins with |, it will be
stripped off by the tokenizer and no tags or escape characters will be
processed.  Commands stuffed into the console from the server are prepended
with | to ensure backward compatibility.  This can also be used anywhere
backward compatibility is needed, such as where info strings are stuffed
into the console, or as an alternative to using escape characters in the
entire string.
2002-03-03 08:29:28 +00:00
Bill Currie
26d7463be7 the majority of raptor's sgi build patch. I'll look at the last two bits
(server.c and vid_sdl.c) later.
2002-03-03 06:03:51 +00:00
Brian Koropoff
4a7f3b3189 This commit fixes up cmd_args to rebuild a string from the processed
tokens and adds support for comments.
2002-03-03 06:00:44 +00:00
Bill Currie
119731e90e fix a buffer overflow snax found 2002-03-03 04:42:32 +00:00
Brian Koropoff
6936615fdf HTML-like tags are more or less done. Next up is variable substitution
and escape characters.
2002-03-03 04:26:37 +00:00
Brian Koropoff
557846b220 This is the first commit to the newcmd branch, which is a mostly-rewritten
console command parser.  It will eventually include html-like tags for
modifying text (gold numbers, brown characters, etc) and escaped characters.
The major differences so far are that dynamic strings are now used instead
of static buffers, and single quotes can be used to enclose tokens as
well as double quotes.
2002-03-03 03:36:27 +00:00
Bill Currie
a384870e4b cl_chatmode works again 2002-02-28 04:12:20 +00:00
Bill Currie
009e6346fe now, so long as ulimit allows it, we can always get a core dump. Looks a
little odd:

Received signal 11, exiting...
IN_Shutdown
IN_LL_Shutdown
VID_Shutdown
Segmentation fault (core dumped)

but the core file does accurately show the error
2002-02-27 06:55:21 +00:00