733 Commits

Author SHA1 Message Date
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
Kevin Shanahan
ad381210b8 trivial: remove unneeded cast in gl_rmain.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-18 09:53:12 +10:30
Kevin Shanahan
7ef937e58a model: rework skin group animations
Simplify the in-memory structures used for animated skins, similar to
model animations.  So, we no longer have maliasskingroup_t, rather every
skin specifies number of frames, which will in most cases be one. Only
costs us 8 bytes per alias model - seems worth it.

On another note, I really should find or create some proper tests for
animated skins...

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-18 09:40:03 +10:30
Kevin Shanahan
5804c883da model: remove skindesk pointer from r_affinetridesc
When I went to modify maliasskindesc_t I realised it was included here,
but upon inspection it's not actually used. Remove it.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-17 21:22:33 +10:30
Kevin Shanahan
1a91d8d95b model: remove unused cachespot from skins and sprites
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-17 14:31:15 +10:30
Kevin Shanahan
e97d7bb951 model: fix typo in gl poseintervals loading
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-17 13:53:10 +10:30
Kevin Shanahan
032bb52216 client: fix nq temp entities
Broken since 293084b "nq: handle visedicts similarly to qw".
Well, I did suspect stuff might get broken... now fixed!

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-17 12:10:00 +10:30
Kevin Shanahan
b9ae1b70a5 model: use proper GLuint type for texture numbers
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-17 11:36:21 +10:30
Kevin Shanahan
b6c3b42290 model: constify R_SetupAliasFrame
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-17 11:35:52 +10:30
Kevin Shanahan
17dbedd0bc model: trivial: remove unnecessary cast
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-17 11:35:21 +10:30
Kevin Shanahan
c70e80292b model: move the frameintervals to aliashdr_t
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-17 11:34:43 +10:30
Kevin Shanahan
e389a1dfd2 model: add per-pose intervals to gl alias models
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-17 11:28:20 +10:30
Kevin Shanahan
e1890b063e model: add back per-frame intervals
Decided it was a bad decision to remove the per-frame intervals for alias
models, so added them back. Still a little better than before I think
since we don't need the maliasgroup_t stuff.

Now, to bring gl alias models into line...

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-17 11:08:38 +10:30
Kevin Shanahan
2d3f89f14a model: sw: factor out skin loading
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-17 07:02:38 +10:30
Kevin Shanahan
2e892ea999 model: byte swap alias skin type in gl
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-17 07:01:25 +10:30
Kevin Shanahan
2eb8493008 model: bring sw and gl model loading code a little closer
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-16 21:11:48 +10:30
Kevin Shanahan
ee45322afc model: separate out renderer specific alias header data
Move the renderer specific fields from aliashdr_t to another struct. Embed the
common aliashdr_t struct within it and use the padded cache allocator to allow
the extra data to be managed automatically by the cache.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-16 14:39:32 +10:30
Kevin Shanahan
850cb61cb5 define offsetof if not already defined
Not sure where I was getting the macro from before, but fix compilation of
pmove.c by defining offsetof when it's not already defined. Must have been
getting it from a system header previously...

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-16 14:37:15 +10:30
Kevin Shanahan
eb6be5c8a5 zone: Add Cache_AllocPadded allocator
I want to be able to have objects in the cache which are are members of a
containing struct, so enable the cache allocation to specify that there is a
certain amount of padding below the memory address of the managed pointer.

Following patches for alias models will show the intended use case.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-16 13:05:27 +10:30
Kevin Shanahan
ea72041593 trivial: remove whitespace between type and varable for casts
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-16 12:59:49 +10:30
Kevin Shanahan
2cf6c1576f common: make COM_LoadFile static
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-16 09:09:26 +10:30
Kevin Shanahan
3e3b4fa951 model: aliashdr.size can be a float (like gl)
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-15 15:04:17 +10:30
Kevin Shanahan
990e70fbf0 model: trivial cleanups - whitespace, unneccesary casts
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-15 15:00:48 +10:30
Kevin Shanahan
d7be8d4d04 model: remove unused fields from gl aliashdr_t
Re-order fields in the software aliashdr to show clearly which fields are
common to both renderers and which are distinct.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-15 12:59:29 +10:30
Kevin Shanahan
ba792b16c4 model: explicitly pass aliashdr_t around in r_alias.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-15 12:49:57 +10:30
Kevin Shanahan
a402913f88 model: remove model field from aliashdr_t
No longer allocate space for a copy of the mdl_t structure below the alias
header. We don't need to keep eyeposition and boundingradius data either, as
neither is used.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-15 12:31:13 +10:30
Kevin Shanahan
2e84f2c33d model: duplicate the needed mdl_t fields into aliashdr_t
Not all of the fields are needed and we can remove dependence on the "on disk"
format of the mdl_t from modelgen.h in the renderer.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-15 12:23:51 +10:30
Kevin Shanahan
b6ff0c10b4 model: copy the frame name for group frames for gl models
Also use strncpy for the name copy for single pose frames.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-15 11:05:29 +10:30
Kevin Shanahan
d0e0d87525 model: fix a familiar looking bbox bug...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-15 11:00:53 +10:30
Kevin Shanahan
0dbeb0bac5 model: minor whitespace cleanups
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-15 09:02:20 +10:30
Kevin Shanahan
9434e7c9f0 model: remove alias group structure in sw alias models
Simplify model animations by removing the alias group concept and making the
structures more like the gl models. We lose the ability to have per-pose
intervals, but those never worked in glquake and it appears all the original
assets just use a fixed interval anyway.

We now have the same MAXALIASFRAMES limit as glquake, but I'm sure that can be
worked around later (for both renderers).

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-15 08:55:18 +10:30
Kevin Shanahan
10893affa9 model: include correct header for d_8to24table
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 19:41:28 +10:30
Kevin Shanahan
68061266bc trivial: remove unused clipplanes in r_draw.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 19:30:23 +10:30
Kevin Shanahan
6a9a376f11 trivial: whitespace cleanup in r_drawa.S
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 19:22:30 +10:30
Kevin Shanahan
11ca153c54 draw: remove unused zpoint interface
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 18:52:58 +10:30