mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-23 02:49:19 +02:00
fix invalid index_size in e3d serialization, fix missing parent message, move captureonstart after crashreporter gui
This commit is contained in:
@@ -1193,10 +1193,10 @@ int TSubModel::index_size() const {
|
|||||||
}
|
}
|
||||||
if( ( size < 4 ) && ( m_geometry.handle != null_handle ) ) {
|
if( ( size < 4 ) && ( m_geometry.handle != null_handle ) ) {
|
||||||
auto const indexcount { GfxRenderer->Indices( m_geometry.handle ).size() };
|
auto const indexcount { GfxRenderer->Indices( m_geometry.handle ).size() };
|
||||||
size = (
|
size = std::max( size, (
|
||||||
indexcount >= ( 1 << 16 ) ? 4 :
|
indexcount >= ( 1 << 16 ) ? 4 :
|
||||||
indexcount >= ( 1 << 8 ) ? 2 :
|
indexcount >= ( 1 << 8 ) ? 2 :
|
||||||
1 );
|
1 ) );
|
||||||
}
|
}
|
||||||
if( ( size < 4 ) && ( Next ) ) {
|
if( ( size < 4 ) && ( Next ) ) {
|
||||||
size = std::max( size, Next->index_size() );
|
size = std::max( size, Next->index_size() );
|
||||||
@@ -2197,8 +2197,6 @@ void TModel3d::LoadFromTextFile(std::string const &FileName, bool dynamic)
|
|||||||
}
|
}
|
||||||
SubModel = new TSubModel();
|
SubModel = new TSubModel();
|
||||||
SubModel->Parent = GetFromName(parent);
|
SubModel->Parent = GetFromName(parent);
|
||||||
if (SubModel->Parent == nullptr && parent != "none")
|
|
||||||
ErrorLog("Bad model: parent for sub-model \"" + SubModel->pName +"\" doesn't exist or is located later in the model data", logtype::model);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
auto const result { SubModel->Load( parser, dynamic ) };
|
auto const result { SubModel->Load( parser, dynamic ) };
|
||||||
@@ -2206,6 +2204,8 @@ void TModel3d::LoadFromTextFile(std::string const &FileName, bool dynamic)
|
|||||||
m_vertexcount += result.second;
|
m_vertexcount += result.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SubModel->Parent == nullptr && parent != "none")
|
||||||
|
ErrorLog("Bad model: parent for sub-model \"" + SubModel->pName +"\" doesn't exist or is located later in the model data", logtype::model);
|
||||||
AddTo(SubModel->Parent, SubModel);
|
AddTo(SubModel->Parent, SubModel);
|
||||||
|
|
||||||
parser.getTokens();
|
parser.getTokens();
|
||||||
|
|||||||
@@ -911,14 +911,6 @@ eu07_application::init_glfw() {
|
|||||||
::SetWindowPos( Hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
|
::SetWindowPos( Hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (Global.captureonstart)
|
|
||||||
{
|
|
||||||
Global.ControlPicking = false;
|
|
||||||
glfwSetInputMode(mainwindow, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Global.ControlPicking = true;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1043,6 +1035,14 @@ eu07_application::init_modes() {
|
|||||||
else
|
else
|
||||||
push_mode( mode::scenarioloader );
|
push_mode( mode::scenarioloader );
|
||||||
|
|
||||||
|
if (Global.captureonstart)
|
||||||
|
{
|
||||||
|
Global.ControlPicking = false;
|
||||||
|
glfwSetInputMode(m_windows.front(), GLFW_CURSOR, GLFW_CURSOR_DISABLED);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Global.ControlPicking = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user