Commit Graph

830 Commits

Author SHA1 Message Date
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
Bill Currie 215d2e9747 Add a function to decompose a matrix.
The function gives rotation(quaternion), scale, shear, and translation (all
three as vectors), shear is (XY, XZ, YZ).
2012-05-15 21:08:44 +09:00
Bill Currie 8aabb704d2 Add tests for inverting a dual quad transform. 2012-05-15 21:08:43 +09:00
Bill Currie f874aeb941 Add support for duals and dual quaternions.
Not everything is unit-tested, but the currently important stuff is.
2012-05-15 21:08:43 +09:00
Bill Currie e6c0512f31 Ensure dstring has space for terminating 0.
It seems (some versions of) windows vsnprintf don't count the terminating 0
when limiting the number of chars written to the buffer. Nor do they
guarantee the output string will be terminated.
2012-05-10 14:48:43 +09:00
Bill Currie 8791b35e55 Add support for half floats.
iqm and OpenGL use them, so they might come in handy. The tests use values
from wikipedia and a couple extra.
2012-04-26 20:55:11 +09:00
Bill Currie efaef89c5f Add a shortcut function for quaterion/vector multiplication.
I got the idea from blender when I discovered by accident that quat * vect
produces the same result as quat * qvect * quat* and looked up the code to
check what was going on. While matrix/vector multiplication still beats the
pants off quaternion/vector multiplication, QuatMultVec is a slight
optimization over quat * qvect * quat* (17+,24* vs 24+,32*, plus no need to
to generate quat*).
2012-04-26 09:48:08 +09:00
Bill Currie 7b0d48313d Fix a signed type mixup.
I mis-applied calim's patch, and gcc failed to tell me :(
2012-04-26 07:28:22 +09:00
Bill Currie a7870a98a1 Apply a couple of patches from calim of nouveau.
One's an actual bug, the other a bit of error checking (not sure how
necessary it is, but it's in code that we don't /want/ to run, so it can't
hurt :)
2012-04-25 08:48:46 +09:00
Bill Currie bc1b483525 Nuke the rcsid stuff.
It's pretty useless in git.
2012-04-22 10:56:32 +09:00
Bill Currie 561484842c Fix some snafus in PL_ParseData
Found them by inspection while writing a python version of qfplist.
2012-04-17 21:26:33 +09:00
Bill Currie ce6ab908a5 Don't include the specific plugin headers in plugin.h.
This lets files that use plugins not depend on plugins they don't use.
2012-02-13 22:02:07 +09:00
Bill Currie d8a37bc791 Correct the usage of gzFile.
Thanks to spirit for pointing that QF wasn't compiling with zlib 1.2.6
(archlinux, not yet in debian).

I was using gzFile as "gzFile *gzfile", but gzFile is already a pointer. In
older versions of zlib (including the 1.2.3 that's in debian), gzFile is
declared as a void *, and it seems that gcc is happy with assigning void **
to void *. However, in recent zlib, gzFile is now struct gzFile_s *, which
gcc is most definitely unhappy about assigning to struct gzFile **.

I just hope that either I had misread the type back when I wrote quakeio,
or that nobody is using such an ancient zlib.
2012-02-13 09:00:31 +09:00
Bill Currie 9fbff2f4d5 Do an audit of the Makefile.am files.
o All instances of LIBADD/LDADD have a corresponding DEPENDENCIES
    specificatiion.
  o libraries now use a lib_ldflags macro to keep things consistent
  o duplication of source/lib names has been minimized (particularly in
    the libraries; more work needs to be done for the executables)
  o automake spec blocks have been organized (again, more work needs to be
    done for the executables)
2012-02-07 16:04:19 +09:00
Bill Currie 042f310ed7 Add MSG_WriteBytes to match MSG_ReadBytes. 2012-02-06 15:04:01 +09:00
Bill Currie be9f05ea14 Catch progs zone errors and give a stack dump. 2012-02-06 12:48:22 +09:00