mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Merge branch 'tmj-dev' into milek-dev
This commit is contained in:
23
Model3d.cpp
23
Model3d.cpp
@@ -174,10 +174,26 @@ int TSubModel::Load( cParser &parser, TModel3d *Model, /*int Pos,*/ bool dynamic
|
||||
/*
|
||||
iVboPtr = Pos; // pozycja w VBO
|
||||
*/
|
||||
if (!parser.expectToken("type:"))
|
||||
ErrorLog("Bad model: expected submodel type definition not found while loading model \"" + Model->NameGet() + "\"" );
|
||||
auto token { parser.getToken<std::string>() };
|
||||
if( token != "type:" ) {
|
||||
std::string errormessage {
|
||||
"Bad model: expected submodel type definition not found while loading model \"" + Model->NameGet() + "\""
|
||||
+ "\ncurrent model data stream content: \"" };
|
||||
auto count { 10 };
|
||||
while( ( true == parser.getTokens() )
|
||||
&& ( false == ( token = parser.peek() ).empty() )
|
||||
&& ( token != "parent:" ) ) {
|
||||
// skip data until next submodel, dump first few tokens in the error message
|
||||
if( --count > 0 ) {
|
||||
errormessage += token + " ";
|
||||
}
|
||||
}
|
||||
errormessage += "(...)\"";
|
||||
ErrorLog( errormessage );
|
||||
return 0;
|
||||
}
|
||||
{
|
||||
std::string type = parser.getToken<std::string>();
|
||||
auto const type { parser.getToken<std::string>() };
|
||||
if (type == "mesh")
|
||||
eType = GL_TRIANGLES; // submodel - trójkaty
|
||||
else if (type == "point")
|
||||
@@ -190,7 +206,6 @@ int TSubModel::Load( cParser &parser, TModel3d *Model, /*int Pos,*/ bool dynamic
|
||||
eType = TP_STARS; // wiele punktów świetlnych
|
||||
};
|
||||
parser.ignoreToken();
|
||||
std::string token;
|
||||
parser.getTokens(1, false); // nazwa submodelu bez zmieny na małe
|
||||
parser >> token;
|
||||
Name(token);
|
||||
|
||||
Reference in New Issue
Block a user