Commit graph

638 commits

Author SHA1 Message Date
Bill Currie
997102fea8 audit the usage of "only"
There are still a few iffy places (notably around certain prepositions), but
the relevant sentences are now much easier to read.
2010-01-13 06:42:26 +00:00
Bill Currie
0a203c0ab5 qccx (etc) "integer" autodetection.
Check for usage of denormal floats and if found, either bail with a
descriptive error message or give a mild warning that things will probably
break. This avoids the possibility of things like RuneQuake getting "lucky"
and doing real harm, and certainly avoids the segfaults.
2010-01-13 06:36:54 +00:00
Bill Currie
00e590f5f5 Really nail down the args param in rua_obj_msg_sendv(). 2010-01-13 06:36:16 +00:00
Bill Currie
5c788d8d44 state.f is not an id instruction 2010-01-13 06:30:07 +00:00
Bill Currie
e0d669590c plug a memory leak
the progs memory was never being freed between maps because the pointer was
being cleared at the start of PR_LoadProgsFile.
2010-01-13 06:27:19 +00:00
Bill Currie
5d6977288f implement bounds checking on all opcodes 2010-01-13 06:19:50 +00:00
Bill Currie
4a7b8f8246 don't look up aux function info when we don't have it 2009-12-21 14:07:43 +00:00
Bill Currie
fe95805d86 various gcc 4.3 fixes 2008-07-19 05:40:57 +00:00
Bill Currie
2b81eaea6c console.h include cleanup 2007-11-06 12:40:38 +00:00
Bill Currie
c04d9ef8c2 plug a potential (though unlikely) memory leak 2007-10-13 11:32:10 +00:00
Bill Currie
3e50aae01f "print" command for dumping values in the progs and add return type info to the debugging information 2007-09-15 07:47:31 +00:00
Bill Currie
ca0bbd909c correctly save and restore the parameters when calling +initialize. fixes the segfault in the qwaq test. 2007-06-09 13:44:06 +00:00
Bill Currie
4973a38cce speed up PF_VarString a little 2007-06-09 09:43:21 +00:00
Bill Currie
4d86c40113 handle float conditionals 2007-05-08 03:20:15 +00:00
Bill Currie
57bd43fc52 make the watchpoint (optionally) conditional 2007-05-08 02:25:01 +00:00
Bill Currie
fe4a4a9e55 "hardware" (haha) watch points (one!) in progs. only catches changes done by progs, and the expression parser is as flaky as anything, but it's better than nothing :) 2007-05-08 02:04:47 +00:00
Bill Currie
b167bc302b fix a segfault when doing backtraces without debug info 2007-05-07 23:10:54 +00:00
Bill Currie
beb5438484 fix messed up build order by putting bi_inputline.c where it really belongs 2007-05-07 13:02:35 +00:00
Bill Currie
ab5536ef46 strip any trailing whitespace from source lines. strips off trailing \r from dos files :) 2007-04-28 01:40:08 +00:00
Bill Currie
d08e1fe511 make PR_StackTrace visible 2007-04-10 09:45:57 +00:00
Bill Currie
48449a972f fix an uninitialized warning on some versions of gcc 2007-04-10 08:32:58 +00:00
Bill Currie
a66cbb5215 PR_ResolveGlobals needs to be visible 2007-04-09 09:00:40 +00:00
Bill Currie
61d349ec78 bah, the other part of that commit :P 2007-04-09 08:55:24 +00:00
Bill Currie
cd6ee38181 remove debuging prints 2007-04-09 06:18:14 +00:00
Bill Currie
b5e6aa4519 for pr_debug 1, don't dump disassembly when tracing, just source lines. pr_debug >= 2 forces disassembly. detailed disassembly now on pr_debug >= 3 figure out the types of arguments in a function call 2007-04-09 06:16:03 +00:00
Bill Currie
2700f4060b make PR_FreeTempStrings not free a string that looks like it's being returned, but rather transfer it to the parent stack frame. 2007-04-08 01:22:00 +00:00
Bill Currie
3e92ac51fd fix another bug caused by the function table changes 2007-04-08 00:56:35 +00:00
Bill Currie
e27b2a9e54 use PR_CatStrings for strcat and padstr. ironicly, this should work better for now, and definitely will by the time I'm done. 2007-04-08 00:00:35 +00:00
Bill Currie
124506fda2 Fix the access alignment bug on 64 bit archs. 2007-04-07 01:41:23 +00:00
Bill Currie
5b761bac83 make progs related code a little more consistent with its int type usage 2007-04-06 00:47:41 +00:00
Bill Currie
38254186da other than floats, progs should now be int size safe 2007-04-04 12:30:49 +00:00
Bill Currie
ff132bb536 64bit windows patch from phrosty 2007-04-04 07:48:14 +00:00
Bill Currie
c20a553e1a free entities that didn't get initialized (lost this in the format conversion) 2007-03-25 04:15:18 +00:00
Bill Currie
81a57bb3fa patch from phrosty for vc2005 support. includes fixes for a bunch of gcc-isms that crept in over the years. 2007-03-22 23:20:57 +00:00
Bill Currie
99c0954b47 the big dso visibility patch :). Sure, we have to have unique names for static builds, but with controlled visibitly we should get faster program loads (although this isn't C++, so it's not as bad) and complex plugins are cleaner. 2007-03-10 12:00:59 +00:00
Bill Currie
165600adc5 fix a very severe d'oh (specifying width caused a segfault) 2006-12-20 10:32:34 +00:00
Bill Currie
acd49060be why did we ever decide not to support %d? 2006-12-20 08:45:49 +00:00
Bill Currie
4dba10d613 support %c for sprintf and make sprintf return a return string rather than a temp string 2006-12-19 14:15:27 +00:00
Bill Currie
3f3ec6404d bare printf doesn't give very desirable results 2006-12-09 08:44:10 +00:00
Bill Currie
70ec9848e7 add PL_RemoveObjectForKey and make PL_D_AddObject take a normal C string for key instead of a pl string. 2006-12-09 06:00:36 +00:00
Bill Currie
c290e9a988 use plists for save-games. old save-games can still be read, but new ones will always be in the new format. might be a good idea to back up any old saves until more testing has been done. 2006-12-09 02:35:44 +00:00
Bill Currie
2a79f42eb5 progs now internally uses plists for entity/global initialization, with support for direct conversion from id's format. This means that the entity string in a map (or the external ent file) can be a plist. 2006-12-09 00:02:57 +00:00
Bill Currie
a6c50b8edd use handles rather than pointers (whatever was I thinking?) 2006-12-02 06:50:59 +00:00
Bill Currie
3fb03fc2be hah, should have been using __attribute__((used)) all that time (rather
than __attribute__((unused))). fixes the missing console in -x11
2005-08-04 15:27:09 +00:00
Bill Currie
4a21eb02c5 heh, slight oversight when implementing rcall using the param pointer
trick. ran into the exact same problem as passing addresses of locals to QC
functions. well, actually, that's exactly what it was, but done in the
engine. anyway, wound up potentially overwriting the params passed to the
function. fortunatly, due to how rcall works, only the first two params are
an issue.
2005-06-14 13:40:34 +00:00
Bill Currie
762aefc9b1 implement Raven's calling convention (rcall: first 2 params in opb and
opc). should give a general speedup to most progs.
2005-06-12 09:54:01 +00:00
Bill Currie
f65c25a7c2 oops, signage error 2005-05-01 08:30:30 +00:00
Bill Currie
a0612e27b9 d'oh, forgot to mark the string ref as freed 2005-05-01 00:01:28 +00:00
Bill Currie
f38fcd9086 catch attempts to use freed strings 2005-04-30 08:37:55 +00:00
Bill Currie
23f71485d1 more tree recovering. This includes Despair's anisotropy support work. 2005-01-02 14:23:20 +00:00
Bill Currie
4a7e2ff093 get the range of the zone right. crashing on what should be a perfectly valid value is just plain bogus :P
This is an imperfect revision of history.
2004-11-14 00:52:00 +00:00
Bill Currie
53ee50655c allow the progs code to hook into the parsing processes
This is an imperfect revision of history.
2004-11-12 11:15:00 +00:00
Bill Currie
0effc54835 don't puke over a void field when dumping entities
This is an imperfect revision of history.
2004-11-12 11:12:00 +00:00
Bill Currie
0e324d1851 use the script api for parsing ent data and savegames
This is an imperfect revision of history.
2004-11-12 02:39:00 +00:00
Bill Currie
2a36c74120 add dynamic (freeable but unchangeable) strings
This is an imperfect revision of history.
2004-11-11 09:40:00 +00:00
Bill Currie
78d98ea787 remove the time pointer (not really needed)
This is an imperfect revision of history.
2004-11-09 22:32:00 +00:00
Bill Currie
8770df39e5 start documenting things (progs building still borked)
This is an imperfect revision of history.
2004-11-08 23:27:00 +00:00
Bill Currie
780fb41858 make a common call function and fix pr_trace such that it autoclears only when the execution session it's set in is exited
This is an imperfect revision of history.
2004-11-07 03:00:00 +00:00
Bill Currie
201252c1c0 FIXME cleanup and a missed win32 compile fix
This is an imperfect revision of history.
2004-11-06 02:21:00 +00:00
Bill Currie
f5bc90a53a clean up some redundant progs functions (may be broken for a while)
This is an imperfect revision of history.
2004-11-05 11:49:00 +00:00
Bill Currie
33bc7858f7 avoid using the hunk in the progs engine (except for the override-able load and alloc functions) so tools (qfprogs and qwaq) don't need to create it.
register only the first instance of a progs provided string

This is an imperfect revision of history.
2004-11-02 04:59:00 +00:00
Bill Currie
633dada682 quaternion conjugate support (engine side) 2004-04-08 04:57:17 +00:00
Bill Currie
fc2413ff72 more quaternion work (should be working, haven't come up with tests yet) 2004-04-08 03:32:14 +00:00
Bill Currie
4882005a49 compile fixes (oops) and start working on quaternion support in qfcc 2004-04-08 02:33:20 +00:00
Bill Currie
8d6f634f30 engine side quaternion support 2004-04-08 00:56:30 +00:00
Bill Currie
ac67a50a9a handle x % 0 by giving a 0 result 2004-02-20 00:25:08 +00:00
Bill Currie
a821f048a0 change FNC to FN and fnc to fn for function based opcodes 2004-02-11 06:52:19 +00:00
Bill Currie
c3f41e3e69 new opcode: state.f. same as state, but takes a 3rd float operand to
specify the step for calculating nextthink. accessed using
[frame, think, step] (state is [frame, think])
2004-02-11 01:43:33 +00:00
Bill Currie
5c9ffad6a1 oops, fix the line number doubling the /right/ way 2004-02-10 04:42:17 +00:00
Bill Currie
a371af75ab don't double the source line number when on the function's first line 2004-02-10 01:54:33 +00:00
Bill Currie
432ae86cca don't seg if the field def can't be found 2004-02-07 01:57:31 +00:00
Bill Currie
ecf4eabe9d check return value... prevents segfault in menu code if menu.dat has issues 2004-02-07 00:04:00 +00:00
Bill Currie
080b973479 make globals without a def a lot easier to read (don't need to print the
address twice:)
2004-02-06 08:03:22 +00:00
Bill Currie
4472f943c5 minor cleanups and use escapes when printing strings 2004-01-31 08:34:01 +00:00
Bill Currie
2ac0f40f7a fix an uninitialized variable 2004-01-31 07:29:11 +00:00
Bill Currie
24294c8778 make printing of global contents in PR_PrintStatement optional so
disassembly output is cleaner
2004-01-31 04:26:01 +00:00
Bill Currie
718c708cec make global printing a little more robust 2004-01-30 08:46:14 +00:00
Bill Currie
e1afa3221c minor cleanup 2004-01-30 07:55:32 +00:00
Bill Currie
390ca99a92 first step to making qfdefs redundant. "standard" progs now get resolved
staticly rather than looking up the defs. "broken" progs should now work.
2004-01-21 08:09:47 +00:00
Bill Currie
77b2942982 several libs can now get built as dlls in windows: console, gamecode,
gamecode_builtins, gib, image, modules, object, ruamoko and util.
2004-01-19 07:47:41 +00:00
Bill Currie
ba8e959cf2 when clearing the return strings, it's a good idea to clear them completely 2004-01-18 07:50:50 +00:00
Bill Currie
249aee2e9f move the OO runtime support code from libQFgamecode to libQFruamoko where
it really belongs :)
2004-01-16 08:02:31 +00:00
Bill Currie
01392c78bb move the bulk of what whas libQFcsqc to libQFruamoko. 2004-01-16 05:46:19 +00:00
Bill Currie
3ad2eaf3cd allocate the aux function map properly 2004-01-08 04:04:55 +00:00
Bill Currie
c5c5c33e7d I had forgotten the free string refs list /had/ to be in the progs vm 2004-01-08 04:03:47 +00:00
Bill Currie
b3f76e1e48 add some string builtins (only the basics for now, but enough to deal with
temporary strings) and fix the game load/save menus.
2004-01-07 07:36:17 +00:00
Bill Currie
9c92a916ff change the dict and array add functions to return true/false and add some
more docs
2004-01-07 06:19:11 +00:00
Bill Currie
e455b760ca use a cycled pool of "return strings". I'd love to come up with something
better, but this will do (similar to what qwe does, but qf style:)
2004-01-07 05:22:57 +00:00
Bill Currie
7885d9ce25 make a local copy of the builtins table being register as it might need to
be modified
2004-01-07 02:48:11 +00:00
Bill Currie
cbe006a2fb print an address if the def name is blank 2004-01-06 08:09:41 +00:00
Bill Currie
133879f8fa provide builtin mappings for id (none, really), qf and ktpro/qwe (qw only),
add qwe builtin extensions to qw-server. provide sv_progs_ext to control
the builtin mapping. valid values are "id", "qf" (our old static builtins),
"qwe"/"ktpro" (either works. for ktpro mod support) and "none" (no
mapping). any other value is equivalent to "none".
2004-01-06 07:00:39 +00:00
Bill Currie
d7592781d7 add builtin mapping support (not used yet) and fix an uninitialized
variable
2004-01-06 06:08:59 +00:00
Bill Currie
acd54afff7 move to using a hash table for builtin number -> builtin lookup so sparse
ranges can be used efficiently. move the auto-allocated builtins to
0x10000000-0x7fffffff. should be more than enough :)

use static builtin tables ("nul" terminated) instead of a series of
function calls to add builtins to a vm. should be more memory efficient.
2004-01-06 05:51:09 +00:00
Bill Currie
fbe6c2f631 make the bad builtin number a warning and provide a suitable function in
case the function is called: allows progs with bad (but unused) builtins
to run anyway
2004-01-06 03:18:44 +00:00
Bill Currie
0ddb5eb822 report all bad builtins rather than just the first 2004-01-05 08:52:20 +00:00
Bill Currie
595280decb do the builtin function lookup at load time rather than runtime and store
the function address in the progs function descriptor. this will speed up
calls to builtin functions, especially when ranges get introduced.
2004-01-05 08:08:46 +00:00
Bill Currie
dfc83c1f5f add PR_PushFrame and PR_PopFrame so temp strings are easy to use for
parameters to progs functions.

double the progs stack sizes (call depth of 32? eek)

allow one extra call on the progs stack :)

misc minor cleanups
2004-01-05 07:10:32 +00:00
Bill Currie
211908e741 implement a couple more obj functions 2004-01-05 01:41:20 +00:00
Bill Currie
dfe7f263c7 new internal printf engine for progs, mostly thanks to Deek.
also a few cleanup bits
2004-01-04 07:42:43 +00:00
Bill Currie
538d669887 micro-tidy while pondering how to rework this whole mess 2004-01-04 03:24:37 +00:00
Bill Currie
a533761770 Nuke PR_GarbageCollect as it's both redundant with the new temp strings
and wrong anyway (could free strings it wasn't supposed to).

Don't free the string pointed to by a strref since it's already been
implicity freed (whole memory space nuked). Fixes new map crash.
2004-01-04 02:03:30 +00:00
Bill Currie
bd561fafc3 o all progs strings are now stored in progs memory
o  temporary strings automaticly get freed when the function they're
    created in (results of str + str and most strings returned from
	builtins). a way to keep temp strings will be provided later
 o	fix up qwaq to test the temp strings
2004-01-03 08:43:57 +00:00
Bill Currie
0307618b15 use the passed "size" parameter rather than qfs_filesize: no telling
/where/ the progs really came from :)
2003-12-22 19:58:46 +00:00
Bill Currie
cd8035319d PR_GetString should have been returning const char *. now does 2003-11-21 21:34:53 +00:00
Bill Currie
e74cd75a0d d'oh, forgot to relocate the builtins :P 2003-11-20 08:01:27 +00:00
Bill Currie
5f5662a063 PF_VarString return a plain char * and make it easier to add "at load" init
functions
2003-11-20 07:46:56 +00:00
Bill Currie
aa37db997c check for null function 2003-09-18 22:50:42 +00:00
Bill Currie
fea382d1d9 fix an accounting error 2003-09-15 21:13:13 +00:00
Brian Koropoff
687a0845b6 Introducing the GIB Object System (TM). This breaks scriptable HUD for now
and probably has enough bugs to leave the Orkin man scratching his head,
but it works and allows you to do neat things like write classes in GIB
(amazing!) and subclass builtin classes (which are Object and Thread at the
moment, Hash should be coming soon as a replacement for stem and leaf
variables).
2003-09-11 06:03:13 +00:00
Bill Currie
30e0cba25d better formats for load* and store[bp]* 2003-09-04 05:30:55 +00:00
Bill Currie
a1fa0b3feb make sure the pointed to def has a name before attempting to print it 2003-09-02 04:52:54 +00:00
Bill Currie
cf93f5f65e oops, who let C++ into C? :) 2003-08-25 01:47:05 +00:00
Bill Currie
96202a5984 bah, forgot to -1 the instruction pointer for jumpb 2003-08-24 07:23:12 +00:00
Bill Currie
afb42f5ed0 fix the unsigned comparison opcodes 2003-08-24 05:53:15 +00:00
Bill Currie
253d19876c no code to dump for a null function 2003-08-24 05:08:47 +00:00
Bill Currie
5d8bebfff8 implement class_get_class_method and (partially) class_pose_as 2003-08-24 03:44:12 +00:00
Bill Currie
b50d283b28 make sel_get_uid and class_get_instance_method work 2003-08-23 22:16:42 +00:00
Bill Currie
edb716ada0 oops, forgot to remove developer forcing 2003-08-23 06:21:35 +00:00
Bill Currie
385a90e8fb correct pr_symtab_t to include the pointer to the array of selectors used
in the module. Unfortunatly, this requires a version bump on both qfo and
progs files due to the changes structure layout.
2003-08-23 06:15:19 +00:00
Bill Currie
98beb38540 implement jumpb correctly 2003-08-22 19:48:36 +00:00
Bill Currie
cb6eba87ca print the value even for unknown defs if the type is known 2003-08-22 17:32:55 +00:00
Bill Currie
a2300387de fix a bunch of segfaults 2003-08-20 22:36:02 +00:00
Bill Currie
fe3b544528 handle "return 0" a bit better. assumes location is is always 0, but it
always has been (and always /should/ be anyway:)
2003-08-13 17:27:34 +00:00
Bill Currie
6f519c7e0f don't bother doing the copy if the value to be returned is already in the
return slot
2003-08-13 17:07:05 +00:00
Bill Currie
7ead5a91f8 don't let gcc automaticly inline functions but make gcc inline bigger
functions when told to. also make gcc warn if it can't inline a function.

Explicitly inline several functions (including moving VectorNormalize to
mathlib.h so it /can/ be) resulting in a 5.5% speedup for spam2 (88 to 92
fps)
2003-08-11 06:05:07 +00:00
Bill Currie
cbc6c40d33 get some single source instruction formats right and handle empty paths
properly
2003-08-05 17:27:47 +00:00
Bill Currie
59c26b5ce0 quick fix to handle .ent files starting with comments 2003-08-04 05:21:18 +00:00
Bill Currie
dd9ab1e050 get unsigned mostly working 2003-08-01 21:20:04 +00:00
Jeff Teunissen
f04d67f319 Nuke the old-style Object's dead built-in methods. 2003-08-01 16:42:02 +00:00
Bill Currie
cbd5c70320 oops, %O should be in hex 2003-07-31 01:57:29 +00:00
Bill Currie
72eca6a956 get the default right :P 2003-07-30 22:24:44 +00:00
Bill Currie
0806fc33dd debugging improvements. opcodes now sport an optional format specifier for
printing their args (default is "%Ga, %Gb, %gc") and PR_ValueString will
try to print what a pointer points to
2003-07-30 22:24:16 +00:00
Bill Currie
dcd143f197 missing/incorrect symbols fixed 2003-07-30 17:44:38 +00:00
Bill Currie
3886723467 fix some builtin method names due to the selector name fixes in qfcc 2003-07-27 19:57:40 +00:00
Jeff Teunissen
c9858f4f65 Preliminary "unsigned" support for qfcc and the gamecode engine. Should still
be compatible.
2003-07-26 21:07:51 +00:00
Bill Currie
5481273639 start working on plist entity files 2003-07-17 18:27:00 +00:00
Bill Currie
043ec906c4 qnx patch from DrSpliff 2003-07-17 15:17:41 +00:00
Bill Currie
cb6bf2e2ae minor house-keeping 2003-07-15 16:34:43 +00:00
Bill Currie
0cf0f710b7 remove some unneeded code 2003-07-09 15:34:58 +00:00
Bill Currie
c2c3a62956 nuke Qexpand_squiggle. instead, expand ~ to $HOME on qfs initialization and
cache the value.

don't call Qopen directly in the engine. instead call QFS_Open (generic) or
QFS_WOpen (write only, zip flag).

rework QFS_NextFilename to use a dstring (avoiding a potential buffer
overflow), support 10000 files and work from the top-level fs_userpath
directory. adjust QFS_WriteFile and QFS_WriteBuffers etc to suit.

make sw32 screenshots actually get written.

hopefully everything gets written to the right places :)
2003-05-23 17:17:01 +00:00
Brian Koropoff
0ba2481632 Applied taniwha's mem leak fix. 2003-05-15 21:59:19 +00:00
Bill Currie
dedb2fa6bf get [super ...] working correctly 2003-05-15 05:58:31 +00:00
Brian Koropoff
72c21f60c9 Add support for GIB handles to the Rua interface. 2003-05-14 21:16:23 +00:00
Bill Currie
5f3573143a the beginnings of a jihad against buffer overflows 2003-05-08 23:24:02 +00:00
Bill Currie
e16a211e1f PR_SetString doesn't like null pointers, it seems. While fixing
PR_SetString would be a better fix, this is faster code.
2003-04-24 04:57:30 +00:00
Bill Currie
f7d806e8d5 can now handle > vector sized parameters 2003-04-22 20:11:16 +00:00
Bill Currie
e732cf591d remove all references to OFS_* from the C code. only the macros in progs.h
use them now
2003-04-22 18:20:15 +00:00
Bill Currie
eb099ae0d3 make qf gcc 3.3 clean 2003-04-17 00:01:48 +00:00
Brian Koropoff
e707e9bb89 Moved gib_*.h into include/ and moved the necessary declarations and struct
definitions to QF/gib.h to interface with libQFgib.
2003-04-13 22:07:58 +00:00
Brian Koropoff
3b703db4d4 Added the beginnings of an interface between Ruamoko and GIB. Although the
API is by no means finalized, it's now possible to write GIB builtins in
Ruamoko that can take arguments and return values to GIB.
2003-04-13 20:43:52 +00:00
Bill Currie
9afc3cf8f6 copyright date fixes 2003-04-10 16:54:12 +00:00
Bill Currie
7f31f05684 alpha compile fixes 2003-04-08 05:33:49 +00:00
Bill Currie
8fc721a2bb plug another overflow 2003-04-08 04:01:20 +00:00
Bill Currie
0b0dfcc38e nuke the string api (never really liked it) 2003-04-08 02:35:09 +00:00
Bill Currie
13fd0b8533 nuke the string hash api as it's been obsoleted 2003-04-07 22:34:39 +00:00
Bill Currie
72036d76b0 hmm, forgot a chunk :P 2003-04-07 20:15:38 +00:00
Bill Currie
7001f1d851 plist api (hope it works:) 2003-04-07 20:02:06 +00:00
Bill Currie
33c9ce0f7b add hash table api 2003-04-07 16:38:34 +00:00
Bill Currie
a72d3f6844 fix a segfault causing typo :P 2003-04-06 01:04:37 +00:00
Bill Currie
58541b6855 support printing a couple more types (especially for edicts) 2003-03-26 18:45:44 +00:00
Bill Currie
fafc578440 correct a comment and ws 2003-03-25 17:40:02 +00:00
Bill Currie
548d3b68f8 pr_load.c:
PR_RelocateBuiltins must be called before PR_InitRuntime
pr_obj.c:
	don't segfault on broken classes
2003-03-13 18:45:45 +00:00
Bill Currie
2858bc4922 d'oh 2003-03-12 22:38:02 +00:00
Bill Currie
71a60717d9 make pr_source_path a ; separated list of dirs and make it controllable in
qfprogs
2003-03-12 22:31:44 +00:00
Bill Currie
bfaef7747b the first fielddef isn't always null (esp with qfcc), so check to see if it
needs printing too
2003-03-05 18:18:42 +00:00
Bill Currie
a9a169e820 make the more relevant parts of qfs available to progs. bi_file.c will
eventually be moving into bi_qfs.c
2003-02-28 05:35:27 +00:00
Bill Currie
93834f2694 better source line tracking 2003-02-24 16:01:52 +00:00
Bill Currie
38d5c8c41a better line search algorithm (not perfect yet, though) 2003-02-24 03:34:11 +00:00
Bill Currie
5c3892cbb2 make sure the string is valid before attempting to print it 2003-02-24 03:07:26 +00:00
Bill Currie
72e5221f06 minor debugging tweaks 2003-02-21 15:09:02 +00:00
Bill Currie
152538bf90 zap the Cmd_Return stuff as that's dead and burried 2003-02-20 20:33:03 +00:00
Bill Currie
b6a3bc8d1c try to give line numbers in the traceback 2003-02-19 06:26:49 +00:00
Bill Currie
851d203916 work towards a more secure qfs 2003-02-14 22:36:10 +00:00
Bill Currie
6a687f5e45 rename all the globals in quakefs.[ch] to be QFS_* or qfs_* 2003-02-14 19:46:07 +00:00
Bill Currie
fd7636137d implement a proper (and optionally secure) QFile interace for ruamoko. 2003-02-14 18:17:17 +00:00
Bill Currie
8a9cd78072 fix up a couple of error cases (and catch them!) 2003-01-29 20:32:44 +00:00
Bill Currie
1342533234 make the PF_Find search field error more informative 2003-01-20 21:28:36 +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
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
d78f34e795 fix some spelling errors 2002-11-20 21:21:22 +00:00
Bill Currie
06df342655 fix a stray ; 2002-11-15 14:56:57 +00:00
Bill Currie
d1199f23da get categories working in the runtime :) 2002-11-14 20:42:48 +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
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
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
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
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
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
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
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
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
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
Jeff Teunissen
575689296a Tidy up progs dump output, and do some whitespace. 2002-10-08 19:46:42 +00:00
Bill Currie
eec3b7d8bc fix missed header commit 2002-09-14 07:51:53 +00:00
Jeff Teunissen
e551c1f22b New dump format for progs. It looks like assembly code. setting pr_debug to 2
or higher adds more debug information.
2002-09-14 07:00:40 +00:00
Bill Currie
bf53f43e13 make PR_break do a backtrace instead of crashing the server 2002-09-07 06:48:15 +00:00
Bill Currie
246ab0009c Change Con_ClearTyping to take a save flag that will cause the current line
(if not empty) to be saved in the inputline history.

Clear the input (but put in history) of say or say team when pressing escape.

Don't say or say_team if the text is empty.
2002-08-28 16:02:43 +00:00
Bill Currie
ec47e08e1c go back to using QFile, quakeio.h and quakefs.h 2002-08-27 07:16:28 +00:00
Bill Currie
8c82a54ac7 fix a 0 byte allocation 2002-08-26 00:30:31 +00:00
Bill Currie
09d89a3214 move bi_keys from csqc to pr_keys in targets allowing the server to link
with libQFcsqc (need a new name:P)
2002-08-21 02:25:51 +00:00
Bill Currie
5009213564 Move the signal handling code from video/targets/* to sys.c (I'm leaving
the SDL target files for Despair since he's working on the currently). Also
make progs segfault handling much more robust (and general: sigill etc too:)
2002-08-20 23:04:57 +00:00
Bill Currie
d328e18de2 implement the "new" inputline api making it possible to pull the Draw_*
functions out of bi_inputline.c. now somebody can be insane enough to
implement a qc controled console for the server ;) (more importantly, one
step closer to being able to have the server link with libQFcsqc (hah!))
2002-08-20 21:19:53 +00:00
Bill Currie
b99a72e876 pr_obj.c:
call obj_find_message with super instead of class when doing a super
	lookup
client_menu.[ch]:
	use the InputLine object instead of directly using the api
InputLine.r:
	builint functions are = #0, not = 0 :P
function.[ch]:
	provide copy_params
method.[ch]
	provide copy_keywordargs
expr.c:
	call inc_users for the parm temp if it's a bind expression
	revers a copy of the selector when building the selector name so the
	selector doesn't get mangled
qc-parse.y:
	catch erronous func = const inintializers (should be func = #const)
2002-08-20 02:09:34 +00:00
Bill Currie
2b1fd8e8c0 fix the menu keybinding not working bug 2002-08-19 02:48:38 +00:00
Bill Currie
c1c6c05cf5 pr_obj.c:
delay class fixups so order doesn't matter
class.c:
	write out the class and category diffs properly
2002-08-16 22:53:37 +00:00
Bill Currie
c1f5659977 bi_inputline.c:
add InputLine_SetUserData
pr_resolve.c:
	report the correct missing symbol (self instead of time)
2002-08-16 21:52:37 +00:00
Bill Currie
8adad57941 Make the cbuf api use a supplied cbuf rather than allocating its own. Kills
a FIXME and (Closes: #32)
2002-08-14 18:45:09 +00:00
Brian Koropoff
cf48363c6e More of GIB done: builtins, functions, various cleanups, math, etc. 2002-08-03 06:04:00 +00:00
Bill Currie
2ce0f2ded2 we now require modern autoconf (2.52+), automake (1.6+) and libtool (1.4+).
This gives us a bunch more flexibility. plugins no longer have the "lib"
prefix or the version suffix, they're now installed in
$fs_sharepath/QFplugins,, builds should take much less time (in general,
only one of pic or non-pic versions are build), bins and libs can have
individual CFLAGS
2002-08-01 19:49:10 +00:00
Brian Koropoff
439f9838d3 Whoops, missed some stuff that needed to be in idparse.h 2002-07-31 22:13:15 +00:00
Brian Koropoff
a93b221272 Split off the old console parser into idparse.[ch] and prepared the cbuf
struct and support functions for GIB mark III.

Oh yeah, I'm back.
2002-07-31 22:03:53 +00:00
Bill Currie
ad6e025a91 take cmd.[ch] back to basics. the gib code is temporarily gone pending
renovations. cmd_source handling is a little hacky in nq, but it's working.
2002-07-31 05:19:03 +00:00
Bill Currie
46ee46fdc6 dead code removal 2002-07-30 04:55:33 +00:00
Bill Currie
587ac5670b using R_FLOAT for setting individual fields of the return vector ain't so
good a thing to do.
2002-07-25 14:58:02 +00:00
Bill Currie
de22355371 use P_* for params and R_* for return values in builtins code 2002-07-24 21:42:33 +00:00
Ragnvald Maartmann-Moe IV
227da6afba Change pr_boundscheck default to 0. *grmbl* 2002-07-21 23:35:36 +00:00
Bill Currie
bff6291bfb don't need to force developer now 2002-07-16 22:06:52 +00:00
Bill Currie
ac1392eb74 object.r:
define __obj_exec_class, obj_msgSend and obj_msgSend_super for the way
	qfcc now handles these defs
pr_edict.c:
	PR_ValueString now checks that the function is valid before trying to
	print its name.
class.c:
	__obj_exec_class is now extern
linker.c:
	fix more mangled relocs
method.c:
	obj_msgSend and obj_msgSend_super are now extern
qfcc.c:
	fixes so obj_module_t doesn't get zapped
type.c:
	fixes so obj_module_t doesn't get zapped
2002-07-16 19:03:56 +00:00
Bill Currie
35d224f1da a little more info and force developer on for now 2002-07-16 15:39:49 +00:00
Bill Currie
34fa421638 whitespace 2002-07-13 03:41:33 +00:00
Bill Currie
717127e0d8 don't print ! on uninitialized global defs that are the correct type for
the instruction
2002-06-17 05:31:08 +00:00
Bill Currie
2264c28310 pr_strings:
remove a bogus 0x which caused confusion in an error message
def.c:
	vector fields still need an extra 3 globals for their component fields
2002-06-16 05:24:58 +00:00
Bill Currie
88fc0be127 arrays are /almost/ working again 2002-06-12 22:37:18 +00:00
Bill Currie
0b1d1ade73 qfprogs can now read the debug data 2002-06-11 17:24:37 +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
Bill Currie
5c943d4ca9 this should speed up progs a little bit 2002-06-07 19:41:13 +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
a7b5b56a2c implement Z_Realloc, PR_Zone_Realloc and pr_obj_realloc 2002-05-29 20:58:53 +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
f78f921285 search for .self' before self' 2002-05-18 00:49:16 +00:00
Bill Currie
057aa61bd3 `document' the type sizes 2002-05-17 16:44:47 +00:00