Commit graph

3486 commits

Author SHA1 Message Date
Bill Currie
e58cd75660 Bound r_maxdlights properly.
QF's implementation doesn't support more than 32 dlights (32 bit int).
2012-07-03 15:27:48 +09:00
Bill Currie
eefefb79b0 Rename char_queue to draw_queue. 2012-07-03 14:45:16 +09:00
Bill Currie
b25de4d995 Rewrite the 2d code to use a scrap.
This severely reduces the calles to BindTexture, and more importantly,
glUseProgram, EnableVertexAttribArray etc. The biggest changes are:

 o  icons and text are all in the one giant texture
 o  icons and text are mixed in the one queue

This gave ~9% speedup for bigass1 (159->174fps).
2012-07-03 13:38:35 +09:00
Bill Currie
df35b22af4 Parameterize the linear filtering of scrap textures. 2012-07-03 12:10:24 +09:00
Bill Currie
e170f4ee75 Slightly reducde the number of calls to glUniformMatrix4fv.
It doesn't make a big difference to bigass1 (yet ?), but it does clean up
apitrace a little.
2012-07-03 10:57:35 +09:00
Bill Currie
1a6b56b0a2 Call glTexSubImage2D only once per frame.
Instead of once per surface... ouch. Gives about 20% speed boost on demo1
(154.7->185.7)
2012-07-02 20:01:28 +09:00
Bill Currie
8fa92bf206 Add 32 button support to sdl and win as well.
The world isn't x11 (much as I'd like it to be)
2012-07-02 16:51:14 +09:00
Bill Currie
7cd8806ec0 Add support for up to 32 mouse buttons.
My new mouse reports only up to 9 (skipping 6 and 9, it seems), but I
/have/ seen 32 button mice...
2012-07-02 16:33:57 +09:00
Bill Currie
4da3be5cd6 Get a minor speed gain in glsl bsp rendering.
About 4% (99.5 to 104.4) from not calling VertexAttrib4fv or BindTexture
when not necessary.
2012-06-29 22:13:20 +09:00
Bill Currie
603fe92cba Add a callback for when key_dest is set. 2012-06-29 18:00:21 +09:00
Bill Currie
3406cad99a Many distcheck fixes.
Yay, bitrot :P
2012-06-29 10:49:21 +09:00
Bill Currie
415decb983 Use memmove instead of strcpy when deleting chars.
It seems recent(?) 64-bit strcpy implementations of strcpy don't work
properly for overlapping regions even when moving down. Quite the
surprise, as I thought that would always work. *shrug*
2012-06-23 20:54:55 +09:00
Bill Currie
7b231bc70e Add support for /*..*/ comments to idparse 2012-06-23 19:43:22 +09:00
Bill Currie
aa2a8e8909 Mostly "merge" cl_screen.c.
Down to protocol/networking differences.
2012-06-15 22:02:17 +09:00
Bill Currie
b2290d92c9 Nuke UNALIGNED_OK.
It's not really necessary (and was effectively dead anyway).
2012-06-15 22:02:17 +09:00
Bill Currie
e730608dd7 Implement r_flatlightstyles from fitzquake. 2012-06-15 22:02:14 +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
ac1bf2a158 Don't save unnamed fields.
There will normally be only one unnamed field (if any), and it's always the
null field. This will put an eventual end to the "'' is not a field"
messages.
2012-06-10 20:56:22 +09:00
Bill Currie
7d84800250 Remove an unnecessary if.
It needed during initial development of the patch, but with the refactoring
of s_init, it became redundant.
2012-05-28 07:58:11 +09:00
Bill Currie
01fb4f265d Attempt to reconnect to jack on loss of connection. 2012-05-28 07:46:22 +09:00
Bill Currie
dbc203b625 And a few more bits of whitespace. 2012-05-23 08:21:27 +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
85da69a96a Transform normals wrt bones in sw and sw32.
Better lighting :), though any scaling/shearing will produce funny results,
and sw32's lighting is broken in general.
2012-05-20 15:21:25 +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
0fbaa2a88a Add sw32 support for iqm models.
That was easy :)
2012-05-20 14:23:41 +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
e2db2dcb63 Support static iqm models.
Segging on a model with no animations is not nice :P
2012-05-19 21:26:11 +09:00
Bill Currie
d25f39cc7d Remove pskindesc from affinetridesc_t.
It's never used after being set.
2012-05-19 09:29:05 +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
be9c0697a2 Give sw iqm its own transform setup.
IQMs don't need to be scaled or offset. This fixes iqms not rendering,
though they actually were: just super tiny.
2012-05-19 00:43:26 +09:00
Bill Currie
c0517b1d97 Factor out the blend palette creation.
gl, sw and sw32 use blend palettes, so share the code. This also abandons
the optimization for transforming verts in sw (had all sorts of problems
anyway). sw still doesn't work, though.
2012-05-19 00:34:15 +09:00
Bill Currie
e069757ceb Refactor the skin setup code. 2012-05-19 00:18:03 +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
da87ac0ce5 Remove some unused parameters. 2012-05-17 21:33:22 +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
7637f35616 Remove the test scaling.
Heh, forgot to remove it again :)
2012-05-17 16:02:13 +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
f958afad53 Optionally allocate extra data for iqm blend frames.
Also, correct the blend parameter type (int->float. oops).
2012-05-17 15:57:07 +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
041d63c828 Move the frame blending into common code. 2012-05-16 17:44:18 +09:00
Bill Currie
8ada7c02a3 Remove the vertex scaling.
It was there only because mrfixit is rather small (8qu?) and it made
finding him easier :). Anyway, any scaling should be done in the engine.
2012-05-16 08:13:59 +09:00
Bill Currie
9984925fe8 Correct a comment. 2012-05-15 21:08:47 +09:00
Bill Currie
31772afd13 Add in some ambient light for iqm models.
Though the bsp loader doesn't yet support colored lighting, the ambient
light will be colored when it does. With this, I guess iqm model support is
done for glsl until I figure out how I want to do dual quaternion support.
2012-05-15 21:08:47 +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
0fd2b01665 Update the shader to work as it should :)
I always thought it whould be "light - point" :P. Also, in normal maps, 127
is 0.
2012-05-15 21:08:47 +09:00
Bill Currie
c454b96d2a Translate lights into entity space.
Finally, lights work "properly". Probably the nicest lighting we've ever
had :) (still have to put in ambient, though).
2012-05-15 21:08:47 +09:00