fix unittests part 1.
parent
bb4eab3ff2
commit
b295fda22c
|
@ -833,9 +833,9 @@ void HL1MDLLoader::read_meshes() {
|
||||||
tricmds[faceIdx + 2] });
|
tricmds[faceIdx + 2] });
|
||||||
} else {
|
} else {
|
||||||
mesh_faces.push_back(HL1MeshFace{
|
mesh_faces.push_back(HL1MeshFace{
|
||||||
tricmds[i],
|
tricmds[faceIdx],
|
||||||
tricmds[i + 1],
|
tricmds[faceIdx + 1],
|
||||||
tricmds[i + 2] });
|
tricmds[faceIdx + 2] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1271,10 +1271,14 @@ inline void Asset::ReadBinaryHeader(IOStream &stream) {
|
||||||
|
|
||||||
inline void Asset::Load(const std::string &pFile, bool isBinary) {
|
inline void Asset::Load(const std::string &pFile, bool isBinary) {
|
||||||
mCurrentAssetDir.clear();
|
mCurrentAssetDir.clear();
|
||||||
std::string::size_type pos = std::max(pFile.rfind('/'), pFile.rfind('\\'));
|
|
||||||
|
int pos = std::max(int(pFile.rfind('/')), int(pFile.rfind('\\')));
|
||||||
|
if (pos != int(std::string::npos)) mCurrentAssetDir = pFile.substr(0, pos + 1);
|
||||||
|
|
||||||
|
/* std::string::size_type pos = std::max(pFile.rfind('/'), pFile.rfind('\\'));
|
||||||
if (pos != std::string::npos) {
|
if (pos != std::string::npos) {
|
||||||
mCurrentAssetDir = pFile.substr(0, pos + 1);
|
mCurrentAssetDir = pFile.substr(0, pos + 1);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
shared_ptr<IOStream> stream(OpenFile(pFile.c_str(), "rb", true));
|
shared_ptr<IOStream> stream(OpenFile(pFile.c_str(), "rb", true));
|
||||||
if (!stream) {
|
if (!stream) {
|
||||||
|
|
|
@ -940,7 +940,7 @@ inline bool GetAttribTargetVector(Mesh::Primitive &p, const int targetIndex, con
|
||||||
inline void Mesh::Read(Value &pJSON_Object, Asset &pAsset_Root) {
|
inline void Mesh::Read(Value &pJSON_Object, Asset &pAsset_Root) {
|
||||||
Value *curName = FindMember(pJSON_Object, "name");
|
Value *curName = FindMember(pJSON_Object, "name");
|
||||||
if (nullptr != curName) {
|
if (nullptr != curName) {
|
||||||
this->name = curName->GetString();
|
name = curName->GetString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************** Mesh primitives ******************/
|
/****************** Mesh primitives ******************/
|
||||||
|
@ -951,7 +951,7 @@ inline void Mesh::Read(Value &pJSON_Object, Asset &pAsset_Root) {
|
||||||
Value &primitive = (*curPrimitives)[i];
|
Value &primitive = (*curPrimitives)[i];
|
||||||
|
|
||||||
Primitive &prim = this->primitives[i];
|
Primitive &prim = this->primitives[i];
|
||||||
prim.mode = MemberOrDefault(*curPrimitives, "mode", PrimitiveMode_TRIANGLES);
|
prim.mode = MemberOrDefault(primitive, "mode", PrimitiveMode_TRIANGLES);
|
||||||
|
|
||||||
if (Value *attrs = FindObject(primitive, "attributes")) {
|
if (Value *attrs = FindObject(primitive, "attributes")) {
|
||||||
for (Value::MemberIterator it = attrs->MemberBegin(); it != attrs->MemberEnd(); ++it) {
|
for (Value::MemberIterator it = attrs->MemberBegin(); it != attrs->MemberEnd(); ++it) {
|
||||||
|
@ -1328,10 +1328,8 @@ inline void Asset::ReadBinaryHeader(IOStream &stream, std::vector<char> &sceneDa
|
||||||
|
|
||||||
inline void Asset::Load(const std::string &pFile, bool isBinary) {
|
inline void Asset::Load(const std::string &pFile, bool isBinary) {
|
||||||
mCurrentAssetDir.clear();
|
mCurrentAssetDir.clear();
|
||||||
std::string::size_type pos = std::max(int(pFile.rfind('/')), int(pFile.rfind('\\')));
|
int pos = std::max(int(pFile.rfind('/')), int(pFile.rfind('\\')));
|
||||||
if (pos != std::string::npos ) {
|
if (pos != int(std::string::npos)) mCurrentAssetDir = pFile.substr(0, pos + 1);
|
||||||
mCurrentAssetDir = pFile.substr(0, pos + 1l);
|
|
||||||
}
|
|
||||||
|
|
||||||
shared_ptr<IOStream> stream(OpenFile(pFile.c_str(), "rb", true));
|
shared_ptr<IOStream> stream(OpenFile(pFile.c_str(), "rb", true));
|
||||||
if (!stream) {
|
if (!stream) {
|
||||||
|
|
|
@ -4,7 +4,6 @@ Open Asset Import Library (assimp)
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2020, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use of this software in source and binary forms,
|
Redistribution and use of this software in source and binary forms,
|
||||||
|
@ -766,7 +765,7 @@ namespace glTF2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
Value *dict = FindArray(*container, d.mDictId);
|
Value *dict = FindArray(*container, d.mDictId);
|
||||||
if (nullptr != dict) {
|
if (nullptr == dict) {
|
||||||
container->AddMember(StringRef(d.mDictId), Value().SetArray().Move(), mDoc.GetAllocator());
|
container->AddMember(StringRef(d.mDictId), Value().SetArray().Move(), mDoc.GetAllocator());
|
||||||
dict = FindArray(*container, d.mDictId);
|
dict = FindArray(*container, d.mDictId);
|
||||||
if (nullptr == dict) {
|
if (nullptr == dict) {
|
||||||
|
|
Loading…
Reference in New Issue