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>
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>
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>
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>
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>
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>
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>
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>
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>
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>