Commit Graph

1080 Commits

Author SHA1 Message Date
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