Bill Currie
3e38c4aa48
Merge branch 'qfcc-cse'
...
qfcc now does local common subexpression elimination. It seems to work, but
is optional (default off): use -O to enable. Also, uninitialized variable
detection is finally back :)
The progs engine now has very basic valgrind-like functionality for
checking pointer accesses. Enable with pr_boundscheck 2
2012-12-13 20:17:28 +09:00
Bill Currie
6473951daa
Make the set notation more correct.
...
The empty set is now {}, the set of everything is now {...} and the rest
now have {} around the members.
2012-12-09 22:17:55 +09:00
Bill Currie
061e2be5d4
Re-write the set testing code.
...
Getting everything right with an enum proved to be too difficult if not
impossible. Also use better tests for equivalence and intersection.
Many more tests have been added. All pass :)
2012-12-09 13:52:48 +09:00
Bill Currie
94e804d786
Make some more set_test fixes.
...
Two inverted sets can never be disjoint.
2012-12-07 22:25:36 +09:00
Bill Currie
56956fc370
Rewrite the intersection tests.
...
The early bailout proved to be difficult to get right, so don't bother.
2012-12-07 22:16:51 +09:00
Bill Currie
98c9e4f8c0
White space.
2012-12-07 22:16:22 +09:00
Bill Currie
f3328a61c7
More tests and update a comment.
2012-12-07 22:16:07 +09:00
Bill Currie
b053edee17
Fix the handling of size in set_expand.
...
It was correct for set_add, but not for other ops :/ (out by 1)
2012-12-07 20:44:09 +09:00
Bill Currie
770a40cef0
Add a bunch more tests.
...
Even found some bugs :)
2012-12-07 20:43:11 +09:00
Bill Currie
39920a4ea7
Fix the type when converting set of everything to string.
2012-12-07 19:35:37 +09:00
Bill Currie
c76231ca30
Add some very basic tests for sets.
...
They test creation, empty, everything and inversion. Already found a bug
(typo: "everythign" :P)
2012-12-07 19:34:34 +09:00
Bill Currie
e0c92b6089
Rename set_iter_t's member to value.
...
Makes more sense now that the membership of the value depends on the
inversion of the set.
2012-12-06 21:11:38 +09:00
Bill Currie
eb8fd55677
Move set.c into libQFutil.
...
Also move the ALLOC/FREE macros from qfcc.h to QF/alloc.h (needed to for
set.c).
Both modules are more generally useful than just for qfcc (eg, set
builtins for ruamoko).
2012-12-06 20:52:53 +09:00
Bill Currie
67b796f851
Fix a silly error in bsp extents checking.
...
Found while hunting for rhinodemons.
2012-11-23 14:38:15 +09:00
Bill Currie
fe9fb41f93
Correct some very suspicious looking code.
...
While accessing short foo[2][4]; as foo[0][0..7] should work in theory, who
knows what gcc does with it when optimizing. I don't know if this will fix
johnnyonflame's bsp loading problem, but no point in having rhinodemonic
code hanging around.
2012-11-23 14:35:34 +09:00
Bill Currie
4b503c7f72
Store the requested size in the block.
...
This necessitated disabling the id2 padding, but it's only commented out
incase there's more growth. Now the (compiler) error in -addObjectNoRetain
is caught ealier.
2012-11-19 21:50:42 +09:00
Bill Currie
8ee98e1ef5
Rename memblock_s's size to block_size.
...
In order to improve the pointer checking, I plan on adding a size field to
represent the requested size.
2012-11-19 21:35:27 +09:00
Bill Currie
49ad301d3d
Add improved memory checking to progs.
...
With pr_boundscheck >= 2, pointer access will be checked against allocated
blocks (qfvalgrind?:). Currently extremely basic, but it seems to work.
2012-11-19 20:03:21 +09:00
Bill Currie
ec42bde527
Make hash tables more const correct.
...
And clean up the resulting mess :/
2012-10-27 11:44:31 +09:00
Bill Currie
cfb856b9cf
Fix byteswapping of a node's firstface/numfaces.
...
I'd forgotten to fix this.
2012-09-08 09:38:22 +09:00
Bill Currie
0ce32a793e
Return the correct size for set_bsp*_write().
...
Need to subtract the size of the bsp_t/bsp29_t struct. Now old and new
qfbsp produce identical bsps (so long as they're both unoptimized, or
(probably) both optimized).
2012-09-07 20:42:04 +09:00
Bill Currie
2d30cddc66
Implement bsp2/bsp29 writing.
...
It's ugly, inefficient, and untested, but it should work.
2012-09-07 18:27:20 +09:00
Bill Currie
3df85a6abe
Fix reading bsp29 files.
2012-09-07 17:37:46 +09:00
Bill Currie
a37c5465e1
First step for BSP2 support. DOES NOT WORK!
...
All of the nastiness is hidden in bspfile.c (including the old bsp29
specific data types). However, the conversions between bsp29 and bsp2 are
implemented but not yet hooked up properly. This commit just gets the data
structures in place and the obvious changes necessary to the rest of the
engine to get it to compile, plus a few obvious "make it work" changes.
2012-09-07 16:09:24 +09:00
Bill Currie
9bfcdad35a
Fix some type-size safety issues.
...
Expecting int to be 32 bits is a little dangerous, and the function
versions of swap/noswap should be unsigned rather than signed.
2012-08-19 13:37:06 +09:00
Bill Currie
7f805c2527
Use pkg-config for zlib.
...
Helps cope with zlib being in weird places (eg, ps3toolchain)
2012-08-18 21:41:33 +09:00
Bill Currie
3b047a3cc1
Check for getuid and cope when it's not there.
...
The ps3toolchain doesn't have getuid or getpwent. Nor does it have
timeGetTime, so use Sys_DoubleTime instead.
2012-08-18 21:37:54 +09:00
Bill Currie
6f484ee757
Add support and tests for 3x3 matrices.
2012-08-18 16:29:57 +09:00
Bill Currie
ee27c49e70
Separate the checks for building dirent.c and fnmatch.c.
...
ps3's libc has opendir and friends, but not fnmatch.
2012-08-18 12:12:45 +09:00
Bill Currie
5613b272da
Whee, another char index issue.
2012-08-18 11:50:35 +09:00
Bill Currie
d074f4a983
Hack in a fake version of "access".
...
It seems access is unimplemented in the ps3 toolchain.
2012-08-18 11:45:26 +09:00
Bill Currie
62face768f
Fix some char index issues.
2012-08-18 11:02:52 +09:00
Bill Currie
7928274b6e
Test for and include sys/select.h.
2012-08-18 10:57:42 +09:00
Bill Currie
6e1f043719
Clean up some unused or local functions.
2012-08-18 09:36:43 +09:00
Bill Currie
a1a2060583
Yet another ps3 plugin fix.
...
Returning an uninitialized pointer... ouch. Hopefully the last one.
2012-08-17 10:24:41 +09:00
Bill Currie
cbaad33638
Fix a couple more ps3 plugin related warnings.
...
Whee :P
2012-08-17 10:20:35 +09:00
Bill Currie
41876e8c37
Some compile fixes for when dlopen is not available.
...
It seems the ps3 gameos build env is... not what we've come to take for
granted.
2012-08-17 09:18:00 +09:00
Bill Currie
1406cf13de
Mask the QFS_Rename message with SYS_FS.
...
It really should have been masked all along, but I guess developer 1 was
too noisy back then.
2012-07-21 22:34:10 +09:00
Bill Currie
7b231bc70e
Add support for /*..*/ comments to idparse
2012-06-23 19:43:22 +09:00
Bill Currie
b4ad695e16
Make info_t opaque.
...
I didn't like the way client/server code was poking around at the
implementation. Instead, provide a couple of accessor functions for the
same information.
2012-06-14 22:46:23 +09:00
Bill Currie
23a38738fc
Massive whitespace cleanup.
...
Lots of trailing whitespace and otherwise blank lines.
2012-05-22 08:23:22 +09:00
Bill Currie
b5add680f7
Add Mat4as3MultVec.
...
to transform a vertex without the translation (eg, for normals) without
having to have separate matrices.
2012-05-20 15:20:18 +09:00
Bill Currie
4ba69b511b
Make quat_origin the right type.
...
It's quat_t, not vec3_t :P.
2012-05-15 21:08:46 +09:00
Bill Currie
9f253454e4
Implement and test Mat4Inverse().
2012-05-15 21:08:44 +09:00
Bill Currie
fa6270322f
Make Mat4Decompose a little more intuitive.
...
Params are now in application order (good thing not much code uses it yet).
2012-05-15 21:08:44 +09:00
Bill Currie
de131c18ad
Add VectorShear and really test Mat4Decompose.
...
And the tests really exercised VectorShear (first attempt had things
messed up when more than one shear value was non-zero). Also,
Mat4Decompose wasn't orthogonalizing the z axis row. Oops. Anyway,
Mat4Decompose is now known to work well, and the usage of its output is
understood :)
2012-05-15 21:08:44 +09:00
Bill Currie
8cea6b0a1e
Fix a scaling snafu in Mat4Decompose.
...
Found when checking how rotation affects non-uniform scaling (haven't
written proper tests yet: need to figure out how).
2012-05-15 21:08:44 +09:00
Bill Currie
82abd5e426
More matrix tests.
2012-05-15 21:08:44 +09:00
Bill Currie
730f9668bd
Add support for mat4 * vec3
2012-05-15 21:08:44 +09:00
Bill Currie
50af8a562e
Add tests for matrix decomposition and fix the bugs.
2012-05-15 21:08:44 +09:00