mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-22 03:55:11 +00:00
Fixed custom level textures
This commit is contained in:
parent
046c595f92
commit
7230c6fccc
3 changed files with 16 additions and 1 deletions
|
@ -695,6 +695,7 @@ s16 *DynOS_Level_GetWarpDeath(s32 aLevel, s32 aArea);
|
|||
|
||||
void DynOS_Lvl_Add(const SysPath &aPackFolder, const char *aLevelName);
|
||||
LevelScript* DynOS_Lvl_Get(const char* levelName);
|
||||
DataNode<TexData> *DynOS_Lvl_Texture_Get(void *aPtr);
|
||||
|
||||
//
|
||||
// Warps
|
||||
|
|
|
@ -257,7 +257,7 @@ static DataNode<TexData> *DynOS_Gfx_RetrieveNode(void *aPtr) {
|
|||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return DynOS_Lvl_Texture_Get(aPtr);
|
||||
}
|
||||
|
||||
static bool DynOS_Gfx_ImportTexture_Typed(THN **aOutput, void *aPtr, s32 aTile, GRAPI *aGfxRApi, THN **aHashMap, THN *aPool, u32 *aPoolPos, u32 aPoolSize) {
|
||||
|
|
|
@ -638,3 +638,17 @@ LevelScript* DynOS_Lvl_Get(const char* levelName) {
|
|||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DataNode<TexData> *DynOS_Lvl_Texture_Get(void *aPtr) {
|
||||
for (s32 i = 0; i < sDynosCustomLevelScripts.Count(); ++i) {
|
||||
auto &mTextures = sDynosCustomLevelScripts[i].second->mTextures;
|
||||
for (s32 j = 0; j < mTextures.Count(); j++) {
|
||||
auto &texture = mTextures[j];
|
||||
if (texture == aPtr) {
|
||||
return texture;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
Loading…
Reference in a new issue