gltfio: various cleanup in response to PR review

This commit is contained in:
Philip Rideout
2020-02-01 16:48:13 -08:00
parent d2c883877d
commit e8e847a662
7 changed files with 48 additions and 35 deletions

View File

@@ -59,7 +59,7 @@ void DependencyGraph::addEdge(Texture* texture, MaterialInstance* material, cons
void DependencyGraph::markAsReady(Texture* texture) {
assert(texture && mFinalized);
mTextures.at(texture)->ready = true;
mTextureNodes.at(texture)->ready = true;
// Iterate over the materials associated with this texture to check if any have become ready.
// This is O(n2) but the inner loop is always small.
@@ -94,10 +94,10 @@ void DependencyGraph::markAsReady(MaterialInstance* material) {
}
}
DependencyGraph::TextureStatus* DependencyGraph::getStatus(Texture* texture) {
auto iter = mTextures.find(texture);
if (iter == mTextures.end()) {
TextureStatus* status = (mTextures[texture] = std::make_unique<TextureStatus>()).get();
DependencyGraph::TextureNode* DependencyGraph::getStatus(Texture* texture) {
auto iter = mTextureNodes.find(texture);
if (iter == mTextureNodes.end()) {
TextureNode* status = (mTextureNodes[texture] = std::make_unique<TextureNode>()).get();
*status = {texture, false};
return status;
}