17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 08:39:19 +02:00

Merge branch 'master' into fix/sonar-reliability-security

This commit is contained in:
jerrrrycho
2026-10-11 12:33:07 +02:00
committed by GitHub
179 changed files with 172242 additions and 16421 deletions

View File

@@ -74,9 +74,15 @@ extern WNDPROC BaseWindowProc;
void focus_callback(GLFWwindow *window, int focus)
{
ui_layer::focus_callback(focus);
Application.on_focus_change(focus != 0);
}
void cursor_enter_callback(GLFWwindow *window, int entered)
{
ui_layer::cursor_enter_callback(entered);
}
void framebuffer_resize_callback(GLFWwindow *, int w, int h)
{
Global.fb_size = glm::ivec2(w, h);
@@ -90,6 +96,7 @@ void window_resize_callback(GLFWwindow *, int w, int h)
void cursor_pos_callback(GLFWwindow *window, double x, double y)
{
ui_layer::cursor_pos_callback(x, y);
Global.cursor_pos = glm::ivec2(x, y);
Application.on_cursor_pos(x, y);
}
@@ -1126,6 +1133,8 @@ int eu07_application::init_settings(int Argc, char *Argv[])
}
// process command line arguments
bool sceneryfromcommandline{false};
bool editwithoutscenery{false};
for (int i = 1; i < Argc; ++i)
{
@@ -1136,6 +1145,7 @@ int eu07_application::init_settings(int Argc, char *Argv[])
if (i + 1 < Argc)
{
Global.SceneryFile = ToLower(Argv[++i]);
sceneryfromcommandline = true;
}
}
else if (token == "-v")
@@ -1145,6 +1155,19 @@ int eu07_application::init_settings(int Argc, char *Argv[])
Global.local_start_vehicle = ToLower(Argv[++i]);
}
}
else if (token == "-edit")
{
// edit session: the scenery is loaded without player vehicle, straight into the editor
Global.editor_session = true;
Global.local_start_vehicle = "ghostview";
if (i + 1 < Argc && Argv[i + 1][0] != '-')
{
Global.SceneryFile = ToLower(Argv[++i]);
sceneryfromcommandline = true;
}
else
editwithoutscenery = true;
}
else if (token == "-seed")
{
// a number is the seed; anything else is a word that stands for one. said in the
@@ -1159,10 +1182,13 @@ int eu07_application::init_settings(int Argc, char *Argv[])
{
std::cout << "usage: " << std::string(Argv[0]) << " [-s sceneryfilepath]"
<< " [-v vehiclename]"
<< " [-edit [sceneryfilepath]]"
<< " [-seed number|word]" << std::endl;
return -1;
}
}
if (editwithoutscenery && false == sceneryfromcommandline)
Global.SceneryFile.clear();
return 0;
}
@@ -1332,6 +1358,7 @@ void eu07_application::init_callbacks()
glfwSetScrollCallback(window, scroll_callback);
glfwSetCharCallback(window, char_callback);
glfwSetWindowFocusCallback(window, focus_callback);
glfwSetCursorEnterCallback(window, cursor_enter_callback);
}
int eu07_application::init_ogl()