Remove the differences in the error messages to make spotting any
remaining real differences easier.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>