remove some redundant data members

This commit is contained in:
Rudolf Polzer 2010-11-16 18:51:28 +01:00 committed by Rudolf Polzer
parent 3ce82871e3
commit 3cd914c5e1
5 changed files with 5 additions and 13 deletions

View File

@ -1999,9 +1999,6 @@ struct OpenGLBinding
void (*assertNoErrors)(const char *file, int line);
GLFont *m_font; // MUST be set!
int m_fontHeight;
int m_fontAscent;
int m_fontDescent;
/// \brief Renders \p string at the current raster-position of the current context.
void drawString(const char* string) const

View File

@ -1692,11 +1692,11 @@ void CamWnd::Cam_Draw()
if(g_camwindow_globals_private.m_showStats)
{
glRasterPos3f(1.0f, static_cast<float>(m_Camera.height) - GlobalOpenGL().m_fontDescent, 0.0f);
glRasterPos3f(1.0f, static_cast<float>(m_Camera.height) - GlobalOpenGL().m_font->getPixelDescent(), 0.0f);
extern const char* Renderer_GetStats();
GlobalOpenGL().drawString(Renderer_GetStats());
glRasterPos3f(1.0f, static_cast<float>(m_Camera.height) - GlobalOpenGL().m_fontDescent - GlobalOpenGL().m_fontHeight, 0.0f);
glRasterPos3f(1.0f, static_cast<float>(m_Camera.height) - GlobalOpenGL().m_font->getPixelDescent() - GlobalOpenGL().m_font->getPixelHeight(), 0.0f);
extern const char* Cull_GetStats();
GlobalOpenGL().drawString(Cull_GetStats());
}

View File

@ -3345,9 +3345,6 @@ void GlobalGL_sharedContextCreated()
#endif
GlobalOpenGL().m_font = g_font;
GlobalOpenGL().m_fontHeight = g_font->getPixelHeight();
GlobalOpenGL().m_fontAscent = g_font->getPixelAscent();
GlobalOpenGL().m_fontDescent = g_font->getPixelDescent();
}
void GlobalGL_sharedContextDestroyed()

View File

@ -370,7 +370,7 @@ const char* TextureBrowser_getComonShadersDir()
inline int TextureBrowser_fontHeight(TextureBrowser& textureBrowser)
{
return GlobalOpenGL().m_fontHeight;
return GlobalOpenGL().m_font->getPixelHeight();
}
const char* TextureBrowser_GetSelectedShader(TextureBrowser& textureBrowser)

View File

@ -1849,9 +1849,7 @@ void XYWnd::XY_DrawGrid(void) {
// draw coordinate text if needed
if ( g_xywindow_globals_private.show_coordinates) {
glColor4fv(vector4_to_array(Vector4(g_xywindow_globals.color_gridtext, 1.0f)));
// why does this not work on windows:
// float offx = m_vOrigin[nDim2] + h - (1 + GlobalOpenGL().m_fontAscent) / m_fScale;
float offx = m_vOrigin[nDim2] + h - 13 / m_fScale;
float offx = m_vOrigin[nDim2] + h - (1 + GlobalOpenGL().m_font->getPixelAscent()) / m_fScale;
float offy = m_vOrigin[nDim1] - w + 1 / m_fScale;
for (x = xb - fmod(xb, stepx); x <= xe ; x += stepx) {
glRasterPos2f (x, offx);