Commit Graph

438 Commits

Author SHA1 Message Date
Bill Currie 62793b2dc2 Fix some potentially garbage assignments.
These are the ones where I could easily make scan-build happy. They do seem
to be potential holes where invalid data in one place could result in use
of uninitialized values.
2018-09-09 09:54:16 +09:00
Bill Currie 59e85b7d5e Fix a pile of dead assignments.
Some were actual bugs!
2018-09-08 22:23:57 +09:00
Bill Currie 8fd5be0ee0 Fix a pile of sizeof goofs.
While scan-build wasn't what I was looking for, it has proven useful
anyway: many of the sizeof errors were just noise, but a few were actual
bugs (allocating too much or too little memory).
2018-09-07 20:00:57 +09:00
Bill Currie 4f58429137 Fix an unhealthy pile of gcc 8 warnings.
While some of the warnings were merely annoying, some where actual bugs or
unearthed bugs in related code.
2018-08-20 00:05:00 +09:00
Bill Currie bd52e46adf Merge branch 'master' into win 2016-01-22 01:10:49 +09:00
Bill Currie 1ea74c6269 Fix the gl skin segfault.
This was caused by an out-by one error when setting up the skin: if cmap
was 0 then the gl_skin struct would be taken from index -1 of the array and
thus cause all sorts of grief.
2016-01-04 22:04:39 +09:00
Bill Currie 61c6a4b68e Include config.h in model tests.
The gcc inlining changes made it necessary.
2016-01-03 16:18:14 +09:00
Jeff Teunissen 890c83ff6e Fix crash in classic GL
GL sometimes crashes when building skins. This probably isn't the correct
fix (finding the situation where fb->tex can become NULL despite fb being
non-null is), but it does kill the segfault. Luckily, this is git and this
commit can just be reverted when the real fix shows up. :)
2014-10-16 13:45:39 -04:00
Bill Currie ab3f554a0e Limit the search for lit and ent files.
The search for these files will stop in the vpath that contains the .bsp
file to which they belong. This will prevent problems with
id1/maps/start.lit being used for shadows/maps/start.bsp.
2014-01-28 16:22:05 +09:00
Bill Currie 3efb0c538f Separate file search from loading.
QFS_LoadFile (and its wrappers) now  take a file handle rather than a
path. This will make vpath usage a little cleaner to implement.
2014-01-28 16:22:05 +09:00
Bill Currie 328b997843 Save the vpath in the model.
This will be used for restricting searches for auxiliary model files.
2014-01-28 16:22:05 +09:00
Bill Currie f5501fbf24 Fix a pile of automake deprecation warnings.
s/INCLUDES/AM_CPPFLAGS/g

I <3 sed :)
2013-11-24 13:11:50 +09:00
Bill Currie 1740e14d2a Do a const-correctness run on palettes. 2013-01-27 19:57:40 +09:00
Bill Currie e27d7cbd2d Handle alloca "correctly".
Use AC_FUNC_ALLOCA and the #ifdef mess suggested by the autoconf docs
(hidden in qfalloca.h).
2013-01-22 21:02:50 +09:00
Bill Currie ec6ba8a03c Make key_dest private to keys.c
This has the bonus feature of making nq pause the game when input focus is
lost (same conditions as dropping the console or bringing up the menu).
2013-01-16 19:48:54 +09:00
Bill Currie 9d6954efb7 Fixup extended bsp when loading the file.
It turns out the tools need the node conversions too, so doing it in
bspfile seems to be best as it is used by everything that reads a bsp file.
2012-12-30 13:29:24 +09:00
Bill Currie a4d95f3f53 Move Mod_FindClipDepth and recurse_clip_tree into clip_hull.c.
Since the hull depth needs to be set for the hull to be useful, it makes
sense to move the code into the same place that allocates new hulls (to me,
anyway).
2012-12-29 16:25:47 +09:00
Bill Currie a12eb940f1 Remove the hard-coded bsp maximum depths.
The depth limits in the gl and glsl renderers and in the trace code really
bothered me, but then the fix hit me: at load-time, recurse the trees
normally and record the depth in the appropriate place. The node stacks can
then be allocated as necessary (I chose to add a paranoia buffer of 2, but
I expect the maximum depth will rarely be used).
2012-11-28 21:29:03 +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 eccc1b5b51 Put the over-size range back to its original value.
This fixes the horribly different results between optimized and unoptimized
qfbsp (there is still a difference of 1 brushface). Unfortunately, it also
severely limits the maximum size of a map.
2012-09-18 09:25:10 +09:00
Bill Currie 45c48a6215 Fix bsp2 loading.
Just some problems with the handling of extended bsp29 files. I'm not
quite happy with the code, but it will do for now.
2012-09-08 09:41:00 +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 69fb78278f Remove the redundant endian conversions from bsp loading.
It's obvious that it's been a very long time since anybody's tried playing
QF on a big-endian machine: double converting data isn't good :/
2012-09-07 15:45:59 +09:00
Bill Currie 6ba6959205 Allow any NxN or 2NxN sky texture for glsl.
Maps that specify a skybox often use a fake sky texture, sometimes 16x16.
Having a hardcoded requiredment of 256x128 is a tad inappropriate.
2012-09-05 14:02:44 +09:00
Bill Currie 31dead3dcd Fix 16-bit mdl loading for glsl.
The extra precision verts are offset by numverts, not numposes :P
2012-08-07 17:06:01 +09:00
Bill Currie c66e437ebe Enable shadows for grenades.
Now that shadevector is correctly transformed, grenade shadows aren't quite
so silly.
2012-07-17 17:12:34 +09:00
Bill Currie 428d57b7e1 Don't attemt fullbright processing for an unavailable skin.
In the end, it turns out this is the correct fix for the gl seg on
overkill, because build_skin will correctly use the fully setup player skin
if the glskin doesn't have a texture associated with it.
2012-07-05 10:30:41 +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 3087e685cc Convert texcoords to fixed point.
Bah, another weekend wasted on an oversight :( However, Mr. Fixit looks
quite alright in the quake palette.
2012-05-20 10:02:44 +09:00
Bill Currie f0285e5a08 Correct the texcoord conversion.
1.0 is to represent the last pixel, not one past it.
2012-05-20 08:51:15 +09:00
Bill Currie c1eb3e77c3 Process each vertex texcoord only once.
Double converting texcoords results in 0,0 for all affected texcoords. Mr
Fixit was looking rather ill. Now he looks weird (something wrong in the
renderer?).
2012-05-19 09:15:26 +09:00
Bill Currie d41bf32d91 Hopefully fix color conversion.
Hard to tell because the triangle rendering is still messed up. However,
storing negative values in bytes doesn't work :)
2012-05-19 09:14:07 +09:00
Bill Currie fb10f38fd4 SW now tries (but fails miserably) to render iqm models.
Something seems to be very wrong with the transforms.
2012-05-18 23:31:14 +09:00
Bill Currie da313cfae7 Load iqm models in the sw renderers.
sw32 loses 32 bit textures :/
loading is /slow/ (converting rgb(a) to 8bit palette... ouch.
2012-05-17 21:17:48 +09:00
Bill Currie c3801d46e5 Render iqm models in GL.
There are still many issues to sort out, but the basics are working.

Problems:
	rendered fullbright (no lighting done)
	normals are ignored
	extra textures (glow etc) not used/loaded

4 models on the screen don't seem to be a problem.
2012-05-17 15:58:29 +09:00
Bill Currie c0df07b607 Enable loading of iqm models in gl.
They don't render yet, but the engine doesn't segfault.
The vertex blend indices are rewritten with blend palette indices.
2012-05-17 15:55:38 +09:00
Bill Currie 23284536b5 Move IQM freeing into common code. 2012-05-16 18:09:44 +09:00
Bill Currie 111377f1be Use buffer objects for iqm vertex arrays and elements. 2012-05-15 21:08:47 +09:00
Bill Currie 5740dba467 Mark iqm models as need-load when clearing.
This fixes the segfault on map change.
2012-05-15 21:08:47 +09:00
Bill Currie 1375c3cf03 Finally, load textures for iqm :) 2012-05-15 21:08:47 +09:00
Bill Currie 202ab04572 Ensure the rotation quats are normalized.
Doesn't make any noticeable difference, but it doesn't hurt.
2012-05-15 21:08:46 +09:00
Bill Currie 31d89782ef Use the correct index variable when byteswapping the arrays.
Not the cause of the broken animations :(
2012-05-15 21:08:46 +09:00
Bill Currie 7cda91a879 Temporarily disable dual quaternions.
The animation data isn't getting loaded or used properly (not sure yet).
This helps ensure it's not something I've done wrong with dual quats.
2012-05-15 21:08:46 +09:00
Bill Currie 551dfc47fb Build the iqm vertex arrays in the correct order.
They need to be built in ascending type order (makes life easier in the
renderer).
2012-05-15 21:08:45 +09:00
Bill Currie 2e98c31175 Check the corrent bits when reading scale frame data.
Fixes the invalid reads when loading an iqm (at least for mrfixit).
2012-05-15 21:08:45 +09:00
Bill Currie a880f33152 Set the model type for iqm.
Forgot this rather important step :P
2012-05-15 21:08:45 +09:00
Bill Currie 078cb10caf Add a stride field to iqm_t.
Since iqm vertex arrays are variable, and I don't want to calculate the
stride every time I render a model, cached the value used when building the
arrays.
2012-05-15 21:08:45 +09:00
Bill Currie 6ab3bd45e5 Implement IQM animation loading.
Bone poses are converted to dual quaternions + shear + scale for nice
skinning. Will likely be slow for software skinning, but too bad.
2012-05-15 21:08:45 +09:00
Bill Currie bf38e6073e Implement iqm joint loading. 2012-05-15 21:08:44 +09:00
Bill Currie 52ab4f64f9 Add code for loading vertex colors.
And correct an oopsie in bledweights.
2012-05-15 21:08:44 +09:00
Bill Currie 1be9384f10 Load the iqm vertex and triangle data.
Still have the meshes, joints and animations to go.
2012-05-15 21:08:43 +09:00
Bill Currie 26a878da48 Stub out the iqm loader. 2012-05-15 21:08:43 +09:00
Bill Currie 95cef4a73e Correct a spelling error. 2012-04-24 14:12:54 +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 878764f79d Fix some segfaults in nq-server. 2012-04-15 15:11:16 +09:00
Bill Currie 6f026e9116 Fix some segfaults in server model loading.
I'd forgotten to test the servers when I did the vid_plugin changes.
2012-04-15 14:12:00 +09:00
Bill Currie 1d864521e9 Fix the sprite model loader for plugins. 2012-04-11 14:58:55 +09:00
Bill Currie cbdbfdd12f Fix the alias model loader for plugins. 2012-04-11 14:58:55 +09:00
Bill Currie 52e518bb1b Fix skin functions for plugins. 2012-04-11 14:58:55 +09:00
Bill Currie d445b4ef88 Rename the glsl qfgl functions to qfegl.
Keep them separate from the gl renderer :)
2012-04-11 14:58:54 +09:00
Bill Currie e991c1fed3 Make a bit of progress cleaning up vid for plugins. 2012-04-11 14:58:54 +09:00
Bill Currie 8530959752 Link the model libs to the render plugins. 2012-04-11 14:58:53 +09:00
Bill Currie 8e91fb7bc1 Get the basics linking.
Still, nothing will work: no plugins are loaded and they're all broken
anyway.

glx, sgl, glslx etc are going away, just the basics will be built: fbdev
(probably go away eventually), sdl, x11 and hopefully someday win. That's
actually the only reason anything links.
2012-04-11 14:58:53 +09:00
Bill Currie a4c280f2b2 Take the first step towards render plugins.
No clients link. Even if they did, nothing would work.
2012-04-11 14:58:53 +09:00
Bill Currie 39e1ccc506 Don't try to process skins in GL without a player model.
If the client receives a skin updated message from the server before having
loaded the player model (shouldn't happen, but some servers have very
strange programmers), no skin data is avaible for updating, so just bail
out.
2012-03-14 16:08:48 +09:00
Bill Currie ef37ed39a9 Clean up global symbols for the glsl renderer.
Where possible, symbols have been made static, prefixed with glsl_/GLSL_ or
moved into the code shared by all renderers. This will make doing plugins
easier but done now for link testing. The moving was done via the gl
commit.
2012-02-18 11:48:52 +09:00
Bill Currie 447ff2f2f5 Clean up global symbols for the gl renderer.
Where possible, symbols have been made static, prefixed with gl_/GL_ or
moved into the code shared by all renderers. This will make doing plugins
easier but done now for link testing.
2012-02-18 11:48:52 +09:00
Bill Currie 4707706f5d Use QF_NEED for the renderer and model libraries.
This breaks RPM building, but I can fix that later.
2012-02-10 13:29:45 +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 201532ea7e Fix missing library references when linking. 2012-02-05 14:25:22 +09:00
Bill Currie 1052bd2624 Fix the segfault on leaving e1m2.
Problem and solution found by Deek, reason by me.
2012-01-31 09:51:44 +09:00
Bill Currie 497718cc40 Plug the memory/texture/vbo leaks.
QF still leaks about 3MB/run on demo1, but even 100 runs didn't show any
render issues.
2012-01-29 22:32:35 +09:00
Bill Currie 8ac9ff0134 Link libQFmodels* agains libQFimage.
This is the correct fix for server linking wrt LoadPCX. Sort of. Really, it
would be better to disconnect the dependencies.
2012-01-27 19:55:30 +09:00
Bill Currie 03c7441265 Fix server linking wrt skin stuff. 2012-01-27 17:37:52 +09:00
Bill Currie ca2c861671 Fix team colors in GL NQ. 2012-01-26 13:53:52 +09:00
Bill Currie 5dcaeae97b Fix custom skins in GL for QW. 2012-01-26 12:50:37 +09:00
Bill Currie df87cffe15 Start working on the new GL skin code. 2012-01-24 23:06:07 +09:00
Bill Currie 6df8867d69 Implement custom skins for glsl. 2012-01-24 10:27:05 +09:00
Bill Currie d6683711f4 Clean up some redundant defines. 2012-01-24 09:37:46 +09:00
Bill Currie 19dc579a5a Fix custom player skins for the sw renderers. 2012-01-23 23:38:32 +09:00
Bill Currie 3dbb5724db Rename Skin_SetColormap_ to Skin_SetupSkin. 2012-01-23 21:40:12 +09:00
Bill Currie 08990ebb5a Make top/bottom color work for GLSL.
Works quite nicely (love those colormaps).
2012-01-23 19:24:12 +09:00
Bill Currie 9a4b065eaf Fix top/bottom colors for the SW renderers. 2012-01-23 17:33:19 +09:00
Bill Currie 7bfddd7ffe Gut most of the old skin code.
Custom skins are smashed on most targets. Player colors don't work, etc.
However, this will let me do a much cleaner implementation.
2012-01-23 16:16:30 +09:00
Bill Currie 3669e3aa2e Make alias model caching optional.
For now, only the glsl loader disables caching, but it stores the frame
vertices in GL memory, so its hunk usage is relatively lower (and will be
lower still when I get skins sorted out).
2012-01-17 19:31:50 +09:00
Bill Currie fb428f8067 Rename mod_flood.c to floodfill.c 2012-01-17 19:31:50 +09:00
Bill Currie 7ba7130f42 Load the sky texture as two separate textures.
The sky texture is normally 256x128, with each 128 wide side being the two
layers of the sky.
2012-01-11 21:09:57 +09:00
Bill Currie b43d03a98b Let the render specific texture loader decide on sky texture loading.
This is necessary to allow the glsl texture loader to process the sky
textures.
2012-01-11 21:08:04 +09:00
Bill Currie aa27a3f49c Load bsp model textures as repeating mipmaps. 2012-01-07 18:05:54 +09:00
Bill Currie 204c1aba03 Don't use the miptex_t after converting to texture_t. 2012-01-07 17:08:07 +09:00
Bill Currie 6f18035c12 Fix up alias-16 support.
After getting in contact with serplord, I now know that the sw alias
loading was correct. Turns out the gl loaders was mostly correct, just a
mistaken subtract rather than add. And with that, I can implement alias-16
support in glsl. better yet, since all the work is done in the loader, the
renderer doesn't know anything about it :) However, I need to create some
16-bit models for testing.
2012-01-05 12:52:12 +09:00
Bill Currie add5440ad1 Upload the normals with the vertex data.
Not all hardware can access a texture sampler from the vertex shader, and I
don't want multiple paths this early in the game. Now, vertex normals are
uploaded as shorts. Should be 14 bytes per vertex (was 10, could have been
8 if I had put the normal index with the vertex rather than st).
2012-01-04 09:42:00 +09:00
Bill Currie 2a3151cecd Hook in alias model drawing.
Nothing is visible yet.
2012-01-02 20:28:40 +09:00
Bill Currie 540bccbc27 Load all the alias vertex data as bytes.
I had forgotten I wanted to do it this way.
2012-01-02 13:41:12 +09:00
Bill Currie 2ad5aa7aed Unbind the array and element array buffers when done.
Not doing so wreaked havoc on my 2d rendering (what's he doing here, and
why's he messing with my redering? ;)
2012-01-02 10:08:56 +09:00
Bill Currie f3884c659c Finish alias skin loading and load vertex data into GL. 2012-01-01 23:55:27 +09:00
Bill Currie edb05fdfce Rename Vector3Scale and QuatCompScale.
They are now VectorCompMult and QuatCompMult.
2011-12-30 20:04:55 +09:00
Bill Currie bcdcd7b36d Implement sprint glsl loading.
That was... easy.
2011-12-30 09:36:57 +09:00
Bill Currie 91afdcf064 Don't call init_box when not doing a box trace.
I took the opportunity to pass qf through callgrind. init_box was
surprisingly expensive, especially considering its results were never used.
2011-12-25 17:11:48 +09:00
Bill Currie 2894689f71 Clean up mod_lightmap_bytes.
Just how many definitions do we need?
2011-12-25 13:02:26 +09:00