767 Commits

Author SHA1 Message Date
Kevin Shanahan
cb85c9b102 model: fix skindata offset calculation for software renderer
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-25 08:24:55 +10:30
Kevin Shanahan
090e2f4c6b screen: make screenshot message consistent
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-25 06:41:22 +10:30
Kevin Shanahan
9f5a3d4b23 screen: move pcx_t definition to client.h
In line with QW, which re-uses it for skins.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-25 06:40:10 +10:30
Kevin Shanahan
6f414bc844 screen: remove duplicated max viewsize check
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-25 06:25:02 +10:30
Kevin Shanahan
1d336ef01c screen: remove duplicated viewsize check
oldscr_viewsize was a duplicated check for changes in the scr_viewsize
cvar. Remove it and make the check consistent across all screen.c files.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-25 06:09:08 +10:30
Kevin Shanahan
bc09847c3b model: implement transform interpolation for gl alias models
Ported the code from the software renderer with minimal changes. Didn't
bother to fix GL shadows at this point.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-24 17:02:39 +10:30
Kevin Shanahan
c7c0eab180 model: allow any origin/angles for R_RotateForEntity
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-24 16:32:04 +10:30
Kevin Shanahan
f810f58f64 model: rename modelorg global and move to gl_rsurf.c
Rename modelorg to bmodelorg and move it to gl_rsurf.c where it is used
for the R_RecursiveWorldNode function. Make it static and add a comment
about it's intended use.

Now it's obvious that the modelorg global in gl_rmain was acutally
set but never used for GL alias model rendering.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-24 16:10:12 +10:30
Kevin Shanahan
adefdb4148 model: alias model animation interpolation for glquake
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-24 15:42:53 +10:30
Kevin Shanahan
166ea1750d model: rename gl version of R_AliasDrawModel
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-24 14:56:17 +10:30
Kevin Shanahan
b5fc4ad124 model: pass pose via e->currentpose in GL R_AliasSetupFrame
Rename the function too, to be consistent with the software renderer.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-24 14:53:54 +10:30
Kevin Shanahan
7edf2c2c3a model: implement transform lerping for alias models
Interpolate position and orientation of alias models as well, makes the
animation interpolation much more effective.  Took some hints from
fitzquake, but ended up implementing a bit differently.

Still a few glitches (fitzquake has some good workarounds) so keep off by
default for now.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-24 13:56:47 +10:30
Kevin Shanahan
8dbe730ce0 sprite: correctly work around strict aliasing warning in gl
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-24 12:21:47 +10:30
Kevin Shanahan
c2abd3df01 client: remove unused bitcounts profiling data
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-24 11:40:37 +10:30
Kevin Shanahan
c5ebfcdcd9 entities: check only top of entity_t struct for matching players
Making this hack even uglier, we may need to ignore the lerp info of the
entity_t structure since we write to this in the cl_visedicts array.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-24 11:36:14 +10:30
Kevin Shanahan
74c3404242 trivial: fix function name in comment in cl_tent.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-23 15:38:59 +10:30
Kevin Shanahan
4be271d1c7 entities: make temp entity sfx static
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-23 15:38:35 +10:30
Kevin Shanahan
f454f4256c entities: pull cl_beams into cl_tent.c and make static
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-23 15:37:39 +10:30
Kevin Shanahan
5dd1b86ae7 trivial: minor comment/whitespace cleanup
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-23 12:44:18 +10:30
Kevin Shanahan
4ef3b2ca5f model: submit proper lerping on alias model frame groups
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-23 12:43:43 +10:30
Kevin Shanahan
3a2a1cb42f model: don't skip lerp on model frame zero
Now that I seem to be initialising the rest of the frame information properly,
we don't need to skip lerp on frame zero.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-23 12:42:04 +10:30
Kevin Shanahan
9f54ac4d34 model: intialise model lerp info for static and temp entities
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-23 12:40:13 +10:30
Kevin Shanahan
6a2940940b entities: fix for handling of lightning/beam temp entities
Unintended re-use of loop variable 'i'.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-23 09:00:43 +10:30
Kevin Shanahan
1afcef5f5f model: disable trivial accept on models while lerping
R_AliasCheckBBox only checks against the current frame's BBox, so if we lerp
then we can end up needing to clip against the edge of the screen. If we use
the unclipped path to draw models we can crash by painting outside the frame
buffer.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-23 07:56:43 +10:30
Kevin Shanahan
1db7166fc2 trivial: whitespace cleanup in d_polysa.S
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-22 13:43:04 +10:30
Kevin Shanahan
cbac42b41c model: fix definition of SPAN_SIZE in d_polysa.S
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-22 13:42:35 +10:30
Kevin Shanahan
27a1439438 trivial: whitespace cleanup in r_aliasa.S
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-22 13:40:17 +10:30
Kevin Shanahan
a931c5730c model: factor out interval selection code for models/sprites/skins
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-22 13:32:18 +10:30
Kevin Shanahan
5518b19190 model: fix thinko in model interpolation patch
Was clamping the wrong end of the blend. Much smoother now!

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-22 12:01:37 +10:30
Kevin Shanahan
c5791aab0f model: fix qwcl build after lerp patch
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-21 12:28:23 +10:30
Kevin Shanahan
f0a6f125d8 render: fix stack overflow in Windows optimised builds
Finally got around to learning enough assembler and debugger skills to
solve this problem. Turns out the gcc was agressively inlining functions
(even at -O1) in the renderer path.

Tell gcc *not* to inline R_EdgeDrawing (into R_RenderView_) because the
massive stack size here doesn't leave enough free for when we call
R_DrawEntitiesOnList -> R_AliasDrawModel (quite large stack there too) ->
R_AliasPrepare{,Unclipped}Points -> D_PolysetDraw.

Only affected the USE_X86_ASM=Y build, I guess because gcc can't see the
large stack inside the assembly file.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-21 11:58:27 +10:30
Kevin Shanahan
22c2cfe7df model: preliminary model interpolation support for NQ/SW
Still a lot of work to do to get this looking good (i.e. at a minimum lerp
movement as well), but this at least interpolates between the animation
frames.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-20 19:15:13 +10:30
Kevin Shanahan
2ac2685ae3 model: remove duplicated poseverts/numverts info
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-20 10:16:15 +10:30
Kevin Shanahan
acfc75321e model: remove gl_model.h and use model.h everywhere
Gets rid of a bunch of conditionals throughout the .c files as well.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-19 13:22:30 +10:30
Kevin Shanahan
cb63c14b44 model: merge differences between model.h headers
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-19 13:02:47 +10:30
Kevin Shanahan
d66b0503c7 model: use common model.c file for both SW and GL
A few minor hacks and we can now use the model.c file for both renderers.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-19 12:42:58 +10:30
Kevin Shanahan
1868f3b93a model: move client functions to bottom of file
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-19 12:13:40 +10:30
Kevin Shanahan
c1fad68619 model: define SV_Error to help merge gl_model.c with model.c
Remove the differences in the error messages to make spotting any
remaining real differences easier.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-19 12:03:16 +10:30
Kevin Shanahan
6211cb4077 model: use the shared alias_model.c file for glquake as well
Add in a small hack for glquake's MAX_SKINS limitation and finally we
can share the alias model loading code between the software and GL
renderers.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-19 11:39:50 +10:30
Kevin Shanahan
233aa47965 model: hand off alias mesh data loading to helper
GLQuake had pretty much already implemented this with
GL_MakeAliasModelDisplayLists, but generalise it to use the model_loader_t
system and have the software render place it's internal details behind the same
interface.

Again I have introduced some limitations into the software renderer in the form
of the static arrays used to hold temporary data as we load the mesh (same a
glquake) - will attempt to get rid of these later.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-19 11:18:36 +10:30
Kevin Shanahan
15ee03733e build: don't use typedefs for forward declarations
Didn't realise this is a C11 feature and makes some compilers unhappy.
Just use the struct names instead of the *_t typedefs.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-19 08:32:41 +10:30
Kevin Shanahan
344cc52e52 model: hand off skin data loading to helper
Have the helper struct do the renderer specific alias model skin
processing. Will probably want to relocate the code to a more appropraite
place later, but just get the factoring done for now.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-19 05:50:04 +10:30
Kevin Shanahan
1a128ddfbf model: create a model loading helper
Create a model loader structure which can be used to pass callbacks down
from the renderer code. This will allow us to have the render do some
processing on the loaded data at appropriate points and let us make the
actual loading code generic.

In the first instance, pass down the aliashdr_t padding value required by
the renderer.

Note that to remove a circular dependency introduced in the headers, I had
to stop including render.h in model.h/gl_model.h and that change
propogated some more changes to includes across the tree...

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-18 18:32:30 +10:30
Kevin Shanahan
97ad3e16a0 model: only save the 8-bit texels for the player model
Can't see any reason why the conditional load was commented out
previously, so let's save some heap space.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-18 16:02:01 +10:30
Kevin Shanahan
b2bf6f9e0a protocol: use strcasecmp for sv_protocol command arguments
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-18 16:01:28 +10:30
Kevin Shanahan
0b4e4e7547 net: fix debug function StrAddr
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-18 16:00:40 +10:30
Kevin Shanahan
b6f2907e71 model: fix skingroup loading
This is why I needed something to test with!
Thankyou Metlslime for Rubicon 2 :)

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-18 15:56:35 +10:30
Kevin Shanahan
b0044d1d79 model: move skindesc into common aliashdr struct
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-18 11:09:26 +10:30
Kevin Shanahan
9d2dc43c87 model: update skin animation code for glquake/glqwcl
Use similar technique as used for the software models, restore full skin
animation capabilities for glquake (in theory - still need a good test!)

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-18 10:58:50 +10:30
Kevin Shanahan
e856f87e90 model: fix calculation for alias model frame/pose time
The old equation just happened to work okay for the existing data, but was
clearly incorrect. Everything still looks normal in-game with this change.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-18 09:53:54 +10:30