diff options
Diffstat (limited to 'gfx/src/asset/asset_cache.c')
-rw-r--r-- | gfx/src/asset/asset_cache.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gfx/src/asset/asset_cache.c b/gfx/src/asset/asset_cache.c index 1d64d66..d077421 100644 --- a/gfx/src/asset/asset_cache.c +++ b/gfx/src/asset/asset_cache.c | |||
@@ -152,10 +152,13 @@ static void log_model_loaded(const LoadModelCmd* cmd) { | |||
152 | static Model* clone_model(const Model* model) { | 152 | static Model* clone_model(const Model* model) { |
153 | assert(model); | 153 | assert(model); |
154 | 154 | ||
155 | // Only the Anima needs to be (shallow) cloned since everything else in the | 155 | // Only the Anima needs to be cloned since everything else in the model is |
156 | // model is static. Also note that only the Anima's joints and animation state | 156 | // static. |
157 | // need to be cloned; all other members can be shared. So a shallow clone of | 157 | // |
158 | // the anima is sufficient. | 158 | // The Anima can be partially shallow-cloned. Skeletons and animations are |
159 | // static and can be shared with the original Anima. Other members are | ||
160 | // deep-cloned. Skeletons in particular point back to their Anima, so need to | ||
161 | // be deep-cloned. | ||
159 | const SceneNode* root = mem_get_node(model->root); | 162 | const SceneNode* root = mem_get_node(model->root); |
160 | if (gfx_get_node_type(root) == AnimaNode) { | 163 | if (gfx_get_node_type(root) == AnimaNode) { |
161 | const Anima* anima = gfx_get_node_anima(root); | 164 | const Anima* anima = gfx_get_node_anima(root); |