mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2024-09-19 22:30:05 +00:00
Fix compilation error on windows+msvc2013
- Some missing includes of <algorithms> in order to have stdd::min() and similar functions. - Need to cast numIndices and numNVerts to int explicitly in order to solve warning treated as an error about precision loss. - Can't do vector[0] for an empty vector, it'll generate a runtime range check error. - MSVC only works fine with make_pair(foo, bar) syntax, without explicit template substitution here. Otherwise weird 'can't cast int to int&&' errors are happening.
This commit is contained in:
parent
97461ea722
commit
f6d45a6de0
@ -25,6 +25,7 @@
|
||||
#ifndef HUD_H
|
||||
#define HUD_H
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <cstdarg>
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
@ -161,9 +161,9 @@ void openSubdiv_getEvaluatorTopology(
|
||||
// application to test this yet.
|
||||
*numVertices = evaluation_descr->topology.numVertices;
|
||||
*refinementLevel = evaluation_descr->topology.refinementLevel;
|
||||
*numIndices = evaluation_descr->topology.indices.size();
|
||||
*numIndices = (int)evaluation_descr->topology.indices.size();
|
||||
*indices = &evaluation_descr->topology.indices[0];
|
||||
*numNVerts = evaluation_descr->topology.nverts.size();
|
||||
*numNVerts = (int)evaluation_descr->topology.nverts.size();
|
||||
*nverts = &evaluation_descr->topology.nverts[0];
|
||||
}
|
||||
|
||||
|
@ -292,9 +292,9 @@ bool _ProcessTagsAndFinishMesh(
|
||||
{
|
||||
mesh->SetInterpolateBoundaryMethod(OpenSubdiv::HbrMesh<T>::k_InterpolateBoundaryEdgeOnly);
|
||||
|
||||
const int* currentInt = &tagData.intArgs[0];
|
||||
const float* currentFloat = &tagData.floatArgs[0];
|
||||
const string* currentString = &tagData.stringArgs[0];
|
||||
const int* currentInt = tagData.intArgs.size() ? &tagData.intArgs[0] : NULL;
|
||||
const float* currentFloat = tagData.floatArgs.size() ? &tagData.floatArgs[0] : NULL;
|
||||
const string* currentString = tagData.stringArgs.size() ? &tagData.stringArgs[0] : NULL;
|
||||
|
||||
// TAGS (crease, corner, hole, smooth triangles, edits(vertex,
|
||||
// edge, face), creasemethod, facevaryingpropagatecorners, interpolateboundary
|
||||
|
@ -151,7 +151,7 @@ OsdUtilPatchPartitioner::OsdUtilPatchPartitioner(FarPatchTables const *srcPatchT
|
||||
int patchIndex = paIt->GetPatchIndex() + i;
|
||||
int ptexIndex = srcPatchParamTable[patchIndex].faceIndex;
|
||||
int partitionID = idsOnPtexFaces[ptexIndex];
|
||||
sortProxy[i] = std::make_pair<int, int>(partitionID, patchIndex);
|
||||
sortProxy[i] = std::make_pair(partitionID, patchIndex);
|
||||
++numPatches[partitionID];
|
||||
}
|
||||
// sort by partitionID
|
||||
|
Loading…
Reference in New Issue
Block a user