- consider pixel stretching when rendering models. For non-voxels an aspect ratio of 1:1 must always be assumed while voxels need to be stretched so that 1 voxel unit == 1 map unit.

This commit is contained in:
Christoph Oelckers 2014-12-31 12:53:29 +01:00
commit 4f08b20df5
5 changed files with 20 additions and 7 deletions

View file

@ -915,6 +915,12 @@ void gl_RenderModel(GLSprite * spr)
gl_RenderState.mModelMatrix.rotate(-ANGLE_TO_FLOAT(smf->angleoffset), 0, 1, 0);
gl_RenderState.mModelMatrix.rotate(smf->pitchoffset, 0, 0, 1);
gl_RenderState.mModelMatrix.rotate(-smf->rolloffset, 1, 0, 0);
// consider the pixel stretching. For non-voxels this must be factored out here
float stretch = (smf->models[0] != NULL ? smf->models[0]->getAspectFactor() : 1.f) / glset.pixelstretch;
gl_RenderState.mModelMatrix.scale(1, stretch, 1);
gl_RenderState.EnableModelMatrix(true);
gl_RenderFrameModels( smf, spr->actor->state, spr->actor->tics, RUNTIME_TYPE(spr->actor), NULL, translation );
gl_RenderState.EnableModelMatrix(false);