Just the functional assimp lib rather than the entire assimp repository unnecessarily.

This commit is contained in:
Areloch 2019-02-28 16:37:15 -06:00
parent bf170ffbca
commit 25ce4477ce
1747 changed files with 9012 additions and 925008 deletions

View file

@ -4,8 +4,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2018, assimp team
Copyright (c) 2006-2017, assimp team
All rights reserved.
@ -50,11 +49,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// internal headers
#include "ACLoader.h"
#include <assimp/ParsingUtils.h>
#include <assimp/fast_atof.h>
#include <assimp/Subdivision.h>
#include "ParsingUtils.h"
#include "fast_atof.h"
#include "Subdivision.h"
#include "Importer.h"
#include <assimp/BaseImporter.h>
#include "BaseImporter.h"
#include <assimp/Importer.hpp>
#include <assimp/light.h>
#include <assimp/DefaultLogger.hpp>
@ -85,7 +84,7 @@ static const aiImporterDesc desc = {
#define AI_AC_SKIP_TO_NEXT_TOKEN() \
if (!SkipSpaces(&buffer)) \
{ \
ASSIMP_LOG_ERROR("AC3D: Unexpected EOF/EOL"); \
DefaultLogger::get()->error("AC3D: Unexpected EOF/EOL"); \
continue; \
}
@ -101,7 +100,7 @@ static const aiImporterDesc desc = {
{ \
if (IsLineEnd( *buffer )) \
{ \
ASSIMP_LOG_ERROR("AC3D: Unexpected EOF/EOL in string"); \
DefaultLogger::get()->error("AC3D: Unexpected EOF/EOL in string"); \
out = "ERROR"; \
break; \
} \
@ -120,7 +119,7 @@ static const aiImporterDesc desc = {
{ \
if (strncmp(buffer,name,name_length) || !IsSpace(buffer[name_length])) \
{ \
ASSIMP_LOG_ERROR("AC3D: Unexpexted token. " name " was expected."); \
DefaultLogger::get()->error("AC3D: Unexpexted token. " name " was expected."); \
continue; \
} \
buffer += name_length+1; \
@ -217,7 +216,7 @@ void AC3DImporter::LoadObjectSection(std::vector<Object>& objects)
light->mName.length = ::ai_snprintf(light->mName.data, MAXLEN, "ACLight_%i",static_cast<unsigned int>(mLights->size())-1);
obj.name = std::string( light->mName.data );
ASSIMP_LOG_DEBUG("AC3D: Light source encountered");
DefaultLogger::get()->debug("AC3D: Light source encountered");
obj.type = Object::Light;
}
else if (!ASSIMP_strincmp(buffer,"group",5))
@ -307,12 +306,12 @@ void AC3DImporter::LoadObjectSection(std::vector<Object>& objects)
{
if (!GetNextLine())
{
ASSIMP_LOG_ERROR("AC3D: Unexpected EOF: not all vertices have been parsed yet");
DefaultLogger::get()->error("AC3D: Unexpected EOF: not all vertices have been parsed yet");
break;
}
else if (!IsNumeric(*buffer))
{
ASSIMP_LOG_ERROR("AC3D: Unexpected token: not all vertices have been parsed yet");
DefaultLogger::get()->error("AC3D: Unexpected token: not all vertices have been parsed yet");
--buffer; // make sure the line is processed a second time
break;
}
@ -338,8 +337,8 @@ void AC3DImporter::LoadObjectSection(std::vector<Object>& objects)
// example writes no surf chunks
if (!Q3DWorkAround)
{
ASSIMP_LOG_WARN("AC3D: SURF token was expected");
ASSIMP_LOG_DEBUG("Continuing with Quick3D Workaround enabled");
DefaultLogger::get()->warn("AC3D: SURF token was expected");
DefaultLogger::get()->debug("Continuing with Quick3D Workaround enabled");
}
--buffer; // make sure the line is processed a second time
// break; --- see fix notes above
@ -384,7 +383,7 @@ void AC3DImporter::LoadObjectSection(std::vector<Object>& objects)
{
if(!GetNextLine())
{
ASSIMP_LOG_ERROR("AC3D: Unexpected EOF: surface references are incomplete");
DefaultLogger::get()->error("AC3D: Unexpected EOF: surface references are incomplete");
break;
}
surf.entries.push_back(Surface::SurfaceEntry());
@ -405,7 +404,7 @@ void AC3DImporter::LoadObjectSection(std::vector<Object>& objects)
}
}
}
ASSIMP_LOG_ERROR("AC3D: Unexpected EOF: \'kids\' line was expected");
DefaultLogger::get()->error("AC3D: Unexpected EOF: \'kids\' line was expected");
}
// ------------------------------------------------------------------------------------------------
@ -478,7 +477,7 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
therefore: if no surfaces are defined return point data only
*/
ASSIMP_LOG_INFO("AC3D: No surfaces defined in object definition, "
DefaultLogger::get()->info("AC3D: No surfaces defined in object definition, "
"a point list is returned");
meshes.push_back(new aiMesh());
@ -519,12 +518,12 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
unsigned int idx = (*it).mat;
if (idx >= needMat.size())
{
ASSIMP_LOG_ERROR("AC3D: material index is out of range");
DefaultLogger::get()->error("AC3D: material index is out of range");
idx = 0;
}
if ((*it).entries.empty())
{
ASSIMP_LOG_WARN("AC3D: surface her zero vertex references");
DefaultLogger::get()->warn("AC3D: surface her zero vertex references");
}
// validate all vertex indices to make sure we won't crash here
@ -533,7 +532,7 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
{
if ((*it2).first >= object.vertices.size())
{
ASSIMP_LOG_WARN("AC3D: Invalid vertex reference");
DefaultLogger::get()->warn("AC3D: Invalid vertex reference");
(*it2).first = 0;
}
}
@ -561,7 +560,7 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
if ((*it).flags & 0xf)
{
ASSIMP_LOG_WARN("AC3D: The type flag of a surface is unknown");
DefaultLogger::get()->warn("AC3D: The type flag of a surface is unknown");
(*it).flags &= ~(0xf);
}
@ -712,7 +711,7 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
if (object.subDiv) {
if (configEvalSubdivision) {
std::unique_ptr<Subdivider> div(Subdivider::Create(Subdivider::CATMULL_CLARKE));
ASSIMP_LOG_INFO("AC3D: Evaluating subdivision surface: "+object.name);
DefaultLogger::get()->info("AC3D: Evaluating subdivision surface: "+object.name);
std::vector<aiMesh*> cpy(meshes.size()-oldm,NULL);
div->Subdivide(&meshes[oldm],cpy.size(),&cpy.front(),object.subDiv,true);
@ -721,7 +720,7 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
// previous meshes are deleted vy Subdivide().
}
else {
ASSIMP_LOG_INFO("AC3D: Letting the subdivision surface untouched due to my configuration: "
DefaultLogger::get()->info("AC3D: Letting the subdivision surface untouched due to my configuration: "
+object.name);
}
}
@ -813,7 +812,7 @@ void AC3DImporter::InternReadFile( const std::string& pFile,
unsigned int version = HexDigitToDecimal( buffer[4] );
char msg[3];
ASSIMP_itoa10(msg,3,version);
ASSIMP_LOG_INFO_F("AC3D file format version: ", msg);
DefaultLogger::get()->info(std::string("AC3D file format version: ") + msg);
std::vector<Material> materials;
materials.reserve(5);
@ -857,7 +856,7 @@ void AC3DImporter::InternReadFile( const std::string& pFile,
}
if (materials.empty())
{
ASSIMP_LOG_WARN("AC3D: No material has been found");
DefaultLogger::get()->warn("AC3D: No material has been found");
materials.push_back(Material());
}