More accurate scaling with GL renderer. The software renderer likely needs an adjustment now.

This commit is contained in:
James Sanford 2012-10-18 00:18:15 -07:00
parent 10c52151f7
commit aff9838674
2 changed files with 4 additions and 7 deletions

View File

@ -43,7 +43,7 @@ class BitmapSize {
if (!doCropBorder()) {
return (int)(Const.A2Height * mScaleFactorY);
} else {
return (int)((Const.A2Height - 32) * mScaleFactorY);
return (int)((Const.A2Height - 32 - 30) * mScaleFactorY);
}
}

View File

@ -88,12 +88,9 @@ class KegsRenderer implements GLSurfaceView.Renderer {
gl.glLoadIdentity();
// 50.0f is 512-(400+32+30) (the distance from the bottom of the texture to our actual bitmap)
float cropBorder = 50.0f;
float fudge = 0.0f;
if (mCropBorder > 0.0f) {
cropBorder += mCropBorder;
fudge = 14.0f; // Bug workaround to view the entire image better...
}
gl.glOrthof(0.0f, (float)mWidth, cropBorder, mHeight + cropBorder + fudge, 0.0f, 1.0f);
cropBorder *= mScaleY;
cropBorder += mCropBorder * mScaleY; // likely zero
gl.glOrthof(0.0f, (float)mWidth, cropBorder, mHeight + cropBorder, 0.0f, 1.0f);
gl.glMatrixMode(GL10.GL_MODELVIEW);
gl.glLoadIdentity();
}