Skip to content

Commit

Permalink
fixups3
Browse files Browse the repository at this point in the history
  • Loading branch information
ohlidalp committed Oct 18, 2022
1 parent e0c9d2c commit f66f9f9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
30 changes: 15 additions & 15 deletions source/main/resources/tobj_fileformat/TObjFileFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,30 +347,30 @@ bool TObjReader::ParseObjectLine(TObjEntry& object)
if (num_args < 6)
return false;

std::string type = "generic";
object.odef_name = "generic";

if (num_args > 0) object.position.x = this->GetArgFloat(0);
if (num_args > 1) object.position.y = this->GetArgFloat(1);
if (num_args > 2) object.position.z = this->GetArgFloat(2);
if (num_args > 3) object.rotation.x = this->GetArgFloat(3);
if (num_args > 4) object.rotation.y = this->GetArgFloat(4);
if (num_args > 5) object.rotation.z = this->GetArgFloat(5);
if (num_args > 6) type = this->GetArgString(6);
if (num_args > 7) object.odef_name = this->GetArgString(7);
if (num_args > 6) object.odef_name = this->GetArgString(6);
if (num_args > 7) object.type = this->GetArgString(7);
if (num_args > 8) object.instance_name = this->GetArgString(8);

if (type == "truck" ) { object.special = TObj::SpecialObject::TRUCK ; }
else if (type == "load" ) { object.special = TObj::SpecialObject::LOAD ; }
else if (type == "machine" ) { object.special = TObj::SpecialObject::MACHINE ; }
else if (type == "boat" ) { object.special = TObj::SpecialObject::BOAT ; }
else if (type == "truck2" ) { object.special = TObj::SpecialObject::TRUCK2 ; }
else if (type == "grid" ) { object.special = TObj::SpecialObject::GRID ; }
else if (type == "road" ) { object.special = TObj::SpecialObject::ROAD ; }
else if (type == "roadborderleft" ) { object.special = TObj::SpecialObject::ROAD_BORDER_LEFT ; }
else if (type == "roadborderright" ) { object.special = TObj::SpecialObject::ROAD_BORDER_RIGHT ; }
else if (type == "roadborderboth" ) { object.special = TObj::SpecialObject::ROAD_BORDER_BOTH ; }
else if (type == "roadbridgenopillar") { object.special = TObj::SpecialObject::ROAD_BRIDGE_NO_PILLARS; }
else if (type == "roadbridge" ) { object.special = TObj::SpecialObject::ROAD_BRIDGE ; }
if (object.odef_name == "truck" ) { object.special = TObj::SpecialObject::TRUCK ; }
else if (object.odef_name == "load" ) { object.special = TObj::SpecialObject::LOAD ; }
else if (object.odef_name == "machine" ) { object.special = TObj::SpecialObject::MACHINE ; }
else if (object.odef_name == "boat" ) { object.special = TObj::SpecialObject::BOAT ; }
else if (object.odef_name == "truck2" ) { object.special = TObj::SpecialObject::TRUCK2 ; }
else if (object.odef_name == "grid" ) { object.special = TObj::SpecialObject::GRID ; }
else if (object.odef_name == "road" ) { object.special = TObj::SpecialObject::ROAD ; }
else if (object.odef_name == "roadborderleft" ) { object.special = TObj::SpecialObject::ROAD_BORDER_LEFT ; }
else if (object.odef_name == "roadborderright" ) { object.special = TObj::SpecialObject::ROAD_BORDER_RIGHT ; }
else if (object.odef_name == "roadborderboth" ) { object.special = TObj::SpecialObject::ROAD_BORDER_BOTH ; }
else if (object.odef_name == "roadbridgenopillar") { object.special = TObj::SpecialObject::ROAD_BRIDGE_NO_PILLARS; }
else if (object.odef_name == "roadbridge" ) { object.special = TObj::SpecialObject::ROAD_BRIDGE ; }

return true;
}
1 change: 1 addition & 0 deletions source/main/utils/GenericFileFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ void Document::Load(Ogre::DataStreamPtr datastream, BitMask_t options)
{
ProcessBool(*this, options, tok, tok_type, tok_number_dot, tok_string_naked, datastream, line_num, c);
}
break;

case TokenType::KEYWORD:
if (c == '\n')
Expand Down

0 comments on commit f66f9f9

Please sign in to comment.