mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 18:09:18 +02:00
Merge pull request #109 from docentYT/fix-compilation-warnings
Fix compilation warnings
This commit is contained in:
@@ -597,7 +597,7 @@ void driver_mode::update_camera(double const Deltatime)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (false == FreeFlyModeFlag)
|
if (false == FreeFlyModeFlag && simulation::Train)
|
||||||
{
|
{
|
||||||
// reset cached view angle in the cab
|
// reset cached view angle in the cab
|
||||||
simulation::Train->pMechViewAngle = {Camera.Angle.x, Camera.Angle.y};
|
simulation::Train->pMechViewAngle = {Camera.Angle.x, Camera.Angle.y};
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
#include "rendering/renderer.h"
|
#include "rendering/renderer.h"
|
||||||
#include "utilities/Logs.h"
|
#include "utilities/Logs.h"
|
||||||
#include "widgets/vehicleparams.h"
|
#include "widgets/vehicleparams.h"
|
||||||
|
#include "utilities/U8.h"
|
||||||
|
|
||||||
#define DRIVER_HINT_CONTENT
|
#define DRIVER_HINT_CONTENT
|
||||||
#include "application/driverhints.h"
|
#include "application/driverhints.h"
|
||||||
@@ -390,7 +391,7 @@ timetable_panel::update() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// header
|
// header
|
||||||
m_tablelines.emplace_back( "┌─────┬────────────────────────────────────┬─────────┬─────┐", Global.UITextColor );
|
m_tablelines.emplace_back(U8("┌─────┬────────────────────────────────────┬─────────┬─────┐"), Global.UITextColor);
|
||||||
|
|
||||||
TMTableLine const *tableline;
|
TMTableLine const *tableline;
|
||||||
for( int i = table.StationStart; i <= table.StationCount; ++i ) {
|
for( int i = table.StationStart; i <= table.StationCount; ++i ) {
|
||||||
@@ -422,11 +423,11 @@ timetable_panel::update() {
|
|||||||
auto const arrival { (
|
auto const arrival { (
|
||||||
tableline->Ah >= 0 ?
|
tableline->Ah >= 0 ?
|
||||||
std::to_string( int( 100 + tableline->Ah ) ).substr( 1, 2 ) + ":" + to_minutes_str( tableline->Am, true, 3 ) :
|
std::to_string( int( 100 + tableline->Ah ) ).substr( 1, 2 ) + ":" + to_minutes_str( tableline->Am, true, 3 ) :
|
||||||
" │ " ) };
|
U8(" │ ") ) };
|
||||||
auto const departure { (
|
auto const departure { (
|
||||||
tableline->Dh >= 0 ?
|
tableline->Dh >= 0 ?
|
||||||
std::to_string( int( 100 + tableline->Dh ) ).substr( 1, 2 ) + ":" + to_minutes_str( tableline->Dm, true, 3 ) :
|
std::to_string( int( 100 + tableline->Dh ) ).substr( 1, 2 ) + ":" + to_minutes_str( tableline->Dm, true, 3 ) :
|
||||||
" │ " ) };
|
U8(" │ ") ) };
|
||||||
auto const candepart { (
|
auto const candepart { (
|
||||||
( table.StationStart < table.StationIndex )
|
( table.StationStart < table.StationIndex )
|
||||||
&& ( i < table.StationIndex )
|
&& ( i < table.StationIndex )
|
||||||
@@ -445,25 +446,25 @@ timetable_panel::update() {
|
|||||||
candepart ? colors::uitextgreen : // czas minął i odjazd był, to nazwa stacji będzie na zielono
|
candepart ? colors::uitextgreen : // czas minął i odjazd był, to nazwa stacji będzie na zielono
|
||||||
isatpassengerstop ? colors::uitextorange :
|
isatpassengerstop ? colors::uitextorange :
|
||||||
Global.UITextColor ) };
|
Global.UITextColor ) };
|
||||||
auto const trackcount{ ( tableline->TrackNo == 1 ? " ┃ " : " ║ " ) };
|
std::string const trackcount{ ( tableline->TrackNo == 1 ? U8(" ┃ ") : U8(" ║ " )) };
|
||||||
m_tablelines.emplace_back(
|
m_tablelines.emplace_back(
|
||||||
( "│ " + vmax + " │ " + station + trackcount + arrival + " │ " + traveltime + " │" ),
|
( U8("│ ") + vmax + U8(" │ ") + station + trackcount + arrival + U8(" │ ") + traveltime + U8(" │") ),
|
||||||
linecolor );
|
linecolor );
|
||||||
m_tablelines.emplace_back(
|
m_tablelines.emplace_back(
|
||||||
( "│ │ " + location + tableline->StationWare + trackcount + departure + " │ │" ),
|
( U8("│ │ ") + location + tableline->StationWare + trackcount + departure + U8(" │ │") ),
|
||||||
linecolor );
|
linecolor );
|
||||||
// divider/footer
|
// divider/footer
|
||||||
if( i < table.StationCount ) {
|
if( i < table.StationCount ) {
|
||||||
auto const *nexttableline { tableline + 1 };
|
auto const *nexttableline { tableline + 1 };
|
||||||
std::string const vmaxnext{ ( tableline->vmax == nexttableline->vmax ? "│ ├" : "├─────┼" ) };
|
std::string const vmaxnext{ ( tableline->vmax == nexttableline->vmax ? U8("│ ├") : U8("├─────┼") ) };
|
||||||
auto const trackcountnext{ ( nexttableline->TrackNo == 1 ? "╂" : "╫" ) };
|
auto const trackcountnext{ ( nexttableline->TrackNo == 1 ? U8("╂") : U8("╫") ) };
|
||||||
m_tablelines.emplace_back(
|
m_tablelines.emplace_back(
|
||||||
vmaxnext + "────────────────────────────────────" + trackcountnext + "─────────┼─────┤",
|
vmaxnext + U8("────────────────────────────────────") + trackcountnext + U8("─────────┼─────┤"),
|
||||||
Global.UITextColor );
|
Global.UITextColor );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_tablelines.emplace_back(
|
m_tablelines.emplace_back(
|
||||||
"└─────┴────────────────────────────────────┴─────────┴─────┘",
|
U8("└─────┴────────────────────────────────────┴─────────┴─────┘"),
|
||||||
Global.UITextColor );
|
Global.UITextColor );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1537,6 +1538,7 @@ bool debug_panel::render_section_developer()
|
|||||||
m_input.vehicle->MoverParameters->reload_FIZ(); // reload fiz
|
m_input.vehicle->MoverParameters->reload_FIZ(); // reload fiz
|
||||||
}
|
}
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|||||||
@@ -100,9 +100,6 @@ private:
|
|||||||
bool render_section( std::vector<text_line> const &Lines );
|
bool render_section( std::vector<text_line> const &Lines );
|
||||||
bool render_section_scenario();
|
bool render_section_scenario();
|
||||||
bool render_section_eventqueue();
|
bool render_section_eventqueue();
|
||||||
#ifdef WITH_UART
|
|
||||||
bool render_section_uart();
|
|
||||||
#endif
|
|
||||||
bool render_section_settings();
|
bool render_section_settings();
|
||||||
bool render_section_developer();
|
bool render_section_developer();
|
||||||
// members
|
// members
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ void scenarioloader_ui::render_()
|
|||||||
// Gradient at the lower half of the screen
|
// Gradient at the lower half of the screen
|
||||||
if (!Global.NvRenderer)
|
if (!Global.NvRenderer)
|
||||||
{
|
{
|
||||||
const auto tex = reinterpret_cast<ImTextureID>(m_gradient_overlay_tex);
|
const ImTextureID tex = (ImTextureID)(intptr_t)m_gradient_overlay_tex; // See https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples#example-for-opengl-users
|
||||||
draw_list->AddImage(tex, ImVec2(0, Global.window_size.y / 2), ImVec2(Global.window_size.x, Global.window_size.y), ImVec2(0, 0), ImVec2(1, 1));
|
draw_list->AddImage(tex, ImVec2(0, Global.window_size.y / 2), ImVec2(Global.window_size.x, Global.window_size.y), ImVec2(0, 0), ImVec2(1, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,19 +61,19 @@ gl::buffer::~buffer()
|
|||||||
glDeleteBuffers(1, *this);
|
glDeleteBuffers(1, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gl::buffer::allocate(targets target, int size, GLenum hint)
|
void gl::buffer::allocate(targets target, GLsizeiptr size, GLenum hint)
|
||||||
{
|
{
|
||||||
bind(target);
|
bind(target);
|
||||||
glBufferData(glenum_target(target), size, nullptr, hint);
|
glBufferData(glenum_target(target), size, nullptr, hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gl::buffer::upload(targets target, const void *data, int offset, int size)
|
void gl::buffer::upload(targets target, const void *data, int offset, GLsizeiptr size)
|
||||||
{
|
{
|
||||||
bind(target);
|
bind(target);
|
||||||
glBufferSubData(glenum_target(target), offset, size, data);
|
glBufferSubData(glenum_target(target), offset, size, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gl::buffer::download(targets target, void *data, int offset, int size)
|
void gl::buffer::download(targets target, void *data, int offset, GLsizeiptr size)
|
||||||
{
|
{
|
||||||
bind(target);
|
bind(target);
|
||||||
if (GLAD_GL_VERSION_3_3)
|
if (GLAD_GL_VERSION_3_3)
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ namespace gl
|
|||||||
static void unbind(targets target);
|
static void unbind(targets target);
|
||||||
static void unbind();
|
static void unbind();
|
||||||
|
|
||||||
void allocate(targets target, int size, GLenum hint);
|
void allocate(targets target, GLsizeiptr size, GLenum hint);
|
||||||
void upload(targets target, const void *data, int offset, int size);
|
void upload(targets target, const void *data, int offset, GLsizeiptr size);
|
||||||
void download(targets target, void *data, int offset, int size);
|
void download(targets target, void *data, int offset, GLsizeiptr size);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "ubo.h"
|
#include "ubo.h"
|
||||||
|
|
||||||
gl::ubo::ubo(int size, int idx, GLenum hint)
|
gl::ubo::ubo(size_t size, int idx, GLenum hint)
|
||||||
{
|
{
|
||||||
allocate(buffer::UNIFORM_BUFFER, size, hint);
|
allocate(buffer::UNIFORM_BUFFER, size, hint);
|
||||||
index = idx;
|
index = idx;
|
||||||
@@ -13,7 +13,7 @@ void gl::ubo::bind_uniform()
|
|||||||
bind_base(buffer::UNIFORM_BUFFER, index);
|
bind_base(buffer::UNIFORM_BUFFER, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gl::ubo::update(const uint8_t *data, int offset, int size)
|
void gl::ubo::update(const uint8_t *data, int offset, GLsizeiptr size)
|
||||||
{
|
{
|
||||||
upload(buffer::UNIFORM_BUFFER, data, offset, size);
|
upload(buffer::UNIFORM_BUFFER, data, offset, size);
|
||||||
}
|
}
|
||||||
|
|||||||
4
gl/ubo.h
4
gl/ubo.h
@@ -22,11 +22,11 @@ namespace gl
|
|||||||
int index;
|
int index;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ubo(int size, int index, GLenum hint = GL_DYNAMIC_DRAW);
|
ubo(size_t size, int index, GLenum hint = GL_DYNAMIC_DRAW);
|
||||||
|
|
||||||
void bind_uniform();
|
void bind_uniform();
|
||||||
|
|
||||||
void update(const uint8_t *data, int offset, int size);
|
void update(const uint8_t *data, int offset, GLsizeiptr size);
|
||||||
template <typename T> void update(const T &data, size_t offset = 0)
|
template <typename T> void update(const T &data, size_t offset = 0)
|
||||||
{
|
{
|
||||||
update(reinterpret_cast<const uint8_t*>(&data), offset, sizeof(data));
|
update(reinterpret_cast<const uint8_t*>(&data), offset, sizeof(data));
|
||||||
|
|||||||
@@ -291,7 +291,7 @@ void ui::scenerylist_panel::draw_trainset(trainset_desc &trainset)
|
|||||||
glm::ivec2 size = mini->size();
|
glm::ivec2 size = mini->size();
|
||||||
float width = 30.0f / size.y * size.x;
|
float width = 30.0f / size.y * size.x;
|
||||||
float beforeX = ImGui::GetCursorPosX();
|
float beforeX = ImGui::GetCursorPosX();
|
||||||
ImGui::Image(reinterpret_cast<void*>(mini->get()), ImVec2(width, 30), ImVec2(0, 1), ImVec2(1, 0));
|
ImGui::Image((ImTextureID)(intptr_t)(mini->get()), ImVec2(width, 30), ImVec2(0, 1), ImVec2(1, 0));
|
||||||
float afterX = ImGui::GetCursorPosX();
|
float afterX = ImGui::GetCursorPosX();
|
||||||
|
|
||||||
ImGui::SameLine(beforeX);
|
ImGui::SameLine(beforeX);
|
||||||
@@ -299,7 +299,7 @@ void ui::scenerylist_panel::draw_trainset(trainset_desc &trainset)
|
|||||||
if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceAutoExpirePayload)) {
|
if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceAutoExpirePayload)) {
|
||||||
vehicle_moved data(trainset, dyn_desc, position - 1);
|
vehicle_moved data(trainset, dyn_desc, position - 1);
|
||||||
|
|
||||||
ImGui::Image(reinterpret_cast<void*>(mini->get()), ImVec2(width, 30), ImVec2(0, 1), ImVec2(1, 0));
|
ImGui::Image((ImTextureID)(intptr_t)mini->get(), ImVec2(width, 30), ImVec2(0, 1), ImVec2(1, 0));
|
||||||
|
|
||||||
ImGui::SetDragDropPayload("vehicle_set", &data, sizeof(vehicle_moved));
|
ImGui::SetDragDropPayload("vehicle_set", &data, sizeof(vehicle_moved));
|
||||||
ImGui::EndDragDropSource();
|
ImGui::EndDragDropSource();
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ bool ui::vehiclepicker_panel::selectable_image(const char *desc, bool selected,
|
|||||||
glm::ivec2 size = image->size();
|
glm::ivec2 size = image->size();
|
||||||
float width = 30.0f / size.y * size.x;
|
float width = 30.0f / size.y * size.x;
|
||||||
ImGui::SameLine(ImGui::GetContentRegionAvail().x - width);
|
ImGui::SameLine(ImGui::GetContentRegionAvail().x - width);
|
||||||
ImGui::Image(reinterpret_cast<void*>(tex), ImVec2(width, 30), ImVec2(0, 1), ImVec2(1, 0));
|
ImGui::Image((ImTextureID)(intptr_t)tex, ImVec2(width, 30), ImVec2(0, 1), ImVec2(1, 0));
|
||||||
|
|
||||||
if (pickable) {
|
if (pickable) {
|
||||||
ImGui::PushID((void*)image);
|
ImGui::PushID((void*)image);
|
||||||
@@ -282,7 +282,7 @@ bool ui::vehiclepicker_panel::selectable_image(const char *desc, bool selected,
|
|||||||
ImGui::InvisibleButton(desc, ImVec2(width, 30));
|
ImGui::InvisibleButton(desc, ImVec2(width, 30));
|
||||||
|
|
||||||
if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceAutoExpirePayload)) {
|
if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceAutoExpirePayload)) {
|
||||||
ImGui::Image(reinterpret_cast<void*>(tex), ImVec2(width, 30), ImVec2(0, 1), ImVec2(1, 0));
|
ImGui::Image((ImTextureID)(intptr_t)tex, ImVec2(width, 30), ImVec2(0, 1), ImVec2(1, 0));
|
||||||
|
|
||||||
ImGui::SetDragDropPayload("vehicle_pure", &pickable, sizeof(skin_set*));
|
ImGui::SetDragDropPayload("vehicle_pure", &pickable, sizeof(skin_set*));
|
||||||
ImGui::EndDragDropSource();
|
ImGui::EndDragDropSource();
|
||||||
|
|||||||
@@ -604,7 +604,7 @@ std::pair<int, int> TSubModel::Load(cParser &parser, bool dynamic)
|
|||||||
parser >> vertex->normal.x >> vertex->normal.y >> vertex->normal.z;
|
parser >> vertex->normal.x >> vertex->normal.y >> vertex->normal.z;
|
||||||
if (glm::length2(vertex->normal) > 0.0f)
|
if (glm::length2(vertex->normal) > 0.0f)
|
||||||
{
|
{
|
||||||
glm::normalize(vertex->normal);
|
vertex->normal = glm::normalize(vertex->normal);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ void network::server::handle_message(std::shared_ptr<connection> conn, const mes
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (msg.type == message::CLIENT_HELLO) {
|
if (msg.type == message::CLIENT_HELLO) {
|
||||||
auto cmd = dynamic_cast<const client_hello&>(msg);
|
const auto& cmd = dynamic_cast<const client_hello&>(msg);
|
||||||
|
|
||||||
if (cmd.version != EU07_NETWORK_VERSION // wrong version
|
if (cmd.version != EU07_NETWORK_VERSION // wrong version
|
||||||
|| !Global.ready_to_load) { // not ready yet
|
|| !Global.ready_to_load) { // not ready yet
|
||||||
@@ -148,7 +148,7 @@ void network::server::handle_message(std::shared_ptr<connection> conn, const mes
|
|||||||
WriteLog("net: client accepted", logtype::net);
|
WriteLog("net: client accepted", logtype::net);
|
||||||
}
|
}
|
||||||
else if (msg.type == message::REQUEST_COMMAND) {
|
else if (msg.type == message::REQUEST_COMMAND) {
|
||||||
auto cmd = dynamic_cast<const request_command&>(msg);
|
const auto& cmd = dynamic_cast<const request_command&>(msg);
|
||||||
|
|
||||||
for (auto const &kv : cmd.commands)
|
for (auto const &kv : cmd.commands)
|
||||||
client_commands_queue.emplace(kv);
|
client_commands_queue.emplace(kv);
|
||||||
@@ -189,7 +189,7 @@ std::tuple<double, double, command_queue::commands_map> network::client::get_nex
|
|||||||
|
|
||||||
|
|
||||||
float size = delta_queue.size() - consume_counter;
|
float size = delta_queue.size() - consume_counter;
|
||||||
auto entry = delta_queue.front();
|
const auto& entry = delta_queue.front();
|
||||||
float mult = entry.render_dt / std::chrono::duration_cast<std::chrono::duration<float>>(frame_time).count();
|
float mult = entry.render_dt / std::chrono::duration_cast<std::chrono::duration<float>>(frame_time).count();
|
||||||
|
|
||||||
if (counter == 1 && size < MAX_BUFFER_SIZE * 2.0f) {
|
if (counter == 1 && size < MAX_BUFFER_SIZE * 2.0f) {
|
||||||
@@ -241,7 +241,7 @@ void network::client::handle_message(std::shared_ptr<connection> conn, const mes
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (msg.type == message::SERVER_HELLO) {
|
if (msg.type == message::SERVER_HELLO) {
|
||||||
auto cmd = dynamic_cast<const server_hello&>(msg);
|
const auto& cmd = dynamic_cast<const server_hello&>(msg);
|
||||||
conn->state = connection::ACTIVE;
|
conn->state = connection::ACTIVE;
|
||||||
|
|
||||||
if (!Global.ready_to_load) {
|
if (!Global.ready_to_load) {
|
||||||
|
|||||||
@@ -706,7 +706,7 @@ void opengl33_renderer::draw_debug_ui()
|
|||||||
|
|
||||||
ImGui::SetNextWindowSize(ImVec2S(400, 400));
|
ImGui::SetNextWindowSize(ImVec2S(400, 400));
|
||||||
if (ImGui::Begin("Pickbuffer") && m_pick_tex) {
|
if (ImGui::Begin("Pickbuffer") && m_pick_tex) {
|
||||||
ImGui::Image(reinterpret_cast<void *>(m_pick_tex->id), ImGui::GetContentRegionAvail(), ImVec2(0, 1.0), ImVec2(1.0, 0));
|
ImGui::Image((ImTextureID)(intptr_t)(m_pick_tex->id), ImGui::GetContentRegionAvail(), ImVec2(0, 1.0), ImVec2(1.0, 0));
|
||||||
}
|
}
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|
||||||
|
|||||||
@@ -4085,7 +4085,7 @@ opengl_renderer::Update_Pick_Control() {
|
|||||||
#endif
|
#endif
|
||||||
m_pickcontrolitem = control;
|
m_pickcontrolitem = control;
|
||||||
// return control;
|
// return control;
|
||||||
for( auto callback : m_control_pick_requests ) {
|
for( auto& callback : m_control_pick_requests ) {
|
||||||
callback( m_pickcontrolitem, glm::vec2() );
|
callback( m_pickcontrolitem, glm::vec2() );
|
||||||
}
|
}
|
||||||
m_control_pick_requests.clear();
|
m_control_pick_requests.clear();
|
||||||
@@ -4134,7 +4134,7 @@ opengl_renderer::Update_Pick_Node() {
|
|||||||
#endif
|
#endif
|
||||||
m_picksceneryitem = node;
|
m_picksceneryitem = node;
|
||||||
// return node;
|
// return node;
|
||||||
for( auto callback : m_node_pick_requests ) {
|
for( auto& callback : m_node_pick_requests ) {
|
||||||
callback( m_picksceneryitem );
|
callback( m_picksceneryitem );
|
||||||
}
|
}
|
||||||
m_node_pick_requests.clear();
|
m_node_pick_requests.clear();
|
||||||
@@ -4313,7 +4313,7 @@ void opengl_renderer::MakeScreenshot()
|
|||||||
void
|
void
|
||||||
opengl_renderer::Update_Lights( light_array &Lights ) {
|
opengl_renderer::Update_Lights( light_array &Lights ) {
|
||||||
// arrange the light array from closest to farthest from current position of the camera
|
// arrange the light array from closest to farthest from current position of the camera
|
||||||
auto const camera = m_renderpass.camera.position();
|
auto const &camera = m_renderpass.camera.position();
|
||||||
std::sort(
|
std::sort(
|
||||||
std::begin( Lights.data ),
|
std::begin( Lights.data ),
|
||||||
std::end( Lights.data ),
|
std::end( Lights.data ),
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ smoke_source::update( double const Timedelta, bool const Onlydespawn ) {
|
|||||||
|
|
||||||
if (Global.AirTemperature <= 5.f || m_owner.vehicle->MoverParameters->dizel_heat.Ts < 45.f)
|
if (Global.AirTemperature <= 5.f || m_owner.vehicle->MoverParameters->dizel_heat.Ts < 45.f)
|
||||||
{
|
{
|
||||||
m_emitter.color == glm::vec3{128, 128, 128};
|
m_emitter.color = glm::vec3{128, 128, 128};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_owner.vehicle->MoverParameters->dizel_spinup == true)
|
if (m_owner.vehicle->MoverParameters->dizel_spinup == true)
|
||||||
|
|||||||
@@ -1054,7 +1054,7 @@ basic_region::on_click( TAnimModel const *Instance ) {
|
|||||||
|
|
||||||
if( Instance->name().empty() || ( Instance->name() == "none" ) ) { return; }
|
if( Instance->name().empty() || ( Instance->name() == "none" ) ) { return; }
|
||||||
|
|
||||||
auto const location { Instance->location() };
|
auto const& location { Instance->location() };
|
||||||
|
|
||||||
if( point_inside( location ) ) {
|
if( point_inside( location ) ) {
|
||||||
section( location ).on_click( Instance );
|
section( location ).on_click( Instance );
|
||||||
@@ -1329,7 +1329,7 @@ basic_region::insert( shape_node Shape, scratch_data &Scratchpad, bool const Tra
|
|||||||
if( ( false == Scratchpad.location.offset.empty() )
|
if( ( false == Scratchpad.location.offset.empty() )
|
||||||
&& ( Scratchpad.location.offset.top() != glm::dvec3( 0, 0, 0 ) ) ) {
|
&& ( Scratchpad.location.offset.top() != glm::dvec3( 0, 0, 0 ) ) ) {
|
||||||
// ...and move
|
// ...and move
|
||||||
auto const offset = Scratchpad.location.offset.top();
|
auto const& offset = Scratchpad.location.offset.top();
|
||||||
for( auto &vertex : shape.m_data.vertices ) {
|
for( auto &vertex : shape.m_data.vertices ) {
|
||||||
vertex.position += offset;
|
vertex.position += offset;
|
||||||
}
|
}
|
||||||
@@ -1383,7 +1383,7 @@ basic_region::insert( lines_node Lines, scratch_data &Scratchpad ) {
|
|||||||
if( ( false == Scratchpad.location.offset.empty() )
|
if( ( false == Scratchpad.location.offset.empty() )
|
||||||
&& ( Scratchpad.location.offset.top() != glm::dvec3( 0, 0, 0 ) ) ) {
|
&& ( Scratchpad.location.offset.top() != glm::dvec3( 0, 0, 0 ) ) ) {
|
||||||
// ...and move
|
// ...and move
|
||||||
auto const offset = Scratchpad.location.offset.top();
|
auto const &offset = Scratchpad.location.offset.top();
|
||||||
for( auto &vertex : Lines.m_data.vertices ) {
|
for( auto &vertex : Lines.m_data.vertices ) {
|
||||||
vertex.position += offset;
|
vertex.position += offset;
|
||||||
}
|
}
|
||||||
@@ -1759,7 +1759,7 @@ void basic_region::update_poi_geometry()
|
|||||||
{
|
{
|
||||||
std::vector<gfx::basic_vertex> vertices;
|
std::vector<gfx::basic_vertex> vertices;
|
||||||
gfx::userdata_array userdata;
|
gfx::userdata_array userdata;
|
||||||
for (const auto sem : map::Objects.entries)
|
for (const auto &sem : map::Objects.entries)
|
||||||
vertices.push_back(std::move(sem->vertex()));
|
vertices.push_back(std::move(sem->vertex()));
|
||||||
|
|
||||||
if (!m_map_poipoints) {
|
if (!m_map_poipoints) {
|
||||||
|
|||||||
@@ -61,8 +61,7 @@ void
|
|||||||
basic_editor::translate( scene::basic_node *Node, float const Offset ) {
|
basic_editor::translate( scene::basic_node *Node, float const Offset ) {
|
||||||
|
|
||||||
// NOTE: offset scaling is calculated early so the same multiplier can be applied to potential whole group
|
// NOTE: offset scaling is calculated early so the same multiplier can be applied to potential whole group
|
||||||
auto location { Node->location() };
|
auto const distance { glm::length( Node->location() - Global.pCamera.Pos ) };
|
||||||
auto const distance { glm::length( location - glm::dvec3{ Global.pCamera.Pos } ) };
|
|
||||||
auto const offset { static_cast<float>( Offset * std::max( 1.0, distance * 0.01 ) ) };
|
auto const offset { static_cast<float>( Offset * std::max( 1.0, distance * 0.01 ) ) };
|
||||||
|
|
||||||
if( Node->group() <= 1 ) {
|
if( Node->group() <= 1 ) {
|
||||||
|
|||||||
3
utilities/U8.h
Normal file
3
utilities/U8.h
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define U8(str) (const char *)u8##str
|
||||||
@@ -27,6 +27,8 @@ Copyright (C) 2007-2014 Maciej Cierniak
|
|||||||
#include "utilities/utilities.h"
|
#include "utilities/utilities.h"
|
||||||
#include "utilities/Globals.h"
|
#include "utilities/Globals.h"
|
||||||
#include "utilities/parser.h"
|
#include "utilities/parser.h"
|
||||||
|
#include "utilities/U8.h"
|
||||||
|
|
||||||
|
|
||||||
//#include "utilities/Logs.h"
|
//#include "utilities/Logs.h"
|
||||||
|
|
||||||
@@ -204,7 +206,7 @@ std::string to_hex_str(int const Value, int const Width)
|
|||||||
return o.str();
|
return o.str();
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string const fractionlabels[] = {" ", "¹", "²", "³", "⁴", "⁵", "⁶", "⁷", "⁸", "⁹"};
|
std::string const fractionlabels[] = {U8(" "), U8("¹"), U8("²"), U8("³"), U8("⁴"), U8("⁵"), U8("⁶"), U8("⁷"), U8("⁸"), U8("⁹")};
|
||||||
|
|
||||||
std::string to_minutes_str(float const Minutes, bool const Leadingzero, int const Width)
|
std::string to_minutes_str(float const Minutes, bool const Leadingzero, int const Width)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ void ui::cameraview_panel::render_contents()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImVec2 surface_size = ImGui::GetContentRegionAvail();
|
ImVec2 surface_size = ImGui::GetContentRegionAvail();
|
||||||
ImGui::Image(reinterpret_cast<void*>(texture->id), surface_size);
|
ImGui::Image((ImTextureID)(intptr_t)(texture->id), surface_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ui::cameraview_panel::capture_func()
|
void ui::cameraview_panel::capture_func()
|
||||||
|
|||||||
@@ -299,7 +299,7 @@ void ui::map_panel::render_contents()
|
|||||||
|
|
||||||
ImVec2 window_origin = ImGui::GetCursorPos();
|
ImVec2 window_origin = ImGui::GetCursorPos();
|
||||||
ImVec2 screen_origin = ImGui::GetCursorScreenPos();
|
ImVec2 screen_origin = ImGui::GetCursorScreenPos();
|
||||||
ImGui::ImageButton(reinterpret_cast<void *>(m_tex->id), surface_size_im, ImVec2(0, surface_size.y / fb_size), ImVec2(surface_size.x / fb_size, 0), 0);
|
ImGui::ImageButton((ImTextureID)(intptr_t)(m_tex->id), surface_size_im, ImVec2(0, surface_size.y / fb_size), ImVec2(surface_size.x / fb_size, 0), 0);
|
||||||
|
|
||||||
if (ImGui::IsItemHovered())
|
if (ImGui::IsItemHovered())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ map::sorted_object_list map::objects::find_in_range(glm::vec3 from, float distan
|
|||||||
float dist = glm::distance2(entry_location, search_point);
|
float dist = glm::distance2(entry_location, search_point);
|
||||||
if (dist < max_distance2)
|
if (dist < max_distance2)
|
||||||
{
|
{
|
||||||
items.emplace(dist, std::move(entry));
|
items.emplace(dist, entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -537,13 +537,12 @@ updatevalues_event::run_() {
|
|||||||
// targetcell->LogValues();
|
// targetcell->LogValues();
|
||||||
if( targetcell->Track == nullptr ) { continue; }
|
if( targetcell->Track == nullptr ) { continue; }
|
||||||
// McZapkie-100302 - updatevalues oprocz zmiany wartosci robi putcommand dla wszystkich 'dynamic' na danym torze
|
// McZapkie-100302 - updatevalues oprocz zmiany wartosci robi putcommand dla wszystkich 'dynamic' na danym torze
|
||||||
auto const location { targetcell->location() };
|
|
||||||
for( auto vehicle : targetcell->Track->Dynamics ) {
|
for( auto vehicle : targetcell->Track->Dynamics ) {
|
||||||
if( vehicle->Mechanik ) {
|
if( vehicle->Mechanik ) {
|
||||||
WriteLog( " Vehicle: [" + vehicle->name() + "]" );
|
WriteLog( " Vehicle: [" + vehicle->name() + "]" );
|
||||||
targetcell->PutCommand(
|
targetcell->PutCommand(
|
||||||
vehicle->Mechanik,
|
vehicle->Mechanik,
|
||||||
&location );
|
&targetcell->location() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user