Updated assimp to latest

This commit is contained in:
Areloch 2019-03-05 14:39:38 -06:00
parent 25ce4477ce
commit 161bf7f83b
461 changed files with 34662 additions and 30165 deletions

View file

@ -3,7 +3,8 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -48,12 +49,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef ASSIMP_BUILD_NO_LWS_IMPORTER
#include "LWSLoader.h"
#include "ParsingUtils.h"
#include "fast_atof.h"
#include <assimp/ParsingUtils.h>
#include <assimp/fast_atof.h>
#include <assimp/SceneCombiner.h>
#include "GenericProperty.h"
#include "SkeletonMeshBuilder.h"
#include <assimp/GenericProperty.h>
#include <assimp/SkeletonMeshBuilder.h>
#include "ConvertToLHProcess.h"
#include "Importer.h"
#include <assimp/DefaultLogger.hpp>
@ -104,7 +105,7 @@ void LWS::Element::Parse (const char*& buffer)
if (children.back().tokens[0] == "Plugin")
{
DefaultLogger::get()->debug("LWS: Skipping over plugin-specific data");
ASSIMP_LOG_DEBUG("LWS: Skipping over plugin-specific data");
// strange stuff inside Plugin/Endplugin blocks. Needn't
// follow LWS syntax, so we skip over it
@ -199,7 +200,7 @@ void LWSImporter::SetupProperties(const Importer* pImp)
void LWSImporter::ReadEnvelope(const LWS::Element& dad, LWO::Envelope& fill )
{
if (dad.children.empty()) {
DefaultLogger::get()->error("LWS: Envelope descriptions must not be empty");
ASSIMP_LOG_ERROR("LWS: Envelope descriptions must not be empty");
return;
}
@ -247,7 +248,7 @@ void LWSImporter::ReadEnvelope(const LWS::Element& dad, LWO::Envelope& fill )
num = 4;
break;
default:
DefaultLogger::get()->error("LWS: Unknown span type");
ASSIMP_LOG_ERROR("LWS: Unknown span type");
}
for (unsigned int i = 0; i < num;++i) {
SkipSpaces(&c);
@ -304,7 +305,7 @@ void LWSImporter::ReadEnvelope_Old(
return;
unexpected_end:
DefaultLogger::get()->error("LWS: Encountered unexpected end of file while parsing object motion");
ASSIMP_LOG_ERROR("LWS: Encountered unexpected end of file while parsing object motion");
}
// ------------------------------------------------------------------------------------------------
@ -351,7 +352,7 @@ void LWSImporter::BuildGraph(aiNode* nd, LWS::NodeDesc& src, std::vector<Attachm
if (src.path.length() ) {
obj = batch.GetImport(src.id);
if (!obj) {
DefaultLogger::get()->error("LWS: Failed to read external file " + src.path);
ASSIMP_LOG_ERROR("LWS: Failed to read external file " + src.path);
}
else {
if (obj->mRootNode->mNumChildren == 1) {
@ -409,7 +410,7 @@ void LWSImporter::BuildGraph(aiNode* nd, LWS::NodeDesc& src, std::vector<Attachm
// name to attach light to node -> unique due to LWs indexing system
lit->mName = nd->mName;
// detemine light type and setup additional members
// determine light type and setup additional members
if (src.lightType == 2) { /* spot light */
lit->mType = aiLightSource_SPOT;
@ -550,7 +551,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
// get file format version and print to log
++it;
unsigned int version = strtoul10((*it).tokens[0].c_str());
DefaultLogger::get()->info("LWS file format version is " + (*it).tokens[0]);
ASSIMP_LOG_INFO("LWS file format version is " + (*it).tokens[0]);
first = 0.;
last = 60.;
fps = 25.; /* seems to be a good default frame rate */
@ -655,7 +656,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
d.number = cur_object++;
nodes.push_back(d);
}
else DefaultLogger::get()->error("LWS: Unexpected keyword: \'Channel\'");
ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'Channel\'");
}
// important: index of channel
@ -672,7 +673,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
// 'Envelope': a single animation channel
else if ((*it).tokens[0] == "Envelope") {
if (nodes.empty() || nodes.back().channels.empty())
DefaultLogger::get()->error("LWS: Unexpected keyword: \'Envelope\'");
ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'Envelope\'");
else {
ReadEnvelope((*it),nodes.back().channels.back());
}
@ -683,7 +684,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
(*it).tokens[0] == "LightMotion")) {
if (nodes.empty())
DefaultLogger::get()->error("LWS: Unexpected keyword: \'<Light|Object|Camera>Motion\'");
ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'<Light|Object|Camera>Motion\'");
else {
ReadEnvelope_Old(it,root.children.end(),nodes.back(),version);
}
@ -691,7 +692,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
// 'Pre/PostBehavior': pre/post animation behaviour for LWSC 2
else if (version == 2 && (*it).tokens[0] == "Pre/PostBehavior") {
if (nodes.empty())
DefaultLogger::get()->error("LWS: Unexpected keyword: \'Pre/PostBehavior'");
ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'Pre/PostBehavior'");
else {
for (std::list<LWO::Envelope>::iterator it = nodes.back().channels.begin(); it != nodes.back().channels.end(); ++it) {
// two ints per envelope
@ -704,14 +705,14 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
// 'ParentItem': specifies the parent of the current element
else if ((*it).tokens[0] == "ParentItem") {
if (nodes.empty())
DefaultLogger::get()->error("LWS: Unexpected keyword: \'ParentItem\'");
ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'ParentItem\'");
else nodes.back().parent = strtoul16(c,&c);
}
// 'ParentObject': deprecated one for older formats
else if (version < 3 && (*it).tokens[0] == "ParentObject") {
if (nodes.empty())
DefaultLogger::get()->error("LWS: Unexpected keyword: \'ParentObject\'");
ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'ParentObject\'");
else {
nodes.back().parent = strtoul10(c,&c) | (1u << 28u);
@ -735,7 +736,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
// 'CameraName': set name of currently active camera
else if ((*it).tokens[0] == "CameraName") {
if (nodes.empty() || nodes.back().type != LWS::NodeDesc::CAMERA)
DefaultLogger::get()->error("LWS: Unexpected keyword: \'CameraName\'");
ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'CameraName\'");
else nodes.back().name = c;
}
@ -757,14 +758,14 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
// 'LightName': set name of currently active light
else if ((*it).tokens[0] == "LightName") {
if (nodes.empty() || nodes.back().type != LWS::NodeDesc::LIGHT)
DefaultLogger::get()->error("LWS: Unexpected keyword: \'LightName\'");
ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'LightName\'");
else nodes.back().name = c;
}
// 'LightIntensity': set intensity of currently active light
else if ((*it).tokens[0] == "LightIntensity" || (*it).tokens[0] == "LgtIntensity" ) {
if (nodes.empty() || nodes.back().type != LWS::NodeDesc::LIGHT)
DefaultLogger::get()->error("LWS: Unexpected keyword: \'LightIntensity\'");
ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'LightIntensity\'");
else fast_atoreal_move<float>(c, nodes.back().lightIntensity );
@ -772,7 +773,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
// 'LightType': set type of currently active light
else if ((*it).tokens[0] == "LightType") {
if (nodes.empty() || nodes.back().type != LWS::NodeDesc::LIGHT)
DefaultLogger::get()->error("LWS: Unexpected keyword: \'LightType\'");
ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'LightType\'");
else nodes.back().lightType = strtoul10(c);
@ -780,7 +781,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
// 'LightFalloffType': set falloff type of currently active light
else if ((*it).tokens[0] == "LightFalloffType") {
if (nodes.empty() || nodes.back().type != LWS::NodeDesc::LIGHT)
DefaultLogger::get()->error("LWS: Unexpected keyword: \'LightFalloffType\'");
ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'LightFalloffType\'");
else nodes.back().lightFalloffType = strtoul10(c);
@ -788,7 +789,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
// 'LightConeAngle': set cone angle of currently active light
else if ((*it).tokens[0] == "LightConeAngle") {
if (nodes.empty() || nodes.back().type != LWS::NodeDesc::LIGHT)
DefaultLogger::get()->error("LWS: Unexpected keyword: \'LightConeAngle\'");
ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'LightConeAngle\'");
else nodes.back().lightConeAngle = fast_atof(c);
@ -796,7 +797,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
// 'LightEdgeAngle': set area where we're smoothing from min to max intensity
else if ((*it).tokens[0] == "LightEdgeAngle") {
if (nodes.empty() || nodes.back().type != LWS::NodeDesc::LIGHT)
DefaultLogger::get()->error("LWS: Unexpected keyword: \'LightEdgeAngle\'");
ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'LightEdgeAngle\'");
else nodes.back().lightEdgeAngle = fast_atof(c);
@ -804,7 +805,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
// 'LightColor': set color of currently active light
else if ((*it).tokens[0] == "LightColor") {
if (nodes.empty() || nodes.back().type != LWS::NodeDesc::LIGHT)
DefaultLogger::get()->error("LWS: Unexpected keyword: \'LightColor\'");
ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'LightColor\'");
else {
c = fast_atoreal_move<float>(c, (float&) nodes.back().lightColor.r );
@ -818,7 +819,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
// 'PivotPosition': position of local transformation origin
else if ((*it).tokens[0] == "PivotPosition" || (*it).tokens[0] == "PivotPoint") {
if (nodes.empty())
DefaultLogger::get()->error("LWS: Unexpected keyword: \'PivotPosition\'");
ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'PivotPosition\'");
else {
c = fast_atoreal_move<float>(c, (float&) nodes.back().pivotPos.x );
SkipSpaces(&c);
@ -839,7 +840,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
if (dit != it && *it == (*dit).parent) {
if ((*dit).parent_resolved) {
// fixme: it's still possible to produce an overflow due to cross references ..
DefaultLogger::get()->error("LWS: Found cross reference in scenegraph");
ASSIMP_LOG_ERROR("LWS: Found cross reference in scene-graph");
continue;
}