mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-20 06:49:19 +02:00
passenger stop departure horn fix
This commit is contained in:
35
uilayer.cpp
35
uilayer.cpp
@@ -74,12 +74,22 @@ ui_layer::render() {
|
||||
glDisable( GL_LIGHTING );
|
||||
glDisable( GL_DEPTH_TEST );
|
||||
glDisable( GL_ALPHA_TEST );
|
||||
glEnable( GL_BLEND );
|
||||
glEnable( GL_TEXTURE_2D );
|
||||
glEnable( GL_BLEND );
|
||||
|
||||
::glColor4fv( glm::value_ptr( colors::white ) );
|
||||
|
||||
// render code here
|
||||
render_background();
|
||||
render_texture();
|
||||
|
||||
glDisable( GL_TEXTURE_2D );
|
||||
glDisable( GL_TEXTURE_CUBE_MAP );
|
||||
|
||||
render_progress();
|
||||
|
||||
glDisable( GL_BLEND );
|
||||
|
||||
render_panels();
|
||||
render_tooltip();
|
||||
|
||||
@@ -113,9 +123,6 @@ ui_layer::render_progress() {
|
||||
|
||||
if( (m_progress == 0.0f) && (m_subtaskprogress == 0.0f) ) return;
|
||||
|
||||
glPushAttrib( GL_ENABLE_BIT );
|
||||
glDisable( GL_TEXTURE_2D );
|
||||
|
||||
glm::vec2 origin, size;
|
||||
if( m_progressbottom == true ) {
|
||||
origin = glm::vec2{ 0.0f, 768.0f - 20.0f };
|
||||
@@ -161,8 +168,6 @@ ui_layer::render_progress() {
|
||||
( 0.5f * ( Global.iWindowHeight - height ) + origin.y * heightratio ) + ( charsize ) + ( ( size.y * heightratio - textheight ) * 0.5f * heightratio ) );
|
||||
print( m_progresstext );
|
||||
}
|
||||
|
||||
glPopAttrib();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -170,9 +175,6 @@ ui_layer::render_panels() {
|
||||
|
||||
if( m_panels.empty() ) { return; }
|
||||
|
||||
glPushAttrib( GL_ENABLE_BIT );
|
||||
glDisable( GL_TEXTURE_2D );
|
||||
|
||||
float const width = std::min( 4.f / 3.f, static_cast<float>(Global.iWindowWidth) / std::max( 1, Global.iWindowHeight ) ) * Global.iWindowHeight;
|
||||
float const height = Global.iWindowHeight / 768.f;
|
||||
|
||||
@@ -181,7 +183,7 @@ ui_layer::render_panels() {
|
||||
int lineidx = 0;
|
||||
for( auto const &line : panel->text_lines ) {
|
||||
|
||||
::glColor4fv( &line.color.x );
|
||||
::glColor4fv( glm::value_ptr( line.color ) );
|
||||
::glRasterPos2f(
|
||||
0.5f * ( Global.iWindowWidth - width ) + panel->origin_x * height,
|
||||
panel->origin_y * height + 20.f * lineidx );
|
||||
@@ -189,8 +191,6 @@ ui_layer::render_panels() {
|
||||
++lineidx;
|
||||
}
|
||||
}
|
||||
|
||||
glPopAttrib();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -201,13 +201,9 @@ ui_layer::render_tooltip() {
|
||||
glm::dvec2 mousepos;
|
||||
glfwGetCursorPos( m_window, &mousepos.x, &mousepos.y );
|
||||
|
||||
glPushAttrib( GL_ENABLE_BIT );
|
||||
glDisable( GL_TEXTURE_2D );
|
||||
::glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
::glColor4fv( glm::value_ptr( colors::white ) );
|
||||
::glRasterPos2f( mousepos.x + 20.0f, mousepos.y + 25.0f );
|
||||
print( m_tooltip );
|
||||
|
||||
glPopAttrib();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -236,8 +232,7 @@ void
|
||||
ui_layer::render_texture() {
|
||||
|
||||
if( m_texture != 0 ) {
|
||||
::glColor4f( 1.f, 1.f, 1.f, 1.f );
|
||||
::glDisable( GL_BLEND );
|
||||
::glColor4fv( glm::value_ptr( colors::white ) );
|
||||
|
||||
GfxRenderer.Bind_Texture( null_handle );
|
||||
::glBindTexture( GL_TEXTURE_2D, m_texture );
|
||||
@@ -255,8 +250,6 @@ ui_layer::render_texture() {
|
||||
glEnd();
|
||||
|
||||
::glBindTexture( GL_TEXTURE_2D, 0 );
|
||||
|
||||
::glEnable( GL_BLEND );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user