Skip to content

Commit

Permalink
guh
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc committed Aug 3, 2024
1 parent 116d077 commit 93f305a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/stim/diagram/gltf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ JsonObj GltfScene::_to_json_local() const {
JsonObj GltfScene::to_json() {
// Clear indices.
visit([&](GltfId &item_id, const char *type, const std::function<JsonObj(void)> &to_json, uintptr_t abs_id) {
item_id.index = SIZE_MAX;
item_id.index = UINT64_MAX;
});

// Re-index.
std::map<std::string, size_t> counts;
visit([&](GltfId &item_id, const char *type, const std::function<JsonObj(void)> &to_json, uintptr_t abs_id) {
auto &c = counts[type];
if (item_id.index == SIZE_MAX || item_id.index == c) {
if (item_id.index == UINT64_MAX || item_id.index == c) {
item_id.index = c;
c++;
} else if (item_id.index > c) {
Expand Down
12 changes: 6 additions & 6 deletions src/stim/diagram/gltf.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ constexpr size_t GL_NEAREST = 9728;

struct GltfId {
std::string name;
size_t index;
uint64_t index;

GltfId(std::string name) : name(name), index(SIZE_MAX) {
GltfId(std::string name) : name(name), index(UINT64_MAX) {
}
GltfId() = delete;
};
Expand Down Expand Up @@ -125,10 +125,10 @@ struct GltfBuffer {

struct GltfSampler {
GltfId id;
size_t magFilter;
size_t minFilter;
size_t wrapS;
size_t wrapT;
uint64_t magFilter;
uint64_t minFilter;
uint64_t wrapS;
uint64_t wrapT;

void visit(const gltf_visit_callback &callback);
JsonObj to_json() const;
Expand Down

0 comments on commit 93f305a

Please sign in to comment.