Compare commits
6 Commits
improvemen
...
feature/ad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a9e4b4a59 | ||
|
|
ea7f710d70 | ||
|
|
93f3c38ceb | ||
|
|
0a9cefe943 | ||
|
|
daa6d64227 | ||
|
|
04946cc0f4 |
@@ -1,17 +1,54 @@
|
||||
{
|
||||
"version": 3,
|
||||
"cmakeMinimumRequired": {
|
||||
"major": 3,
|
||||
"minor": 20,
|
||||
"patch": 0
|
||||
"version": 3,
|
||||
"cmakeMinimumRequired": {
|
||||
"major": 3,
|
||||
"minor": 20,
|
||||
"patch": 0
|
||||
},
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "assimp",
|
||||
"binaryDir": "${sourceDir}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"ASSIMP_BUILD_ASSIMP_TOOLS": "OFF"
|
||||
}
|
||||
},
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "assimp_with_tools",
|
||||
"binaryDir": "${sourceDir}",
|
||||
"cacheVariables": {
|
||||
"ASSIMP_BUILD_ASSIMP_TOOLS" : "ON"
|
||||
}
|
||||
}
|
||||
]
|
||||
{
|
||||
"name": "assimp_static",
|
||||
"binaryDir": "${sourceDir}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"BUILD_SHARED_LIBS": "OFF",
|
||||
"ASSIMP_BUILD_ASSIMP_TOOLS": "OFF",
|
||||
"ASSIMP_DOUBLE_PRECISION": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "assimp_double_precision",
|
||||
"binaryDir": "${sourceDir}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"ASSIMP_BUILD_ASSIMP_TOOLS": "OFF",
|
||||
"ASSIMP_DOUBLE_PRECISION": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "assimp_with_tools",
|
||||
"binaryDir": "${sourceDir}",
|
||||
"cacheVariables": {
|
||||
"ASSIMP_BUILD_ASSIMP_TOOLS": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "assimp_all",
|
||||
"binaryDir": "${sourceDir}",
|
||||
"cacheVariables": {
|
||||
"ASSIMP_BUILD_ASSIMP_TOOLS": "ON",
|
||||
"ASSIMP_BUILD_SAMPLES": "ON",
|
||||
"ASSIMP_BUILD_DOCS": "ON"
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
@@ -139,13 +139,12 @@ void ObjFileParser::parseFile(IOStreamBuffer<char> &streamBuffer) {
|
||||
// handle c-stype section end (http://paulbourke.net/dataformats/obj/)
|
||||
if (insideCstype) {
|
||||
switch (*m_DataIt) {
|
||||
case 'e': {
|
||||
char *name{nullptr};
|
||||
size_t len{0};
|
||||
getNameNoSpace(m_DataIt, m_DataItEnd, &name, len);
|
||||
//insideCstype = name != "end";
|
||||
insideCstype = strncmp(name, "end", len) == 0;
|
||||
} break;
|
||||
case 'e': {
|
||||
char *name{nullptr};
|
||||
size_t len{0};
|
||||
getNameNoSpace(m_DataIt, m_DataItEnd, &name, len);
|
||||
insideCstype = !(len == 3 && strncmp(name, "end", 3) == 0);
|
||||
} break;
|
||||
}
|
||||
goto pf_skip_line;
|
||||
}
|
||||
@@ -200,16 +199,10 @@ void ObjFileParser::parseFile(IOStreamBuffer<char> &streamBuffer) {
|
||||
|
||||
case 'u': // Parse a material desc. setter
|
||||
{
|
||||
//std::string name;
|
||||
char *name{nullptr};
|
||||
size_t len{ 0 };
|
||||
getNameNoSpace(m_DataIt, m_DataItEnd, &name, len);
|
||||
|
||||
//size_t nextSpace = name.find(' ');
|
||||
//if (nextSpace != std::string::npos)
|
||||
// name = name.substr(0, nextSpace);
|
||||
|
||||
//if (name == "usemtl") {
|
||||
if (strncmp(name, "usemtl", len) == 0) {
|
||||
getMaterialDesc();
|
||||
}
|
||||
@@ -217,19 +210,11 @@ void ObjFileParser::parseFile(IOStreamBuffer<char> &streamBuffer) {
|
||||
|
||||
case 'm': // Parse a material library or merging group ('mg')
|
||||
{
|
||||
// std::string name;
|
||||
char *name{nullptr};
|
||||
size_t len{ 0 };
|
||||
getNameNoSpace(m_DataIt, m_DataItEnd, &name, len);
|
||||
|
||||
//size_t nextSpace = name.find(' ');
|
||||
//if (nextSpace != std::string::npos)
|
||||
// name = name.substr(0, nextSpace);
|
||||
|
||||
if (strncmp(name, "mg", len) == 0)
|
||||
//if (name == "mg")
|
||||
getGroupNumberAndResolution();
|
||||
//else if (name == "mtllib")
|
||||
else if (strncmp(name, "mtllib", len) == 0)
|
||||
getMaterialLib();
|
||||
else
|
||||
@@ -257,7 +242,6 @@ void ObjFileParser::parseFile(IOStreamBuffer<char> &streamBuffer) {
|
||||
char *name{nullptr};
|
||||
size_t len{0};
|
||||
getNameNoSpace(m_DataIt, m_DataItEnd, &name, len);
|
||||
//insideCstype = name == "cstype";
|
||||
insideCstype = strncmp(name, "cstype", len) == 0;
|
||||
goto pf_skip_line;
|
||||
}
|
||||
|
||||
@@ -185,6 +185,10 @@ inline char_t getNameNoSpace(char_t it, char_t end, char **name, size_t &len) {
|
||||
}
|
||||
|
||||
char *pStart = &(*it);
|
||||
while (&(*it) > pStart && (isEndOfBuffer(it, end) || IsLineEnd(*it) || IsSpaceOrNewLine(*it))) {
|
||||
--it;
|
||||
--len;
|
||||
}
|
||||
while (!isEndOfBuffer(it, end) && !IsLineEnd(*it) && !IsSpaceOrNewLine(*it)) {
|
||||
++it;
|
||||
++len;
|
||||
|
||||
@@ -58,8 +58,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef GLTF2ASSET_H_INC
|
||||
#define GLTF2ASSET_H_INC
|
||||
|
||||
//#if !defined(ASSIMP_BUILD_NO_GLTF_IMPORTER) && !defined(ASSIMP_BUILD_NO_GLTF2_IMPORTER)
|
||||
|
||||
#include <assimp/Exceptional.h>
|
||||
|
||||
#include <algorithm>
|
||||
@@ -1283,6 +1281,4 @@ inline std::string getContextForErrorMessages(const std::string &id, const std::
|
||||
// Include the implementation of the methods
|
||||
#include "glTF2Asset.inl"
|
||||
|
||||
//#endif // ASSIMP_BUILD_NO_GLTF_IMPORTER
|
||||
|
||||
#endif // GLTF2ASSET_H_INC
|
||||
|
||||
Reference in New Issue
Block a user