mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-12-22 16:30:23 +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();
|
||||
}
|
||||
|
||||
// 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
|
||||
auto& map = sAssetMap[aModelPool];
|
||||
if (aDeDuplicate && map.count(aAsset)) {
|
||||
|
|
Loading…
Reference in a new issue