mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-22 03:55:11 +00:00
Deduplicate level models using the permanent model map
This commit is contained in:
parent
def1122159
commit
daf8c7e444
1 changed files with 13 additions and 0 deletions
|
@ -66,6 +66,19 @@ struct GraphNode* DynOS_Model_LoadCommon(u32* aId, enum ModelPool aModelPool, vo
|
||||||
sModelPools[aModelPool] = dynamic_pool_init();
|
sModelPools[aModelPool] = dynamic_pool_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check perm map
|
||||||
|
auto& permMap = sAssetMap[MODEL_POOL_PERMANENT];
|
||||||
|
if (aDeDuplicate && permMap.count(aAsset)) {
|
||||||
|
auto& found = permMap[aAsset];
|
||||||
|
if (*aId && *aId == found.id) {
|
||||||
|
return found.graphNode;
|
||||||
|
}
|
||||||
|
if (*aId == 0) {
|
||||||
|
*aId = found.id;
|
||||||
|
return found.graphNode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check map
|
// check map
|
||||||
auto& map = sAssetMap[aModelPool];
|
auto& map = sAssetMap[aModelPool];
|
||||||
if (aDeDuplicate && map.count(aAsset)) {
|
if (aDeDuplicate && map.count(aAsset)) {
|
||||||
|
|
Loading…
Reference in a new issue