mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-21 19:45:10 +00:00
Split dynos_misc stuff into mgr files
This commit is contained in:
parent
5d479165fb
commit
18835a588a
9 changed files with 237 additions and 226 deletions
|
@ -38,7 +38,7 @@ Collision* dynos_collision_get(const char* collisionName);
|
|||
void dynos_add_level(s32 modIndex, const char *modPath, const char* levelName);
|
||||
LevelScript* dynos_level_get(const char* levelName);
|
||||
const char* dynos_level_get_token(u32 index);
|
||||
struct MovtexQuadCollection *dynos_level_movtexqc_getfromindex(s32 index);
|
||||
struct MovtexQuadCollection *dynos_level_get_movtexqc(s32 index);
|
||||
void dynos_level_load_background(void *ptr);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -712,14 +712,6 @@ s16 *DynOS_Level_GetWarp(s32 aLevel, s32 aArea, u8 aWarpId);
|
|||
s16 *DynOS_Level_GetWarpEntry(s32 aLevel, s32 aArea);
|
||||
s16 *DynOS_Level_GetWarpDeath(s32 aLevel, s32 aArea);
|
||||
|
||||
void DynOS_Lvl_Add(s32 modIndex, const SysPath &aPackFolder, const char *aLevelName);
|
||||
LevelScript* DynOS_Lvl_Get(const char* levelName);
|
||||
s32 DynOS_Lvl_GetModIndex(void* levelScript);
|
||||
const char* DynOS_Lvl_Get_Token(u32 index);
|
||||
DataNode<TexData> *DynOS_Lvl_Texture_Get(void *aPtr);
|
||||
DataNode<MovtexQC> *DynOS_Lvl_MovtexQuadCollection_GetFromIndex(s32 index);
|
||||
void DynOS_Lvl_Load_Background(void *aPtr);
|
||||
|
||||
//
|
||||
// Warps
|
||||
//
|
||||
|
@ -733,14 +725,7 @@ void DynOS_Warp_SetParam(s32 aLevel, s32 aIndex);
|
|||
const char *DynOS_Warp_GetParamName(s32 aLevel, s32 aIndex);
|
||||
|
||||
//
|
||||
// Collisions
|
||||
//
|
||||
|
||||
void DynOS_Col_Add(const SysPath &aPackFolder, const char *aCollisionName);
|
||||
Collision* DynOS_Col_Get(const char* collisionName);
|
||||
|
||||
//
|
||||
// Managers
|
||||
// Builtin
|
||||
//
|
||||
|
||||
const void* DynOS_Builtin_ScriptPtr_GetFromName(const char* aDataName);
|
||||
|
@ -755,6 +740,26 @@ const void* DynOS_Builtin_Func_GetFromName(const char* aDataName);
|
|||
const void* DynOS_Builtin_Func_GetFromIndex(s32 aIndex);
|
||||
s32 DynOS_Builtin_Func_GetIndexFromData(const void* aData);
|
||||
|
||||
//
|
||||
// Lvl Manager
|
||||
//
|
||||
|
||||
Array<Pair<const char*, GfxData*>> &DynOS_Lvl_GetArray();
|
||||
void DynOS_Lvl_Activate(s32 modIndex, const SysPath &aPackFolder, const char *aLevelName);
|
||||
LevelScript* DynOS_Lvl_GetScript(const char* levelName);
|
||||
s32 DynOS_Lvl_GetModIndex(void* levelScript);
|
||||
DataNode<TexData> *DynOS_Lvl_GetTexture(void *aPtr);
|
||||
const char* DynOS_Lvl_GetToken(u32 index);
|
||||
DataNode<MovtexQC> *DynOS_Lvl_GetMovtexQuadCollection(s32 index);
|
||||
void DynOS_Lvl_LoadBackground(void *aPtr);
|
||||
|
||||
//
|
||||
// Col Manager
|
||||
//
|
||||
|
||||
void DynOS_Col_Activate(const SysPath &aPackFolder, const char *aCollisionName);
|
||||
Collision* DynOS_Col_Get(const char* collisionName);
|
||||
|
||||
//
|
||||
// Bin
|
||||
//
|
||||
|
|
|
@ -91,7 +91,7 @@ const void* dynos_geolayout_get(const char *name) {
|
|||
// -- collisions -- //
|
||||
|
||||
void dynos_add_collision(const char *modPath, const char* collisionName) {
|
||||
DynOS_Col_Add(modPath, collisionName);
|
||||
DynOS_Col_Activate(modPath, collisionName);
|
||||
}
|
||||
|
||||
Collision* dynos_collision_get(const char* collisionName) {
|
||||
|
@ -101,26 +101,26 @@ Collision* dynos_collision_get(const char* collisionName) {
|
|||
// -- levels -- //
|
||||
|
||||
void dynos_add_level(s32 modIndex, const char *modPath, const char* levelName) {
|
||||
DynOS_Lvl_Add(modIndex, modPath, levelName);
|
||||
DynOS_Lvl_Activate(modIndex, modPath, levelName);
|
||||
}
|
||||
|
||||
LevelScript* dynos_level_get(const char* levelName) {
|
||||
return DynOS_Lvl_Get(levelName);
|
||||
return DynOS_Lvl_GetScript(levelName);
|
||||
}
|
||||
|
||||
const char* dynos_level_get_token(u32 index) {
|
||||
return DynOS_Lvl_Get_Token(index);
|
||||
return DynOS_Lvl_GetToken(index);
|
||||
}
|
||||
|
||||
struct MovtexQuadCollection *dynos_level_movtexqc_getfromindex(s32 index) {
|
||||
DataNode<MovtexQC> *node = DynOS_Lvl_MovtexQuadCollection_GetFromIndex(index);
|
||||
struct MovtexQuadCollection *dynos_level_get_movtexqc(s32 index) {
|
||||
DataNode<MovtexQC> *node = DynOS_Lvl_GetMovtexQuadCollection(index);
|
||||
if (node == NULL) { return NULL; }
|
||||
|
||||
return node->mData;
|
||||
}
|
||||
|
||||
void dynos_level_load_background(void *ptr) {
|
||||
DynOS_Lvl_Load_Background(ptr);
|
||||
DynOS_Lvl_LoadBackground(ptr);
|
||||
}
|
||||
|
||||
}
|
|
@ -257,7 +257,7 @@ static DataNode<TexData> *DynOS_Gfx_RetrieveNode(void *aPtr) {
|
|||
}
|
||||
}
|
||||
}
|
||||
return DynOS_Lvl_Texture_Get(aPtr);
|
||||
return DynOS_Lvl_GetTexture(aPtr);
|
||||
}
|
||||
|
||||
static bool DynOS_Gfx_ImportTexture_Typed(THN **aOutput, void *aPtr, s32 aTile, GRAPI *aGfxRApi, THN **aHashMap, THN *aPool, u32 *aPoolPos, u32 aPoolSize) {
|
||||
|
|
|
@ -228,7 +228,7 @@ s32 DynOS_Level_GetCourse(s32 aLevel) {
|
|||
const void *DynOS_Level_GetScript(s32 aLevel) {
|
||||
DynOS_Level_Init();
|
||||
if (aLevel != LEVEL_WDW) {
|
||||
LevelScript* script = DynOS_Lvl_Get("");
|
||||
LevelScript* script = DynOS_Lvl_GetScript("");
|
||||
sDynosCurrentLevelNum = aLevel;
|
||||
sDynosLevelWarps[sDynosCurrentLevelNum].Clear();
|
||||
DynOS_Level_ParseScript(script, DynOS_Level_PreprocessScript);
|
||||
|
|
47
data/dynos_mgr_col.cpp
Normal file
47
data/dynos_mgr_col.cpp
Normal file
|
@ -0,0 +1,47 @@
|
|||
#include "dynos.cpp.h"
|
||||
|
||||
static Array<Pair<const char*, DataNode<Collision>*>> sDynosCollisions;
|
||||
|
||||
void DynOS_Col_Activate(const SysPath &aPackFolder, const char *aCollisionName) {
|
||||
// check for duplicates
|
||||
for (s32 i = 0; i < sDynosCollisions.Count(); ++i) {
|
||||
if (!strcmp(sDynosCollisions[i].first, aCollisionName)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Allocate name
|
||||
u16 collisionLen = strlen(aCollisionName);
|
||||
char* collisionName = (char*)calloc(1, sizeof(char) * (collisionLen + 1));
|
||||
strcpy(collisionName, aCollisionName);
|
||||
|
||||
// Load
|
||||
DataNode<Collision>* _Node = DynOS_Col_LoadFromBinary(aPackFolder, collisionName);
|
||||
if (!_Node) {
|
||||
free(collisionName);
|
||||
return;
|
||||
}
|
||||
|
||||
// Add to collisions
|
||||
sDynosCollisions.Add({ collisionName, _Node });
|
||||
}
|
||||
|
||||
Collision* DynOS_Col_Get(const char* collisionName) {
|
||||
// check levels
|
||||
auto& levelsArray = DynOS_Lvl_GetArray();
|
||||
for (auto& lvl : levelsArray) {
|
||||
for (auto& col : lvl.second->mCollisions) {
|
||||
if (col->mName == collisionName) {
|
||||
return col->mData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check normal actor collisions
|
||||
for (s32 i = 0; i < sDynosCollisions.Count(); ++i) {
|
||||
if (!strcmp(sDynosCollisions[i].first, collisionName)) {
|
||||
return sDynosCollisions[i].second->mData;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
156
data/dynos_mgr_lvl.cpp
Normal file
156
data/dynos_mgr_lvl.cpp
Normal file
|
@ -0,0 +1,156 @@
|
|||
#include "dynos.cpp.h"
|
||||
extern "C" {
|
||||
#include "engine/level_script.h"
|
||||
#include "game/skybox.h"
|
||||
}
|
||||
|
||||
static Array<Pair<const char*, GfxData*>> sDynosCustomLevelScripts;
|
||||
|
||||
Array<Pair<const char*, GfxData*>> &DynOS_Lvl_GetArray() {
|
||||
return sDynosCustomLevelScripts;
|
||||
}
|
||||
|
||||
void DynOS_Lvl_Activate(s32 modIndex, const SysPath &aPackFolder, const char *aLevelName) {
|
||||
// check for duplicates
|
||||
for (s32 i = 0; i < sDynosCustomLevelScripts.Count(); ++i) {
|
||||
if (!strcmp(sDynosCustomLevelScripts[i].first, aLevelName)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
u16 levelLen = strlen(aLevelName);
|
||||
char* levelName = (char*)calloc(1, sizeof(char) * (levelLen + 1));
|
||||
strcpy(levelName, aLevelName);
|
||||
|
||||
GfxData* _Node = DynOS_Lvl_LoadFromBinary(aPackFolder, levelName);
|
||||
if (!_Node) {
|
||||
free(levelName);
|
||||
return;
|
||||
}
|
||||
|
||||
// remember index
|
||||
_Node->mModIndex = modIndex;
|
||||
|
||||
// Add to levels
|
||||
sDynosCustomLevelScripts.Add({ levelName, _Node });
|
||||
}
|
||||
|
||||
LevelScript* DynOS_Lvl_GetScript(const char* levelName) {
|
||||
if (strlen(levelName) == 0) {
|
||||
static u32 index = 0; // DO NOT COMMIT
|
||||
s32 levelScriptCount = sDynosCustomLevelScripts.Count(); // DO NOT COMMIT
|
||||
if (levelScriptCount < 1) { return NULL; } // DO NOT COMMIT
|
||||
index = (index + 1) % levelScriptCount; // DO NOT COMMIT
|
||||
auto& scripts = sDynosCustomLevelScripts[index].second->mLevelScripts; // DO NOT COMMIT
|
||||
Print("Going to level: %s\n", scripts[scripts.Count() - 1]->mName); // DO NOT COMMIT
|
||||
return scripts[scripts.Count() - 1]->mData; // DO NOT COMMIT
|
||||
}
|
||||
|
||||
for (s32 i = 0; i < sDynosCustomLevelScripts.Count(); ++i) {
|
||||
if (!strcmp(sDynosCustomLevelScripts[i].first, levelName)) {
|
||||
auto& scripts = sDynosCustomLevelScripts[i].second->mLevelScripts;
|
||||
return scripts[scripts.Count() - 1]->mData;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
s32 DynOS_Lvl_GetModIndex(void* levelScript) {
|
||||
for (s32 i = 0; i < sDynosCustomLevelScripts.Count(); ++i) {
|
||||
auto& scripts = sDynosCustomLevelScripts[i].second->mLevelScripts;
|
||||
if (levelScript == scripts[scripts.Count() - 1]->mData) {
|
||||
return sDynosCustomLevelScripts[i].second->mModIndex;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
DataNode<TexData> *DynOS_Lvl_GetTexture(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;
|
||||
}
|
||||
|
||||
static GfxData* DynOS_Lvl_GetActiveGfx(void) {
|
||||
for (s32 i = 0; i < sDynosCustomLevelScripts.Count(); ++i) {
|
||||
auto& gfxData = sDynosCustomLevelScripts[i].second;
|
||||
auto& scripts = gfxData->mLevelScripts;
|
||||
if (gLevelScriptActive == scripts[scripts.Count() - 1]->mData) {
|
||||
return gfxData;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char* DynOS_Lvl_GetToken(u32 index) {
|
||||
GfxData* gfxData = DynOS_Lvl_GetActiveGfx();
|
||||
if (gfxData == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// have to 1-index due to to pointer read code
|
||||
index = index - 1;
|
||||
|
||||
if (index >= gfxData->mLuaTokenList.Count()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return gfxData->mLuaTokenList[index].begin();
|
||||
}
|
||||
|
||||
DataNode<MovtexQC> *DynOS_Lvl_GetMovtexQuadCollection(s32 index) {
|
||||
GfxData* gfxData = DynOS_Lvl_GetActiveGfx();
|
||||
if (gfxData == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
auto &mMovtexQCs = gfxData->mMovtexQCs;
|
||||
|
||||
// Sanity check the index we passed.
|
||||
if (index < 0 || index >= mMovtexQCs.Count()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return mMovtexQCs[index];
|
||||
}
|
||||
|
||||
void DynOS_Lvl_LoadBackground(void *aPtr) {
|
||||
// ensure this texture list exists
|
||||
GfxData* foundGfxData = NULL;
|
||||
DataNode<TexData*>* foundList = NULL;
|
||||
for (auto& script : sDynosCustomLevelScripts) {
|
||||
auto &textureLists = script.second->mTextureLists;
|
||||
for (auto& textureList : textureLists) {
|
||||
if (textureList == aPtr) {
|
||||
foundGfxData = script.second;
|
||||
foundList = textureList;
|
||||
goto double_break;
|
||||
}
|
||||
}
|
||||
}
|
||||
double_break:
|
||||
|
||||
if (foundList == NULL) {
|
||||
Print("Could not find custom background");
|
||||
return;
|
||||
}
|
||||
|
||||
// Load up custom background
|
||||
for (s32 i = 0; i < 80; i++) {
|
||||
// find texture
|
||||
for (auto& tex : foundGfxData->mTextures) {
|
||||
if (tex->mData == foundList->mData[i]) {
|
||||
gCustomSkyboxPtrList[i] = (Texture*)tex;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -41,8 +41,6 @@ extern "C" {
|
|||
#include "actors/zcustom0.h"
|
||||
}
|
||||
|
||||
static Array<Pair<const char*, GfxData*>> sDynosCustomLevelScripts;
|
||||
|
||||
//
|
||||
// String
|
||||
//
|
||||
|
@ -391,7 +389,8 @@ const void *DynOS_Geo_GetActorLayoutFromName(const char *aActorName) {
|
|||
if (aActorName == NULL) { return NULL; }
|
||||
|
||||
// check levels
|
||||
for (auto& lvl : sDynosCustomLevelScripts) {
|
||||
auto& levelsArray = DynOS_Lvl_GetArray();
|
||||
for (auto& lvl : levelsArray) {
|
||||
for (auto& geo : lvl.second->mGeoLayouts) {
|
||||
if (geo->mName == aActorName) {
|
||||
return geo->mData;
|
||||
|
@ -482,199 +481,3 @@ void *DynOS_Geo_GetGraphNode(const void *aGeoLayout, bool aKeepInMemory) {
|
|||
free(_Pool);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
////////////////
|
||||
// Collisions //
|
||||
////////////////
|
||||
|
||||
static Array<Pair<const char*, DataNode<Collision>*>> sDynosCollisions;
|
||||
|
||||
void DynOS_Col_Add(const SysPath &aPackFolder, const char *aCollisionName) {
|
||||
// check for duplicates
|
||||
for (s32 i = 0; i < sDynosCollisions.Count(); ++i) {
|
||||
if (!strcmp(sDynosCollisions[i].first, aCollisionName)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
u16 collisionLen = strlen(aCollisionName);
|
||||
char* collisionName = (char*)calloc(1, sizeof(char) * (collisionLen + 1));
|
||||
strcpy(collisionName, aCollisionName);
|
||||
|
||||
DataNode<Collision>* _Node = DynOS_Col_LoadFromBinary(aPackFolder, collisionName);
|
||||
if (!_Node) {
|
||||
free(collisionName);
|
||||
return;
|
||||
}
|
||||
|
||||
// Add to collisions
|
||||
sDynosCollisions.Add({ collisionName, _Node });
|
||||
}
|
||||
|
||||
Collision* DynOS_Col_Get(const char* collisionName) {
|
||||
// check levels
|
||||
for (auto& lvl : sDynosCustomLevelScripts) {
|
||||
for (auto& col : lvl.second->mCollisions) {
|
||||
if (col->mName == collisionName) {
|
||||
return col->mData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check normal actor collisions
|
||||
for (s32 i = 0; i < sDynosCollisions.Count(); ++i) {
|
||||
if (!strcmp(sDynosCollisions[i].first, collisionName)) {
|
||||
return sDynosCollisions[i].second->mData;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
////////////
|
||||
// Levels //
|
||||
////////////
|
||||
|
||||
void DynOS_Lvl_Add(s32 modIndex, const SysPath &aPackFolder, const char *aLevelName) {
|
||||
// check for duplicates
|
||||
for (s32 i = 0; i < sDynosCustomLevelScripts.Count(); ++i) {
|
||||
if (!strcmp(sDynosCustomLevelScripts[i].first, aLevelName)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
u16 levelLen = strlen(aLevelName);
|
||||
char* levelName = (char*)calloc(1, sizeof(char) * (levelLen + 1));
|
||||
strcpy(levelName, aLevelName);
|
||||
|
||||
GfxData* _Node = DynOS_Lvl_LoadFromBinary(aPackFolder, levelName);
|
||||
if (!_Node) {
|
||||
free(levelName);
|
||||
return;
|
||||
}
|
||||
|
||||
// remember index
|
||||
_Node->mModIndex = modIndex;
|
||||
|
||||
// Add to levels
|
||||
sDynosCustomLevelScripts.Add({ levelName, _Node });
|
||||
}
|
||||
|
||||
LevelScript* DynOS_Lvl_Get(const char* levelName) {
|
||||
if (strlen(levelName) == 0) {
|
||||
static u32 index = 0; // DO NOT COMMIT
|
||||
s32 levelScriptCount = sDynosCustomLevelScripts.Count(); // DO NOT COMMIT
|
||||
if (levelScriptCount < 1) { return NULL; } // DO NOT COMMIT
|
||||
index = (index + 1) % levelScriptCount; // DO NOT COMMIT
|
||||
auto& scripts = sDynosCustomLevelScripts[index].second->mLevelScripts; // DO NOT COMMIT
|
||||
Print("Going to level: %s\n", scripts[scripts.Count() - 1]->mName); // DO NOT COMMIT
|
||||
return scripts[scripts.Count() - 1]->mData; // DO NOT COMMIT
|
||||
}
|
||||
|
||||
for (s32 i = 0; i < sDynosCustomLevelScripts.Count(); ++i) {
|
||||
if (!strcmp(sDynosCustomLevelScripts[i].first, levelName)) {
|
||||
auto& scripts = sDynosCustomLevelScripts[i].second->mLevelScripts;
|
||||
return scripts[scripts.Count() - 1]->mData;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
s32 DynOS_Lvl_GetModIndex(void* levelScript) {
|
||||
for (s32 i = 0; i < sDynosCustomLevelScripts.Count(); ++i) {
|
||||
auto& scripts = sDynosCustomLevelScripts[i].second->mLevelScripts;
|
||||
if (levelScript == scripts[scripts.Count() - 1]->mData) {
|
||||
return sDynosCustomLevelScripts[i].second->mModIndex;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
static GfxData* DynOS_Lvl_Get_Active_Gfx(void) {
|
||||
for (s32 i = 0; i < sDynosCustomLevelScripts.Count(); ++i) {
|
||||
auto& gfxData = sDynosCustomLevelScripts[i].second;
|
||||
auto& scripts = gfxData->mLevelScripts;
|
||||
if (gLevelScriptActive == scripts[scripts.Count() - 1]->mData) {
|
||||
return gfxData;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char* DynOS_Lvl_Get_Token(u32 index) {
|
||||
GfxData* gfxData = DynOS_Lvl_Get_Active_Gfx();
|
||||
if (gfxData == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// have to 1-index due to to pointer read code
|
||||
index = index - 1;
|
||||
|
||||
if (index >= gfxData->mLuaTokenList.Count()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return gfxData->mLuaTokenList[index].begin();
|
||||
}
|
||||
|
||||
DataNode<MovtexQC> *DynOS_Lvl_MovtexQuadCollection_GetFromIndex(s32 index) {
|
||||
GfxData* gfxData = DynOS_Lvl_Get_Active_Gfx();
|
||||
if (gfxData == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
auto &mMovtexQCs = gfxData->mMovtexQCs;
|
||||
|
||||
// Sanity check the index we passed.
|
||||
if (index < 0 || index >= mMovtexQCs.Count()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return mMovtexQCs[index];
|
||||
}
|
||||
|
||||
void DynOS_Lvl_Load_Background(void *aPtr) {
|
||||
// ensure this texture list exists
|
||||
GfxData* foundGfxData = NULL;
|
||||
DataNode<TexData*>* foundList = NULL;
|
||||
for (auto& script : sDynosCustomLevelScripts) {
|
||||
auto &textureLists = script.second->mTextureLists;
|
||||
for (auto& textureList : textureLists) {
|
||||
if (textureList == aPtr) {
|
||||
foundGfxData = script.second;
|
||||
foundList = textureList;
|
||||
goto double_break;
|
||||
}
|
||||
}
|
||||
}
|
||||
double_break:
|
||||
|
||||
if (foundList == NULL) {
|
||||
Print("Could not find custom background");
|
||||
return;
|
||||
}
|
||||
|
||||
// Load up custom background
|
||||
for (s32 i = 0; i < 80; i++) {
|
||||
// find texture
|
||||
for (auto& tex : foundGfxData->mTextures) {
|
||||
if (tex->mData == foundList->mData[i]) {
|
||||
gCustomSkyboxPtrList[i] = (Texture*)tex;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -706,7 +706,7 @@ Gfx *geo_movtex_draw_water_regions_ext(s32 callContext, struct GraphNode *node,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
quadCollection = dynos_level_movtexqc_getfromindex(asGenerated->parameter);
|
||||
quadCollection = dynos_level_get_movtexqc(asGenerated->parameter);
|
||||
if (quadCollection == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue