clean all warnings for vs-2019
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -675,7 +675,7 @@ namespace glTF2 {
|
||||
uint32_t binaryChunkLength = 0;
|
||||
if (bodyBuffer->byteLength > 0) {
|
||||
binaryChunkLength = (bodyBuffer->byteLength + 3) & ~3; // Round up to next multiple of 4
|
||||
auto paddingLength = binaryChunkLength - bodyBuffer->byteLength;
|
||||
//auto curPaddingLength = binaryChunkLength - bodyBuffer->byteLength;
|
||||
|
||||
GLB_Chunk binaryChunk;
|
||||
binaryChunk.chunkLength = binaryChunkLength;
|
||||
@@ -753,19 +753,20 @@ namespace glTF2 {
|
||||
|
||||
if (d.mExtId) {
|
||||
Value* exts = FindObject(mDoc, "extensions");
|
||||
if (!exts) {
|
||||
if (nullptr != exts) {
|
||||
mDoc.AddMember("extensions", Value().SetObject().Move(), mDoc.GetAllocator());
|
||||
exts = FindObject(mDoc, "extensions");
|
||||
}
|
||||
|
||||
if (!(container = FindObject(*exts, d.mExtId))) {
|
||||
container = FindObject(*exts, d.mExtId);
|
||||
if (nullptr != container) {
|
||||
exts->AddMember(StringRef(d.mExtId), Value().SetObject().Move(), mDoc.GetAllocator());
|
||||
container = FindObject(*exts, d.mExtId);
|
||||
}
|
||||
}
|
||||
|
||||
Value* dict;
|
||||
if (!(dict = FindArray(*container, d.mDictId))) {
|
||||
Value *dict = FindArray(*container, d.mDictId);
|
||||
if (nullptr != dict) {
|
||||
container->AddMember(StringRef(d.mDictId), Value().SetArray().Move(), mDoc.GetAllocator());
|
||||
dict = FindArray(*container, d.mDictId);
|
||||
if (nullptr == dict) {
|
||||
@@ -774,7 +775,9 @@ namespace glTF2 {
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < d.mObjs.size(); ++i) {
|
||||
if (d.mObjs[i]->IsSpecial()) continue;
|
||||
if (d.mObjs[i]->IsSpecial()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Value obj;
|
||||
obj.SetObject();
|
||||
|
||||
@@ -347,16 +347,16 @@ void glTF2Exporter::GetMatTex(const aiMaterial* mat, Ref<Texture>& texture, aiTe
|
||||
texture->source = mAsset->images.Create(imgId);
|
||||
|
||||
if (path[0] == '*') { // embedded
|
||||
aiTexture* tex = mScene->mTextures[atoi(&path[1])];
|
||||
aiTexture* curTex = mScene->mTextures[atoi(&path[1])];
|
||||
|
||||
texture->source->name = tex->mFilename.C_Str();
|
||||
texture->source->name = curTex->mFilename.C_Str();
|
||||
|
||||
// The asset has its own buffer, see Image::SetData
|
||||
texture->source->SetData(reinterpret_cast<uint8_t*> (tex->pcData), tex->mWidth, *mAsset);
|
||||
texture->source->SetData(reinterpret_cast<uint8_t *>(curTex->pcData), curTex->mWidth, *mAsset);
|
||||
|
||||
if (tex->achFormatHint[0]) {
|
||||
if (curTex->achFormatHint[0]) {
|
||||
std::string mimeType = "image/";
|
||||
mimeType += (memcmp(tex->achFormatHint, "jpg", 3) == 0) ? "jpeg" : tex->achFormatHint;
|
||||
mimeType += (memcmp(curTex->achFormatHint, "jpg", 3) == 0) ? "jpeg" : curTex->achFormatHint;
|
||||
texture->source->mimeType = mimeType;
|
||||
}
|
||||
}
|
||||
@@ -890,14 +890,14 @@ void glTF2Exporter::MergeMeshes()
|
||||
|
||||
//find the presence of the removed mesh in other nodes
|
||||
for (unsigned int nn = 0; nn < mAsset->nodes.Size(); ++nn) {
|
||||
Ref<Node> node = mAsset->nodes.Get(nn);
|
||||
Ref<Node> curNode = mAsset->nodes.Get(nn);
|
||||
|
||||
for (unsigned int mm = 0; mm < node->meshes.size(); ++mm) {
|
||||
Ref<Mesh>& meshRef = node->meshes.at(mm);
|
||||
for (unsigned int mm = 0; mm < curNode->meshes.size(); ++mm) {
|
||||
Ref<Mesh> &meshRef = curNode->meshes.at(mm);
|
||||
unsigned int meshIndex = meshRef.GetIndex();
|
||||
|
||||
if (meshIndex == removedIndex) {
|
||||
node->meshes.erase(node->meshes.begin() + mm);
|
||||
node->meshes.erase(curNode->meshes.begin() + mm);
|
||||
} else if (meshIndex > removedIndex) {
|
||||
Ref<Mesh> newMeshRef = mAsset->meshes.Get(meshIndex - 1);
|
||||
|
||||
|
||||
@@ -984,7 +984,7 @@ struct AnimationSamplers {
|
||||
Animation::Sampler *weight;
|
||||
};
|
||||
|
||||
aiNodeAnim *CreateNodeAnim(glTF2::Asset &r, Node &node, AnimationSamplers &samplers) {
|
||||
aiNodeAnim *CreateNodeAnim(glTF2::Asset&, Node &node, AnimationSamplers &samplers) {
|
||||
aiNodeAnim *anim = new aiNodeAnim();
|
||||
anim->mNodeName = GetNodeName(node);
|
||||
|
||||
@@ -1063,7 +1063,7 @@ aiNodeAnim *CreateNodeAnim(glTF2::Asset &r, Node &node, AnimationSamplers &sampl
|
||||
return anim;
|
||||
}
|
||||
|
||||
aiMeshMorphAnim *CreateMeshMorphAnim(glTF2::Asset &r, Node &node, AnimationSamplers &samplers) {
|
||||
aiMeshMorphAnim *CreateMeshMorphAnim(glTF2::Asset&, Node &node, AnimationSamplers &samplers) {
|
||||
aiMeshMorphAnim *anim = new aiMeshMorphAnim();
|
||||
anim->mName = GetNodeName(node);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user