From 3cd914c5e14822c11e6e1a03cee9d61e992d6174 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Tue, 16 Nov 2010 18:51:28 +0100 Subject: [PATCH] remove some redundant data members --- include/igl.h | 3 --- radiant/camwindow.cpp | 4 ++-- radiant/mainframe.cpp | 3 --- radiant/texwindow.cpp | 2 +- radiant/xywindow.cpp | 6 ++---- 5 files changed, 5 insertions(+), 13 deletions(-) diff --git a/include/igl.h b/include/igl.h index 8f7d7dc0..35174967 100644 --- a/include/igl.h +++ b/include/igl.h @@ -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 diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index 8a0c8949..f0744e48 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -1692,11 +1692,11 @@ void CamWnd::Cam_Draw() if(g_camwindow_globals_private.m_showStats) { - glRasterPos3f(1.0f, static_cast(m_Camera.height) - GlobalOpenGL().m_fontDescent, 0.0f); + glRasterPos3f(1.0f, static_cast(m_Camera.height) - GlobalOpenGL().m_font->getPixelDescent(), 0.0f); extern const char* Renderer_GetStats(); GlobalOpenGL().drawString(Renderer_GetStats()); - glRasterPos3f(1.0f, static_cast(m_Camera.height) - GlobalOpenGL().m_fontDescent - GlobalOpenGL().m_fontHeight, 0.0f); + glRasterPos3f(1.0f, static_cast(m_Camera.height) - GlobalOpenGL().m_font->getPixelDescent() - GlobalOpenGL().m_font->getPixelHeight(), 0.0f); extern const char* Cull_GetStats(); GlobalOpenGL().drawString(Cull_GetStats()); } diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 18c82f95..0aaf6647 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -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() diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 774c0f85..95d490ab 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -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) diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index 857e7b99..5ead90b4 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -1849,10 +1849,8 @@ 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 offy = m_vOrigin[nDim1] - w + 1 / 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); sprintf (text, "%g", x); -- 2.39.2