remove some redundant data members
This commit is contained in:
parent
3ce82871e3
commit
3cd914c5e1
|
|
@ -1999,9 +1999,6 @@ struct OpenGLBinding
|
||||||
void (*assertNoErrors)(const char *file, int line);
|
void (*assertNoErrors)(const char *file, int line);
|
||||||
|
|
||||||
GLFont *m_font; // MUST be set!
|
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.
|
/// \brief Renders \p string at the current raster-position of the current context.
|
||||||
void drawString(const char* string) const
|
void drawString(const char* string) const
|
||||||
|
|
|
||||||
|
|
@ -1692,11 +1692,11 @@ void CamWnd::Cam_Draw()
|
||||||
|
|
||||||
if(g_camwindow_globals_private.m_showStats)
|
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();
|
extern const char* Renderer_GetStats();
|
||||||
GlobalOpenGL().drawString(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();
|
extern const char* Cull_GetStats();
|
||||||
GlobalOpenGL().drawString(Cull_GetStats());
|
GlobalOpenGL().drawString(Cull_GetStats());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3345,9 +3345,6 @@ void GlobalGL_sharedContextCreated()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GlobalOpenGL().m_font = g_font;
|
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()
|
void GlobalGL_sharedContextDestroyed()
|
||||||
|
|
|
||||||
|
|
@ -370,7 +370,7 @@ const char* TextureBrowser_getComonShadersDir()
|
||||||
|
|
||||||
inline int TextureBrowser_fontHeight(TextureBrowser& textureBrowser)
|
inline int TextureBrowser_fontHeight(TextureBrowser& textureBrowser)
|
||||||
{
|
{
|
||||||
return GlobalOpenGL().m_fontHeight;
|
return GlobalOpenGL().m_font->getPixelHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* TextureBrowser_GetSelectedShader(TextureBrowser& textureBrowser)
|
const char* TextureBrowser_GetSelectedShader(TextureBrowser& textureBrowser)
|
||||||
|
|
|
||||||
|
|
@ -1849,10 +1849,8 @@ void XYWnd::XY_DrawGrid(void) {
|
||||||
// draw coordinate text if needed
|
// draw coordinate text if needed
|
||||||
if ( g_xywindow_globals_private.show_coordinates) {
|
if ( g_xywindow_globals_private.show_coordinates) {
|
||||||
glColor4fv(vector4_to_array(Vector4(g_xywindow_globals.color_gridtext, 1.0f)));
|
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_font->getPixelAscent()) / m_fScale;
|
||||||
// float offx = m_vOrigin[nDim2] + h - (1 + GlobalOpenGL().m_fontAscent) / m_fScale;
|
float offy = m_vOrigin[nDim1] - w + 1 / m_fScale;
|
||||||
float offx = m_vOrigin[nDim2] + h - 13 / m_fScale;
|
|
||||||
float offy = m_vOrigin[nDim1] - w + 1 / m_fScale;
|
|
||||||
for (x = xb - fmod(xb, stepx); x <= xe ; x += stepx) {
|
for (x = xb - fmod(xb, stepx); x <= xe ; x += stepx) {
|
||||||
glRasterPos2f (x, offx);
|
glRasterPos2f (x, offx);
|
||||||
sprintf (text, "%g", x);
|
sprintf (text, "%g", x);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user