Fixed custom level textures
This commit is contained in:
parent
4052347247
commit
95e826d1c8
|
@ -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 New Issue