fix initialization + some vs2019 compiler warnings.
parent
17946e26ef
commit
a8182d86cb
|
@ -802,22 +802,27 @@ inline void Texture::Read(Value& obj, Asset& r)
|
||||||
namespace {
|
namespace {
|
||||||
inline void SetTextureProperties(Asset& r, Value* prop, TextureInfo& out) {
|
inline void SetTextureProperties(Asset& r, Value* prop, TextureInfo& out) {
|
||||||
if (r.extensionsUsed.KHR_texture_transform) {
|
if (r.extensionsUsed.KHR_texture_transform) {
|
||||||
out.scale[0] = 1;
|
|
||||||
out.scale[1] = 1;
|
|
||||||
out.offset[0] = 0;
|
|
||||||
out.offset[1] = 0;
|
|
||||||
out.rotation = 0;
|
|
||||||
if (Value *extensions = FindObject(*prop, "extensions")) {
|
if (Value *extensions = FindObject(*prop, "extensions")) {
|
||||||
if (Value *pKHR_texture_transform = FindObject(*extensions, "KHR_texture_transform")) {
|
if (Value *pKHR_texture_transform = FindObject(*extensions, "KHR_texture_transform")) {
|
||||||
if (Value *array = FindArray(*pKHR_texture_transform, "offset")) {
|
if (Value *array = FindArray(*pKHR_texture_transform, "offset")) {
|
||||||
out.offset[0] = (*array)[0].GetFloat();
|
out.offset[0] = (*array)[0].GetFloat();
|
||||||
out.offset[1] = (*array)[1].GetFloat();
|
out.offset[1] = (*array)[1].GetFloat();
|
||||||
}
|
} else {
|
||||||
ReadMember(*pKHR_texture_transform, "rotation", out.rotation);
|
out.offset[0] = 0;
|
||||||
if (Value *array = FindArray(*pKHR_texture_transform, "scale")) {
|
out.offset[1] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ReadMember(*pKHR_texture_transform, "rotation", out.rotation)) {
|
||||||
|
out.rotation = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Value *array = FindArray(*pKHR_texture_transform, "scale")) {
|
||||||
out.scale[0] = (*array)[0].GetFloat();
|
out.scale[0] = (*array)[0].GetFloat();
|
||||||
out.scale[1] = (*array)[1].GetFloat();
|
out.scale[1] = (*array)[1].GetFloat();
|
||||||
}
|
} else {
|
||||||
|
out.scale[0] = 1;
|
||||||
|
out.scale[1] = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -622,7 +622,7 @@ void glTF2Importer::ImportMeshes(glTF2::Asset& r)
|
||||||
nFaces = count / 2;
|
nFaces = count / 2;
|
||||||
if (nFaces * 2 != count) {
|
if (nFaces * 2 != count) {
|
||||||
ASSIMP_LOG_WARN("The number of vertices was not compatible with the LINES mode. Some vertices were dropped.");
|
ASSIMP_LOG_WARN("The number of vertices was not compatible with the LINES mode. Some vertices were dropped.");
|
||||||
count = nFaces * 2;
|
count = (unsigned int) nFaces * 2;
|
||||||
}
|
}
|
||||||
faces = new aiFace[nFaces];
|
faces = new aiFace[nFaces];
|
||||||
for (unsigned int i = 0; i < count; i += 2) {
|
for (unsigned int i = 0; i < count; i += 2) {
|
||||||
|
@ -649,7 +649,7 @@ void glTF2Importer::ImportMeshes(glTF2::Asset& r)
|
||||||
nFaces = count / 3;
|
nFaces = count / 3;
|
||||||
if (nFaces * 3 != count) {
|
if (nFaces * 3 != count) {
|
||||||
ASSIMP_LOG_WARN("The number of vertices was not compatible with the TRIANGLES mode. Some vertices were dropped.");
|
ASSIMP_LOG_WARN("The number of vertices was not compatible with the TRIANGLES mode. Some vertices were dropped.");
|
||||||
count = nFaces * 3;
|
count = (unsigned int) nFaces * 3;
|
||||||
}
|
}
|
||||||
faces = new aiFace[nFaces];
|
faces = new aiFace[nFaces];
|
||||||
for (unsigned int i = 0; i < count; i += 3) {
|
for (unsigned int i = 0; i < count; i += 3) {
|
||||||
|
@ -1134,7 +1134,7 @@ aiMeshMorphAnim* CreateMeshMorphAnim(glTF2::Asset& r, Node& node, AnimationSampl
|
||||||
samplers.weight->output->ExtractData(values);
|
samplers.weight->output->ExtractData(values);
|
||||||
anim->mNumKeys = static_cast<uint32_t>(samplers.weight->input->count);
|
anim->mNumKeys = static_cast<uint32_t>(samplers.weight->input->count);
|
||||||
|
|
||||||
const unsigned int numMorphs = samplers.weight->output->count / anim->mNumKeys;
|
const unsigned int numMorphs = (unsigned int)samplers.weight->output->count / anim->mNumKeys;
|
||||||
|
|
||||||
anim->mKeys = new aiMeshMorphKey[anim->mNumKeys];
|
anim->mKeys = new aiMeshMorphKey[anim->mNumKeys];
|
||||||
unsigned int k = 0u;
|
unsigned int k = 0u;
|
||||||
|
|
Loading…
Reference in New Issue