mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 14:49:19 +02:00
reformat: use auto on certain types
This commit is contained in:
@@ -123,8 +123,8 @@ void ui::cameraview_panel::capture_func()
|
||||
piped_proc proc(cmdline);
|
||||
|
||||
size_t frame_size = Global.extcam_res.x * Global.extcam_res.y * 3;
|
||||
uint8_t *read_buffer = new uint8_t[frame_size];
|
||||
uint8_t *active_buffer = new uint8_t[frame_size];
|
||||
auto read_buffer = new uint8_t[frame_size];
|
||||
auto active_buffer = new uint8_t[frame_size];
|
||||
|
||||
size_t bufpos = 0;
|
||||
|
||||
@@ -173,7 +173,7 @@ void ui::cameraview_panel::record_func()
|
||||
piped_proc proc(cmdline, true);
|
||||
|
||||
size_t frame_size = Global.extcam_res.x * Global.extcam_res.y * 3;
|
||||
uint8_t *read_buffer = new uint8_t[frame_size];
|
||||
auto read_buffer = new uint8_t[frame_size];
|
||||
uint32_t last_cnt = 0;
|
||||
size_t bufpos = frame_size;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ ui::map_panel::map_panel() : ui_panel(STR_C("Map"), false)
|
||||
window_flags = ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse;
|
||||
|
||||
#ifdef WITH_OPENGL_MODERN
|
||||
opengl33_renderer *gl33 = dynamic_cast<opengl33_renderer*>(GfxRenderer.get());
|
||||
auto gl33 = dynamic_cast<opengl33_renderer*>(GfxRenderer.get());
|
||||
if (!gl33) {
|
||||
ErrorLog("map not supported on old renderer");
|
||||
return;
|
||||
@@ -146,7 +146,7 @@ void ui::map_panel::render_map_texture(glm::mat4 transform, glm::vec2 surface_si
|
||||
scene_ubo->bind_uniform();
|
||||
|
||||
#ifdef WITH_OPENGL_MODERN
|
||||
opengl33_renderer *gl33 = dynamic_cast<opengl33_renderer*>(GfxRenderer.get());
|
||||
auto gl33 = dynamic_cast<opengl33_renderer*>(GfxRenderer.get());
|
||||
|
||||
gl33->Draw_Geometry(m_section_handles.begin(), m_section_handles.end());
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ void ui::vehiclelist_panel::render_contents()
|
||||
if (vehicle->Mechanik)
|
||||
timetable = vehicle->Mechanik->TrainName() + ", ";
|
||||
|
||||
std::string label = std::string(name + ", " + timetable + std::to_string(speed) + " km/h###");
|
||||
auto label = std::string(name + ", " + timetable + std::to_string(speed) + " km/h###");
|
||||
|
||||
ImGui::PushID(vehicle);
|
||||
if (ImGui::Button(label.c_str())) {
|
||||
|
||||
@@ -24,7 +24,7 @@ void ui::vehicleparams_panel::draw_infobutton(const char *str, ImVec2 pos, const
|
||||
|
||||
ImGuiStyle &style = ImGui::GetStyle();
|
||||
ImVec2 text_size = ImGui::CalcTextSize(str);
|
||||
ImVec2 button_size = ImVec2(text_size.x + style.FramePadding.x * 2.0f, text_size.y + style.FramePadding.y * 2.0f);
|
||||
auto button_size = ImVec2(text_size.x + style.FramePadding.x * 2.0f, text_size.y + style.FramePadding.y * 2.0f);
|
||||
|
||||
pos.x = pos.x * window_size.x / 512.0f - button_size.x / 2.0f;
|
||||
pos.y = pos.y * window_size.y / 118.0f - button_size.y / 2.0f;
|
||||
@@ -124,8 +124,8 @@ void ui::vehicleparams_panel::render_contents()
|
||||
|
||||
glm::mat3 proj = glm::translate(glm::scale(glm::mat3(), 1.0f / viewport.scale), viewport.offset);
|
||||
|
||||
glm::vec2 uv0 = glm::vec2(proj * glm::vec3(0.0f, 1.0f, 1.0f));
|
||||
glm::vec2 uv1 = glm::vec2(proj * glm::vec3(1.0f, 0.0f, 1.0f));
|
||||
auto uv0 = glm::vec2(proj * glm::vec3(0.0f, 1.0f, 1.0f));
|
||||
auto uv1 = glm::vec2(proj * glm::vec3(1.0f, 0.0f, 1.0f));
|
||||
|
||||
ImVec2 size = ImGui::GetContentRegionAvail();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user