diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d885353..fb8677c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1381,7 +1381,8 @@ foreach(TINYUSDZ_LIB_TARGET ${TINYUSDZ_LIBS}) # On 32-bit systems, 64-bit atomic operations require libatomic # (Skip for emscripten as libatomic doesn't exist in wasm environment) - if (CMAKE_SIZEOF_VOID_P EQUAL 4 AND NOT EMSCRIPTEN) + # (Skip for MSVC as atomics are built into the runtime) + if (CMAKE_SIZEOF_VOID_P EQUAL 4 AND NOT EMSCRIPTEN AND NOT MSVC) target_link_libraries(${TINYUSDZ_LIB_TARGET} atomic) endif() diff --git a/src/crate-reader.cc b/src/crate-reader.cc index b8944df3..8eca47cf 100644 --- a/src/crate-reader.cc +++ b/src/crate-reader.cc @@ -1092,7 +1092,8 @@ bool CrateReader::ReadDoubleArrayTyped(bool is_compressed, TypedArray *d _err += "Failed to read compressed ints in ReadDoubleArrayTyped.\n"; return false; } - std::copy(ints.begin(), ints.end(), (*d)->data()); + std::transform(ints.begin(), ints.end(), (*d)->data(), + [](int64_t v) { return static_cast(v); }); } else if (code == 't') { uint32_t lutSize; if (!_sr->read4(&lutSize)) { diff --git a/src/pprinter.cc b/src/pprinter.cc index 4c094776..6730a399 100644 --- a/src/pprinter.cc +++ b/src/pprinter.cc @@ -13,6 +13,7 @@ #include "layer.hh" #include "str-util.hh" #include "tiny-format.hh" +#include "usdLux.hh" #include "usdShade.hh" #include "usdMtlx.hh" #include "value-pprint.hh" @@ -4649,30 +4650,7 @@ std::string to_string(const XformOp::OpType &op) { //std::string to_string(const tinyusdz::value::token &v) { return v.str(); } -std::string to_string(const DomeLight::TextureFormat &texformat) { - std::string s = "[InvalidTextureFormat]"; - - switch (texformat) { - case DomeLight::TextureFormat::Automatic: { - s = "automatic"; - break; - } - case DomeLight::TextureFormat::Latlong: { - s = "latlong"; - break; - } - case DomeLight::TextureFormat::MirroredBall: { - s = "mirroedBall"; - break; - } - case DomeLight::TextureFormat::Angular: { - s = "angular"; - break; - } - } - - return s; -} +// to_string(DomeLight::TextureFormat) is defined in usdLux.cc std::string dump_path(const Path &path) { std::stringstream ss;