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.
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
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.
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.
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.
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.
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.
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.
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.
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. :/
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).
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.
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.
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.
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.
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.
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.
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.
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
about the path it's handed (need to get even more paranoid, though). the
string module just has char replacement so far. Add Draw_CenterPic to
r_progs.c, but this will only last till qpic_t is supported in qc.
the load menu almost works: just need to add key handling and fix a bug in
PF_sprintf
emit.c: convert & (address) to . in unary .
rewrite emit_assign_expr
expr.c: remove debug code and make unary . less agressive on address calcs
also convert & (address) to . for lvals
code into the sw model loading code, remove all refs to r_pixbytes from the
sw renderer (it was never anything but 1), kill libQFmodels_sw32, remove
all the 16 bit code from the 8 bit sw renderer.
code. This fixes blather's `melted models' (sw), the nq alt player model
skins (gl), the arbitrary limits on skins and skin groups in gl, and the
incorrect timing of group skins (animated) in gl.
o add OP_JUMPB
o OP_JUMPB renumberd some opcodes, so up PROG_VERSION
pr_edict.c:
o make the version error reporting more informative
pr_exec.c:
o implement OP_JUMPB (goto *(ptr + index))
pr_opcode.c: (libs/gamecode/engine)
o add OP_JUMPB to the table
expr.h:
o ex_uinteger support
o some const correctness
o prototype new_label_expr
qfcc.h:
o uinteger ussport
o add pointers for op_jump and op_jumpb
o prototype PR_GetArray
emit.c:
o general uinteger support
o new reference/reloc type 3: absolute statement address
o jumpb support (binary goto)
expr.c:
o uinteger support
o break the label name creation out of new_label_expr into
new_label_name
o some const correctness
pr_def.c:
o add PR_GetArray to allocate an array in global space
o factor out some code common to PR_GetDef and PR_GetArray that would
otherwise be duplicated
pr_imm.c:
o some const correctness
o uinteger support
pr_lex.c:
o uinteger support
pr_opcode.c: (tools/qfcc/source)
o support jump and jumpb
switch.c:
o rewrite the binary search code to support ranges.
o add ev_uniteger to the types enum
o add opcodes for ifbe, ifb, ifae, ifa, jump, lt.ui, gt.ui, le.ui, ge.ui
progs.h:
o add uinteger accessors
pr_exec.c:
o implement ifbe, ifb, ifae, ifa, jump, lt.ui, gt.ui, le.ui, ge.ui
pr_opcode.c:
o add opcodes for ifbe, ifb, ifae, ifa, jump, lt.ui, gt.ui, le.ui, ge.ui
expr.h:
o prototype inc_users
qfcc.h:
o add externs for op_ifbe, op_ifb, op_ifae and op_ifa
emit.c:
o don't bother emiting an assignment to a temp def that's only used once
(ie, it's never read, only written to)
o support the new if* instructions
expr.c:
o support the new if* insructions
o dectect expression loops in append_expr
o support unsigned integers
o re-work temp def usage counting
pr_def.c
o debugging for temp def usage counts
pr_opcode.c:
o support the new if* instructions
qc-parse.y:
o provide defines for IFBE IFB IFAE IFA
switch.c:
o do binary searches for strings, floats and ints if there are more than
8 cases in a switch. Strings need more testing.
like normal, f_skins reports the average percent fullbright for all loaded
skins, and f_skins skinname reports the fullbright percent for a signle
skin. cl_freply controls the time in seconds before another query can be
made. Set it to 0 to disable them. More queries will be added later.
The table for accessing special characters from the console has been
tweaked a bit. Expect it to get tweaked more in the future.
This required changes to the api (info_t instead of char *) but should be
a net gain in speed (not a lot, admittedly: it was pretty fast to begin
with, but this paves the way for some other changes I have in mind).