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:
Sergey Sharybin 2014-05-17 10:48:33 +02:00 committed by Manuel Kraemer
parent 97461ea722
commit f6d45a6de0
5 changed files with 8 additions and 6 deletions

View File

@ -25,6 +25,7 @@
#ifndef HUD_H
#define HUD_H
#include <algorithm>
#include <vector>
#include <string>
#include <cstdarg>

View File

@ -24,6 +24,7 @@
#pragma once
#include <algorithm>
#include <limits>
#include <cmath>
#include <vector>

View File

@ -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];
}

View File

@ -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

View File

@ -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