Incremental fix on my Navigator work - switched out global to JGE vars actualWidth/Height to be real accessible members of the JRenderer instance, so that we can actually access what the real display width is from within the MTG project. This makes the fix for enchantment zone targetting work when the window is resized on Win32.

This commit is contained in:
wrenczes
2010-11-02 04:07:25 +00:00
parent f472c48a8a
commit 858950fb9d
6 changed files with 49 additions and 16 deletions

View File

@@ -11,8 +11,6 @@
#ifdef WIN32
#pragma warning(disable : 4786)
extern int actualWidth;
extern int actualHeight;
#pragma comment( lib, "giflib.lib" )
#endif
@@ -393,7 +391,7 @@ void JRenderer::Destroy()
}
}
JRenderer::JRenderer()
JRenderer::JRenderer() : mActualWidth(SCREEN_WIDTH_F), mActualHeight(SCREEN_HEIGHT_F)
{
}
@@ -814,8 +812,8 @@ void JRenderer::BeginScene()
esOrtho(&theMvpMatrix, 0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f,-1.0f, 1.0f);
#endif //(!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
#ifdef WIN32
float scaleH = (float)actualHeight/SCREEN_HEIGHT_F;
float scaleW = (float)actualWidth/SCREEN_WIDTH_F;
float scaleH = mActualHeight/SCREEN_HEIGHT_F;
float scaleW = mActualWidth/SCREEN_WIDTH_F;
glScalef(scaleW,scaleW,1.f);
#endif
checkGlError();