mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
fixes
This commit is contained in:
@@ -279,7 +279,7 @@ void TPythonScreenRenderer::updateTexture()
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
|
||||
// build texture
|
||||
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, textureData );
|
||||
glTexImage2D( GL_TEXTURE_2D, 0, GL_SRGB8_ALPHA8, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, textureData );
|
||||
|
||||
#ifdef _PY_INT_MORE_LOG
|
||||
GLenum status = glGetError();
|
||||
|
||||
6
map.cpp
6
map.cpp
@@ -69,7 +69,10 @@ void map::render(scene::basic_region *Region)
|
||||
|
||||
if (!scene_ubo)
|
||||
if (!init())
|
||||
{
|
||||
map_opened = false;
|
||||
return;
|
||||
}
|
||||
|
||||
ImGui::SetNextWindowSizeConstraints(ImVec2(200, 200), ImVec2(fb_size, fb_size));
|
||||
if (ImGui::Begin("Map", &map_opened, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse))
|
||||
@@ -165,7 +168,8 @@ void map::render(scene::basic_region *Region)
|
||||
if (Global.iMultisampling)
|
||||
m_fb->blit_from(*m_msaa_fb, size.x, size.y, GL_COLOR_BUFFER_BIT, GL_COLOR_ATTACHMENT0);
|
||||
|
||||
m_fb->unbind();
|
||||
gl::framebuffer::unbind();
|
||||
m_shader->unbind();
|
||||
|
||||
ImGui::ImageButton(reinterpret_cast<void*>(m_tex->id), size, ImVec2(0, size.y / fb_size), ImVec2(size.x / fb_size, 0), 0);
|
||||
|
||||
|
||||
@@ -383,7 +383,7 @@ void opengl_renderer::Render_pass(rendermode const Mode)
|
||||
Update_Lights(simulation::Lights);
|
||||
scene_ubs.time = Timer::GetTime();
|
||||
scene_ubs.projection = OpenGLMatrices.data(GL_PROJECTION);
|
||||
scene_ubo->update(scene_ubs);
|
||||
scene_ubo->update(scene_ubs);
|
||||
scene_ubo->bind_uniform();
|
||||
|
||||
m_colorpass = m_renderpass;
|
||||
@@ -521,6 +521,9 @@ void opengl_renderer::Render_pass(rendermode const Mode)
|
||||
glDebug("uilayer render");
|
||||
UILayer.render();
|
||||
|
||||
// restore binding
|
||||
scene_ubo->bind_uniform();
|
||||
|
||||
glDebug("rendermode::color end");
|
||||
break;
|
||||
}
|
||||
|
||||
16
uilayer.cpp
16
uilayer.cpp
@@ -142,14 +142,14 @@ bool ui_layer::on_key(int const Key, int const Action)
|
||||
case GLFW_KEY_F2:
|
||||
{
|
||||
// parametry pojazdu
|
||||
vehicle_info_active = !vehicle_info_active;
|
||||
timetable_active = !timetable_active;
|
||||
return true;
|
||||
}
|
||||
|
||||
case GLFW_KEY_F3:
|
||||
{
|
||||
// timetable
|
||||
timetable_active = !timetable_active;
|
||||
vehicle_info_active = !vehicle_info_active;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ void ui_layer::render()
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
if (vehicle_info_active)
|
||||
if (timetable_active)
|
||||
{
|
||||
// timetable
|
||||
auto *vehicle{(FreeFlyModeFlag ? std::get<TDynamicObject *>(simulation::Region->find_vehicle(camera->Pos, 20, false, false)) : controlled)}; // w trybie latania lokalizujemy wg mapy
|
||||
@@ -368,7 +368,7 @@ void ui_layer::render()
|
||||
}
|
||||
|
||||
ImGui::SetNextWindowSize(ImVec2(0, 0));
|
||||
ImGui::Begin("Timetable", &vehicle_info_active, ImGuiWindowFlags_NoResize);
|
||||
ImGui::Begin("Timetable", &timetable_active, ImGuiWindowFlags_NoResize);
|
||||
ImGui::TextUnformatted(uitextline1.c_str());
|
||||
ImGui::TextUnformatted(uitextline2.c_str());
|
||||
ImGui::TextUnformatted(uitextline3.c_str());
|
||||
@@ -424,10 +424,10 @@ void ui_layer::render()
|
||||
|
||||
f2_cancel:;
|
||||
|
||||
if (timetable_active)
|
||||
if (vehicle_info_active)
|
||||
{
|
||||
ImGui::SetNextWindowSize(ImVec2(0, 0));
|
||||
ImGui::Begin("Vehicle status", &timetable_active, ImGuiWindowFlags_NoResize);
|
||||
ImGui::Begin("Vehicle status", &vehicle_info_active, ImGuiWindowFlags_NoResize);
|
||||
|
||||
uitextline1 = "";
|
||||
uitextline2 = "";
|
||||
@@ -1120,8 +1120,8 @@ f2_cancel:;
|
||||
if (ImGui::BeginMenu("Window"))
|
||||
{
|
||||
ImGui::MenuItem("Basic info", "F1", &basic_info_active);
|
||||
ImGui::MenuItem("Timetable", "F2", &vehicle_info_active);
|
||||
ImGui::MenuItem("Vehicle info", "F3", &timetable_active);
|
||||
ImGui::MenuItem("Timetable", "F2", &timetable_active);
|
||||
ImGui::MenuItem("Vehicle info", "F3", &vehicle_info_active);
|
||||
ImGui::MenuItem("Renderer stats", "F8", &renderer_debug_active);
|
||||
ImGui::MenuItem("Scenery inspector", "F11", &EditorModeFlag);
|
||||
ImGui::MenuItem("Events", nullptr, &events_active);
|
||||
|
||||
@@ -64,8 +64,8 @@ private:
|
||||
// members:
|
||||
GLFWwindow *m_window { nullptr };
|
||||
bool basic_info_active = false;
|
||||
bool vehicle_info_active = false;
|
||||
bool timetable_active = false;
|
||||
bool vehicle_info_active = false;
|
||||
bool renderer_debug_active = false;
|
||||
bool about_active = false;
|
||||
bool quit_active = false;
|
||||
|
||||
Reference in New Issue
Block a user