mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-03-21 17:55:13 -05:00
This commit is contained in:
parent
51cda64091
commit
f61660fddd
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef POKEPLATINUM_BERRY_PATCH_GRAPHICS_H
|
||||
#define POKEPLATINUM_BERRY_PATCH_GRAPHICS_H
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
|
||||
#include "billboard.h"
|
||||
|
||||
BOOL BerryPatchGraphics_IsBerryPatch(int graphicsID);
|
||||
int BerryPatchGraphics_GetCurrentGraphicsResourceID(const MapObject *mapObject);
|
||||
void BerryPatchGraphics_MarkForUpdate(MapObject *mapObject);
|
||||
|
|
@ -15,6 +16,6 @@ void BerryPatchGraphics_UpdateGraphics(MapObject *mapObject);
|
|||
void BerryPatchGraphics_FreeGraphics(MapObject *mapObject);
|
||||
void BerryPatchGraphics_PauseGraphics(MapObject *mapObject);
|
||||
void BerryPatchGraphics_ResumeGraphics(MapObject *mapObject);
|
||||
UnkStruct_020216E0 *BerryPatchGraphics_GetGraphicsObject(MapObject *mapObject);
|
||||
Billboard *BerryPatchGraphics_GetGraphicsObject(MapObject *mapObject);
|
||||
|
||||
#endif // POKEPLATINUM_BERRY_PATCH_GRAPHICS_H
|
||||
|
|
|
|||
125
include/billboard.h
Normal file
125
include/billboard.h
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
#ifndef POKEPLATINUM_BILLBOARD_H
|
||||
#define POKEPLATINUM_BILLBOARD_H
|
||||
|
||||
#include <nitro/fx/fx.h>
|
||||
#include <nnsys.h>
|
||||
|
||||
#include "constants/heap.h"
|
||||
|
||||
#include "billboard_gfx_sequence.h"
|
||||
#include "billboard_vram_transfer.h"
|
||||
|
||||
typedef struct Billboard Billboard;
|
||||
typedef struct BillboardList BillboardList;
|
||||
typedef void (*BillboardCallback)(Billboard *, void *);
|
||||
|
||||
typedef struct BillboardAnim {
|
||||
int startFrame;
|
||||
int endFrame;
|
||||
int animType;
|
||||
} BillboardAnim;
|
||||
|
||||
typedef struct Billboard {
|
||||
VecFx32 pos;
|
||||
VecFx32 scale;
|
||||
const MtxFx33 *rotMatrix;
|
||||
void *callbackParam;
|
||||
BillboardCallback callback;
|
||||
u8 draw;
|
||||
BillboardList *list;
|
||||
const BillboardAnim *anims;
|
||||
NNSG3dRenderObj renderObj;
|
||||
NNSG3dResMdlSet *modelSet;
|
||||
NNSG3dResMdl *model;
|
||||
NNSG3dResTex *texture;
|
||||
const NNSG3dResTex *animTexture;
|
||||
NNSGfdTexKey texKey;
|
||||
NNSGfdTexKey tex4x4Key;
|
||||
NNSGfdPlttKey plttKey;
|
||||
BillboardGfxSequence gfxSequence;
|
||||
BillboardVRAMTransfer *vramTransfer;
|
||||
u8 state;
|
||||
u16 animNum;
|
||||
fx32 frameNum;
|
||||
Billboard *next;
|
||||
Billboard *prev;
|
||||
} Billboard;
|
||||
|
||||
typedef struct BillboardList {
|
||||
u8 active;
|
||||
u8 draw;
|
||||
u8 unused;
|
||||
u8 redraw;
|
||||
Billboard *billboards;
|
||||
int capacity;
|
||||
Billboard sentinelData;
|
||||
Billboard **freeBillboards;
|
||||
int freeBillboardHead;
|
||||
NNSFndAllocator *allocator;
|
||||
BillboardListVRAMTransfer *vramTransfer;
|
||||
} BillboardList;
|
||||
|
||||
typedef struct BillboardResources {
|
||||
void *modelRes;
|
||||
const NNSG3dResTex *texture;
|
||||
const BillboardAnim *anims;
|
||||
BillboardGfxSequence gfxSequence;
|
||||
NNSGfdTexKey texKey;
|
||||
NNSGfdTexKey tex4x4Key;
|
||||
NNSGfdPlttKey plttKey;
|
||||
} BillboardResources;
|
||||
|
||||
typedef struct BillboardTemplate {
|
||||
BillboardList *list;
|
||||
const BillboardResources *resources;
|
||||
VecFx32 pos;
|
||||
VecFx32 scale;
|
||||
} BillboardTemplate;
|
||||
|
||||
typedef struct BillboardListParams {
|
||||
int maxElements;
|
||||
enum HeapID heapID;
|
||||
} BillboardListParams;
|
||||
|
||||
typedef struct UnkStruct_ov5_021ED110 {
|
||||
u32 unk_00;
|
||||
BillboardResources *unk_04;
|
||||
} UnkStruct_ov5_021ED110;
|
||||
|
||||
void Billboard_Reset(Billboard *billboard);
|
||||
void BillboardLists_Create(int count, enum HeapID heapID);
|
||||
void BillboardLists_Delete(void);
|
||||
void BillboardLists_Draw(void);
|
||||
BillboardList *BillboardList_New(const BillboardListParams *params);
|
||||
BOOL BillboardList_Delete(BillboardList *list);
|
||||
BOOL BillboardList_DeleteAll(BillboardList *list);
|
||||
BOOL BillboardList_IsRedrawing(BillboardList *list);
|
||||
void BillboardList_ResetRedraw(BillboardList *list);
|
||||
Billboard *BillboardList_Append(const BillboardTemplate *template);
|
||||
BOOL Billboard_Delete(Billboard *billboard);
|
||||
void BillboardResources_Set(BillboardResources *resources, void *modelRes, const NNSG3dResTex *texture, const BillboardAnim *param3, const BillboardGfxSequence *gfxSequence, NNSGfdTexKey texKey, NNSGfdTexKey tex4x4Key, NNSGfdPlttKey plttKey);
|
||||
void BillboardResources_SetWithoutKeys(BillboardResources *resources, void *modelRes, const NNSG3dResTex *texture, const BillboardAnim *param3, const BillboardGfxSequence *gfxSequence);
|
||||
void Billboard_SetPos(Billboard *billboard, const VecFx32 *pos);
|
||||
const VecFx32 *Billboard_GetPos(const Billboard *billboard);
|
||||
void Billboard_SetScale(Billboard *billboard, const VecFx32 *scale);
|
||||
const VecFx32 *Billboard_GetScale(const Billboard *billboard);
|
||||
void Billboard_SetRotMatrix(Billboard *billboard, const MtxFx33 *rotMatrix);
|
||||
const MtxFx33 *Billboard_GetRotMatrix(const Billboard *billboard);
|
||||
void Billboard_SetDrawFlag(Billboard *billboard, u8 draw);
|
||||
u8 Billboard_GetDrawFlag(const Billboard *billboard);
|
||||
void Billboard_SetAnimNum(Billboard *billboard, int animNum);
|
||||
int Billboard_GetAnimNum(const Billboard *billboard);
|
||||
int Billboard_AdvanceAnim(Billboard *billboard, fx32 numFrames);
|
||||
void Billboard_SetFrameNum(Billboard *billboard, fx32 frameNum);
|
||||
fx32 Billboard_GetFrameNum(const Billboard *billboard);
|
||||
void Billboard_SetAnimFrameNum(Billboard *billboard, fx32 animFrameNum);
|
||||
fx32 Billboard_GetAnimFrameNum(const Billboard *billboard);
|
||||
NNSG3dResMdl *Billboard_GetModel(const Billboard *billboard);
|
||||
int Billboard_GetState(const Billboard *billboard);
|
||||
void Billboard_TryRequestVRAMTransfer(Billboard *billboard);
|
||||
NNSG3dResMdl *Billboard_GetModel2(Billboard *billboard);
|
||||
NNSG3dResTex *Billboard_GetTexture(Billboard *billboard);
|
||||
NNSG3dRenderObj *Billboard_GetRenderObj(Billboard *billboard);
|
||||
void Billboard_SetCallback(Billboard *billboard, BillboardCallback callback, void *callbackParam);
|
||||
|
||||
#endif // POKEPLATINUM_BILLBOARD_H
|
||||
19
include/billboard_gfx_sequence.h
Normal file
19
include/billboard_gfx_sequence.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef POKEPLATINUM_BILLBOARD_GFX_SEQUENCE_H
|
||||
#define POKEPLATINUM_BILLBOARD_GFX_SEQUENCE_H
|
||||
|
||||
typedef struct BillboardTexPlttIndex {
|
||||
u8 textureIdx;
|
||||
u8 plttIdx;
|
||||
} BillboardTexPlttIndex;
|
||||
|
||||
typedef struct BillboardGfxSequence {
|
||||
const u16 *startFrame;
|
||||
const u8 *textureIdx;
|
||||
const u8 *plttIdx;
|
||||
u32 seqCount;
|
||||
} BillboardGfxSequence;
|
||||
|
||||
BillboardTexPlttIndex BillboardGfxSequence_GetTexPlttIndexAt(const BillboardGfxSequence *gfxSequence, const u16 index);
|
||||
void BillboardGfxSequence_SetData(const void *data, BillboardGfxSequence *gfxSequence);
|
||||
|
||||
#endif // POKEPLATINUM_BILLBOARD_GFX_SEQUENCE_H
|
||||
35
include/billboard_vram_transfer.h
Normal file
35
include/billboard_vram_transfer.h
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#ifndef POKEPLATINUM_BILLBOARD_VRAM_TRANSFER_H
|
||||
#define POKEPLATINUM_BILLBOARD_VRAM_TRANSFER_H
|
||||
|
||||
#include <nnsys.h>
|
||||
|
||||
#include "constants/heap.h"
|
||||
|
||||
#include "billboard_gfx_sequence.h"
|
||||
|
||||
typedef struct BillboardVRAMTransfer {
|
||||
const BillboardGfxSequence *gfxSequence;
|
||||
const NNSG3dResTex *texture;
|
||||
NNSGfdTexKey texKey;
|
||||
NNSGfdPlttKey plttKey;
|
||||
u8 textureIdx;
|
||||
u8 plttIdx;
|
||||
} BillboardVRAMTransfer;
|
||||
|
||||
typedef struct BillboardListVRAMTransfer {
|
||||
BillboardVRAMTransfer *billboardTransfers;
|
||||
int maxElements;
|
||||
} BillboardListVRAMTransfer;
|
||||
|
||||
BillboardListVRAMTransfer *BillboardListVRAMTransfer_New(int maxElements, enum HeapID heapID);
|
||||
void BillboardListVRAMTransfer_Free(BillboardListVRAMTransfer *listTransfer);
|
||||
BillboardVRAMTransfer *BillboardListVRAMTransfer_NewBillboardTransfer(BillboardListVRAMTransfer *listTransfer, const BillboardGfxSequence *gfxSequence, const NNSG3dResTex *texture, NNSGfdTexKey texKey, NNSGfdPlttKey plttKey, const fx32 index);
|
||||
void BillboardVRAMTransfer_Reset(BillboardVRAMTransfer *transfer);
|
||||
void BillboardListVRAMTransfer_ResetAll(BillboardListVRAMTransfer *listTransfer);
|
||||
void BillboardVRAMTransfer_Request(BillboardVRAMTransfer *param0, const fx32 param1);
|
||||
void *GetTextureDataVRAMBuffer(NNSG3dResTex *texture, const u8 index);
|
||||
void *GetPlttDataVRAMBuffer(NNSG3dResTex *texture, const u8 index);
|
||||
void *GetTextureDataBufferFromResourceName(NNSG3dResTex *texture, const char *name);
|
||||
int CalcTextureDataSizeFromResourceName(NNSG3dResTex *texture, const char *name);
|
||||
|
||||
#endif // POKEPLATINUM_BILLBOARD_VRAM_TRANSFER_H
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
#ifndef POKEPLATINUM_FUNCPTR_02021444_H
|
||||
#define POKEPLATINUM_FUNCPTR_02021444_H
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
|
||||
typedef void (*UnkFuncPtr_02021444)(UnkStruct_020216E0 *, void *);
|
||||
|
||||
#endif // POKEPLATINUM_FUNCPTR_02021444_H
|
||||
|
|
@ -3,13 +3,11 @@
|
|||
|
||||
#include <nitro/fx/fx.h>
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
|
||||
#include "field/field_system_decl.h"
|
||||
#include "overlay005/struct_ov5_021DF84C.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "overworld_anim_manager.h"
|
||||
#include "simple3d.h"
|
||||
|
||||
|
|
@ -52,9 +50,9 @@ void FieldEffectManager_ReadNARCWholeMember(FieldEffectManager *fieldEffMan, u32
|
|||
void *FieldEffectManager_AllocAndReadNARCWholeMember(FieldEffectManager *fieldEffMan, u32 memberIndex, BOOL allocAtEnd);
|
||||
OverworldAnimManager *FieldEffectManager_InitAnimManager(const FieldEffectManager *fieldEffMan, const OverworldAnimManagerFuncs *funcs, const VecFx32 *initialPos, int animId, const void *userData, int sysTaskPriority);
|
||||
void FieldEffectManager_FinishAnimManager(OverworldAnimManager *animMan);
|
||||
UnkStruct_020216E0 *ov5_021DF7F8(FieldEffectManager *param0, const UnkStruct_ov5_021DF84C *param1, const VecFx32 *param2);
|
||||
UnkStruct_020216E0 *ov5_021DF84C(FieldEffectManager *param0, u32 param1, const VecFx32 *param2);
|
||||
UnkStruct_ov5_021DF84C *ov5_021DF864(FieldEffectManager *param0, u32 param1, u32 param2, u32 param3, u32 param4, int param5, const UnkStruct_020217F4 *param6);
|
||||
Billboard *ov5_021DF7F8(FieldEffectManager *param0, const BillboardResources *param1, const VecFx32 *param2);
|
||||
Billboard *ov5_021DF84C(FieldEffectManager *param0, u32 param1, const VecFx32 *param2);
|
||||
BillboardResources *ov5_021DF864(FieldEffectManager *param0, u32 param1, u32 param2, u32 param3, u32 param4, int param5, const BillboardAnim *param6);
|
||||
void ov5_021DF9D4(FieldEffectManager *param0, u32 param1);
|
||||
void ov5_021DF9E0(FieldEffectManager *param0, u32 param1, u32 param2);
|
||||
void *ov5_021DF9FC(FieldEffectManager *param0, u32 param1);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef POKEPLATINUM_FUNCPTR_OV5_021EE454_H
|
||||
#define POKEPLATINUM_FUNCPTR_OV5_021EE454_H
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "billboard.h"
|
||||
|
||||
typedef void (*UnkFuncPtr_ov5_021EE454)(void *, const UnkStruct_020216E0 *);
|
||||
typedef void (*UnkFuncPtr_ov5_021EE454)(void *, const Billboard *);
|
||||
|
||||
#endif // POKEPLATINUM_FUNCPTR_OV5_021EE454_H
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
#ifndef POKEPLATINUM_OV5_021EB1A0_H
|
||||
#define POKEPLATINUM_OV5_021EB1A0_H
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
|
||||
UnkStruct_020216E0 *ov5_021EB1A0(MapObject *param0);
|
||||
#include "billboard.h"
|
||||
|
||||
Billboard *ov5_021EB1A0(MapObject *param0);
|
||||
void ov5_021EB2EC(MapObject *param0);
|
||||
void ov5_021EB314(MapObject *param0);
|
||||
void ov5_021EB328(MapObject *param0);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
#ifndef POKEPLATINUM_OV5_021ECA70_H
|
||||
#define POKEPLATINUM_OV5_021ECA70_H
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
|
||||
#include "overlay005/struct_ov5_021ECB8C_decl.h"
|
||||
|
||||
#include "billboard.h"
|
||||
|
||||
void ov5_021ECA70(MapObject *param0);
|
||||
void ov5_021ECA90(MapObject *param0);
|
||||
void ov5_021ECABC(MapObject *param0);
|
||||
|
|
@ -14,7 +15,7 @@ void ov5_021ECAF0(MapObject *param0);
|
|||
void ov5_021ECB34(MapObject *param0);
|
||||
void ov5_021ECB58(MapObject *param0);
|
||||
void ov5_021ECB78(MapObject *param0);
|
||||
UnkStruct_020216E0 *ov5_021ECB80(MapObject *param0);
|
||||
UnkStruct_020216E0 *ov5_021ECB8C(UnkStruct_ov5_021ECB8C *param0);
|
||||
Billboard *ov5_021ECB80(MapObject *param0);
|
||||
Billboard *ov5_021ECB8C(UnkStruct_ov5_021ECB8C *param0);
|
||||
|
||||
#endif // POKEPLATINUM_OV5_021ECA70_H
|
||||
|
|
|
|||
|
|
@ -1,34 +1,32 @@
|
|||
#ifndef POKEPLATINUM_OV5_021ECE40_H
|
||||
#define POKEPLATINUM_OV5_021ECE40_H
|
||||
|
||||
#include "struct_decls/struct_02020C44_decl.h"
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061830_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
|
||||
#include "overlay005/funcptr_ov5_021EE454.h"
|
||||
#include "overlay005/struct_ov5_021DF84C.h"
|
||||
#include "overlay005/struct_ov5_021ED01C.h"
|
||||
#include "overlay005/struct_ov5_021ED0A4.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "resource_collection.h"
|
||||
|
||||
void ov5_021ECE40(UnkStruct_ov5_021ED0A4 *param0, const MapObjectManager *param1, int param2, int param3, int param4, int param5, const int *param6, int param7);
|
||||
void ov5_021ECE94(UnkStruct_ov5_021ED0A4 *param0);
|
||||
int ov5_021ECEB4(MapObject *param0, UnkStruct_020216E0 **param1, int param2);
|
||||
int ov5_021ECF04(MapObject *param0, UnkStruct_020216E0 **param1);
|
||||
UnkStruct_020216E0 *ov5_021ECF1C(MapObject *param0, int param1);
|
||||
void ov5_021ECF70(const MapObject *param0, UnkStruct_020216E0 **param1, int param2);
|
||||
void ov5_021ECFA4(const MapObject *param0, UnkStruct_020216E0 **param1);
|
||||
void ov5_021ECFD8(const MapObject *param0, UnkStruct_020216E0 **param1, int param2);
|
||||
void ov5_021ED01C(UnkStruct_020216E0 *param0, UnkStruct_ov5_021ED01C *param1);
|
||||
void ov5_021ED03C(UnkStruct_020216E0 *param0, UnkStruct_ov5_021ED01C *param1);
|
||||
void ov5_021ED060(MapObject *param0, UnkStruct_020216E0 **param1, int param2);
|
||||
int ov5_021ED150(const MapObjectManager *param0, u32 param1, UnkStruct_ov5_021DF84C *param2);
|
||||
int ov5_021ECEB4(MapObject *param0, Billboard **param1, int param2);
|
||||
int ov5_021ECF04(MapObject *param0, Billboard **param1);
|
||||
Billboard *ov5_021ECF1C(MapObject *param0, int param1);
|
||||
void ov5_021ECF70(const MapObject *param0, Billboard **param1, int param2);
|
||||
void ov5_021ECFA4(const MapObject *param0, Billboard **param1);
|
||||
void ov5_021ECFD8(const MapObject *param0, Billboard **param1, int param2);
|
||||
void ov5_021ED01C(Billboard *param0, UnkStruct_ov5_021ED01C *param1);
|
||||
void ov5_021ED03C(Billboard *param0, UnkStruct_ov5_021ED01C *param1);
|
||||
void ov5_021ED060(MapObject *param0, Billboard **param1, int param2);
|
||||
int ov5_021ED150(const MapObjectManager *param0, u32 param1, BillboardResources *param2);
|
||||
void ov5_021EDA38(MapObjectManager *param0, UnkStruct_ov5_021ED0A4 *param1);
|
||||
void ov5_021EDBC4(const MapObjectManager *param0, int param1, MapObject *param2);
|
||||
void ov5_021EDC84(UnkStruct_ov5_021ED0A4 *param0, UnkStruct_02020C44 *param1);
|
||||
UnkStruct_02020C44 *ov5_021EDC8C(UnkStruct_ov5_021ED0A4 *param0);
|
||||
void ov5_021EDC84(UnkStruct_ov5_021ED0A4 *param0, BillboardList *param1);
|
||||
BillboardList *ov5_021EDC8C(UnkStruct_ov5_021ED0A4 *param0);
|
||||
void ov5_021EDC94(UnkStruct_ov5_021ED0A4 *param0, int param1);
|
||||
ResourceCollection *ov5_021EDC98(const UnkStruct_ov5_021ED0A4 *param0);
|
||||
ResourceCollection *ov5_021EDCA0(const UnkStruct_ov5_021ED0A4 *param0);
|
||||
|
|
@ -36,11 +34,11 @@ void ov5_021EDCA8(UnkStruct_ov5_021ED0A4 *param0, TextureResourceManager *param1
|
|||
TextureResourceManager *ov5_021EDCB0(const UnkStruct_ov5_021ED0A4 *param0);
|
||||
void ov5_021EDD78(MapObject *param0, int param1);
|
||||
int ov5_021EDD94(MapObject *param0);
|
||||
BOOL ov5_021EDEB4(MapObject *param0, UnkStruct_020216E0 *param1);
|
||||
void ov5_021EDED8(MapObject *param0, UnkStruct_020216E0 *param1);
|
||||
BOOL ov5_021EDEB4(MapObject *param0, Billboard *param1);
|
||||
void ov5_021EDED8(MapObject *param0, Billboard *param1);
|
||||
int ov5_021EDF18(int param0);
|
||||
int ov5_021EDF24(int param0);
|
||||
int ov5_021EDF30(int param0);
|
||||
UnkStruct_020216E0 *ov5_021EE3FC(MapObject *param0, int param1, UnkFuncPtr_ov5_021EE454 param2, void *param3);
|
||||
Billboard *ov5_021EE3FC(MapObject *param0, int param1, UnkFuncPtr_ov5_021EE454 param2, void *param3);
|
||||
|
||||
#endif // POKEPLATINUM_OV5_021ECE40_H
|
||||
|
|
|
|||
|
|
@ -3,17 +3,16 @@
|
|||
|
||||
#include <nitro/fx/fx.h>
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
|
||||
#include "overlay005/field_effect_manager.h"
|
||||
#include "overlay005/struct_ov5_021DF84C.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "overworld_anim_manager.h"
|
||||
|
||||
void *ov5_021F17B8(FieldEffectManager *param0);
|
||||
void ov5_021F17D4(void *param0);
|
||||
void ov5_021F1800(MapObject *param0, int param1);
|
||||
OverworldAnimManager *ov5_021F1BA4(FieldEffectManager *param0, const UnkStruct_ov5_021DF84C *param1, const UnkStruct_020216E0 *param2, const VecFx32 *param3, int param4, int param5);
|
||||
OverworldAnimManager *ov5_021F1BA4(FieldEffectManager *param0, const BillboardResources *param1, const Billboard *param2, const VecFx32 *param3, int param4, int param5);
|
||||
|
||||
#endif // POKEPLATINUM_OV5_021F17B8_H
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_OV5_021DF7F8_H
|
||||
#define POKEPLATINUM_STRUCT_OV5_021DF7F8_H
|
||||
|
||||
#include <nitro/fx/fx.h>
|
||||
|
||||
#include "struct_decls/struct_02020C44_decl.h"
|
||||
|
||||
#include "overlay005/struct_ov5_021DF84C.h"
|
||||
|
||||
typedef struct {
|
||||
UnkStruct_02020C44 *unk_00;
|
||||
const UnkStruct_ov5_021DF84C *unk_04;
|
||||
VecFx32 unk_08;
|
||||
VecFx32 unk_14;
|
||||
} UnkStruct_ov5_021DF7F8;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_OV5_021DF7F8_H
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_OV5_021DF84C_H
|
||||
#define POKEPLATINUM_STRUCT_OV5_021DF84C_H
|
||||
|
||||
#include <nnsys.h>
|
||||
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
#include "struct_defs/struct_02024184.h"
|
||||
|
||||
typedef struct {
|
||||
void *unk_00;
|
||||
const NNSG3dResTex *unk_04;
|
||||
const UnkStruct_020217F4 *unk_08;
|
||||
UnkStruct_02024184 unk_0C;
|
||||
NNSGfdTexKey unk_1C;
|
||||
NNSGfdTexKey unk_20;
|
||||
NNSGfdPlttKey unk_24;
|
||||
} UnkStruct_ov5_021DF84C;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_OV5_021DF84C_H
|
||||
|
|
@ -1,14 +1,12 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_OV5_021ED0A4_H
|
||||
#define POKEPLATINUM_STRUCT_OV5_021ED0A4_H
|
||||
|
||||
#include "struct_decls/struct_02020C44_decl.h"
|
||||
#include "struct_decls/struct_02061830_decl.h"
|
||||
|
||||
#include "overlay005/resource_heap.h"
|
||||
#include "overlay005/struct_ov5_021DF84C.h"
|
||||
#include "overlay005/struct_ov5_021ED110.h"
|
||||
#include "overlay005/struct_ov5_021EDF3C.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "resource_collection.h"
|
||||
|
||||
typedef struct UnkStruct_ov5_021ED0A4_t {
|
||||
|
|
@ -23,8 +21,8 @@ typedef struct UnkStruct_ov5_021ED0A4_t {
|
|||
int unk_20[8];
|
||||
int unk_40[8];
|
||||
int unk_60[32];
|
||||
UnkStruct_02020C44 *unk_E0;
|
||||
UnkStruct_ov5_021DF84C *unk_E4;
|
||||
BillboardList *unk_E0;
|
||||
BillboardResources *unk_E4;
|
||||
ResourceCollection *unk_E8;
|
||||
ResourceCollection *unk_EC;
|
||||
TextureResourceManager *unk_F0;
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_OV5_021ED110_H
|
||||
#define POKEPLATINUM_STRUCT_OV5_021ED110_H
|
||||
|
||||
#include "overlay005/struct_ov5_021DF84C.h"
|
||||
|
||||
typedef struct {
|
||||
u32 unk_00;
|
||||
UnkStruct_ov5_021DF84C *unk_04;
|
||||
} UnkStruct_ov5_021ED110;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_OV5_021ED110_H
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_OV5_021EDD04_H
|
||||
#define POKEPLATINUM_STRUCT_OV5_021EDD04_H
|
||||
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
#include "billboard.h"
|
||||
|
||||
typedef struct {
|
||||
int unk_00;
|
||||
int unk_04;
|
||||
int unk_06;
|
||||
const UnkStruct_020217F4 *unk_08;
|
||||
const BillboardAnim *unk_08;
|
||||
} UnkStruct_ov5_021EDD04;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_OV5_021EDD04_H
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_OV5_021EDDAC_H
|
||||
#define POKEPLATINUM_STRUCT_OV5_021EDDAC_H
|
||||
|
||||
#include "constants/heap.h"
|
||||
|
||||
typedef struct {
|
||||
int unk_00;
|
||||
enum HeapID heapID;
|
||||
} UnkStruct_ov5_021EDDAC;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_OV5_021EDDAC_H
|
||||
|
|
@ -1,13 +1,14 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_OV5_021EE294_H
|
||||
#define POKEPLATINUM_STRUCT_OV5_021EE294_H
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
|
||||
#include "billboard.h"
|
||||
|
||||
typedef struct {
|
||||
int unk_00;
|
||||
MapObject *unk_04;
|
||||
UnkStruct_020216E0 **unk_08;
|
||||
Billboard **unk_08;
|
||||
} UnkStruct_ov5_021EE294;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_OV5_021EE294_H
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
#ifndef POKEPLATINUM_OV9_02249960_H
|
||||
#define POKEPLATINUM_OV9_02249960_H
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
|
||||
#include "field/field_system_decl.h"
|
||||
#include "overlay009/struct_ov9_0224F6EC_decl.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "field_task.h"
|
||||
|
||||
#define GHOST_PROP_GROUP_MAX_COUNT 24
|
||||
|
|
@ -33,8 +33,8 @@ BOOL DistWorld_DynamicMapFeaturesCheckCollision(FieldSystem *fieldSystem, const
|
|||
void DistWorld_UpdateCameraAngle(FieldSystem *fieldSystem);
|
||||
void DistWorld_ResetPersistedCameraAngles(FieldSystem *fieldSystem);
|
||||
int ov9_0224A520(FieldSystem *fieldSystem, MapObject *param1);
|
||||
void ov9_0224A558(FieldSystem *fieldSystem, UnkStruct_020216E0 *param1, int param2);
|
||||
void ov9_0224A564(FieldSystem *fieldSystem, const UnkStruct_020216E0 *param1);
|
||||
void ov9_0224A558(FieldSystem *fieldSystem, Billboard *param1, int param2);
|
||||
void ov9_0224A564(FieldSystem *fieldSystem, const Billboard *param1);
|
||||
BOOL ov9_0224A59C(FieldSystem *fieldSystem, int param1);
|
||||
BOOL ov9_0224A67C(FieldSystem *fieldSystem, int param1);
|
||||
BOOL ov9_0224A71C(FieldSystem *fieldSystem);
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_0201DD00_DECL_H
|
||||
#define POKEPLATINUM_STRUCT_0201DD00_DECL_H
|
||||
|
||||
typedef struct UnkStruct_0201DD00_t UnkStruct_0201DD00;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_0201DD00_DECL_H
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_0201DDF4_DECL_H
|
||||
#define POKEPLATINUM_STRUCT_0201DDF4_DECL_H
|
||||
|
||||
typedef struct UnkStruct_0201DDF4_t UnkStruct_0201DDF4;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_0201DDF4_DECL_H
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_02020C44_DECL_H
|
||||
#define POKEPLATINUM_STRUCT_02020C44_DECL_H
|
||||
|
||||
typedef struct UnkStruct_02020C44_t UnkStruct_02020C44;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_02020C44_DECL_H
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_020216E0_DECL_H
|
||||
#define POKEPLATINUM_STRUCT_020216E0_DECL_H
|
||||
|
||||
typedef struct UnkStruct_020216E0_t UnkStruct_020216E0;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_020216E0_DECL_H
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_0202144C_H
|
||||
#define POKEPLATINUM_STRUCT_0202144C_H
|
||||
|
||||
typedef struct {
|
||||
u8 unk_00;
|
||||
u8 unk_01;
|
||||
} UnkStruct_0202144C;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_0202144C_H
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_020217F4_H
|
||||
#define POKEPLATINUM_STRUCT_020217F4_H
|
||||
|
||||
typedef struct {
|
||||
int unk_00;
|
||||
int unk_04;
|
||||
int unk_08;
|
||||
} UnkStruct_020217F4;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_020217F4_H
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_02024184_H
|
||||
#define POKEPLATINUM_STRUCT_02024184_H
|
||||
|
||||
typedef struct {
|
||||
const u16 *unk_00;
|
||||
const u8 *unk_04;
|
||||
const u8 *unk_08;
|
||||
u32 unk_0C;
|
||||
} UnkStruct_02024184;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_02024184_H
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#ifndef POKEPLATINUM_UNK_0201DD00_H
|
||||
#define POKEPLATINUM_UNK_0201DD00_H
|
||||
|
||||
#include <nnsys.h>
|
||||
|
||||
#include "constants/heap.h"
|
||||
|
||||
#include "struct_decls/struct_0201DD00_decl.h"
|
||||
#include "struct_decls/struct_0201DDF4_decl.h"
|
||||
#include "struct_defs/struct_02024184.h"
|
||||
|
||||
UnkStruct_0201DD00 *sub_0201DD00(int param0, enum HeapID heapID);
|
||||
void sub_0201DD3C(UnkStruct_0201DD00 *param0);
|
||||
UnkStruct_0201DDF4 *sub_0201DD54(UnkStruct_0201DD00 *param0, const UnkStruct_02024184 *param1, const NNSG3dResTex *param2, NNSGfdTexKey param3, NNSGfdPlttKey param4, const fx32 param5);
|
||||
void sub_0201DDAC(UnkStruct_0201DDF4 *param0);
|
||||
void sub_0201DDB4(UnkStruct_0201DD00 *param0);
|
||||
void sub_0201DDD8(UnkStruct_0201DDF4 *param0, const fx32 param1);
|
||||
void *sub_0201DEAC(NNSG3dResTex *param0, const u8 param1);
|
||||
void *sub_0201DEFC(NNSG3dResTex *param0, const u8 param1);
|
||||
void *sub_0201DF50(NNSG3dResTex *param0, const char *param1);
|
||||
int sub_0201DFE4(NNSG3dResTex *param0, const char *param1);
|
||||
|
||||
#endif // POKEPLATINUM_UNK_0201DD00_H
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
#ifndef POKEPLATINUM_UNK_02020AEC_H
|
||||
#define POKEPLATINUM_UNK_02020AEC_H
|
||||
|
||||
#include <nitro/fx/fx.h>
|
||||
#include <nnsys.h>
|
||||
|
||||
#include "constants/heap.h"
|
||||
|
||||
#include "struct_decls/struct_02020C44_decl.h"
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
#include "struct_defs/struct_02024184.h"
|
||||
|
||||
#include "functypes/funcptr_02021444.h"
|
||||
#include "overlay005/struct_ov5_021DF7F8.h"
|
||||
#include "overlay005/struct_ov5_021DF84C.h"
|
||||
#include "overlay005/struct_ov5_021EDDAC.h"
|
||||
|
||||
void sub_02020B14(UnkStruct_020216E0 *param0);
|
||||
void sub_02020B90(int param0, enum HeapID heapID);
|
||||
void sub_02020BD0(void);
|
||||
void sub_02020C08(void);
|
||||
UnkStruct_02020C44 *sub_02020C44(const UnkStruct_ov5_021EDDAC *param0);
|
||||
BOOL sub_02020CCC(UnkStruct_02020C44 *param0);
|
||||
BOOL sub_02020D14(UnkStruct_02020C44 *param0);
|
||||
BOOL sub_02020D50(UnkStruct_02020C44 *param0);
|
||||
void sub_02020D68(UnkStruct_02020C44 *param0);
|
||||
UnkStruct_020216E0 *sub_0202119C(const UnkStruct_ov5_021DF7F8 *param0);
|
||||
BOOL sub_020211FC(UnkStruct_020216E0 *param0);
|
||||
void sub_0202125C(UnkStruct_ov5_021DF84C *param0, void *param1, const NNSG3dResTex *param2, const UnkStruct_020217F4 *param3, const UnkStruct_02024184 *param4, NNSGfdTexKey param5, NNSGfdTexKey param6, NNSGfdPlttKey param7);
|
||||
void sub_02021284(UnkStruct_ov5_021DF84C *param0, void *param1, const NNSG3dResTex *param2, const UnkStruct_020217F4 *param3, const UnkStruct_02024184 *param4);
|
||||
void sub_020212A8(UnkStruct_020216E0 *param0, const VecFx32 *param1);
|
||||
const VecFx32 *sub_020212C0(const UnkStruct_020216E0 *param0);
|
||||
void sub_020212D0(UnkStruct_020216E0 *param0, const VecFx32 *param1);
|
||||
const VecFx32 *sub_020212EC(const UnkStruct_020216E0 *param0);
|
||||
void sub_020212FC(UnkStruct_020216E0 *param0, const MtxFx33 *param1);
|
||||
const MtxFx33 *sub_02021310(const UnkStruct_020216E0 *param0);
|
||||
void sub_02021320(UnkStruct_020216E0 *param0, u8 param1);
|
||||
u8 sub_02021334(const UnkStruct_020216E0 *param0);
|
||||
void sub_02021344(UnkStruct_020216E0 *param0, int param1);
|
||||
int sub_02021358(const UnkStruct_020216E0 *param0);
|
||||
int sub_02021368(UnkStruct_020216E0 *param0, fx32 param1);
|
||||
void sub_02021380(UnkStruct_020216E0 *param0, fx32 param1);
|
||||
fx32 sub_02021394(const UnkStruct_020216E0 *param0);
|
||||
void sub_020213A4(UnkStruct_020216E0 *param0, fx32 param1);
|
||||
fx32 sub_020213D4(const UnkStruct_020216E0 *param0);
|
||||
NNSG3dResMdl *sub_020213F4(const UnkStruct_020216E0 *param0);
|
||||
int sub_02021404(const UnkStruct_020216E0 *param0);
|
||||
void sub_02021414(UnkStruct_020216E0 *param0);
|
||||
NNSG3dResMdl *sub_02021430(UnkStruct_020216E0 *param0);
|
||||
NNSG3dResTex *sub_02021438(UnkStruct_020216E0 *param0);
|
||||
NNSG3dRenderObj *sub_02021440(UnkStruct_020216E0 *param0);
|
||||
void sub_02021444(UnkStruct_020216E0 *param0, UnkFuncPtr_02021444 param1, void *param2);
|
||||
|
||||
#endif // POKEPLATINUM_UNK_02020AEC_H
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
#ifndef POKEPLATINUM_UNK_0202414C_H
|
||||
#define POKEPLATINUM_UNK_0202414C_H
|
||||
|
||||
#include "struct_defs/struct_0202144C.h"
|
||||
#include "struct_defs/struct_02024184.h"
|
||||
|
||||
UnkStruct_0202144C sub_0202414C(const UnkStruct_02024184 *param0, const u16 param1);
|
||||
void sub_02024184(const void *param0, UnkStruct_02024184 *param1);
|
||||
|
||||
#endif // POKEPLATINUM_UNK_0202414C_H
|
||||
|
|
@ -78,7 +78,7 @@ Static main
|
|||
Object main.nef.p/src_text.c.o
|
||||
Object main.nef.p/src_vram_transfer.c.o
|
||||
Object main.nef.p/src_cell_transfer.c.o
|
||||
Object main.nef.p/src_unk_0201DD00.c.o
|
||||
Object main.nef.p/src_billboard_vram_transfer.c.o
|
||||
Object main.nef.p/src_grid_menu_cursor_position.c.o
|
||||
Object main.nef.p/src_ascii_util.c.o
|
||||
Object main.nef.p/src_fx_util.c.o
|
||||
|
|
@ -88,7 +88,7 @@ Static main
|
|||
Object main.nef.p/src_pltt_transfer.c.o
|
||||
Object main.nef.p/src_gx_layers.c.o
|
||||
Object main.nef.p/src_camera.c.o
|
||||
Object main.nef.p/src_unk_02020AEC.c.o
|
||||
Object main.nef.p/src_billboard.c.o
|
||||
Object main.nef.p/src_sprite.c.o
|
||||
Object main.nef.p/src_touch_screen.c.o
|
||||
Object main.nef.p/src_timer.c.o
|
||||
|
|
@ -98,7 +98,7 @@ Static main
|
|||
Object main.nef.p/src_font_manager.c.o
|
||||
Object main.nef.p/src_string_gf.c.o
|
||||
Object main.nef.p/src_touch_screen_actions.c.o
|
||||
Object main.nef.p/src_unk_0202414C.c.o
|
||||
Object main.nef.p/src_billboard_gfx_sequence.c.o
|
||||
Object main.nef.p/src_unk_0202419C.c.o
|
||||
Object main.nef.p/src_hardware_palette.c.o
|
||||
Object main.nef.p/src_g3d_pipeline.c.o
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
|
||||
#include "overlay005/berry_graphics_data.h"
|
||||
|
|
@ -15,9 +14,9 @@
|
|||
|
||||
#include "berry_patch_manager.h"
|
||||
#include "berry_patches.h"
|
||||
#include "billboard.h"
|
||||
#include "map_header_data.h"
|
||||
#include "map_object.h"
|
||||
#include "unk_02020AEC.h"
|
||||
|
||||
typedef struct BerryPatchData {
|
||||
u16 growthStage;
|
||||
|
|
@ -27,7 +26,7 @@ typedef struct BerryPatchData {
|
|||
typedef struct BerryPatchGraphics {
|
||||
int graphicsResourceID;
|
||||
enum BerryGrowthStage lastGrowthStage;
|
||||
UnkStruct_020216E0 *graphicsObject;
|
||||
Billboard *graphicsObject;
|
||||
UnkStruct_ov5_021ED01C graphicsState;
|
||||
} BerryPatchGraphics;
|
||||
|
||||
|
|
@ -135,7 +134,7 @@ void BerryPatchGraphics_UpdateGraphics(MapObject *mapObject)
|
|||
ov5_021EDEB4(mapObject, graphicsData->graphicsObject);
|
||||
|
||||
if (ov5_021ECD38(mapObject) == 0) {
|
||||
sub_02021368(graphicsData->graphicsObject, FX32_ONE );
|
||||
Billboard_AdvanceAnim(graphicsData->graphicsObject, FX32_ONE );
|
||||
}
|
||||
|
||||
ov5_021EDED8(mapObject, graphicsData->graphicsObject);
|
||||
|
|
@ -213,9 +212,9 @@ static int BerryPatchGraphics_GetGraphicsResourceID(int berryID, enum BerryGrowt
|
|||
return 0xffff;
|
||||
}
|
||||
|
||||
UnkStruct_020216E0 *BerryPatchGraphics_GetGraphicsObject(MapObject *mapObject)
|
||||
Billboard *BerryPatchGraphics_GetGraphicsObject(MapObject *mapObject)
|
||||
{
|
||||
UnkStruct_020216E0 *graphicsObject = NULL;
|
||||
Billboard *graphicsObject = NULL;
|
||||
|
||||
GF_ASSERT(BerryPatchGraphics_IsBerryPatch(MapObject_GetGraphicsID(mapObject)));
|
||||
|
||||
|
|
|
|||
884
src/billboard.c
Normal file
884
src/billboard.c
Normal file
|
|
@ -0,0 +1,884 @@
|
|||
#include "billboard.h"
|
||||
|
||||
#include "billboard_vram_transfer.h"
|
||||
#include "easy3d.h"
|
||||
#include "heap.h"
|
||||
|
||||
enum BillboardAnimType {
|
||||
BILLBOARD_ANIM_TYPE_LOOP = 0,
|
||||
BILLBOARD_ANIM_TYPE_ONESHOT,
|
||||
BILLBOARD_ANIM_TYPE_TABLE_END, // used as the anim type for the dummy entry at the end of anim tables
|
||||
};
|
||||
|
||||
enum BillboardAnimStatus {
|
||||
BILLBOARD_ANIM_STATUS_RUNNING = 0,
|
||||
BILLBOARD_ANIM_STATUS_FINISHED,
|
||||
};
|
||||
|
||||
enum BillboardRedraw {
|
||||
BILLBOARD_REDRAW_NONE = 0,
|
||||
BILLBOARD_REDRAW_NEEDED,
|
||||
BILLBOARD_REDRAW_FINISHED,
|
||||
};
|
||||
|
||||
enum BillboardResourceValue {
|
||||
BILLBOARD_RESOURCE_MODEL_RES = 0,
|
||||
BILLBOARD_RESOURCE_TEXTURE,
|
||||
};
|
||||
|
||||
enum BillboardState {
|
||||
BILLBOARD_STATE_INACTIVE = 0,
|
||||
BILLBOARD_STATE_INITIALIZED,
|
||||
BILLBOARD_STATE_VRAM_TRANSFER,
|
||||
BILLBOARD_STATE_ACTIVE,
|
||||
};
|
||||
|
||||
static BillboardList *FindFirstFreeBillboardList(void);
|
||||
static void BillboardList_Reset(BillboardList *list);
|
||||
static void BillboardList_Draw(BillboardList *list);
|
||||
static void UpdateTexPlttAddressesForCurrentFrame(Billboard *billboard);
|
||||
static void UpdateModelTextureAddresses(NNSG3dResMdl *model, const NNSG3dResTex *texture, u8 textureIdx);
|
||||
static void UpdateMaterialTextureAddresses(NNSG3dResMat *material, const NNSG3dResDictTexToMatIdxData *texToMatDict, u32 textureAddress);
|
||||
static void UpdateModelPlttAddresses(NNSG3dResMdl *model, const NNSG3dResTex *texture, u8 plttIdx);
|
||||
static void UpdateMaterialPlttAddresses(NNSG3dResMat *material, const NNSG3dResDictPlttToMatIdxData *plttToMatDict, u32 plttAddress);
|
||||
static void BillboardList_InitBillboards(BillboardList *list);
|
||||
static Billboard *BillboardList_AllocBillboard(BillboardList *list);
|
||||
static BOOL BillboardList_FreeBillboard(BillboardList *list, Billboard *billboard);
|
||||
static void AppendBillboardToList(Billboard *sentinel, Billboard *newBillboard);
|
||||
static void BillboardList_Remove(Billboard *billboard);
|
||||
static void Billboard_SetKeysAndBindModelSet(Billboard *billboard);
|
||||
static void ReleaseVRAMKeysAndModelSet(Billboard *billboard);
|
||||
static void *BillboardResources_GetValue(const BillboardResources *resources, int value);
|
||||
static const BillboardAnim *Billboard_GetAnimAt(const BillboardAnim *anims, int index);
|
||||
static NNSG3dResMdlSet *RetrieveBillboardResources(const BillboardResources *resources, NNSG3dResMdl **outModel, NNSG3dResTex **outTexture);
|
||||
static NNSG3dResTex *BillboardResources_GetTexture(const BillboardResources *resources);
|
||||
static void SetAndAppendBillboard(Billboard *billboard, const BillboardResources *resources);
|
||||
static void AllocResourcesAndAppendBillboard(Billboard *billboard, const BillboardResources *resources);
|
||||
static void ResetResourcesAndAppendBillboard(Billboard *billboard, const BillboardResources *resources);
|
||||
static fx32 GetAnimStartFrame(const Billboard *billboard, int animNum);
|
||||
static int GetAndAdvanceAnim(Billboard *billboard, fx32 numFrames);
|
||||
static int AdvanceAnim(const BillboardAnim *anim, fx32 *currFrame, fx32 numFrames);
|
||||
static void AllocTextureVRAM(const NNSG3dResTex *texture, NNSG3dTexKey *texKey, NNSG3dTexKey *tex4x4Key, NNSG3dPlttKey *plttKey);
|
||||
static void ReleaseVRAMKeys(NNSG3dResTex *texture, NNSG3dTexKey *texKey, NNSG3dTexKey *tex4x4Key, NNSG3dPlttKey *outPlttKey);
|
||||
static void SetKeysAndBindModelSet(NNSG3dResTex *texture, NNSG3dResMdlSet *modelSet, NNSG3dTexKey *texKey, NNSG3dTexKey *tex4x4Key, NNSG3dPlttKey *plttKey);
|
||||
static void FreeVRAMKeys(NNSG3dTexKey *texKey, NNSG3dTexKey *tex4x4Key, NNSG3dPlttKey *plttKey);
|
||||
static BOOL AreTexturesSameSize(const NNSG3dResTex *texture1, const NNSG3dResTex *texture2);
|
||||
static void Billboard_ResetVRAMTransfer(BillboardList *unused, Billboard *billboard);
|
||||
static void Billboard_AllocTextureAndSetModel(Billboard *billboard, const BillboardResources *resources);
|
||||
static void Billboard_InitAnimAndRequestTransfer(const BillboardList *list, Billboard *billboard, const BillboardResources *resources);
|
||||
static void SetBillboardModelSetAndAnimTexture(Billboard *billboard, const BillboardResources *resources);
|
||||
static void SetBillboardGfxSeqAndResetVRAMTransfer(Billboard *billboard, const BillboardResources *resources);
|
||||
|
||||
static BillboardList *sBillboardLists = NULL;
|
||||
static int sBillboardListCount = 0;
|
||||
|
||||
static void BillboardList_Reset(BillboardList *list)
|
||||
{
|
||||
list->active = FALSE;
|
||||
list->draw = FALSE;
|
||||
list->billboards = NULL;
|
||||
list->capacity = 0;
|
||||
list->freeBillboards = NULL;
|
||||
list->freeBillboardHead = 0;
|
||||
list->allocator = NULL;
|
||||
list->vramTransfer = NULL;
|
||||
list->redraw = BILLBOARD_REDRAW_NONE;
|
||||
}
|
||||
|
||||
void Billboard_Reset(Billboard *billboard)
|
||||
{
|
||||
billboard->list = NULL;
|
||||
billboard->anims = NULL;
|
||||
billboard->modelSet = NULL;
|
||||
billboard->model = NULL;
|
||||
billboard->texture = NULL;
|
||||
billboard->animTexture = NULL;
|
||||
|
||||
memset(&billboard->gfxSequence, 0, sizeof(BillboardGfxSequence));
|
||||
|
||||
billboard->texKey = NNS_GFD_ALLOC_ERROR_TEXKEY;
|
||||
billboard->tex4x4Key = NNS_GFD_ALLOC_ERROR_TEXKEY;
|
||||
billboard->plttKey = NNS_GFD_ALLOC_ERROR_PLTTKEY;
|
||||
billboard->vramTransfer = NULL;
|
||||
|
||||
VEC_Set(&billboard->pos, 0, 0, 0);
|
||||
VEC_Set(&billboard->scale, FX32_ONE, FX32_ONE, FX32_ONE);
|
||||
|
||||
billboard->rotMatrix = NULL;
|
||||
billboard->animNum = 0;
|
||||
billboard->state = BILLBOARD_STATE_INACTIVE;
|
||||
billboard->next = NULL;
|
||||
billboard->prev = NULL;
|
||||
billboard->draw = FALSE;
|
||||
billboard->callback = NULL;
|
||||
}
|
||||
|
||||
void BillboardLists_Create(int count, enum HeapID heapID)
|
||||
{
|
||||
GF_ASSERT(sBillboardLists == NULL);
|
||||
|
||||
sBillboardLists = Heap_Alloc(heapID, sizeof(BillboardList) * count);
|
||||
sBillboardListCount = count;
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
BillboardList_Reset(&sBillboardLists[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void BillboardLists_Delete(void)
|
||||
{
|
||||
for (int i = 0; i < sBillboardListCount; i++) {
|
||||
BillboardList_Delete(sBillboardLists + i);
|
||||
}
|
||||
|
||||
Heap_Free(sBillboardLists);
|
||||
|
||||
sBillboardLists = NULL;
|
||||
sBillboardListCount = 0;
|
||||
}
|
||||
|
||||
void BillboardLists_Draw(void)
|
||||
{
|
||||
for (int i = 0; i < sBillboardListCount; i++) {
|
||||
if (sBillboardLists[i].draw == TRUE) {
|
||||
BillboardList_Draw(&sBillboardLists[i]);
|
||||
}
|
||||
|
||||
if (sBillboardLists[i].redraw == BILLBOARD_REDRAW_NEEDED) {
|
||||
sBillboardLists[i].redraw = BILLBOARD_REDRAW_FINISHED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BillboardList *BillboardList_New(const BillboardListParams *params)
|
||||
{
|
||||
BillboardList *list = FindFirstFreeBillboardList();
|
||||
|
||||
if (list == NULL) {
|
||||
GF_ASSERT(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
list->active = TRUE;
|
||||
list->draw = TRUE;
|
||||
list->billboards = Heap_Alloc(params->heapID, sizeof(Billboard) * params->maxElements);
|
||||
list->capacity = params->maxElements;
|
||||
|
||||
Billboard_Reset(&list->sentinelData);
|
||||
|
||||
list->sentinelData.next = &list->sentinelData;
|
||||
list->sentinelData.prev = &list->sentinelData;
|
||||
list->freeBillboards = Heap_Alloc(params->heapID, sizeof(Billboard *) * params->maxElements);
|
||||
|
||||
BillboardList_InitBillboards(list);
|
||||
list->allocator = Heap_Alloc(params->heapID, sizeof(NNSFndAllocator));
|
||||
|
||||
HeapExp_FndInitAllocator(list->allocator, params->heapID, 4);
|
||||
list->vramTransfer = BillboardListVRAMTransfer_New(params->maxElements, params->heapID);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
BOOL BillboardList_Delete(BillboardList *list)
|
||||
{
|
||||
if (list == NULL) {
|
||||
GF_ASSERT(0);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (list->active) {
|
||||
BillboardList_DeleteAll(list);
|
||||
Heap_Free(list->billboards);
|
||||
Heap_Free(list->freeBillboards);
|
||||
Heap_Free(list->allocator);
|
||||
BillboardListVRAMTransfer_Free(list->vramTransfer);
|
||||
BillboardList_Reset(list);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL BillboardList_DeleteAll(BillboardList *list)
|
||||
{
|
||||
Billboard *billboard, *next;
|
||||
|
||||
if (list == NULL) {
|
||||
GF_ASSERT(list);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (list->active) {
|
||||
billboard = list->sentinelData.next;
|
||||
|
||||
while (billboard != &list->sentinelData) {
|
||||
next = billboard->next;
|
||||
Billboard_Delete(billboard);
|
||||
billboard = next;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL BillboardList_IsRedrawing(BillboardList *list)
|
||||
{
|
||||
GF_ASSERT(list);
|
||||
|
||||
if (list->redraw == BILLBOARD_REDRAW_NONE) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void BillboardList_ResetRedraw(BillboardList *list)
|
||||
{
|
||||
if (list->redraw == BILLBOARD_REDRAW_FINISHED) {
|
||||
list->redraw = BILLBOARD_REDRAW_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
static BillboardList *FindFirstFreeBillboardList(void)
|
||||
{
|
||||
for (int i = 0; i < sBillboardListCount; i++) {
|
||||
if (sBillboardLists[i].active == FALSE) {
|
||||
return &sBillboardLists[i];
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void BillboardList_Draw(BillboardList *list)
|
||||
{
|
||||
MtxFx33 identityMatrix;
|
||||
const MtxFx33 *rotMatrix;
|
||||
|
||||
GF_ASSERT(list);
|
||||
MTX_Identity33(&identityMatrix);
|
||||
|
||||
Billboard *billboard = list->sentinelData.next;
|
||||
|
||||
while (billboard != &list->sentinelData) {
|
||||
if (billboard->draw == TRUE) {
|
||||
if (billboard->callback != NULL) {
|
||||
billboard->callback(billboard, billboard->callbackParam);
|
||||
}
|
||||
|
||||
Billboard_SetKeysAndBindModelSet(billboard);
|
||||
|
||||
if (billboard->state == BILLBOARD_STATE_ACTIVE) {
|
||||
UpdateTexPlttAddressesForCurrentFrame(billboard);
|
||||
} else if (billboard->state == BILLBOARD_STATE_VRAM_TRANSFER) {
|
||||
Billboard_TryRequestVRAMTransfer(billboard);
|
||||
}
|
||||
|
||||
rotMatrix = billboard->rotMatrix;
|
||||
|
||||
if (rotMatrix == NULL) {
|
||||
rotMatrix = &identityMatrix;
|
||||
}
|
||||
|
||||
Easy3D_DrawRenderObj(&billboard->renderObj, &billboard->pos, rotMatrix, &billboard->scale);
|
||||
ReleaseVRAMKeysAndModelSet(billboard);
|
||||
}
|
||||
|
||||
billboard = billboard->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void AllocResourcesAndAppendBillboard(Billboard *billboard, const BillboardResources *resources)
|
||||
{
|
||||
BillboardList *list = billboard->list;
|
||||
|
||||
Billboard_ResetVRAMTransfer(list, billboard);
|
||||
Billboard_AllocTextureAndSetModel(billboard, resources);
|
||||
Billboard_InitAnimAndRequestTransfer(list, billboard, resources);
|
||||
|
||||
if (billboard->state == BILLBOARD_STATE_INITIALIZED) {
|
||||
AppendBillboardToList(&list->sentinelData, billboard);
|
||||
}
|
||||
|
||||
billboard->state = BILLBOARD_STATE_VRAM_TRANSFER;
|
||||
billboard->anims = resources->anims;
|
||||
billboard->animNum = 0;
|
||||
billboard->frameNum = 0;
|
||||
}
|
||||
|
||||
static void ResetResourcesAndAppendBillboard(Billboard *billboard, const BillboardResources *resources)
|
||||
{
|
||||
BillboardList *list = billboard->list;
|
||||
|
||||
Billboard_ResetVRAMTransfer(list, billboard);
|
||||
|
||||
if (billboard->state == BILLBOARD_STATE_VRAM_TRANSFER) {
|
||||
FreeVRAMKeys(&billboard->texKey, &billboard->tex4x4Key, &billboard->plttKey);
|
||||
}
|
||||
|
||||
billboard->texKey = resources->texKey;
|
||||
billboard->tex4x4Key = resources->tex4x4Key;
|
||||
billboard->plttKey = resources->plttKey;
|
||||
|
||||
SetBillboardModelSetAndAnimTexture(billboard, resources);
|
||||
SetBillboardGfxSeqAndResetVRAMTransfer(billboard, resources);
|
||||
|
||||
if (billboard->state == BILLBOARD_STATE_INITIALIZED) {
|
||||
AppendBillboardToList(&list->sentinelData, billboard);
|
||||
}
|
||||
|
||||
billboard->state = BILLBOARD_STATE_ACTIVE;
|
||||
billboard->anims = resources->anims;
|
||||
billboard->animNum = 0;
|
||||
billboard->frameNum = 0;
|
||||
}
|
||||
|
||||
static void AllocTextureVRAM(const NNSG3dResTex *texture, NNSG3dTexKey *texKey, NNSG3dTexKey *tex4x4Key, NNSG3dPlttKey *plttKey)
|
||||
{
|
||||
u32 texSize = NNS_G3dTexGetRequiredSize(texture);
|
||||
u32 tex4x4Size = NNS_G3dTex4x4GetRequiredSize(texture);
|
||||
u32 plttSize = NNS_G3dPlttGetRequiredSize(texture);
|
||||
|
||||
if (texSize > 0) {
|
||||
*texKey = NNS_GfdAllocTexVram(texSize, FALSE, 0);
|
||||
GF_ASSERT(*texKey != NNS_GFD_ALLOC_ERROR_TEXKEY);
|
||||
} else {
|
||||
*texKey = 0;
|
||||
}
|
||||
|
||||
if (tex4x4Size > 0) {
|
||||
*tex4x4Key = NNS_GfdAllocTexVram(tex4x4Size, TRUE, 0);
|
||||
GF_ASSERT(*tex4x4Key != NNS_GFD_ALLOC_ERROR_TEXKEY);
|
||||
} else {
|
||||
*tex4x4Key = 0;
|
||||
}
|
||||
|
||||
if (plttSize > 0) {
|
||||
*plttKey = NNS_GfdAllocPlttVram(plttSize, texture->tex4x4Info.flag & NNS_G3D_RESPLTT_USEPLTT4, 0);
|
||||
GF_ASSERT(*plttKey != NNS_GFD_ALLOC_ERROR_PLTTKEY);
|
||||
} else {
|
||||
*plttKey = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void ReleaseVRAMKeys(NNSG3dResTex *texture, NNSG3dTexKey *texKey, NNSG3dTexKey *tex4x4Key, NNSG3dPlttKey *outPlttKey)
|
||||
{
|
||||
NNS_G3dTexReleaseTexKey(texture, texKey, tex4x4Key);
|
||||
*outPlttKey = NNS_G3dPlttReleasePlttKey(texture);
|
||||
}
|
||||
|
||||
static void SetKeysAndBindModelSet(NNSG3dResTex *texture, NNSG3dResMdlSet *modelSet, NNSG3dTexKey *texKey, NNSG3dTexKey *tex4x4Key, NNSG3dPlttKey *plttKey)
|
||||
{
|
||||
NNS_G3dTexSetTexKey(texture, *texKey, *tex4x4Key);
|
||||
NNS_G3dPlttSetPlttKey(texture, *plttKey);
|
||||
NNS_G3dBindMdlSet(modelSet, texture);
|
||||
}
|
||||
|
||||
static void FreeVRAMKeys(NNSG3dTexKey *texKey, NNSG3dTexKey *tex4x4Key, NNSG3dPlttKey *plttKey)
|
||||
{
|
||||
if (*texKey != NNS_GFD_ALLOC_ERROR_TEXKEY) {
|
||||
NNS_GfdFreeTexVram(*texKey);
|
||||
}
|
||||
|
||||
if (*tex4x4Key != NNS_GFD_ALLOC_ERROR_TEXKEY) {
|
||||
NNS_GfdFreeTexVram(*tex4x4Key);
|
||||
}
|
||||
|
||||
if (*plttKey != NNS_GFD_ALLOC_ERROR_PLTTKEY) {
|
||||
NNS_GfdFreePlttVram(*plttKey);
|
||||
}
|
||||
}
|
||||
|
||||
static BOOL AreTexturesSameSize(const NNSG3dResTex *texture1, const NNSG3dResTex *texture2)
|
||||
{
|
||||
if (texture1 == NULL || texture2 == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u32 texSize1 = NNS_G3dTexGetRequiredSize(texture1);
|
||||
u32 tex4x4Size1 = NNS_G3dTex4x4GetRequiredSize(texture1);
|
||||
u32 plttSize1 = NNS_G3dPlttGetRequiredSize(texture1);
|
||||
u32 texSize2 = NNS_G3dTexGetRequiredSize(texture2);
|
||||
u32 tex4x4Size2 = NNS_G3dTex4x4GetRequiredSize(texture2);
|
||||
u32 plttSize2 = NNS_G3dPlttGetRequiredSize(texture2);
|
||||
|
||||
BOOL ret;
|
||||
if (texSize1 != texSize2 || tex4x4Size1 != tex4x4Size2 || plttSize1 != plttSize2) {
|
||||
ret = FALSE;
|
||||
} else {
|
||||
ret = TRUE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void Billboard_ResetVRAMTransfer(BillboardList *unused, Billboard *billboard)
|
||||
{
|
||||
if (billboard->vramTransfer) {
|
||||
BillboardVRAMTransfer_Reset(billboard->vramTransfer);
|
||||
billboard->vramTransfer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void Billboard_AllocTextureAndSetModel(Billboard *billboard, const BillboardResources *resources)
|
||||
{
|
||||
BOOL sameTexSize;
|
||||
NNSG3dResTex *originalTexture = billboard->texture;
|
||||
|
||||
billboard->modelSet = RetrieveBillboardResources(resources, &billboard->model, &billboard->texture);
|
||||
|
||||
NNS_G3dRenderObjInit(&billboard->renderObj, billboard->model);
|
||||
|
||||
if (billboard->state != BILLBOARD_STATE_ACTIVE) {
|
||||
sameTexSize = AreTexturesSameSize(originalTexture, billboard->texture);
|
||||
} else {
|
||||
sameTexSize = FALSE;
|
||||
}
|
||||
|
||||
if (sameTexSize == FALSE) {
|
||||
if (billboard->state == BILLBOARD_STATE_VRAM_TRANSFER) {
|
||||
FreeVRAMKeys(&billboard->texKey, &billboard->tex4x4Key, &billboard->plttKey);
|
||||
}
|
||||
|
||||
AllocTextureVRAM(billboard->texture, &billboard->texKey, &billboard->tex4x4Key, &billboard->plttKey);
|
||||
}
|
||||
}
|
||||
|
||||
static void Billboard_InitAnimAndRequestTransfer(const BillboardList *list, Billboard *billboard, const BillboardResources *resources)
|
||||
{
|
||||
billboard->animTexture = BillboardResources_GetTexture(resources);
|
||||
billboard->gfxSequence = resources->gfxSequence;
|
||||
billboard->vramTransfer = BillboardListVRAMTransfer_NewBillboardTransfer(list->vramTransfer, &billboard->gfxSequence, billboard->animTexture, billboard->texKey, billboard->plttKey, billboard->frameNum);
|
||||
}
|
||||
|
||||
static void SetBillboardModelSetAndAnimTexture(Billboard *billboard, const BillboardResources *resources)
|
||||
{
|
||||
billboard->modelSet = RetrieveBillboardResources(resources, &billboard->model, &billboard->texture);
|
||||
NNS_G3dRenderObjInit(&billboard->renderObj, billboard->model);
|
||||
billboard->animTexture = BillboardResources_GetTexture(resources);
|
||||
}
|
||||
|
||||
static void SetBillboardGfxSeqAndResetVRAMTransfer(Billboard *billboard, const BillboardResources *resources)
|
||||
{
|
||||
billboard->gfxSequence = resources->gfxSequence;
|
||||
billboard->vramTransfer = NULL;
|
||||
}
|
||||
|
||||
Billboard *BillboardList_Append(const BillboardTemplate *template)
|
||||
{
|
||||
if (template->list == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BillboardList *list = template->list;
|
||||
Billboard *billboard = BillboardList_AllocBillboard(list);
|
||||
|
||||
if (billboard == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
billboard->list = list;
|
||||
billboard->pos = template->pos;
|
||||
billboard->scale = template->scale;
|
||||
billboard->animNum = 0;
|
||||
billboard->draw = TRUE;
|
||||
billboard->state = BILLBOARD_STATE_INITIALIZED;
|
||||
|
||||
SetAndAppendBillboard(billboard, template->resources);
|
||||
|
||||
return billboard;
|
||||
}
|
||||
|
||||
BOOL Billboard_Delete(Billboard *billboard)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
GF_ASSERT(billboard->state != BILLBOARD_STATE_INITIALIZED);
|
||||
|
||||
BillboardList *list = billboard->list;
|
||||
|
||||
if (billboard->state == BILLBOARD_STATE_INACTIVE) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BillboardList_Remove(billboard);
|
||||
|
||||
if (billboard->state == BILLBOARD_STATE_VRAM_TRANSFER) {
|
||||
FreeVRAMKeys(&billboard->texKey, &billboard->tex4x4Key, &billboard->plttKey);
|
||||
}
|
||||
|
||||
Billboard_ResetVRAMTransfer(list, billboard);
|
||||
BillboardList_FreeBillboard(list, billboard);
|
||||
|
||||
list->redraw = BILLBOARD_REDRAW_NEEDED;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void BillboardResources_Set(BillboardResources *resources, void *modelRes, const NNSG3dResTex *texture, const BillboardAnim *anims, const BillboardGfxSequence *gfxSequence, NNSGfdTexKey texKey, NNSGfdTexKey tex4x4Key, NNSGfdPlttKey plttKey)
|
||||
{
|
||||
resources->modelRes = modelRes;
|
||||
resources->texture = texture;
|
||||
resources->anims = anims;
|
||||
resources->gfxSequence = *gfxSequence;
|
||||
resources->texKey = texKey;
|
||||
resources->tex4x4Key = tex4x4Key;
|
||||
resources->plttKey = plttKey;
|
||||
}
|
||||
|
||||
void BillboardResources_SetWithoutKeys(BillboardResources *resources, void *modelRes, const NNSG3dResTex *texture, const BillboardAnim *anims, const BillboardGfxSequence *gfxSequence)
|
||||
{
|
||||
resources->modelRes = modelRes;
|
||||
resources->texture = texture;
|
||||
resources->anims = anims;
|
||||
resources->gfxSequence = *gfxSequence;
|
||||
resources->texKey = NNS_GFD_ALLOC_ERROR_TEXKEY;
|
||||
resources->tex4x4Key = NNS_GFD_ALLOC_ERROR_TEXKEY;
|
||||
resources->plttKey = NNS_GFD_ALLOC_ERROR_PLTTKEY;
|
||||
}
|
||||
|
||||
void Billboard_SetPos(Billboard *billboard, const VecFx32 *pos)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
billboard->pos = *pos;
|
||||
}
|
||||
|
||||
const VecFx32 *Billboard_GetPos(const Billboard *billboard)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
return &billboard->pos;
|
||||
}
|
||||
|
||||
void Billboard_SetScale(Billboard *billboard, const VecFx32 *scale)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
billboard->scale = *scale;
|
||||
}
|
||||
|
||||
const VecFx32 *Billboard_GetScale(const Billboard *billboard)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
return &billboard->scale;
|
||||
}
|
||||
|
||||
void Billboard_SetRotMatrix(Billboard *billboard, const MtxFx33 *rotMatrix)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
billboard->rotMatrix = rotMatrix;
|
||||
}
|
||||
|
||||
const MtxFx33 *Billboard_GetRotMatrix(const Billboard *billboard)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
return billboard->rotMatrix;
|
||||
}
|
||||
|
||||
void Billboard_SetDrawFlag(Billboard *billboard, u8 draw)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
billboard->draw = draw;
|
||||
}
|
||||
|
||||
u8 Billboard_GetDrawFlag(const Billboard *billboard)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
return billboard->draw;
|
||||
}
|
||||
|
||||
void Billboard_SetAnimNum(Billboard *billboard, int animNum)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
billboard->animNum = animNum;
|
||||
}
|
||||
|
||||
int Billboard_GetAnimNum(const Billboard *billboard)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
return billboard->animNum;
|
||||
}
|
||||
|
||||
int Billboard_AdvanceAnim(Billboard *billboard, fx32 numFrames)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
|
||||
return GetAndAdvanceAnim(billboard, numFrames);
|
||||
}
|
||||
|
||||
void Billboard_SetFrameNum(Billboard *billboard, fx32 frameNum)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
billboard->frameNum = frameNum;
|
||||
}
|
||||
|
||||
fx32 Billboard_GetFrameNum(const Billboard *billboard)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
return billboard->frameNum;
|
||||
}
|
||||
|
||||
void Billboard_SetAnimFrameNum(Billboard *billboard, fx32 animFrameNum)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
|
||||
billboard->frameNum = GetAnimStartFrame(billboard, billboard->animNum);
|
||||
billboard->frameNum += animFrameNum;
|
||||
}
|
||||
|
||||
fx32 Billboard_GetAnimFrameNum(const Billboard *billboard)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
return billboard->frameNum - GetAnimStartFrame(billboard, billboard->animNum);
|
||||
}
|
||||
|
||||
NNSG3dResMdl *Billboard_GetModel(const Billboard *billboard)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
return billboard->model;
|
||||
}
|
||||
|
||||
int Billboard_GetState(const Billboard *billboard)
|
||||
{
|
||||
GF_ASSERT(billboard);
|
||||
return billboard->state;
|
||||
}
|
||||
|
||||
void Billboard_TryRequestVRAMTransfer(Billboard *billboard)
|
||||
{
|
||||
if (billboard->state == BILLBOARD_STATE_VRAM_TRANSFER) {
|
||||
BillboardVRAMTransfer_Request(billboard->vramTransfer, billboard->frameNum);
|
||||
}
|
||||
}
|
||||
|
||||
NNSG3dResMdl *Billboard_GetModel2(Billboard *billboard)
|
||||
{
|
||||
return billboard->model;
|
||||
}
|
||||
|
||||
NNSG3dResTex *Billboard_GetTexture(Billboard *billboard)
|
||||
{
|
||||
return billboard->texture;
|
||||
}
|
||||
|
||||
NNSG3dRenderObj *Billboard_GetRenderObj(Billboard *billboard)
|
||||
{
|
||||
return &billboard->renderObj;
|
||||
}
|
||||
|
||||
void Billboard_SetCallback(Billboard *billboard, BillboardCallback callback, void *callbackParam)
|
||||
{
|
||||
billboard->callbackParam = callbackParam;
|
||||
billboard->callback = callback;
|
||||
}
|
||||
|
||||
static void UpdateTexPlttAddressesForCurrentFrame(Billboard *billboard)
|
||||
{
|
||||
BillboardTexPlttIndex indexes = BillboardGfxSequence_GetTexPlttIndexAt(&billboard->gfxSequence, billboard->frameNum >> FX32_SHIFT);
|
||||
|
||||
UpdateModelTextureAddresses(billboard->model, billboard->animTexture, indexes.textureIdx);
|
||||
UpdateModelPlttAddresses(billboard->model, billboard->animTexture, indexes.plttIdx);
|
||||
}
|
||||
|
||||
static void UpdateModelTextureAddresses(NNSG3dResMdl *model, const NNSG3dResTex *texture, u8 textureIdx)
|
||||
{
|
||||
NNSG3dResMat *material = NNS_G3dGetMat(model);
|
||||
const NNSG3dResDict *textureDict = (NNSG3dResDict *)((u8 *)material + material->ofsDictTexToMatList);
|
||||
const NNSG3dResDictTexData *textureData = NNS_G3dGetTexDataByIdx(texture, textureIdx);
|
||||
u32 textureAddress = textureData->texImageParam & NNS_G3D_TEXIMAGE_PARAM_TEX_ADDR_MASK;
|
||||
|
||||
for (int i = 0; i < textureDict->numEntry; ++i) {
|
||||
const NNSG3dResDictTexToMatIdxData *texToMatDict = (NNSG3dResDictTexToMatIdxData *)NNS_G3dGetResDataByIdx(textureDict, i);
|
||||
|
||||
if (texToMatDict->flag & 1) {
|
||||
UpdateMaterialTextureAddresses(material, texToMatDict, textureAddress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void UpdateMaterialTextureAddresses(NNSG3dResMat *material, const NNSG3dResDictTexToMatIdxData *texToMatDict, u32 textureAddress)
|
||||
{
|
||||
u8 *texMaterials = (u8 *)material + texToMatDict->offset;
|
||||
|
||||
for (int i = 0; i < texToMatDict->numIdx; i++) {
|
||||
NNSG3dResMatData *materialData = NNS_G3dGetMatDataByIdx(material, *(texMaterials + i));
|
||||
GF_ASSERT((materialData->texImageParam & NNS_G3D_TEXIMAGE_PARAM_TEX_ADDR_MASK) + textureAddress <= NNS_G3D_TEXIMAGE_PARAM_TEX_ADDR_MASK);
|
||||
materialData->texImageParam += textureAddress;
|
||||
}
|
||||
}
|
||||
|
||||
static void UpdateModelPlttAddresses(NNSG3dResMdl *model, const NNSG3dResTex *texture, u8 plttIdx)
|
||||
{
|
||||
NNSG3dResMat *material = NNS_G3dGetMat(model);
|
||||
const NNSG3dResDict *plttDict = (NNSG3dResDict *)((u8 *)material + material->ofsDictPlttToMatList);
|
||||
const NNSG3dResDictPlttData *plttData = NNS_G3dGetPlttDataByIdx(texture, plttIdx);
|
||||
u32 plttAddress = plttData->offset;
|
||||
|
||||
if (!(plttData->flag & 1)) {
|
||||
plttAddress >>= 1;
|
||||
}
|
||||
|
||||
for (u32 i = 0; i < plttDict->numEntry; ++i) {
|
||||
const NNSG3dResDictPlttToMatIdxData *plttToMatDict = (NNSG3dResDictPlttToMatIdxData *)NNS_G3dGetResDataByIdx(plttDict, i);
|
||||
|
||||
if (plttToMatDict->flag & 1) {
|
||||
UpdateMaterialPlttAddresses(material, plttToMatDict, plttAddress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void UpdateMaterialPlttAddresses(NNSG3dResMat *material, const NNSG3dResDictPlttToMatIdxData *plttToMatDict, u32 plttAddress)
|
||||
{
|
||||
u8 *plttMaterials = (u8 *)material + plttToMatDict->offset;
|
||||
|
||||
for (u32 i = 0; i < plttToMatDict->numIdx; i++) {
|
||||
NNSG3dResMatData *materialData = NNS_G3dGetMatDataByIdx(material, *(plttMaterials + i));
|
||||
GF_ASSERT(((materialData->texPlttBase & REG_G3_TEXPLTT_BASE_PLTT_BASE_MASK) + plttAddress) <= REG_G3_TEXPLTT_BASE_PLTT_BASE_MASK);
|
||||
materialData->texPlttBase += plttAddress;
|
||||
}
|
||||
}
|
||||
|
||||
static void BillboardList_InitBillboards(BillboardList *list)
|
||||
{
|
||||
for (int i = 0; i < list->capacity; i++) {
|
||||
Billboard_Reset(&list->billboards[i]);
|
||||
list->freeBillboards[i] = list->billboards + i;
|
||||
}
|
||||
|
||||
list->freeBillboardHead = 0;
|
||||
}
|
||||
|
||||
static Billboard *BillboardList_AllocBillboard(BillboardList *list)
|
||||
{
|
||||
if (list->freeBillboardHead >= list->capacity) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Billboard *billboard = list->freeBillboards[list->freeBillboardHead];
|
||||
list->freeBillboardHead++;
|
||||
|
||||
return billboard;
|
||||
}
|
||||
|
||||
static BOOL BillboardList_FreeBillboard(BillboardList *list, Billboard *billboard)
|
||||
{
|
||||
if (list->freeBillboardHead <= 0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Billboard_Reset(billboard);
|
||||
|
||||
list->freeBillboardHead--;
|
||||
list->freeBillboards[list->freeBillboardHead] = billboard;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void AppendBillboardToList(Billboard *sentinel, Billboard *newBillboard)
|
||||
{
|
||||
newBillboard->prev = sentinel->prev;
|
||||
sentinel->prev->next = newBillboard;
|
||||
newBillboard->next = sentinel;
|
||||
sentinel->prev = newBillboard;
|
||||
}
|
||||
|
||||
static void BillboardList_Remove(Billboard *billboard)
|
||||
{
|
||||
billboard->prev->next = billboard->next;
|
||||
billboard->next->prev = billboard->prev;
|
||||
}
|
||||
|
||||
static NNSG3dResMdlSet *RetrieveBillboardResources(const BillboardResources *resources, NNSG3dResMdl **outModel, NNSG3dResTex **outTexture)
|
||||
{
|
||||
void *modelRes = BillboardResources_GetValue(resources, BILLBOARD_RESOURCE_MODEL_RES);
|
||||
NNSG3dResMdlSet *outModelSet = NNS_G3dGetMdlSet(modelRes);
|
||||
|
||||
*outModel = NNS_G3dGetMdlByIdx(outModelSet, 0);
|
||||
|
||||
if (outTexture) {
|
||||
*outTexture = NNS_G3dGetTex(modelRes);
|
||||
}
|
||||
|
||||
return outModelSet;
|
||||
}
|
||||
|
||||
static NNSG3dResTex *BillboardResources_GetTexture(const BillboardResources *resources)
|
||||
{
|
||||
NNSG3dResTex *texture = (NNSG3dResTex *)BillboardResources_GetValue(resources, BILLBOARD_RESOURCE_TEXTURE);
|
||||
return texture;
|
||||
}
|
||||
|
||||
static void SetAndAppendBillboard(Billboard *billboard, const BillboardResources *resources)
|
||||
{
|
||||
if (resources->texKey == NNS_GFD_ALLOC_ERROR_TEXKEY) {
|
||||
AllocResourcesAndAppendBillboard(billboard, resources);
|
||||
} else {
|
||||
ResetResourcesAndAppendBillboard(billboard, resources);
|
||||
}
|
||||
}
|
||||
|
||||
static fx32 GetAnimStartFrame(const Billboard *billboard, int animNum)
|
||||
{
|
||||
const BillboardAnim *anim = Billboard_GetAnimAt(billboard->anims, animNum);
|
||||
return anim->startFrame << FX32_SHIFT;
|
||||
}
|
||||
|
||||
static int GetAndAdvanceAnim(Billboard *billboard, fx32 numFrames)
|
||||
{
|
||||
const BillboardAnim *anim = Billboard_GetAnimAt(billboard->anims, billboard->animNum);
|
||||
return AdvanceAnim(anim, &billboard->frameNum, numFrames);
|
||||
}
|
||||
|
||||
static int AdvanceAnim(const BillboardAnim *anim, fx32 *currentFrame, fx32 numFrames)
|
||||
{
|
||||
int status = BILLBOARD_ANIM_STATUS_RUNNING;
|
||||
|
||||
if (anim->startFrame * FX32_ONE > *currentFrame || anim->endFrame * FX32_ONE < *currentFrame) {
|
||||
*currentFrame = anim->startFrame * FX32_ONE;
|
||||
} else if (anim->endFrame * FX32_ONE < *currentFrame + numFrames) {
|
||||
if (anim->animType == BILLBOARD_ANIM_TYPE_LOOP) {
|
||||
*currentFrame = anim->startFrame * FX32_ONE;
|
||||
} else {
|
||||
status = BILLBOARD_ANIM_STATUS_FINISHED;
|
||||
*currentFrame = anim->endFrame * FX32_ONE;
|
||||
}
|
||||
} else {
|
||||
*currentFrame += numFrames;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static void Billboard_SetKeysAndBindModelSet(Billboard *billboard)
|
||||
{
|
||||
SetKeysAndBindModelSet(billboard->texture, billboard->modelSet, &billboard->texKey, &billboard->tex4x4Key, &billboard->plttKey);
|
||||
}
|
||||
|
||||
static void ReleaseVRAMKeysAndModelSet(Billboard *billboard)
|
||||
{
|
||||
NNSG3dTexKey tex4x4Key, texKey;
|
||||
NNSG3dPlttKey dummyPlttKey;
|
||||
|
||||
NNS_G3dReleaseMdlSet(billboard->modelSet);
|
||||
ReleaseVRAMKeys(billboard->texture, &texKey, &tex4x4Key, &dummyPlttKey);
|
||||
}
|
||||
|
||||
static void *BillboardResources_GetValue(const BillboardResources *resources, int value)
|
||||
{
|
||||
void *ret;
|
||||
|
||||
switch (value) {
|
||||
case BILLBOARD_RESOURCE_MODEL_RES:
|
||||
ret = resources->modelRes;
|
||||
break;
|
||||
case BILLBOARD_RESOURCE_TEXTURE:
|
||||
ret = (void *)resources->texture;
|
||||
break;
|
||||
default:
|
||||
ret = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const BillboardAnim *Billboard_GetAnimAt(const BillboardAnim *anims, int index)
|
||||
{
|
||||
return anims + index;
|
||||
}
|
||||
32
src/billboard_gfx_sequence.c
Normal file
32
src/billboard_gfx_sequence.c
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#include "billboard_gfx_sequence.h"
|
||||
|
||||
BillboardTexPlttIndex BillboardGfxSequence_GetTexPlttIndexAt(const BillboardGfxSequence *gfxSequence, const u16 index)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < gfxSequence->seqCount - 1; i++) {
|
||||
if (gfxSequence->startFrame[i + 1] > index) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
BillboardTexPlttIndex outIndexes;
|
||||
outIndexes.textureIdx = gfxSequence->textureIdx[i];
|
||||
outIndexes.plttIdx = gfxSequence->plttIdx[i];
|
||||
|
||||
return outIndexes;
|
||||
}
|
||||
|
||||
void BillboardGfxSequence_SetData(const void *data, BillboardGfxSequence *gfxSequence)
|
||||
{
|
||||
const u8 *u8DataPtr = data;
|
||||
gfxSequence->seqCount = *((u32 *)u8DataPtr);
|
||||
|
||||
u8DataPtr += sizeof(u32);
|
||||
gfxSequence->startFrame = (u16 *)u8DataPtr;
|
||||
|
||||
u8DataPtr += sizeof(u16) * gfxSequence->seqCount;
|
||||
gfxSequence->textureIdx = u8DataPtr;
|
||||
|
||||
u8DataPtr += sizeof(u8) * gfxSequence->seqCount;
|
||||
gfxSequence->plttIdx = u8DataPtr;
|
||||
}
|
||||
211
src/billboard_vram_transfer.c
Normal file
211
src/billboard_vram_transfer.c
Normal file
|
|
@ -0,0 +1,211 @@
|
|||
#include "billboard_vram_transfer.h"
|
||||
|
||||
#include "ascii_util.h"
|
||||
#include "billboard.h"
|
||||
#include "heap.h"
|
||||
#include "vram_transfer.h"
|
||||
|
||||
static void RequestBillboardVRAMTransfer(BillboardVRAMTransfer *transfer, const u16 index);
|
||||
static void *GetBillboardTextureVRAMBuffer(BillboardVRAMTransfer *transfer, const BillboardTexPlttIndex *texPlttIndex);
|
||||
static void *GetBillboardPlttVRAMBuffer(BillboardVRAMTransfer *transfer, const BillboardTexPlttIndex *texPlttIndex);
|
||||
static void ResetBillboardVRAMTransfer(BillboardVRAMTransfer *transfer);
|
||||
static void RequestBillboardTextureVRAMTransfer(BillboardVRAMTransfer *transfer, const BillboardTexPlttIndex *texPlttIndexes);
|
||||
static void RequestBillboardPlttVRAMTransfer(BillboardVRAMTransfer *transfer, const BillboardTexPlttIndex *texPlttIndexes);
|
||||
|
||||
BillboardListVRAMTransfer *BillboardListVRAMTransfer_New(int maxElements, enum HeapID heapID)
|
||||
{
|
||||
BillboardListVRAMTransfer *listTransfer = Heap_Alloc(heapID, sizeof(BillboardListVRAMTransfer));
|
||||
listTransfer->billboardTransfers = Heap_Alloc(heapID, sizeof(BillboardVRAMTransfer) * maxElements);
|
||||
listTransfer->maxElements = maxElements;
|
||||
|
||||
for (int i = 0; i < listTransfer->maxElements; i++) {
|
||||
ResetBillboardVRAMTransfer(&listTransfer->billboardTransfers[i]);
|
||||
}
|
||||
|
||||
return listTransfer;
|
||||
}
|
||||
|
||||
void BillboardListVRAMTransfer_Free(BillboardListVRAMTransfer *listTransfer)
|
||||
{
|
||||
BillboardListVRAMTransfer_ResetAll(listTransfer);
|
||||
Heap_Free(listTransfer->billboardTransfers);
|
||||
Heap_Free(listTransfer);
|
||||
}
|
||||
|
||||
BillboardVRAMTransfer *BillboardListVRAMTransfer_NewBillboardTransfer(BillboardListVRAMTransfer *listTransfer, const BillboardGfxSequence *gfxSequence, const NNSG3dResTex *texture, NNSGfdTexKey texKey, NNSGfdPlttKey plttKey, const fx32 index)
|
||||
{
|
||||
BillboardVRAMTransfer *transfer = NULL;
|
||||
|
||||
for (int i = 0; i < listTransfer->maxElements; i++) {
|
||||
if (listTransfer->billboardTransfers[i].gfxSequence == NULL) {
|
||||
transfer = &listTransfer->billboardTransfers[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (transfer == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
transfer->gfxSequence = gfxSequence;
|
||||
transfer->texture = texture;
|
||||
transfer->texKey = texKey;
|
||||
transfer->plttKey = plttKey;
|
||||
transfer->textureIdx = -1;
|
||||
transfer->plttIdx = -1;
|
||||
|
||||
RequestBillboardVRAMTransfer(transfer, index >> FX32_SHIFT);
|
||||
|
||||
return transfer;
|
||||
}
|
||||
|
||||
void BillboardVRAMTransfer_Reset(BillboardVRAMTransfer *transfer)
|
||||
{
|
||||
ResetBillboardVRAMTransfer(transfer);
|
||||
}
|
||||
|
||||
void BillboardListVRAMTransfer_ResetAll(BillboardListVRAMTransfer *listTransfer)
|
||||
{
|
||||
for (int i = 0; i < listTransfer->maxElements; i++) {
|
||||
ResetBillboardVRAMTransfer(listTransfer->billboardTransfers + i);
|
||||
}
|
||||
}
|
||||
|
||||
void BillboardVRAMTransfer_Request(BillboardVRAMTransfer *transfer, const fx32 indexFx32)
|
||||
{
|
||||
u16 index = indexFx32 >> FX32_SHIFT;
|
||||
RequestBillboardVRAMTransfer(transfer, index);
|
||||
}
|
||||
|
||||
static void ResetBillboardVRAMTransfer(BillboardVRAMTransfer *transfer)
|
||||
{
|
||||
transfer->gfxSequence = NULL;
|
||||
transfer->texture = NULL;
|
||||
transfer->texKey = 0;
|
||||
transfer->plttKey = 0;
|
||||
transfer->textureIdx = 0;
|
||||
transfer->plttIdx = 0;
|
||||
}
|
||||
|
||||
static void RequestBillboardVRAMTransfer(BillboardVRAMTransfer *transfer, const u16 index)
|
||||
{
|
||||
BillboardTexPlttIndex texPlttIndexes = BillboardGfxSequence_GetTexPlttIndexAt(transfer->gfxSequence, index);
|
||||
|
||||
if (transfer->textureIdx != texPlttIndexes.textureIdx) {
|
||||
RequestBillboardTextureVRAMTransfer(transfer, &texPlttIndexes);
|
||||
}
|
||||
|
||||
if (transfer->plttIdx != texPlttIndexes.plttIdx) {
|
||||
RequestBillboardPlttVRAMTransfer(transfer, &texPlttIndexes);
|
||||
}
|
||||
}
|
||||
|
||||
static void RequestBillboardTextureVRAMTransfer(BillboardVRAMTransfer *transfer, const BillboardTexPlttIndex *texPlttIndexes)
|
||||
{
|
||||
void *buffer = GetBillboardTextureVRAMBuffer(transfer, texPlttIndexes);
|
||||
VramTransfer_Request(NNS_GFD_DST_3D_TEX_VRAM, NNS_GfdGetTexKeyAddr(transfer->texKey), buffer, NNS_GfdGetTexKeySize(transfer->texKey));
|
||||
transfer->textureIdx = texPlttIndexes->textureIdx;
|
||||
}
|
||||
|
||||
static void RequestBillboardPlttVRAMTransfer(BillboardVRAMTransfer *transfer, const BillboardTexPlttIndex *texPlttIndexes)
|
||||
{
|
||||
void *buffer = GetBillboardPlttVRAMBuffer(transfer, texPlttIndexes);
|
||||
VramTransfer_Request(NNS_GFD_DST_3D_TEX_PLTT, NNS_GfdGetPlttKeyAddr(transfer->plttKey), buffer, NNS_GfdGetPlttKeySize(transfer->plttKey));
|
||||
transfer->plttIdx = texPlttIndexes->plttIdx;
|
||||
}
|
||||
|
||||
static void *GetBillboardTextureVRAMBuffer(BillboardVRAMTransfer *transfer, const BillboardTexPlttIndex *texPlttIndex)
|
||||
{
|
||||
return GetTextureDataVRAMBuffer(transfer->texture, texPlttIndex->textureIdx);
|
||||
}
|
||||
|
||||
static void *GetBillboardPlttVRAMBuffer(BillboardVRAMTransfer *transfer, const BillboardTexPlttIndex *texPlttIndex)
|
||||
{
|
||||
return GetPlttDataVRAMBuffer(transfer->texture, texPlttIndex->plttIdx);
|
||||
}
|
||||
|
||||
void *GetTextureDataVRAMBuffer(NNSG3dResTex *texture, const u8 index)
|
||||
{
|
||||
const NNSG3dResDictTexData *textureData = NNS_G3dGetTexDataByIdx(texture, index);
|
||||
|
||||
if (textureData == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
u32 address = (textureData->texImageParam & NNS_G3D_TEXIMAGE_PARAM_TEX_ADDR_MASK) + texture->texInfo.vramKey;
|
||||
return (void *)((u8 *)texture + texture->texInfo.ofsTex + (address << 3));
|
||||
}
|
||||
|
||||
void *GetPlttDataVRAMBuffer(NNSG3dResTex *texture, const u8 index)
|
||||
{
|
||||
const NNSG3dResDictPlttData *plttData = NNS_G3dGetPlttDataByIdx(texture, index);
|
||||
|
||||
if (plttData == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return (void *)((u8 *)texture + texture->plttInfo.ofsPlttData + (plttData->offset << 3));
|
||||
}
|
||||
|
||||
static void *GetTextureDataBuffer(NNSG3dResTex *texture, const NNSG3dResDictTexData *textureData)
|
||||
{
|
||||
u32 address = (textureData->texImageParam & NNS_G3D_TEXIMAGE_PARAM_TEX_ADDR_MASK) << 3;
|
||||
address += NNS_GfdGetTexKeyAddr(texture->texInfo.vramKey);
|
||||
return (void *)address;
|
||||
}
|
||||
|
||||
void *GetTextureDataBufferFromResourceName(NNSG3dResTex *texture, const char *name)
|
||||
{
|
||||
NNSG3dResName resName;
|
||||
Ascii_SetResourceName(&resName, name);
|
||||
const NNSG3dResDictTexData *textureData = NNS_G3dGetTexDataByName(texture, &resName);
|
||||
|
||||
if (textureData == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return GetTextureDataBuffer(texture, textureData);
|
||||
}
|
||||
|
||||
static int CalcTextureDataSize(NNSG3dResTex *texture, const NNSG3dResDictTexData *textureData)
|
||||
{
|
||||
u32 textureFormat = (textureData->texImageParam & NNS_G3D_TEXIMAGE_PARAM_TEXFMT_MASK) >> NNS_G3D_TEXIMAGE_PARAM_TEXFMT_SHIFT;
|
||||
u32 texelSize;
|
||||
|
||||
switch (textureFormat) {
|
||||
case GX_TEXFMT_PLTT4:
|
||||
texelSize = 4;
|
||||
break;
|
||||
case GX_TEXFMT_PLTT16:
|
||||
texelSize = 2;
|
||||
break;
|
||||
case GX_TEXFMT_PLTT256:
|
||||
texelSize = 1;
|
||||
break;
|
||||
case GX_TEXFMT_A3I5:
|
||||
texelSize = 1;
|
||||
break;
|
||||
case GX_TEXFMT_A5I3:
|
||||
texelSize = 1;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 sSize = (textureData->texImageParam & NNS_G3D_TEXIMAGE_PARAM_S_SIZE_MASK) >> NNS_G3D_TEXIMAGE_PARAM_S_SIZE_SHIFT;
|
||||
sSize <<= 4;
|
||||
|
||||
u32 tSize = (textureData->texImageParam & NNS_G3D_TEXIMAGE_PARAM_T_SIZE_MASK) >> NNS_G3D_TEXIMAGE_PARAM_T_SIZE_SHIFT;
|
||||
tSize <<= 4;
|
||||
|
||||
return (sSize * tSize) / texelSize;
|
||||
}
|
||||
|
||||
int CalcTextureDataSizeFromResourceName(NNSG3dResTex *texture, const char *name)
|
||||
{
|
||||
NNSG3dResName resName;
|
||||
Ascii_SetResourceName(&resName, name);
|
||||
const NNSG3dResDictTexData *textureData = NNS_G3dGetTexDataByName(texture, &resName);
|
||||
|
||||
return CalcTextureDataSize(texture, textureData);
|
||||
}
|
||||
|
|
@ -72,7 +72,7 @@ pokeplatinum_c = files(
|
|||
'text.c',
|
||||
'vram_transfer.c',
|
||||
'cell_transfer.c',
|
||||
'unk_0201DD00.c',
|
||||
'billboard_vram_transfer.c',
|
||||
'grid_menu_cursor_position.c',
|
||||
'ascii_util.c',
|
||||
'fx_util.c',
|
||||
|
|
@ -81,7 +81,7 @@ pokeplatinum_c = files(
|
|||
'char_transfer.c',
|
||||
'pltt_transfer.c',
|
||||
'camera.c',
|
||||
'unk_02020AEC.c',
|
||||
'billboard.c',
|
||||
'sprite.c',
|
||||
'touch_screen.c',
|
||||
'timer.c',
|
||||
|
|
@ -89,7 +89,7 @@ pokeplatinum_c = files(
|
|||
'render_view.c',
|
||||
'font_manager.c',
|
||||
'touch_screen_actions.c',
|
||||
'unk_0202414C.c',
|
||||
'billboard_gfx_sequence.c',
|
||||
'unk_0202419C.c',
|
||||
'hardware_palette.c',
|
||||
'g3d_pipeline.c',
|
||||
|
|
|
|||
|
|
@ -4,18 +4,16 @@
|
|||
|
||||
#include "constants/field/field_effect_renderer.h"
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
|
||||
#include "overlay005/field_effect_manager.h"
|
||||
#include "overlay005/ov5_021ECC20.h"
|
||||
|
||||
#include "berry_patch_manager.h"
|
||||
#include "billboard.h"
|
||||
#include "map_object.h"
|
||||
#include "overworld_anim_manager.h"
|
||||
#include "simple3d.h"
|
||||
#include "unk_02020AEC.h"
|
||||
|
||||
// Berry patch moisture effect resource IDs
|
||||
#define BERRY_PATCH_MOISTURE_RESOURCE_COUNT 3
|
||||
|
|
@ -60,7 +58,7 @@ typedef struct BerryPatchSparkleEffect {
|
|||
int animationFrame;
|
||||
BOOL isAnimating;
|
||||
BerryPatchSparkleEffectContext context;
|
||||
UnkStruct_020216E0 *graphicsObject;
|
||||
Billboard *graphicsObject;
|
||||
} BerryPatchSparkleEffect;
|
||||
|
||||
static void BerryPatchGraphicsManager_InitResources(BerryPatchGraphicsManager *manager);
|
||||
|
|
@ -75,7 +73,7 @@ static void BerryPatchEffectCounter_CheckDisable(BerryPatchEffectCounter *counte
|
|||
static const OverworldAnimManagerFuncs sBerryPatchMoistureEffectDefinition;
|
||||
static const OverworldAnimManagerFuncs sBerryPatchSparkleEffectDefinition;
|
||||
static const u32 sBerryPatchMoistureResourceIDs[BERRY_PATCH_MOISTURE_RESOURCE_COUNT];
|
||||
static const UnkStruct_020217F4 sBerryPatchSparkleEffectData[];
|
||||
static const BillboardAnim sBerryPatchSparkleEffectData[];
|
||||
|
||||
void *BerryPatchGraphicsManager_New(FieldEffectManager *fieldEffMan)
|
||||
{
|
||||
|
|
@ -300,7 +298,7 @@ static void BerryPatchSparkleEffect_Free(OverworldAnimManager *effect, void *con
|
|||
{
|
||||
BerryPatchSparkleEffect *sparkleEffect = context;
|
||||
|
||||
sub_020211FC(sparkleEffect->graphicsObject);
|
||||
Billboard_Delete(sparkleEffect->graphicsObject);
|
||||
BerryPatchEffectCounter_Decrement(sparkleEffect->context.effectCounter);
|
||||
BerryPatchEffectCounter_CheckDisable(sparkleEffect->context.effectCounter);
|
||||
}
|
||||
|
|
@ -320,10 +318,10 @@ static void BerryPatchSparkleEffect_Update(OverworldAnimManager *effect, void *c
|
|||
return;
|
||||
}
|
||||
|
||||
sub_02021380(sparkleEffect->graphicsObject, 0);
|
||||
Billboard_SetFrameNum(sparkleEffect->graphicsObject, 0);
|
||||
}
|
||||
|
||||
if (sub_02021368(sparkleEffect->graphicsObject, animationSpeeds[sparkleEffect->animationFrame]) != 1) {
|
||||
if (Billboard_AdvanceAnim(sparkleEffect->graphicsObject, animationSpeeds[sparkleEffect->animationFrame]) != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -336,7 +334,7 @@ static void BerryPatchSparkleEffect_Render(OverworldAnimManager *effect, void *c
|
|||
BerryPatchSparkleEffect *sparkleEffect = context;
|
||||
|
||||
OverworldAnimManager_GetPosition(effect, &position);
|
||||
sub_020212A8(sparkleEffect->graphicsObject, &position);
|
||||
Billboard_SetPos(sparkleEffect->graphicsObject, &position);
|
||||
}
|
||||
|
||||
static const OverworldAnimManagerFuncs sBerryPatchSparkleEffectDefinition = {
|
||||
|
|
@ -355,7 +353,7 @@ static const u32 sBerryPatchMoistureResourceIDs[BERRY_PATCH_MOISTURE_RESOURCE_CO
|
|||
|
||||
// Sparkle effect configuration data for berry patches
|
||||
// Each entry defines: { model_variant, animation_frame_count, effect_type }
|
||||
static const UnkStruct_020217F4 sBerryPatchSparkleEffectData[] = {
|
||||
static const BillboardAnim sBerryPatchSparkleEffectData[] = {
|
||||
{ 0, 9, 1 }, // Animated sparkle effect (9 animation frames, type 1)
|
||||
{ 0, 0, 2 } // Static sparkle effect (no animation, type 2)
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,20 +5,14 @@
|
|||
|
||||
#include "constants/field/field_effect_renderer.h"
|
||||
|
||||
#include "struct_decls/struct_02020C44_decl.h"
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
#include "struct_defs/struct_02024184.h"
|
||||
|
||||
#include "field/field_system.h"
|
||||
#include "overlay005/area_light.h"
|
||||
#include "overlay005/field_effect_renderer.h"
|
||||
#include "overlay005/resource_heap.h"
|
||||
#include "overlay005/struct_ov5_021DF7F8.h"
|
||||
#include "overlay005/struct_ov5_021DF84C.h"
|
||||
#include "overlay005/struct_ov5_021EDDAC.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "heap.h"
|
||||
#include "map_object.h"
|
||||
#include "narc.h"
|
||||
|
|
@ -27,8 +21,6 @@
|
|||
#include "simple3d.h"
|
||||
#include "sys_task.h"
|
||||
#include "sys_task_manager.h"
|
||||
#include "unk_02020AEC.h"
|
||||
#include "unk_0202414C.h"
|
||||
|
||||
typedef struct UnkStruct_ov5_021DF8FC_t {
|
||||
enum HeapID heapID;
|
||||
|
|
@ -36,17 +28,17 @@ typedef struct UnkStruct_ov5_021DF8FC_t {
|
|||
u16 unk_06;
|
||||
u16 unk_08;
|
||||
u16 unk_0A;
|
||||
UnkStruct_02020C44 *unk_0C;
|
||||
BillboardList *unk_0C;
|
||||
ResourceHeap *modelResHeap;
|
||||
ResourceHeap *metadataResHeap;
|
||||
TextureResourceManager *texResMan;
|
||||
UnkStruct_ov5_021DF8C8 *unk_1C;
|
||||
UnkStruct_ov5_021DF84C *unk_20;
|
||||
BillboardResources *unk_20;
|
||||
} UnkStruct_ov5_021DF8FC;
|
||||
|
||||
typedef struct UnkStruct_ov5_021DF8C8_t {
|
||||
u32 unk_00;
|
||||
UnkStruct_ov5_021DF84C *unk_04;
|
||||
BillboardResources *unk_04;
|
||||
} UnkStruct_ov5_021DF8C8;
|
||||
|
||||
typedef struct FieldEffectTexture {
|
||||
|
|
@ -75,9 +67,9 @@ static void ov5_021DF754(FieldEffectManager *param0, enum HeapID heapID, u32 par
|
|||
static void ov5_021DF7C4(FieldEffectManager *fieldEffMan);
|
||||
static void ov5_021DF8C8(FieldEffectManager *fieldEffMan, UnkStruct_ov5_021DF8FC *graphicsManager, u32 objectCount);
|
||||
static void ov5_021DF8FC(UnkStruct_ov5_021DF8FC *graphicsManager);
|
||||
static UnkStruct_ov5_021DF84C *ov5_021DF9B4(UnkStruct_ov5_021DF8FC *graphicsManager, u32 id);
|
||||
static BillboardResources *ov5_021DF9B4(UnkStruct_ov5_021DF8FC *graphicsManager, u32 id);
|
||||
static void ov5_021DF910(UnkStruct_ov5_021DF8FC *graphicsManager, u32 id);
|
||||
static UnkStruct_ov5_021DF84C *ov5_021DF930(UnkStruct_ov5_021DF8FC *graphicsManager, u32 id, void *modelData, UnkStruct_02024184 *textureData, void *textureResource, TextureResource *texture, const UnkStruct_020217F4 *effectData);
|
||||
static BillboardResources *ov5_021DF930(UnkStruct_ov5_021DF8FC *graphicsManager, u32 id, void *modelData, BillboardGfxSequence *textureData, void *textureResource, TextureResource *texture, const BillboardAnim *effectData);
|
||||
static void UploadTextureResourceToVRamDuringVBlank(FieldEffectManager *fieldEffMan, u32 texID, TextureResourceManager *texResMan);
|
||||
static void UploadTextureResourceToVRamTask(SysTask *task, void *context);
|
||||
static void DiscardTextureDataTask(SysTask *task, void *context);
|
||||
|
|
@ -373,7 +365,7 @@ void FieldEffectManager_FinishAnimManager(OverworldAnimManager *animMan)
|
|||
static void ov5_021DF754(FieldEffectManager *param0, enum HeapID heapID, u32 param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8)
|
||||
{
|
||||
UnkStruct_ov5_021DF8FC *v0;
|
||||
UnkStruct_ov5_021EDDAC v1;
|
||||
BillboardListParams v1;
|
||||
|
||||
v0 = FieldEffectManager_HeapAllocInit(param0, (sizeof(UnkStruct_ov5_021DF8FC)), 0, 0);
|
||||
param0->unk_20 = v0;
|
||||
|
|
@ -389,9 +381,9 @@ static void ov5_021DF754(FieldEffectManager *param0, enum HeapID heapID, u32 par
|
|||
|
||||
ov5_021DF8C8(param0, v0, param2);
|
||||
|
||||
v1.unk_00 = param2;
|
||||
v1.maxElements = param2;
|
||||
v1.heapID = GetHeapID(param0);
|
||||
v0->unk_0C = sub_02020C44(&v1);
|
||||
v0->unk_0C = BillboardList_New(&v1);
|
||||
}
|
||||
|
||||
static void ov5_021DF7C4(FieldEffectManager *fieldEffMan)
|
||||
|
|
@ -399,7 +391,7 @@ static void ov5_021DF7C4(FieldEffectManager *fieldEffMan)
|
|||
UnkStruct_ov5_021DF8FC *v0 = fieldEffMan->unk_20;
|
||||
|
||||
if (v0 != NULL) {
|
||||
sub_02020CCC(v0->unk_0C);
|
||||
BillboardList_Delete(v0->unk_0C);
|
||||
ov5_021DF8FC(v0);
|
||||
ResourceHeap_Free(v0->modelResHeap);
|
||||
ResourceHeap_Free(v0->metadataResHeap);
|
||||
|
|
@ -410,48 +402,48 @@ static void ov5_021DF7C4(FieldEffectManager *fieldEffMan)
|
|||
}
|
||||
}
|
||||
|
||||
UnkStruct_020216E0 *ov5_021DF7F8(FieldEffectManager *param0, const UnkStruct_ov5_021DF84C *param1, const VecFx32 *param2)
|
||||
Billboard *ov5_021DF7F8(FieldEffectManager *param0, const BillboardResources *param1, const VecFx32 *param2)
|
||||
{
|
||||
UnkStruct_ov5_021DF7F8 v0;
|
||||
UnkStruct_020216E0 *v1;
|
||||
UnkStruct_02020C44 *v2;
|
||||
BillboardTemplate v0;
|
||||
Billboard *v1;
|
||||
BillboardList *v2;
|
||||
VecFx32 v3 = { FX32_ONE, FX32_ONE, FX32_ONE };
|
||||
|
||||
v2 = param0->unk_20->unk_0C;
|
||||
|
||||
v0.unk_00 = v2;
|
||||
v0.unk_04 = param1;
|
||||
v0.unk_08 = *param2;
|
||||
v0.unk_14 = v3;
|
||||
v0.list = v2;
|
||||
v0.resources = param1;
|
||||
v0.pos = *param2;
|
||||
v0.scale = v3;
|
||||
|
||||
v1 = sub_0202119C(&v0);
|
||||
v1 = BillboardList_Append(&v0);
|
||||
GF_ASSERT(v1 != NULL);
|
||||
|
||||
if (v1 != NULL) {
|
||||
NNS_G3dMdlSetMdlFogEnableFlagAll(sub_020213F4(v1), 1);
|
||||
AreaLight_UseGlobalModelAttributes(sub_020213F4(v1));
|
||||
NNS_G3dMdlSetMdlFogEnableFlagAll(Billboard_GetModel(v1), 1);
|
||||
AreaLight_UseGlobalModelAttributes(Billboard_GetModel(v1));
|
||||
}
|
||||
|
||||
return v1;
|
||||
}
|
||||
|
||||
UnkStruct_020216E0 *ov5_021DF84C(FieldEffectManager *param0, u32 param1, const VecFx32 *param2)
|
||||
Billboard *ov5_021DF84C(FieldEffectManager *param0, u32 param1, const VecFx32 *param2)
|
||||
{
|
||||
UnkStruct_ov5_021DF84C *v0 = ov5_021DF9B4(param0->unk_20, param1);
|
||||
BillboardResources *v0 = ov5_021DF9B4(param0->unk_20, param1);
|
||||
return ov5_021DF7F8(param0, v0, param2);
|
||||
}
|
||||
|
||||
UnkStruct_ov5_021DF84C *ov5_021DF864(FieldEffectManager *param0, u32 param1, u32 param2, u32 param3, u32 param4, int param5, const UnkStruct_020217F4 *param6)
|
||||
BillboardResources *ov5_021DF864(FieldEffectManager *param0, u32 param1, u32 param2, u32 param3, u32 param4, int param5, const BillboardAnim *param6)
|
||||
{
|
||||
void *v0, *v1, *v2;
|
||||
UnkStruct_02024184 v3;
|
||||
BillboardGfxSequence v3;
|
||||
TextureResource *v4;
|
||||
UnkStruct_ov5_021DF84C *v5;
|
||||
BillboardResources *v5;
|
||||
UnkStruct_ov5_021DF8FC *v6 = param0->unk_20;
|
||||
v0 = ResourceHeap_GetItemData(v6->modelResHeap, param2);
|
||||
v2 = ResourceHeap_GetItemData(v6->metadataResHeap, param3);
|
||||
|
||||
sub_02024184(v2, &v3);
|
||||
BillboardGfxSequence_SetData(v2, &v3);
|
||||
|
||||
v4 = TextureResourceManager_FindTextureResource(v6->texResMan, param4);
|
||||
GF_ASSERT(v4 != NULL);
|
||||
|
|
@ -469,10 +461,10 @@ UnkStruct_ov5_021DF84C *ov5_021DF864(FieldEffectManager *param0, u32 param1, u32
|
|||
|
||||
static void ov5_021DF8C8(FieldEffectManager *param0, UnkStruct_ov5_021DF8FC *param1, u32 param2)
|
||||
{
|
||||
UnkStruct_ov5_021DF84C *v0;
|
||||
BillboardResources *v0;
|
||||
UnkStruct_ov5_021DF8C8 *v1;
|
||||
|
||||
v0 = FieldEffectManager_HeapAlloc(param0, sizeof(UnkStruct_ov5_021DF84C) * param2, 0);
|
||||
v0 = FieldEffectManager_HeapAlloc(param0, sizeof(BillboardResources) * param2, 0);
|
||||
param1->unk_20 = v0;
|
||||
|
||||
v1 = FieldEffectManager_HeapAlloc(param0, (sizeof(UnkStruct_ov5_021DF8C8)) * param2, 0);
|
||||
|
|
@ -511,9 +503,9 @@ static void ov5_021DF910(UnkStruct_ov5_021DF8FC *param0, u32 param1)
|
|||
GF_ASSERT(FALSE);
|
||||
}
|
||||
|
||||
static UnkStruct_ov5_021DF84C *ov5_021DF930(UnkStruct_ov5_021DF8FC *param0, u32 param1, void *param2, UnkStruct_02024184 *param3, void *param4, TextureResource *param5, const UnkStruct_020217F4 *param6)
|
||||
static BillboardResources *ov5_021DF930(UnkStruct_ov5_021DF8FC *param0, u32 param1, void *param2, BillboardGfxSequence *param3, void *param4, TextureResource *param5, const BillboardAnim *param6)
|
||||
{
|
||||
UnkStruct_ov5_021DF84C *v0 = NULL;
|
||||
BillboardResources *v0 = NULL;
|
||||
|
||||
{
|
||||
u32 v1 = param0->unk_04;
|
||||
|
|
@ -544,23 +536,23 @@ static UnkStruct_ov5_021DF84C *ov5_021DF930(UnkStruct_ov5_021DF8FC *param0, u32
|
|||
}
|
||||
|
||||
GF_ASSERT(v0 != NULL);
|
||||
memset(v0, 0, sizeof(UnkStruct_ov5_021DF84C));
|
||||
memset(v0, 0, sizeof(BillboardResources));
|
||||
|
||||
v0->unk_00 = param2;
|
||||
v0->unk_0C = *param3;
|
||||
v0->unk_04 = param4;
|
||||
v0->modelRes = param2;
|
||||
v0->gfxSequence = *param3;
|
||||
v0->texture = param4;
|
||||
|
||||
if (param5 != NULL) {
|
||||
v0->unk_1C = TextureResource_GetTexKey(param5);
|
||||
v0->unk_20 = TextureResource_GetTex4x4Key(param5);
|
||||
v0->unk_24 = TextureResource_GetPaletteKey(param5);
|
||||
v0->texKey = TextureResource_GetTexKey(param5);
|
||||
v0->tex4x4Key = TextureResource_GetTex4x4Key(param5);
|
||||
v0->plttKey = TextureResource_GetPaletteKey(param5);
|
||||
}
|
||||
|
||||
v0->unk_08 = param6;
|
||||
v0->anims = param6;
|
||||
return v0;
|
||||
}
|
||||
|
||||
static UnkStruct_ov5_021DF84C *ov5_021DF9B4(UnkStruct_ov5_021DF8FC *param0, u32 param1)
|
||||
static BillboardResources *ov5_021DF9B4(UnkStruct_ov5_021DF8FC *param0, u32 param1)
|
||||
{
|
||||
u32 v0 = param0->unk_04;
|
||||
UnkStruct_ov5_021DF8C8 *v1 = param0->unk_1C;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
#include "constants/field/map_load.h"
|
||||
#include "constants/heap.h"
|
||||
|
||||
#include "struct_decls/struct_02020C44_decl.h"
|
||||
#include "struct_decls/struct_0203A790_decl.h"
|
||||
|
||||
#include "field/field_system.h"
|
||||
|
|
@ -47,6 +46,7 @@
|
|||
|
||||
#include "berry_patch_manager.h"
|
||||
#include "bg_window.h"
|
||||
#include "billboard.h"
|
||||
#include "camera.h"
|
||||
#include "char_transfer.h"
|
||||
#include "comm_player_manager.h"
|
||||
|
|
@ -78,7 +78,6 @@
|
|||
#include "screen_fade.h"
|
||||
#include "script_manager.h"
|
||||
#include "system.h"
|
||||
#include "unk_02020AEC.h"
|
||||
#include "unk_0202419C.h"
|
||||
#include "unk_020553DC.h"
|
||||
#include "unk_020559DC.h"
|
||||
|
|
@ -131,9 +130,9 @@ static void ov5_021D1A70(UnkStruct_ov5_021D1A68 *param0);
|
|||
static inline void inline_fieldmap(FieldSystem *fieldSystem)
|
||||
{
|
||||
UnkStruct_ov5_021ED0A4 *v0 = sub_0206285C(fieldSystem->mapObjMan);
|
||||
UnkStruct_02020C44 *v1 = ov5_021EDC8C(v0);
|
||||
BillboardList *v1 = ov5_021EDC8C(v0);
|
||||
|
||||
sub_02020D68(v1);
|
||||
BillboardList_ResetRedraw(v1);
|
||||
}
|
||||
|
||||
static void fieldmap(void *param0)
|
||||
|
|
@ -193,7 +192,7 @@ static BOOL FieldMap_Init(ApplicationManager *appMan, int *state)
|
|||
ov5_021D1414();
|
||||
|
||||
VramTransfer_New(128, HEAP_ID_FIELD1);
|
||||
sub_02020B90(4, HEAP_ID_FIELD1);
|
||||
BillboardLists_Create(4, HEAP_ID_FIELD1);
|
||||
Easy3D_Init(HEAP_ID_FIELD1);
|
||||
|
||||
ov5_021D15B4();
|
||||
|
|
@ -333,7 +332,7 @@ static BOOL FieldMap_Exit(ApplicationManager *appMan, int *param1)
|
|||
case 2:
|
||||
if (FieldSystem_IsBottomScreenDone(fieldSystem)) {
|
||||
ov5_021D15E8();
|
||||
sub_02020BD0();
|
||||
BillboardLists_Delete();
|
||||
VramTransfer_Free();
|
||||
Easy3D_Shutdown();
|
||||
ov5_021D1AE4(fieldSystem->unk_04->unk_04);
|
||||
|
|
@ -724,7 +723,7 @@ static void ov5_021D15F4(FieldSystem *fieldSystem)
|
|||
}
|
||||
|
||||
FieldEffectManager_Render(fieldSystem->fieldEffMan);
|
||||
sub_02020C08();
|
||||
BillboardLists_Draw();
|
||||
|
||||
if (FieldMap_InDistortionWorld(fieldSystem) == TRUE) {
|
||||
ov9_02250780(fieldSystem);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
#include "generated/game_records.h"
|
||||
#include "generated/movement_actions.h"
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_0205E884_decl.h"
|
||||
#include "struct_decls/struct_02061830_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
|
|
@ -28,6 +27,7 @@
|
|||
#include "overlay009/ov9_02249960.h"
|
||||
#include "overlay009/struct_ov9_0224F6EC_decl.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "encounter.h"
|
||||
#include "field_battle_data_transfer.h"
|
||||
#include "field_task.h"
|
||||
|
|
@ -164,7 +164,7 @@ static void MonRideTask_Init(FieldSystem *fieldSystem, Pokemon *partyMon, MonRid
|
|||
static void NewMonRideCutIn(FieldSystem *fieldSystem, MonRideTask *monRideTask);
|
||||
static BOOL CheckMonRideCutInFinished(MonRideTask *monRideTask);
|
||||
static void PlayerAvatar_Redraw(PlayerAvatar *playerAvatar, int param1);
|
||||
static void ov5_021E10C0(void *param0, const UnkStruct_020216E0 *param1);
|
||||
static void ov5_021E10C0(void *param0, const Billboard *param1);
|
||||
static MapObject *ov5_021E10D4(PlayerAvatar *playerAvatar, int param1);
|
||||
static void *MonRideTaskEnv_New(int size);
|
||||
static void MonRideTaskEnv_Free(void *taskEnv);
|
||||
|
|
@ -1736,7 +1736,7 @@ static void PlayerAvatar_Redraw(PlayerAvatar *playerAvatar, int param1)
|
|||
} else {
|
||||
int v1;
|
||||
FieldSystem *fieldSystem;
|
||||
UnkStruct_020216E0 *v3;
|
||||
Billboard *v3;
|
||||
|
||||
fieldSystem = MapObject_FieldSystem(v0);
|
||||
v1 = ov9_0224A520(fieldSystem, v0);
|
||||
|
|
@ -1748,7 +1748,7 @@ static void PlayerAvatar_Redraw(PlayerAvatar *playerAvatar, int param1)
|
|||
}
|
||||
}
|
||||
|
||||
static void ov5_021E10C0(void *param0, const UnkStruct_020216E0 *param1)
|
||||
static void ov5_021E10C0(void *param0, const Billboard *param1)
|
||||
{
|
||||
PlayerAvatar *playerAvatar = param0;
|
||||
MapObject *v1 = Player_MapObject(playerAvatar);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -3,24 +3,23 @@
|
|||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
|
||||
#include "overlay005/ov5_021ECE40.h"
|
||||
#include "overlay005/struct_ov5_021ECB8C_decl.h"
|
||||
#include "overlay005/struct_ov5_021ED01C.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "map_object.h"
|
||||
#include "unk_02020AEC.h"
|
||||
|
||||
typedef struct UnkStruct_ov5_021ECB8C_t {
|
||||
UnkStruct_020216E0 *unk_00;
|
||||
Billboard *unk_00;
|
||||
UnkStruct_ov5_021ED01C unk_04;
|
||||
};
|
||||
|
||||
static void ov5_021ECB90(MapObject *param0);
|
||||
static void ov5_021ECBA4(MapObject *param0);
|
||||
static void ov5_021ECBCC(MapObject *param0, UnkStruct_020216E0 *param1);
|
||||
static void ov5_021ECBCC(MapObject *param0, Billboard *param1);
|
||||
static void ov5_021ECC0C(MapObject *param0);
|
||||
|
||||
void ov5_021ECA70(MapObject *param0)
|
||||
|
|
@ -39,7 +38,7 @@ void ov5_021ECA70(MapObject *param0)
|
|||
void ov5_021ECA90(MapObject *param0)
|
||||
{
|
||||
UnkStruct_ov5_021ECB8C *v0 = sub_02062AF0(param0);
|
||||
UnkStruct_020216E0 *v1 = v0->unk_00;
|
||||
Billboard *v1 = v0->unk_00;
|
||||
|
||||
if (ov5_021EDD94(param0) == 1) {
|
||||
return;
|
||||
|
|
@ -50,7 +49,7 @@ void ov5_021ECA90(MapObject *param0)
|
|||
}
|
||||
|
||||
ov5_021ECBA4(param0);
|
||||
sub_02021368(v1, FX32_ONE);
|
||||
Billboard_AdvanceAnim(v1, FX32_ONE);
|
||||
}
|
||||
|
||||
void ov5_021ECABC(MapObject *param0)
|
||||
|
|
@ -105,7 +104,7 @@ void ov5_021ECB34(MapObject *param0)
|
|||
void ov5_021ECB58(MapObject *param0)
|
||||
{
|
||||
UnkStruct_ov5_021ECB8C *v0 = sub_02062AF0(param0);
|
||||
UnkStruct_020216E0 *v1 = v0->unk_00;
|
||||
Billboard *v1 = v0->unk_00;
|
||||
|
||||
if (ov5_021EDD94(param0) == 1) {
|
||||
return;
|
||||
|
|
@ -123,13 +122,13 @@ void ov5_021ECB78(MapObject *param0)
|
|||
ov5_021ECC0C(param0);
|
||||
}
|
||||
|
||||
UnkStruct_020216E0 *ov5_021ECB80(MapObject *param0)
|
||||
Billboard *ov5_021ECB80(MapObject *param0)
|
||||
{
|
||||
UnkStruct_ov5_021ECB8C *v0 = sub_02062AF0(param0);
|
||||
return ov5_021ECB8C(v0);
|
||||
}
|
||||
|
||||
UnkStruct_020216E0 *ov5_021ECB8C(UnkStruct_ov5_021ECB8C *param0)
|
||||
Billboard *ov5_021ECB8C(UnkStruct_ov5_021ECB8C *param0)
|
||||
{
|
||||
return param0->unk_00;
|
||||
}
|
||||
|
|
@ -144,14 +143,14 @@ static void ov5_021ECB90(MapObject *param0)
|
|||
static void ov5_021ECBA4(MapObject *param0)
|
||||
{
|
||||
UnkStruct_ov5_021ECB8C *v0 = sub_02062AF0(param0);
|
||||
UnkStruct_020216E0 *v1 = v0->unk_00;
|
||||
Billboard *v1 = v0->unk_00;
|
||||
|
||||
ov5_021EDEB4(param0, v1);
|
||||
sub_02021368(v1, (FX32_ONE));
|
||||
Billboard_AdvanceAnim(v1, (FX32_ONE));
|
||||
ov5_021ECBCC(param0, v1);
|
||||
}
|
||||
|
||||
static void ov5_021ECBCC(MapObject *param0, UnkStruct_020216E0 *param1)
|
||||
static void ov5_021ECBCC(MapObject *param0, Billboard *param1)
|
||||
{
|
||||
int v0 = 1;
|
||||
|
||||
|
|
@ -165,7 +164,7 @@ static void ov5_021ECBCC(MapObject *param0, UnkStruct_020216E0 *param1)
|
|||
}
|
||||
}
|
||||
|
||||
sub_02021320(param1, v0);
|
||||
Billboard_SetDrawFlag(param1, v0);
|
||||
}
|
||||
|
||||
static void ov5_021ECC0C(MapObject *param0)
|
||||
|
|
|
|||
|
|
@ -3,12 +3,8 @@
|
|||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_02020C44_decl.h"
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061830_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
#include "struct_defs/struct_02024184.h"
|
||||
|
||||
#include "overlay005/area_light.h"
|
||||
#include "overlay005/const_ov5_021FAF40.h"
|
||||
|
|
@ -24,21 +20,18 @@
|
|||
#include "overlay005/ov5_021ECC20.h"
|
||||
#include "overlay005/ov5_021F17B8.h"
|
||||
#include "overlay005/resource_heap.h"
|
||||
#include "overlay005/struct_ov5_021DF7F8.h"
|
||||
#include "overlay005/struct_ov5_021DF84C.h"
|
||||
#include "overlay005/struct_ov5_021ECD10.h"
|
||||
#include "overlay005/struct_ov5_021ED01C.h"
|
||||
#include "overlay005/struct_ov5_021ED0A4.h"
|
||||
#include "overlay005/struct_ov5_021ED110.h"
|
||||
#include "overlay005/struct_ov5_021ED2D0.h"
|
||||
#include "overlay005/struct_ov5_021EDD04.h"
|
||||
#include "overlay005/struct_ov5_021EDDAC.h"
|
||||
#include "overlay005/struct_ov5_021EDF3C.h"
|
||||
#include "overlay005/struct_ov5_021EDFBC.h"
|
||||
#include "overlay005/struct_ov5_021EE134.h"
|
||||
#include "overlay005/struct_ov5_021EE294.h"
|
||||
|
||||
#include "berry_patch_graphics.h"
|
||||
#include "billboard.h"
|
||||
#include "enums.h"
|
||||
#include "heap.h"
|
||||
#include "map_object.h"
|
||||
|
|
@ -49,8 +42,6 @@
|
|||
#include "resource_collection.h"
|
||||
#include "sys_task.h"
|
||||
#include "sys_task_manager.h"
|
||||
#include "unk_02020AEC.h"
|
||||
#include "unk_0202414C.h"
|
||||
|
||||
typedef enum {
|
||||
UnkEnum_ov5_021ED334_00 = 0,
|
||||
|
|
@ -64,9 +55,9 @@ typedef struct {
|
|||
void *unk_08;
|
||||
void *unk_0C;
|
||||
void *unk_10;
|
||||
UnkStruct_02024184 unk_14;
|
||||
UnkStruct_020216E0 *unk_24;
|
||||
UnkStruct_ov5_021DF84C unk_28;
|
||||
BillboardGfxSequence unk_14;
|
||||
Billboard *unk_24;
|
||||
BillboardResources unk_28;
|
||||
MapObject *unk_50;
|
||||
OverworldAnimManager *unk_54;
|
||||
void *unk_58;
|
||||
|
|
@ -76,7 +67,7 @@ typedef struct {
|
|||
static void ov5_021ED094(const MapObject *param0);
|
||||
static void ov5_021ED0A4(UnkStruct_ov5_021ED0A4 *param0, int param1);
|
||||
static void ov5_021ED0F0(UnkStruct_ov5_021ED0A4 *param0);
|
||||
static UnkStruct_ov5_021DF84C *ov5_021ED110(UnkStruct_ov5_021ED0A4 *param0, u32 param1);
|
||||
static BillboardResources *ov5_021ED110(UnkStruct_ov5_021ED0A4 *param0, u32 param1);
|
||||
static void ov5_021ED184(UnkStruct_ov5_021ED0A4 *param0, u32 param1);
|
||||
static void ov5_021ED1A4(UnkStruct_ov5_021ED0A4 *param0);
|
||||
static int ov5_021ED1C8(const MapObjectManager *param0, const MapObject *param1, int param2);
|
||||
|
|
@ -149,12 +140,12 @@ static void *ov5_021EDCF4(UnkStruct_ov5_021ED0A4 *param0, u32 param1, int param2
|
|||
static const UnkStruct_ov5_021EDD04 *ov5_021EDD04(int param0);
|
||||
static int ov5_021EDD2C(int param0);
|
||||
static int ov5_021EDD38(int param0);
|
||||
static const UnkStruct_020217F4 *ov5_021EDD44(int param0);
|
||||
static const BillboardAnim *ov5_021EDD44(int param0);
|
||||
static u32 ov5_021EDD50(int param0);
|
||||
static void ov5_021EDDAC(UnkStruct_ov5_021ED0A4 *param0, int param1);
|
||||
static void ov5_021EDDD4(UnkStruct_02020C44 *param0);
|
||||
static UnkStruct_020216E0 *ov5_021EDDDC(UnkStruct_02020C44 *param0, const UnkStruct_ov5_021DF84C *param1, const VecFx32 *param2, u32 param3);
|
||||
static void ov5_021EDE3C(UnkStruct_ov5_021ED0A4 *param0, u32 param1, UnkStruct_ov5_021DF84C *param2);
|
||||
static void ov5_021EDDD4(BillboardList *param0);
|
||||
static Billboard *ov5_021EDDDC(BillboardList *param0, const BillboardResources *param1, const VecFx32 *param2, u32 param3);
|
||||
static void ov5_021EDE3C(UnkStruct_ov5_021ED0A4 *param0, u32 param1, BillboardResources *param2);
|
||||
static UnkStruct_ov5_021ED0A4 *ov5_021EDEA8(const MapObject *param0);
|
||||
static int ov5_021EDF3C(UnkStruct_ov5_021ED0A4 *param0, int param1, u32 param2, int param3);
|
||||
static void ov5_021EDFBC(UnkStruct_ov5_021ED0A4 *param0, int param1);
|
||||
|
|
@ -165,14 +156,14 @@ static void ov5_021EE134(UnkStruct_ov5_021ED0A4 *param0, int param1);
|
|||
static void ov5_021EE170(UnkStruct_ov5_021ED0A4 *param0, int param1);
|
||||
static void ov5_021EE1AC(SysTask *param0, void *param1);
|
||||
static void ov5_021EE1E8(SysTask *param0, void *param1);
|
||||
static void ov5_021EE228(UnkStruct_ov5_021ED0A4 *param0, MapObject *param1, UnkStruct_020216E0 **param2, int param3);
|
||||
static void ov5_021EE228(UnkStruct_ov5_021ED0A4 *param0, MapObject *param1, Billboard **param2, int param3);
|
||||
static void ov5_021EE264(UnkStruct_ov5_021ED0A4 *param0, const MapObject *param1);
|
||||
static void ov5_021EE2C4(SysTask *param0, void *param1);
|
||||
static void ov5_021EE294(UnkStruct_ov5_021ED0A4 *param0);
|
||||
static void ov5_021EE2D0(UnkStruct_ov5_021ED0A4 *param0, UnkStruct_ov5_021EE294 *param1);
|
||||
static void ov5_021EE320(UnkStruct_ov5_021ED0A4 *param0, int param1, int param2);
|
||||
static void ov5_021EE3C4(UnkStruct_ov5_021ED0A4 *param0);
|
||||
static UnkStruct_020216E0 *ov5_021EE454(MapObject *param0, int param1, UnkFuncPtr_ov5_021EE454 param2, void *param3);
|
||||
static Billboard *ov5_021EE454(MapObject *param0, int param1, UnkFuncPtr_ov5_021EE454 param2, void *param3);
|
||||
static void ov5_021EE698(SysTask *param0, void *param1);
|
||||
|
||||
void ov5_021ECE40(UnkStruct_ov5_021ED0A4 *param0, const MapObjectManager *param1, int param2, int param3, int param4, int param5, const int *param6, int param7)
|
||||
|
|
@ -194,7 +185,7 @@ void ov5_021ECE94(UnkStruct_ov5_021ED0A4 *param0)
|
|||
ov5_021ED2AC(param0);
|
||||
}
|
||||
|
||||
int ov5_021ECEB4(MapObject *param0, UnkStruct_020216E0 **param1, int param2)
|
||||
int ov5_021ECEB4(MapObject *param0, Billboard **param1, int param2)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_ov5_021ED0A4 *v1;
|
||||
|
|
@ -218,7 +209,7 @@ int ov5_021ECEB4(MapObject *param0, UnkStruct_020216E0 **param1, int param2)
|
|||
return v0;
|
||||
}
|
||||
|
||||
int ov5_021ECF04(MapObject *param0, UnkStruct_020216E0 **param1)
|
||||
int ov5_021ECF04(MapObject *param0, Billboard **param1)
|
||||
{
|
||||
int v0 = MapObject_GetGraphicsID(param0);
|
||||
int v1 = ov5_021ECEB4(param0, param1, v0);
|
||||
|
|
@ -226,12 +217,12 @@ int ov5_021ECF04(MapObject *param0, UnkStruct_020216E0 **param1)
|
|||
return v1;
|
||||
}
|
||||
|
||||
UnkStruct_020216E0 *ov5_021ECF1C(MapObject *param0, int param1)
|
||||
Billboard *ov5_021ECF1C(MapObject *param0, int param1)
|
||||
{
|
||||
VecFx32 v0;
|
||||
UnkStruct_02020C44 *v1;
|
||||
UnkStruct_020216E0 *v2;
|
||||
UnkStruct_ov5_021DF84C *v3;
|
||||
BillboardList *v1;
|
||||
Billboard *v2;
|
||||
BillboardResources *v3;
|
||||
UnkStruct_ov5_021ED0A4 *v4 = ov5_021EDEA8(param0);
|
||||
v1 = ov5_021EDC8C(v4);
|
||||
|
||||
|
|
@ -248,11 +239,11 @@ UnkStruct_020216E0 *ov5_021ECF1C(MapObject *param0, int param1)
|
|||
return v2;
|
||||
}
|
||||
|
||||
void ov5_021ECF70(const MapObject *param0, UnkStruct_020216E0 **param1, int param2)
|
||||
void ov5_021ECF70(const MapObject *param0, Billboard **param1, int param2)
|
||||
{
|
||||
int v0;
|
||||
|
||||
sub_020211FC(*param1);
|
||||
Billboard_Delete(*param1);
|
||||
*param1 = NULL;
|
||||
|
||||
v0 = ov5_021ED1C8(MapObject_MapObjectManager(param0), param0, param2);
|
||||
|
|
@ -262,7 +253,7 @@ void ov5_021ECF70(const MapObject *param0, UnkStruct_020216E0 **param1, int para
|
|||
}
|
||||
}
|
||||
|
||||
void ov5_021ECFA4(const MapObject *param0, UnkStruct_020216E0 **param1)
|
||||
void ov5_021ECFA4(const MapObject *param0, Billboard **param1)
|
||||
{
|
||||
ov5_021ED094(param0);
|
||||
|
||||
|
|
@ -277,14 +268,14 @@ void ov5_021ECFA4(const MapObject *param0, UnkStruct_020216E0 **param1)
|
|||
}
|
||||
}
|
||||
|
||||
void ov5_021ECFD8(const MapObject *param0, UnkStruct_020216E0 **param1, int param2)
|
||||
void ov5_021ECFD8(const MapObject *param0, Billboard **param1, int param2)
|
||||
{
|
||||
int v0;
|
||||
|
||||
ov5_021ED094(param0);
|
||||
|
||||
if ((*param1) != NULL) {
|
||||
sub_020211FC(*param1);
|
||||
Billboard_Delete(*param1);
|
||||
*param1 = NULL;
|
||||
}
|
||||
|
||||
|
|
@ -297,21 +288,21 @@ void ov5_021ECFD8(const MapObject *param0, UnkStruct_020216E0 **param1, int para
|
|||
}
|
||||
}
|
||||
|
||||
void ov5_021ED01C(UnkStruct_020216E0 *param0, UnkStruct_ov5_021ED01C *param1)
|
||||
void ov5_021ED01C(Billboard *param0, UnkStruct_ov5_021ED01C *param1)
|
||||
{
|
||||
param1->unk_00 = sub_02021334(param0);
|
||||
param1->unk_02 = sub_02021358(param0);
|
||||
param1->unk_04 = sub_02021394(param0);
|
||||
param1->unk_00 = Billboard_GetDrawFlag(param0);
|
||||
param1->unk_02 = Billboard_GetAnimNum(param0);
|
||||
param1->unk_04 = Billboard_GetFrameNum(param0);
|
||||
}
|
||||
|
||||
void ov5_021ED03C(UnkStruct_020216E0 *param0, UnkStruct_ov5_021ED01C *param1)
|
||||
void ov5_021ED03C(Billboard *param0, UnkStruct_ov5_021ED01C *param1)
|
||||
{
|
||||
sub_02021320(param0, param1->unk_00);
|
||||
sub_02021344(param0, param1->unk_02);
|
||||
sub_02021380(param0, param1->unk_04);
|
||||
Billboard_SetDrawFlag(param0, param1->unk_00);
|
||||
Billboard_SetAnimNum(param0, param1->unk_02);
|
||||
Billboard_SetFrameNum(param0, param1->unk_04);
|
||||
}
|
||||
|
||||
void ov5_021ED060(MapObject *param0, UnkStruct_020216E0 **param1, int param2)
|
||||
void ov5_021ED060(MapObject *param0, Billboard **param1, int param2)
|
||||
{
|
||||
UnkStruct_ov5_021ED0A4 *v0 = ov5_021EDEA8(param0);
|
||||
|
||||
|
|
@ -332,10 +323,10 @@ static void ov5_021ED094(const MapObject *param0)
|
|||
static void ov5_021ED0A4(UnkStruct_ov5_021ED0A4 *param0, int param1)
|
||||
{
|
||||
int v0, v1;
|
||||
UnkStruct_ov5_021DF84C *v2;
|
||||
BillboardResources *v2;
|
||||
UnkStruct_ov5_021ED110 *v3;
|
||||
|
||||
v0 = sizeof(UnkStruct_ov5_021DF84C) * param1;
|
||||
v0 = sizeof(BillboardResources) * param1;
|
||||
v2 = Heap_Alloc(HEAP_ID_FIELD1, v0);
|
||||
|
||||
param0->unk_E4 = v2;
|
||||
|
|
@ -347,7 +338,7 @@ static void ov5_021ED0A4(UnkStruct_ov5_021ED0A4 *param0, int param1)
|
|||
param0->unk_F4 = v3;
|
||||
GF_ASSERT(v3 != NULL);
|
||||
|
||||
v1 = sizeof(UnkStruct_ov5_021DF84C);
|
||||
v1 = sizeof(BillboardResources);
|
||||
|
||||
do {
|
||||
v3->unk_00 = 0xffff;
|
||||
|
|
@ -366,7 +357,7 @@ static void ov5_021ED0F0(UnkStruct_ov5_021ED0A4 *param0)
|
|||
Heap_FreeExplicit(HEAP_ID_FIELD1, param0->unk_F4);
|
||||
}
|
||||
|
||||
static UnkStruct_ov5_021DF84C *ov5_021ED110(UnkStruct_ov5_021ED0A4 *param0, u32 param1)
|
||||
static BillboardResources *ov5_021ED110(UnkStruct_ov5_021ED0A4 *param0, u32 param1)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_ov5_021ED110 *v1 = param0->unk_F4;
|
||||
|
|
@ -398,7 +389,7 @@ static UnkStruct_ov5_021DF84C *ov5_021ED110(UnkStruct_ov5_021ED0A4 *param0, u32
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int ov5_021ED150(const MapObjectManager *param0, u32 param1, UnkStruct_ov5_021DF84C *param2)
|
||||
int ov5_021ED150(const MapObjectManager *param0, u32 param1, BillboardResources *param2)
|
||||
{
|
||||
int v0;
|
||||
const UnkStruct_ov5_021ED0A4 *v1 = sub_0206285C(param0);
|
||||
|
|
@ -1176,12 +1167,12 @@ void ov5_021EDBC4(const MapObjectManager *param0, int param1, MapObject *param2)
|
|||
}
|
||||
}
|
||||
|
||||
void ov5_021EDC84(UnkStruct_ov5_021ED0A4 *param0, UnkStruct_02020C44 *param1)
|
||||
void ov5_021EDC84(UnkStruct_ov5_021ED0A4 *param0, BillboardList *param1)
|
||||
{
|
||||
param0->unk_E0 = param1;
|
||||
}
|
||||
|
||||
UnkStruct_02020C44 *ov5_021EDC8C(UnkStruct_ov5_021ED0A4 *param0)
|
||||
BillboardList *ov5_021EDC8C(UnkStruct_ov5_021ED0A4 *param0)
|
||||
{
|
||||
return param0->unk_E0;
|
||||
}
|
||||
|
|
@ -1319,7 +1310,7 @@ static int ov5_021EDD38(int param0)
|
|||
return v0->unk_06;
|
||||
}
|
||||
|
||||
static const UnkStruct_020217F4 *ov5_021EDD44(int param0)
|
||||
static const BillboardAnim *ov5_021EDD44(int param0)
|
||||
{
|
||||
const UnkStruct_ov5_021EDD04 *v0 = ov5_021EDD04(param0);
|
||||
return v0->unk_08;
|
||||
|
|
@ -1359,78 +1350,78 @@ int ov5_021EDD94(MapObject *param0)
|
|||
|
||||
static void ov5_021EDDAC(UnkStruct_ov5_021ED0A4 *param0, int param1)
|
||||
{
|
||||
UnkStruct_ov5_021EDDAC v0;
|
||||
UnkStruct_02020C44 *v1;
|
||||
BillboardListParams v0;
|
||||
BillboardList *v1;
|
||||
|
||||
v0.unk_00 = param1;
|
||||
v0.maxElements = param1;
|
||||
v0.heapID = HEAP_ID_FIELD1;
|
||||
|
||||
v1 = sub_02020C44(&v0);
|
||||
v1 = BillboardList_New(&v0);
|
||||
ov5_021EDC84(param0, v1);
|
||||
ov5_021EDC94(param0, param1);
|
||||
}
|
||||
|
||||
static void ov5_021EDDD4(UnkStruct_02020C44 *param0)
|
||||
static void ov5_021EDDD4(BillboardList *param0)
|
||||
{
|
||||
sub_02020CCC(param0);
|
||||
BillboardList_Delete(param0);
|
||||
}
|
||||
|
||||
static UnkStruct_020216E0 *ov5_021EDDDC(UnkStruct_02020C44 *param0, const UnkStruct_ov5_021DF84C *param1, const VecFx32 *param2, u32 param3)
|
||||
static Billboard *ov5_021EDDDC(BillboardList *param0, const BillboardResources *param1, const VecFx32 *param2, u32 param3)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_ov5_021DF7F8 v1;
|
||||
UnkStruct_020216E0 *v2;
|
||||
BillboardTemplate v1;
|
||||
Billboard *v2;
|
||||
VecFx32 v3 = { FX32_ONE, FX32_ONE, FX32_ONE };
|
||||
|
||||
v1.unk_00 = param0;
|
||||
v1.unk_04 = param1;
|
||||
v1.unk_08 = *param2;
|
||||
v1.unk_14 = v3;
|
||||
v1.list = param0;
|
||||
v1.resources = param1;
|
||||
v1.pos = *param2;
|
||||
v1.scale = v3;
|
||||
|
||||
v2 = sub_0202119C(&v1);
|
||||
v2 = BillboardList_Append(&v1);
|
||||
|
||||
if (v2 != NULL) {
|
||||
sub_02021320(v2, 0);
|
||||
sub_02021344(v2, 0);
|
||||
sub_020213A4(v2, 0);
|
||||
NNS_G3dMdlSetMdlFogEnableFlagAll(sub_020213F4(v2), param3);
|
||||
AreaLight_UseGlobalModelAttributes(sub_020213F4(v2));
|
||||
Billboard_SetDrawFlag(v2, 0);
|
||||
Billboard_SetAnimNum(v2, 0);
|
||||
Billboard_SetAnimFrameNum(v2, 0);
|
||||
NNS_G3dMdlSetMdlFogEnableFlagAll(Billboard_GetModel(v2), param3);
|
||||
AreaLight_UseGlobalModelAttributes(Billboard_GetModel(v2));
|
||||
}
|
||||
|
||||
return v2;
|
||||
}
|
||||
|
||||
static void ov5_021EDE3C(UnkStruct_ov5_021ED0A4 *param0, u32 param1, UnkStruct_ov5_021DF84C *param2)
|
||||
static void ov5_021EDE3C(UnkStruct_ov5_021ED0A4 *param0, u32 param1, BillboardResources *param2)
|
||||
{
|
||||
{
|
||||
int v0 = ov5_021EDD2C(param1);
|
||||
void *v1 = ResourceHeap_GetItemData(param0->unk_F8, v0);
|
||||
|
||||
param2->unk_00 = v1;
|
||||
param2->modelRes = v1;
|
||||
}
|
||||
|
||||
{
|
||||
int v2 = ov5_021EDD38(param1);
|
||||
void *v3 = ResourceHeap_GetItemData(param0->unk_FC, v2);
|
||||
|
||||
sub_02024184(v3, ¶m2->unk_0C);
|
||||
BillboardGfxSequence_SetData(v3, ¶m2->gfxSequence);
|
||||
}
|
||||
|
||||
{
|
||||
TextureResourceManager *v4 = ov5_021EDCB0(param0);
|
||||
TextureResource *v5 = TextureResourceManager_FindTextureResource(v4, param1);
|
||||
|
||||
param2->unk_04 = TextureResource_GetUnderlyingResource(v5);
|
||||
param2->texture = TextureResource_GetUnderlyingResource(v5);
|
||||
|
||||
{
|
||||
param2->unk_1C = TextureResource_GetTexKey(v5);
|
||||
param2->unk_20 = TextureResource_GetTex4x4Key(v5);
|
||||
param2->unk_24 = TextureResource_GetPaletteKey(v5);
|
||||
param2->texKey = TextureResource_GetTexKey(v5);
|
||||
param2->tex4x4Key = TextureResource_GetTex4x4Key(v5);
|
||||
param2->plttKey = TextureResource_GetPaletteKey(v5);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
param2->unk_08 = ov5_021EDD44(param1);
|
||||
param2->anims = ov5_021EDD44(param1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1440,7 +1431,7 @@ static UnkStruct_ov5_021ED0A4 *ov5_021EDEA8(const MapObject *param0)
|
|||
return (UnkStruct_ov5_021ED0A4 *)sub_0206285C(v0);
|
||||
}
|
||||
|
||||
BOOL ov5_021EDEB4(MapObject *param0, UnkStruct_020216E0 *param1)
|
||||
BOOL ov5_021EDEB4(MapObject *param0, Billboard *param1)
|
||||
{
|
||||
BOOL v0;
|
||||
VecFx32 v1;
|
||||
|
|
@ -1451,12 +1442,12 @@ BOOL ov5_021EDEB4(MapObject *param0, UnkStruct_020216E0 *param1)
|
|||
v1.y += 0;
|
||||
v1.z += (FX32_ONE * 6);
|
||||
|
||||
sub_020212A8(param1, &v1);
|
||||
Billboard_SetPos(param1, &v1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ov5_021EDED8(MapObject *param0, UnkStruct_020216E0 *param1)
|
||||
void ov5_021EDED8(MapObject *param0, Billboard *param1)
|
||||
{
|
||||
int v0 = 1;
|
||||
|
||||
|
|
@ -1470,7 +1461,7 @@ void ov5_021EDED8(MapObject *param0, UnkStruct_020216E0 *param1)
|
|||
}
|
||||
}
|
||||
|
||||
sub_02021320(param1, v0);
|
||||
Billboard_SetDrawFlag(param1, v0);
|
||||
}
|
||||
|
||||
static const int Unk_ov5_021FF4C0[] = { 0, 1, 2, 3 };
|
||||
|
|
@ -1498,7 +1489,7 @@ static int ov5_021EDF3C(UnkStruct_ov5_021ED0A4 *param0, int param1, u32 param2,
|
|||
{
|
||||
UnkStruct_ov5_021EDF3C *v0 = param0->unk_100;
|
||||
|
||||
if ((v0->unk_04 >= v0->unk_02) || (sub_02020D50(param0->unk_E0) == 1)) {
|
||||
if ((v0->unk_04 >= v0->unk_02) || (BillboardList_IsRedrawing(param0->unk_E0) == 1)) {
|
||||
int v1 = 0;
|
||||
UnkStruct_ov5_021EDFBC *v2 = v0->unk_0C;
|
||||
|
||||
|
|
@ -1575,7 +1566,7 @@ static void ov5_021EE030(SysTask *param0, void *param1)
|
|||
UnkStruct_ov5_021EDFBC *v3 = v2->unk_0C;
|
||||
|
||||
{
|
||||
if (sub_02020D50(v1->unk_E0) == 1) {
|
||||
if (BillboardList_IsRedrawing(v1->unk_E0) == 1) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -1723,7 +1714,7 @@ static void ov5_021EE1E8(SysTask *param0, void *param1)
|
|||
v2->unk_06 = 0;
|
||||
}
|
||||
|
||||
static void ov5_021EE228(UnkStruct_ov5_021ED0A4 *param0, MapObject *param1, UnkStruct_020216E0 **param2, int param3)
|
||||
static void ov5_021EE228(UnkStruct_ov5_021ED0A4 *param0, MapObject *param1, Billboard **param2, int param3)
|
||||
{
|
||||
int v0 = 0;
|
||||
UnkStruct_ov5_021EDF3C *v1 = param0->unk_100;
|
||||
|
|
@ -1857,7 +1848,7 @@ static void ov5_021EE3C4(UnkStruct_ov5_021ED0A4 *param0)
|
|||
param0->unk_100 = NULL;
|
||||
}
|
||||
|
||||
UnkStruct_020216E0 *ov5_021EE3FC(MapObject *param0, int param1, UnkFuncPtr_ov5_021EE454 param2, void *param3)
|
||||
Billboard *ov5_021EE3FC(MapObject *param0, int param1, UnkFuncPtr_ov5_021EE454 param2, void *param3)
|
||||
{
|
||||
if ((ov5_021EDD94(param0) == 1) || (ov5_021EB1A0(param0) == NULL)) {
|
||||
int v0 = MapObject_GetGraphicsID(param0);
|
||||
|
|
@ -1872,16 +1863,16 @@ UnkStruct_020216E0 *ov5_021EE3FC(MapObject *param0, int param1, UnkFuncPtr_ov5_0
|
|||
return ov5_021EE454(param0, param1, param2, param3);
|
||||
}
|
||||
|
||||
static UnkStruct_020216E0 *ov5_021EE454(MapObject *param0, int param1, UnkFuncPtr_ov5_021EE454 param2, void *param3)
|
||||
static Billboard *ov5_021EE454(MapObject *param0, int param1, UnkFuncPtr_ov5_021EE454 param2, void *param3)
|
||||
{
|
||||
VecFx32 v0;
|
||||
int v1, v2, v3, v4;
|
||||
TextureResource *v5;
|
||||
UnkStruct_020216E0 *v6;
|
||||
Billboard *v6;
|
||||
const UnkStruct_ov5_021ED2D0 *v7;
|
||||
UnkStruct_ov5_021ED0A4 *v8 = ov5_021EDEA8(param0);
|
||||
UnkStruct_02020C44 *v9 = ov5_021EDC8C(v8);
|
||||
UnkStruct_020216E0 *v10 = ov5_021EB1A0(param0);
|
||||
BillboardList *v9 = ov5_021EDC8C(v8);
|
||||
Billboard *v10 = ov5_021EB1A0(param0);
|
||||
UnkStruct_ov5_021EE698 *v11 = Heap_AllocAtEnd(HEAP_ID_FIELD1, sizeof(UnkStruct_ov5_021EE698));
|
||||
|
||||
memset(v11, 0, sizeof(UnkStruct_ov5_021EE698));
|
||||
|
|
@ -1925,7 +1916,7 @@ static UnkStruct_020216E0 *ov5_021EE454(MapObject *param0, int param1, UnkFuncPt
|
|||
|
||||
GF_ASSERT(v7->unk_00 != 0xffff);
|
||||
v11->unk_0C = ov5_021EDCF4(v8, v7->unk_04, 0);
|
||||
sub_02024184(v11->unk_0C, &v11->unk_14);
|
||||
BillboardGfxSequence_SetData(v11->unk_0C, &v11->unk_14);
|
||||
}
|
||||
|
||||
{
|
||||
|
|
@ -1946,10 +1937,10 @@ static UnkStruct_020216E0 *ov5_021EE454(MapObject *param0, int param1, UnkFuncPt
|
|||
v11->unk_10 = ov5_021EDCF4(v8, v7->unk_04, 0);
|
||||
}
|
||||
|
||||
sub_02021284(&v11->unk_28, v11->unk_08, NNS_G3dGetTex(v11->unk_10), ov5_021EDD44(v2), &v11->unk_14);
|
||||
BillboardResources_SetWithoutKeys(&v11->unk_28, v11->unk_08, NNS_G3dGetTex(v11->unk_10), ov5_021EDD44(v2), &v11->unk_14);
|
||||
|
||||
{
|
||||
const VecFx32 *v8 = sub_020212C0(v10);
|
||||
const VecFx32 *v8 = Billboard_GetPos(v10);
|
||||
|
||||
v0 = *v8;
|
||||
v11->unk_24 = ov5_021EDDDC(v9, &v11->unk_28, &v0, ov5_021EDD50(v2));
|
||||
|
|
@ -1957,13 +1948,13 @@ static UnkStruct_020216E0 *ov5_021EE454(MapObject *param0, int param1, UnkFuncPt
|
|||
v6 = v11->unk_24;
|
||||
}
|
||||
|
||||
sub_020212FC(v11->unk_24, sub_02021310(v10));
|
||||
sub_02021344(v11->unk_24, sub_02021358(v10));
|
||||
sub_020213A4(v11->unk_24, sub_020213D4(v10));
|
||||
sub_02021380(v11->unk_24, sub_02021394(v10));
|
||||
sub_02021368(v11->unk_24, 0);
|
||||
sub_02021320(v11->unk_24, 1);
|
||||
sub_02021414(v11->unk_24);
|
||||
Billboard_SetRotMatrix(v11->unk_24, Billboard_GetRotMatrix(v10));
|
||||
Billboard_SetAnimNum(v11->unk_24, Billboard_GetAnimNum(v10));
|
||||
Billboard_SetAnimFrameNum(v11->unk_24, Billboard_GetAnimFrameNum(v10));
|
||||
Billboard_SetFrameNum(v11->unk_24, Billboard_GetFrameNum(v10));
|
||||
Billboard_AdvanceAnim(v11->unk_24, 0);
|
||||
Billboard_SetDrawFlag(v11->unk_24, 1);
|
||||
Billboard_TryRequestVRAMTransfer(v11->unk_24);
|
||||
|
||||
{
|
||||
if (sub_02062F64(param0) == 1) {
|
||||
|
|
@ -1997,7 +1988,7 @@ static UnkStruct_020216E0 *ov5_021EE454(MapObject *param0, int param1, UnkFuncPt
|
|||
ov5_021EE698(v17, v11);
|
||||
}
|
||||
|
||||
if (sub_02021404(v11->unk_24) == 0) {
|
||||
if (Billboard_GetState(v11->unk_24) == 0) {
|
||||
v6 = NULL;
|
||||
} else {
|
||||
v11->unk_58 = param3;
|
||||
|
|
@ -2024,7 +2015,7 @@ static void ov5_021EE698(SysTask *param0, void *param1)
|
|||
OverworldAnimManager_Finish(v0->unk_54);
|
||||
}
|
||||
|
||||
sub_020211FC(v0->unk_24);
|
||||
Billboard_Delete(v0->unk_24);
|
||||
Heap_Free(v0->unk_08);
|
||||
Heap_Free(v0->unk_0C);
|
||||
Heap_Free(v0->unk_10);
|
||||
|
|
@ -2048,7 +2039,7 @@ static void ov5_021EE698(SysTask *param0, void *param1)
|
|||
OverworldAnimManager_Finish(v0->unk_54);
|
||||
}
|
||||
|
||||
sub_020211FC(v0->unk_24);
|
||||
Billboard_Delete(v0->unk_24);
|
||||
Heap_Free(v0->unk_08);
|
||||
Heap_Free(v0->unk_0C);
|
||||
Heap_Free(v0->unk_10);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061830_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
|
||||
|
|
@ -11,13 +10,12 @@
|
|||
#include "overlay005/field_effect_manager.h"
|
||||
#include "overlay005/ov5_021EB1A0.h"
|
||||
#include "overlay005/ov5_021ECE40.h"
|
||||
#include "overlay005/struct_ov5_021DF84C.h"
|
||||
|
||||
#include "berry_patch_graphics.h"
|
||||
#include "billboard.h"
|
||||
#include "map_object.h"
|
||||
#include "map_object_move.h"
|
||||
#include "overworld_anim_manager.h"
|
||||
#include "unk_02020AEC.h"
|
||||
|
||||
typedef struct {
|
||||
FieldEffectManager *unk_00;
|
||||
|
|
@ -37,7 +35,7 @@ typedef struct {
|
|||
int unk_0C;
|
||||
int unk_10;
|
||||
UnkStruct_ov5_021F1800 unk_14;
|
||||
UnkStruct_020216E0 *unk_24;
|
||||
Billboard *unk_24;
|
||||
VecFx32 unk_28;
|
||||
fx32 unk_34;
|
||||
} UnkStruct_ov5_021F1A24;
|
||||
|
|
@ -46,14 +44,14 @@ typedef struct {
|
|||
FieldSystem *fieldSystem;
|
||||
FieldEffectManager *unk_04;
|
||||
UnkStruct_ov5_021F17E4 *unk_08;
|
||||
UnkStruct_ov5_021DF84C unk_0C;
|
||||
const UnkStruct_020216E0 *unk_34;
|
||||
BillboardResources unk_0C;
|
||||
const Billboard *unk_34;
|
||||
} UnkStruct_ov5_021F1BEC;
|
||||
|
||||
typedef struct {
|
||||
int unk_00;
|
||||
UnkStruct_ov5_021F1BEC unk_04;
|
||||
UnkStruct_020216E0 *unk_3C;
|
||||
Billboard *unk_3C;
|
||||
VecFx32 unk_40;
|
||||
fx32 unk_4C;
|
||||
VecFx32 unk_50;
|
||||
|
|
@ -151,7 +149,7 @@ static void ov5_021F18D0(OverworldAnimManager *param0, void *param1)
|
|||
UnkStruct_ov5_021F1A24 *v0 = param1;
|
||||
|
||||
if (v0->unk_0C == 1) {
|
||||
sub_020211FC(v0->unk_24);
|
||||
Billboard_Delete(v0->unk_24);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -218,25 +216,25 @@ static void ov5_021F1978(OverworldAnimManager *param0, void *param1)
|
|||
}
|
||||
|
||||
if (MapObject_IsHidden(v1) == 1) {
|
||||
sub_02021320(v0->unk_24, 0);
|
||||
Billboard_SetDrawFlag(v0->unk_24, 0);
|
||||
} else {
|
||||
sub_02021320(v0->unk_24, 1);
|
||||
Billboard_SetDrawFlag(v0->unk_24, 1);
|
||||
}
|
||||
|
||||
{
|
||||
VecFx32 v3;
|
||||
|
||||
OverworldAnimManager_GetPosition(param0, &v3);
|
||||
sub_020212A8(v0->unk_24, &v3);
|
||||
Billboard_SetPos(v0->unk_24, &v3);
|
||||
}
|
||||
|
||||
sub_020212D0(v0->unk_24, &v0->unk_28);
|
||||
Billboard_SetScale(v0->unk_24, &v0->unk_28);
|
||||
|
||||
{
|
||||
UnkStruct_020216E0 *v4 = ov5_021EB1A0(v0->unk_14.unk_0C);
|
||||
Billboard *v4 = ov5_021EB1A0(v0->unk_14.unk_0C);
|
||||
|
||||
sub_02021344(v0->unk_24, sub_02021358(v4));
|
||||
sub_02021380(v0->unk_24, sub_02021394(v4));
|
||||
Billboard_SetAnimNum(v0->unk_24, Billboard_GetAnimNum(v4));
|
||||
Billboard_SetFrameNum(v0->unk_24, Billboard_GetFrameNum(v4));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -280,7 +278,7 @@ static void ov5_021F1A8C(OverworldAnimManager *param0, UnkStruct_ov5_021F1A24 *p
|
|||
int v0;
|
||||
void *v1;
|
||||
VecFx32 v2;
|
||||
UnkStruct_ov5_021DF84C v3;
|
||||
BillboardResources v3;
|
||||
|
||||
{
|
||||
const MapObjectManager *v4 = MapObject_MapObjectManager(param1->unk_14.unk_0C);
|
||||
|
|
@ -295,7 +293,7 @@ static void ov5_021F1A8C(OverworldAnimManager *param0, UnkStruct_ov5_021F1A24 *p
|
|||
}
|
||||
|
||||
v1 = ov5_021DF9FC(param1->unk_14.unk_04, 2);
|
||||
v3.unk_00 = v1;
|
||||
v3.modelRes = v1;
|
||||
|
||||
OverworldAnimManager_GetPosition(param0, &v2);
|
||||
|
||||
|
|
@ -310,22 +308,22 @@ static void ov5_021F1AD8(OverworldAnimManager *param0, UnkStruct_ov5_021F1AD8 *p
|
|||
int v0;
|
||||
void *v1;
|
||||
VecFx32 v2;
|
||||
UnkStruct_ov5_021DF84C v3 = param1->unk_04.unk_0C;
|
||||
BillboardResources v3 = param1->unk_04.unk_0C;
|
||||
|
||||
v1 = ov5_021DF9FC(param1->unk_04.unk_04, 2);
|
||||
v3.unk_00 = v1;
|
||||
v3.modelRes = v1;
|
||||
|
||||
OverworldAnimManager_GetPosition(param0, &v2);
|
||||
param1->unk_3C = ov5_021DF7F8(param1->unk_04.unk_04, &v3, &v2);
|
||||
|
||||
{
|
||||
const UnkStruct_020216E0 *v4 = param1->unk_04.unk_34;
|
||||
const Billboard *v4 = param1->unk_04.unk_34;
|
||||
|
||||
sub_02021344(param1->unk_3C, sub_02021358(v4));
|
||||
sub_020213A4(param1->unk_3C, sub_020213D4(v4));
|
||||
sub_02021380(param1->unk_3C, sub_02021394(v4));
|
||||
sub_02021368(param1->unk_3C, 0);
|
||||
sub_02021414(param1->unk_3C);
|
||||
Billboard_SetAnimNum(param1->unk_3C, Billboard_GetAnimNum(v4));
|
||||
Billboard_SetAnimFrameNum(param1->unk_3C, Billboard_GetAnimFrameNum(v4));
|
||||
Billboard_SetFrameNum(param1->unk_3C, Billboard_GetFrameNum(v4));
|
||||
Billboard_AdvanceAnim(param1->unk_3C, 0);
|
||||
Billboard_TryRequestVRAMTransfer(param1->unk_3C);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -351,7 +349,7 @@ static void ov5_021F1B4C(UnkStruct_ov5_021F1AD8 *param0, VecFx32 *param1)
|
|||
}
|
||||
}
|
||||
|
||||
OverworldAnimManager *ov5_021F1BA4(FieldEffectManager *param0, const UnkStruct_ov5_021DF84C *param1, const UnkStruct_020216E0 *param2, const VecFx32 *param3, int param4, int param5)
|
||||
OverworldAnimManager *ov5_021F1BA4(FieldEffectManager *param0, const BillboardResources *param1, const Billboard *param2, const VecFx32 *param3, int param4, int param5)
|
||||
{
|
||||
OverworldAnimManager *v0;
|
||||
UnkStruct_ov5_021F1BEC v1;
|
||||
|
|
@ -399,7 +397,7 @@ static int ov5_021F1BEC(OverworldAnimManager *param0, void *param1)
|
|||
static void ov5_021F1C54(OverworldAnimManager *param0, void *param1)
|
||||
{
|
||||
UnkStruct_ov5_021F1AD8 *v0 = param1;
|
||||
sub_020211FC(v0->unk_3C);
|
||||
Billboard_Delete(v0->unk_3C);
|
||||
}
|
||||
|
||||
static void ov5_021F1C60(OverworldAnimManager *param0, void *param1)
|
||||
|
|
@ -432,10 +430,10 @@ static void ov5_021F1CA4(OverworldAnimManager *param0, void *param1)
|
|||
VecFx32 v1;
|
||||
|
||||
OverworldAnimManager_GetPosition(param0, &v1);
|
||||
sub_020212A8(v0->unk_3C, &v1);
|
||||
Billboard_SetPos(v0->unk_3C, &v1);
|
||||
}
|
||||
|
||||
sub_020212D0(v0->unk_3C, &v0->unk_40);
|
||||
Billboard_SetScale(v0->unk_3C, &v0->unk_40);
|
||||
}
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_0220034C = {
|
||||
|
|
|
|||
|
|
@ -3,17 +3,15 @@
|
|||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
|
||||
#include "field/field_system.h"
|
||||
#include "overlay005/field_effect_manager.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "map_object.h"
|
||||
#include "map_object_move.h"
|
||||
#include "overworld_anim_manager.h"
|
||||
#include "unk_02020AEC.h"
|
||||
|
||||
typedef struct UnkStruct_ov5_021F2D20_t {
|
||||
FieldEffectManager *unk_00;
|
||||
|
|
@ -37,7 +35,7 @@ typedef struct {
|
|||
int unk_10;
|
||||
int unk_14;
|
||||
UnkStruct_021F2EA4 unk_18;
|
||||
UnkStruct_020216E0 *unk_34;
|
||||
Billboard *unk_34;
|
||||
} UnkStruct_021F2FA0;
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -52,7 +50,7 @@ typedef struct {
|
|||
int unk_00;
|
||||
int unk_04;
|
||||
UnkStruct_021F30C4 unk_08;
|
||||
UnkStruct_020216E0 *unk_1C;
|
||||
Billboard *unk_1C;
|
||||
} UnkStruct_021F30FC;
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -69,7 +67,7 @@ typedef struct {
|
|||
int unk_08;
|
||||
int unk_0C;
|
||||
UnkStruct_021F3154 unk_10;
|
||||
UnkStruct_020216E0 *unk_24;
|
||||
Billboard *unk_24;
|
||||
} UnkStruct_021F31A8;
|
||||
|
||||
void include_unk_ov5_02200500(void);
|
||||
|
|
@ -78,10 +76,10 @@ static void ov5_021F2D4C(UnkStruct_ov5_021F2D20 *param0);
|
|||
static void ov5_021F2E2C(UnkStruct_ov5_021F2D20 *param0);
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_022004EC;
|
||||
const UnkStruct_020217F4 Unk_ov5_02200540[];
|
||||
const UnkStruct_020217F4 Unk_ov5_02200558[];
|
||||
const UnkStruct_020217F4 Unk_ov5_02200528[];
|
||||
const UnkStruct_020217F4 Unk_ov5_02200570[];
|
||||
const BillboardAnim Unk_ov5_02200540[];
|
||||
const BillboardAnim Unk_ov5_02200558[];
|
||||
const BillboardAnim Unk_ov5_02200528[];
|
||||
const BillboardAnim Unk_ov5_02200570[];
|
||||
|
||||
void *ov5_021F2D20(FieldEffectManager *param0)
|
||||
{
|
||||
|
|
@ -204,7 +202,7 @@ static int ov5_021F2F0C(OverworldAnimManager *param0, void *param1)
|
|||
static void ov5_021F2FA0(OverworldAnimManager *param0, void *param1)
|
||||
{
|
||||
UnkStruct_021F2FA0 *v0 = param1;
|
||||
sub_020211FC(v0->unk_34);
|
||||
Billboard_Delete(v0->unk_34);
|
||||
}
|
||||
|
||||
static void ov5_021F2FAC(OverworldAnimManager *param0, void *param1)
|
||||
|
|
@ -237,15 +235,15 @@ static void ov5_021F2FAC(OverworldAnimManager *param0, void *param1)
|
|||
|
||||
switch (v1->unk_00) {
|
||||
case 0:
|
||||
sub_02021368(v1->unk_34, FX32_ONE);
|
||||
v0 = sub_020213D4(v1->unk_34) / FX32_ONE;
|
||||
Billboard_AdvanceAnim(v1->unk_34, FX32_ONE);
|
||||
v0 = Billboard_GetAnimFrameNum(v1->unk_34) / FX32_ONE;
|
||||
|
||||
if (v0 >= 12) {
|
||||
v1->unk_00 = 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
sub_02021380(v1->unk_34, (12 * FX32_ONE));
|
||||
Billboard_SetFrameNum(v1->unk_34, (12 * FX32_ONE));
|
||||
v1->unk_00 = 2;
|
||||
case 2:
|
||||
if (sub_020627B4(v2, v1->unk_04, v1->unk_08, v1->unk_0C) == 0) {
|
||||
|
|
@ -280,7 +278,7 @@ static void ov5_021F308C(OverworldAnimManager *param0, void *param1)
|
|||
}
|
||||
|
||||
OverworldAnimManager_GetPosition(param0, &v0);
|
||||
sub_020212A8(v1->unk_34, &v0);
|
||||
Billboard_SetPos(v1->unk_34, &v0);
|
||||
}
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_022004EC = {
|
||||
|
|
@ -291,7 +289,7 @@ static const OverworldAnimManagerFuncs Unk_ov5_022004EC = {
|
|||
ov5_021F308C
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_02200540[] = {
|
||||
static const BillboardAnim Unk_ov5_02200540[] = {
|
||||
{ 0x0, 0xC, 0x0 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
|
@ -322,7 +320,7 @@ static int ov5_021F30C4(OverworldAnimManager *param0, void *param1)
|
|||
static void ov5_021F30FC(OverworldAnimManager *param0, void *param1)
|
||||
{
|
||||
UnkStruct_021F30FC *v0 = param1;
|
||||
sub_020211FC(v0->unk_1C);
|
||||
Billboard_Delete(v0->unk_1C);
|
||||
}
|
||||
|
||||
static void ov5_021F3108(OverworldAnimManager *param0, void *param1)
|
||||
|
|
@ -332,8 +330,8 @@ static void ov5_021F3108(OverworldAnimManager *param0, void *param1)
|
|||
|
||||
switch (v1->unk_00) {
|
||||
case 0:
|
||||
sub_02021368(v1->unk_1C, FX32_ONE);
|
||||
v0 = sub_020213D4(v1->unk_1C) / FX32_ONE;
|
||||
Billboard_AdvanceAnim(v1->unk_1C, FX32_ONE);
|
||||
v0 = Billboard_GetAnimFrameNum(v1->unk_1C) / FX32_ONE;
|
||||
|
||||
if (v0 >= 12) {
|
||||
v1->unk_04 = 1;
|
||||
|
|
@ -350,7 +348,7 @@ static void ov5_021F313C(OverworldAnimManager *param0, void *param1)
|
|||
VecFx32 v0;
|
||||
UnkStruct_021F30FC *v1 = param1;
|
||||
OverworldAnimManager_GetPosition(param0, &v0);
|
||||
sub_020212A8(v1->unk_1C, &v0);
|
||||
Billboard_SetPos(v1->unk_1C, &v0);
|
||||
}
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_02200500 = {
|
||||
|
|
@ -363,17 +361,17 @@ static const OverworldAnimManagerFuncs Unk_ov5_02200500 = {
|
|||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_02200514;
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_02200558[] = {
|
||||
static const BillboardAnim Unk_ov5_02200558[] = {
|
||||
{ 0x0, 0x28, 0x1 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_02200528[] = {
|
||||
static const BillboardAnim Unk_ov5_02200528[] = {
|
||||
{ 0x0, 0x18, 0x1 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_02200570[] = {
|
||||
static const BillboardAnim Unk_ov5_02200570[] = {
|
||||
{ 0x0, 0x28, 0x1 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
|
@ -447,7 +445,7 @@ static int ov5_021F31B4(OverworldAnimManager *param0, void *param1)
|
|||
static void ov5_021F3238(OverworldAnimManager *param0, void *param1)
|
||||
{
|
||||
UnkStruct_021F31A8 *v0 = param1;
|
||||
sub_020211FC(v0->unk_24);
|
||||
Billboard_Delete(v0->unk_24);
|
||||
}
|
||||
|
||||
static void ov5_021F3244(OverworldAnimManager *param0, void *param1)
|
||||
|
|
@ -457,7 +455,7 @@ static void ov5_021F3244(OverworldAnimManager *param0, void *param1)
|
|||
|
||||
switch (v1->unk_00) {
|
||||
case 0:
|
||||
if (sub_02021368(v1->unk_24, FX32_ONE) == 1) {
|
||||
if (Billboard_AdvanceAnim(v1->unk_24, FX32_ONE) == 1) {
|
||||
v1->unk_04 = 1;
|
||||
v1->unk_00++;
|
||||
}
|
||||
|
|
@ -473,7 +471,7 @@ static void ov5_021F326C(OverworldAnimManager *param0, void *param1)
|
|||
UnkStruct_021F31A8 *v1 = param1;
|
||||
|
||||
OverworldAnimManager_GetPosition(param0, &v0);
|
||||
sub_020212A8(v1->unk_24, &v0);
|
||||
Billboard_SetPos(v1->unk_24, &v0);
|
||||
}
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_02200514 = {
|
||||
|
|
|
|||
|
|
@ -3,16 +3,14 @@
|
|||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
|
||||
#include "field/field_system.h"
|
||||
#include "overlay005/field_effect_manager.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "map_object.h"
|
||||
#include "overworld_anim_manager.h"
|
||||
#include "unk_02020AEC.h"
|
||||
|
||||
typedef struct {
|
||||
FieldEffectManager *unk_00;
|
||||
|
|
@ -32,14 +30,14 @@ typedef struct {
|
|||
int unk_0C;
|
||||
int unk_10;
|
||||
UnkStruct_ov5_021F331C unk_14;
|
||||
UnkStruct_020216E0 *unk_24;
|
||||
Billboard *unk_24;
|
||||
} UnkStruct_ov5_021F336C;
|
||||
|
||||
static void ov5_021F32B0(UnkStruct_ov5_021F32B0 *param0);
|
||||
static void ov5_021F32F4(UnkStruct_ov5_021F32B0 *param0);
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_02200588;
|
||||
const UnkStruct_020217F4 Unk_ov5_0220059C[];
|
||||
const BillboardAnim Unk_ov5_0220059C[];
|
||||
|
||||
void *ov5_021F3284(FieldEffectManager *param0)
|
||||
{
|
||||
|
|
@ -118,7 +116,7 @@ static int ov5_021F336C(OverworldAnimManager *param0, void *param1)
|
|||
static void ov5_021F33C4(OverworldAnimManager *param0, void *param1)
|
||||
{
|
||||
UnkStruct_ov5_021F336C *v0 = param1;
|
||||
sub_020211FC(v0->unk_24);
|
||||
Billboard_Delete(v0->unk_24);
|
||||
}
|
||||
|
||||
static void ov5_021F33D0(OverworldAnimManager *param0, void *param1)
|
||||
|
|
@ -143,15 +141,15 @@ static void ov5_021F33D0(OverworldAnimManager *param0, void *param1)
|
|||
|
||||
switch (v2->unk_00) {
|
||||
case 0:
|
||||
sub_02021368(v2->unk_24, FX32_ONE);
|
||||
v0 = sub_020213D4(v2->unk_24) / FX32_ONE;
|
||||
Billboard_AdvanceAnim(v2->unk_24, FX32_ONE);
|
||||
v0 = Billboard_GetAnimFrameNum(v2->unk_24) / FX32_ONE;
|
||||
|
||||
if (v0 >= 12) {
|
||||
if (v1 == 0) {
|
||||
FieldEffectManager_FinishAnimManager(param0);
|
||||
return;
|
||||
} else {
|
||||
sub_02021380(v2->unk_24, 0);
|
||||
Billboard_SetFrameNum(v2->unk_24, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -172,7 +170,7 @@ static void ov5_021F3448(OverworldAnimManager *param0, void *param1)
|
|||
MapObject_GetPosPtr(v2, &v0);
|
||||
|
||||
v0.z += FX32_ONE * 8;
|
||||
sub_020212A8(v1->unk_24, &v0);
|
||||
Billboard_SetPos(v1->unk_24, &v0);
|
||||
}
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_02200588 = {
|
||||
|
|
@ -183,7 +181,7 @@ static const OverworldAnimManagerFuncs Unk_ov5_02200588 = {
|
|||
ov5_021F3448
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_0220059C[] = {
|
||||
static const BillboardAnim Unk_ov5_0220059C[] = {
|
||||
{ 0x0, 0xC, 0x1 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,17 +3,15 @@
|
|||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
|
||||
#include "field/field_system.h"
|
||||
#include "overlay005/field_effect_manager.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "map_object.h"
|
||||
#include "map_object_move.h"
|
||||
#include "overworld_anim_manager.h"
|
||||
#include "unk_02020AEC.h"
|
||||
|
||||
typedef struct {
|
||||
u32 unk_00;
|
||||
|
|
@ -33,7 +31,7 @@ typedef struct {
|
|||
int unk_08;
|
||||
int unk_0C;
|
||||
UnkStruct_ov5_021F35E8 unk_10;
|
||||
UnkStruct_020216E0 *unk_20;
|
||||
Billboard *unk_20;
|
||||
} UnkStruct_ov5_021F36F4;
|
||||
|
||||
static void ov5_021F34D0(UnkStruct_ov5_021F34D0 *param0);
|
||||
|
|
@ -41,7 +39,7 @@ static void ov5_021F3518(UnkStruct_ov5_021F34D0 *param0);
|
|||
static void ov5_021F358C(UnkStruct_ov5_021F34D0 *param0);
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_022005C4;
|
||||
const UnkStruct_020217F4 Unk_ov5_022005D8[];
|
||||
const BillboardAnim Unk_ov5_022005D8[];
|
||||
|
||||
void *ov5_021F348C(FieldEffectManager *param0)
|
||||
{
|
||||
|
|
@ -204,7 +202,7 @@ static int ov5_021F36F4(OverworldAnimManager *param0, void *param1)
|
|||
static void ov5_021F3754(OverworldAnimManager *param0, void *param1)
|
||||
{
|
||||
UnkStruct_ov5_021F36F4 *v0 = param1;
|
||||
sub_020211FC(v0->unk_20);
|
||||
Billboard_Delete(v0->unk_20);
|
||||
}
|
||||
|
||||
static void ov5_021F3760(OverworldAnimManager *param0, void *param1)
|
||||
|
|
@ -215,8 +213,8 @@ static void ov5_021F3760(OverworldAnimManager *param0, void *param1)
|
|||
|
||||
switch (v1->unk_00) {
|
||||
case 0:
|
||||
sub_02021368(v1->unk_20, FX32_ONE);
|
||||
v0 = sub_020213D4(v1->unk_20) / FX32_ONE;
|
||||
Billboard_AdvanceAnim(v1->unk_20, FX32_ONE);
|
||||
v0 = Billboard_GetAnimFrameNum(v1->unk_20) / FX32_ONE;
|
||||
|
||||
if (v0 >= 9) {
|
||||
FieldEffectManager_FinishAnimManager(param0);
|
||||
|
|
@ -233,7 +231,7 @@ static void ov5_021F3790(OverworldAnimManager *param0, void *param1)
|
|||
MapObject *v3 = v2->unk_10.unk_0C;
|
||||
|
||||
OverworldAnimManager_GetPosition(param0, &v0);
|
||||
sub_020212A8(v2->unk_20, &v0);
|
||||
Billboard_SetPos(v2->unk_20, &v0);
|
||||
}
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_022005C4 = {
|
||||
|
|
@ -244,7 +242,7 @@ static const OverworldAnimManagerFuncs Unk_ov5_022005C4 = {
|
|||
ov5_021F3790
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_022005D8[] = {
|
||||
static const BillboardAnim Unk_ov5_022005D8[] = {
|
||||
{ 0x0, 0x9, 0x1 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,17 +3,15 @@
|
|||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
|
||||
#include "field/field_system.h"
|
||||
#include "overlay005/field_effect_manager.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "map_object.h"
|
||||
#include "map_object_move.h"
|
||||
#include "overworld_anim_manager.h"
|
||||
#include "unk_02020AEC.h"
|
||||
|
||||
typedef struct {
|
||||
FieldEffectManager *unk_00;
|
||||
|
|
@ -37,14 +35,14 @@ typedef struct {
|
|||
int unk_10;
|
||||
int unk_14;
|
||||
UnkStruct_ov5_021F3844 unk_18;
|
||||
UnkStruct_020216E0 *unk_34;
|
||||
Billboard *unk_34;
|
||||
} UnkStruct_ov5_021F38AC;
|
||||
|
||||
static void ov5_021F37D4(UnkStruct_ov5_021F37D4 *param0);
|
||||
static void ov5_021F381C(UnkStruct_ov5_021F37D4 *param0);
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_02200620;
|
||||
const UnkStruct_020217F4 Unk_ov5_02200634[];
|
||||
const BillboardAnim Unk_ov5_02200634[];
|
||||
|
||||
void *ov5_021F37A8(FieldEffectManager *param0)
|
||||
{
|
||||
|
|
@ -140,7 +138,7 @@ static int ov5_021F38AC(OverworldAnimManager *param0, void *param1)
|
|||
static void ov5_021F3940(OverworldAnimManager *param0, void *param1)
|
||||
{
|
||||
UnkStruct_ov5_021F38AC *v0 = param1;
|
||||
sub_020211FC(v0->unk_34);
|
||||
Billboard_Delete(v0->unk_34);
|
||||
}
|
||||
|
||||
static void ov5_021F394C(OverworldAnimManager *param0, void *param1)
|
||||
|
|
@ -173,16 +171,16 @@ static void ov5_021F394C(OverworldAnimManager *param0, void *param1)
|
|||
|
||||
switch (v1->unk_00) {
|
||||
case 0:
|
||||
sub_02021368(v1->unk_34, FX32_ONE);
|
||||
v0 = (sub_020213D4(v1->unk_34) / FX32_ONE);
|
||||
Billboard_AdvanceAnim(v1->unk_34, FX32_ONE);
|
||||
v0 = (Billboard_GetAnimFrameNum(v1->unk_34) / FX32_ONE);
|
||||
|
||||
if (v0 >= 12) {
|
||||
v1->unk_00 = 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
sub_02021380(v1->unk_34, (FX32_ONE * 12));
|
||||
sub_02021368(v1->unk_34, 0);
|
||||
Billboard_SetFrameNum(v1->unk_34, (FX32_ONE * 12));
|
||||
Billboard_AdvanceAnim(v1->unk_34, 0);
|
||||
v1->unk_00 = 2;
|
||||
case 2: {
|
||||
int v5 = MapObject_GetX(v2);
|
||||
|
|
@ -208,7 +206,7 @@ static void ov5_021F3A18(OverworldAnimManager *param0, void *param1)
|
|||
}
|
||||
|
||||
OverworldAnimManager_GetPosition(param0, &v0);
|
||||
sub_020212A8(v1->unk_34, &v0);
|
||||
Billboard_SetPos(v1->unk_34, &v0);
|
||||
}
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_02200620 = {
|
||||
|
|
@ -219,7 +217,7 @@ static const OverworldAnimManagerFuncs Unk_ov5_02200620 = {
|
|||
ov5_021F3A18
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_02200634[] = {
|
||||
static const BillboardAnim Unk_ov5_02200634[] = {
|
||||
{ 0x0, 0xC, 0x0 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,17 +3,15 @@
|
|||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
|
||||
#include "field/field_system.h"
|
||||
#include "overlay005/field_effect_manager.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "map_object.h"
|
||||
#include "map_object_move.h"
|
||||
#include "overworld_anim_manager.h"
|
||||
#include "unk_02020AEC.h"
|
||||
|
||||
typedef struct {
|
||||
FieldEffectManager *unk_00;
|
||||
|
|
@ -37,14 +35,14 @@ typedef struct {
|
|||
int unk_10;
|
||||
int unk_14;
|
||||
UnkStruct_ov5_021F3AEC unk_18;
|
||||
UnkStruct_020216E0 *unk_34;
|
||||
Billboard *unk_34;
|
||||
} UnkStruct_ov5_021F3B54;
|
||||
|
||||
static void ov5_021F3A7C(UnkStruct_ov5_021F3A7C *param0);
|
||||
static void ov5_021F3AC4(UnkStruct_ov5_021F3A7C *param0);
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_0220064C;
|
||||
const UnkStruct_020217F4 Unk_ov5_02200660[];
|
||||
const BillboardAnim Unk_ov5_02200660[];
|
||||
|
||||
void *ov5_021F3A50(FieldEffectManager *param0)
|
||||
{
|
||||
|
|
@ -141,7 +139,7 @@ static int ov5_021F3B54(OverworldAnimManager *param0, void *param1)
|
|||
static void ov5_021F3BF4(OverworldAnimManager *param0, void *param1)
|
||||
{
|
||||
UnkStruct_ov5_021F3B54 *v0 = param1;
|
||||
sub_020211FC(v0->unk_34);
|
||||
Billboard_Delete(v0->unk_34);
|
||||
}
|
||||
|
||||
static void ov5_021F3C00(OverworldAnimManager *param0, void *param1)
|
||||
|
|
@ -174,16 +172,16 @@ static void ov5_021F3C00(OverworldAnimManager *param0, void *param1)
|
|||
|
||||
switch (v1->unk_00) {
|
||||
case 0:
|
||||
sub_02021368(v1->unk_34, FX32_ONE);
|
||||
v0 = (sub_020213D4(v1->unk_34) / FX32_ONE);
|
||||
Billboard_AdvanceAnim(v1->unk_34, FX32_ONE);
|
||||
v0 = (Billboard_GetAnimFrameNum(v1->unk_34) / FX32_ONE);
|
||||
|
||||
if (v0 >= 2) {
|
||||
v1->unk_00 = 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
sub_02021380(v1->unk_34, (FX32_ONE * 2));
|
||||
sub_02021368(v1->unk_34, 0);
|
||||
Billboard_SetFrameNum(v1->unk_34, (FX32_ONE * 2));
|
||||
Billboard_AdvanceAnim(v1->unk_34, 0);
|
||||
v1->unk_00 = 2;
|
||||
case 2: {
|
||||
int v5 = MapObject_GetX(v2);
|
||||
|
|
@ -209,7 +207,7 @@ static void ov5_021F3CCC(OverworldAnimManager *param0, void *param1)
|
|||
}
|
||||
|
||||
OverworldAnimManager_GetPosition(param0, &v0);
|
||||
sub_020212A8(v1->unk_34, &v0);
|
||||
Billboard_SetPos(v1->unk_34, &v0);
|
||||
}
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_0220064C = {
|
||||
|
|
@ -220,7 +218,7 @@ static const OverworldAnimManagerFuncs Unk_ov5_0220064C = {
|
|||
ov5_021F3CCC
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_02200660[] = {
|
||||
static const BillboardAnim Unk_ov5_02200660[] = {
|
||||
{ 0x0, 0x2, 0x0 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,17 +3,15 @@
|
|||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
|
||||
#include "field/field_system.h"
|
||||
#include "overlay005/field_effect_manager.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "map_object.h"
|
||||
#include "map_object_move.h"
|
||||
#include "overworld_anim_manager.h"
|
||||
#include "unk_02020AEC.h"
|
||||
|
||||
typedef struct {
|
||||
FieldEffectManager *unk_00;
|
||||
|
|
@ -32,14 +30,14 @@ typedef struct {
|
|||
int unk_08;
|
||||
int unk_0C;
|
||||
UnkStruct_ov5_021F3F10 unk_10;
|
||||
UnkStruct_020216E0 *unk_20;
|
||||
Billboard *unk_20;
|
||||
} UnkStruct_ov5_021F3FB8;
|
||||
|
||||
static void ov5_021F3EA0(UnkStruct_ov5_021F3EA0 *param0);
|
||||
static void ov5_021F3EE8(UnkStruct_ov5_021F3EA0 *param0);
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_0220069C;
|
||||
const UnkStruct_020217F4 Unk_ov5_022006B0[];
|
||||
const BillboardAnim Unk_ov5_022006B0[];
|
||||
|
||||
void *ov5_021F3E74(FieldEffectManager *param0)
|
||||
{
|
||||
|
|
@ -120,7 +118,7 @@ static int ov5_021F3F74(OverworldAnimManager *param0, void *param1)
|
|||
static void ov5_021F3FB8(OverworldAnimManager *param0, void *param1)
|
||||
{
|
||||
UnkStruct_ov5_021F3FB8 *v0 = param1;
|
||||
sub_020211FC(v0->unk_20);
|
||||
Billboard_Delete(v0->unk_20);
|
||||
}
|
||||
|
||||
static void ov5_021F3FC4(OverworldAnimManager *param0, void *param1)
|
||||
|
|
@ -131,8 +129,8 @@ static void ov5_021F3FC4(OverworldAnimManager *param0, void *param1)
|
|||
|
||||
switch (v1->unk_00) {
|
||||
case 0:
|
||||
sub_02021368(v1->unk_20, FX32_ONE);
|
||||
v0 = sub_020213D4(v1->unk_20) / FX32_ONE;
|
||||
Billboard_AdvanceAnim(v1->unk_20, FX32_ONE);
|
||||
v0 = Billboard_GetAnimFrameNum(v1->unk_20) / FX32_ONE;
|
||||
|
||||
if (v0 >= 7) {
|
||||
FieldEffectManager_FinishAnimManager(param0);
|
||||
|
|
@ -150,7 +148,7 @@ static void ov5_021F3FF4(OverworldAnimManager *param0, void *param1)
|
|||
|
||||
OverworldAnimManager_GetPosition(param0, &v0);
|
||||
v0.z += (FX32_ONE * 8);
|
||||
sub_020212A8(v2->unk_20, &v0);
|
||||
Billboard_SetPos(v2->unk_20, &v0);
|
||||
}
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_0220069C = {
|
||||
|
|
@ -161,7 +159,7 @@ static const OverworldAnimManagerFuncs Unk_ov5_0220069C = {
|
|||
ov5_021F3FF4
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_022006B0[] = {
|
||||
static const BillboardAnim Unk_ov5_022006B0[] = {
|
||||
{ 0x0, 0x7, 0x1 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,18 +3,16 @@
|
|||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
|
||||
#include "field/field_system.h"
|
||||
#include "overlay005/field_effect_manager.h"
|
||||
#include "overlay005/ov5_021ECC20.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "map_object.h"
|
||||
#include "overworld_anim_manager.h"
|
||||
#include "sound_playback.h"
|
||||
#include "unk_02020AEC.h"
|
||||
|
||||
void include_unk_ov5_02200B98(void);
|
||||
|
||||
|
|
@ -45,7 +43,7 @@ typedef struct {
|
|||
VecFx32 unk_18;
|
||||
VecFx32 unk_24;
|
||||
UnkStruct_ov5_021F5D8C unk_30;
|
||||
UnkStruct_020216E0 *unk_40;
|
||||
Billboard *unk_40;
|
||||
} UnkStruct_ov5_021F5C4C;
|
||||
|
||||
static void ov5_021F5A34(UnkStruct_ov5_021F5A34 *param0);
|
||||
|
|
@ -64,12 +62,12 @@ static void ov5_021F5BD0(UnkStruct_ov5_021F5A34 *param0);
|
|||
static void ov5_021F5BE0(UnkStruct_ov5_021F5A34 *param0);
|
||||
static void ov5_021F5BF0(UnkStruct_ov5_021F5A34 *param0, int param1);
|
||||
static void ov5_021F5C04(UnkStruct_ov5_021F5A34 *param0, int param1);
|
||||
static UnkStruct_020216E0 *ov5_021F5C18(FieldEffectManager *param0, int param1, VecFx32 *param2, u32 param3);
|
||||
static Billboard *ov5_021F5C18(FieldEffectManager *param0, int param1, VecFx32 *param2, u32 param3);
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_02200B98;
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_02200B84;
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_02200BAC;
|
||||
const UnkStruct_020217F4 Unk_ov5_02200BC0[];
|
||||
const BillboardAnim Unk_ov5_02200BC0[];
|
||||
|
||||
void *ov5_021F5A10(FieldEffectManager *param0)
|
||||
{
|
||||
|
|
@ -226,13 +224,13 @@ static void ov5_021F5C04(UnkStruct_ov5_021F5A34 *param0, int param1)
|
|||
}
|
||||
}
|
||||
|
||||
static UnkStruct_020216E0 *ov5_021F5C18(FieldEffectManager *param0, int param1, VecFx32 *param2, u32 param3)
|
||||
static Billboard *ov5_021F5C18(FieldEffectManager *param0, int param1, VecFx32 *param2, u32 param3)
|
||||
{
|
||||
int v0[2] = { 1, 12 };
|
||||
UnkStruct_020216E0 *v1 = ov5_021DF84C(param0, v0[param1], param2);
|
||||
Billboard *v1 = ov5_021DF84C(param0, v0[param1], param2);
|
||||
|
||||
if (param3 == 1) {
|
||||
NNSG3dResMdl *v2 = sub_020213F4(v1);
|
||||
NNSG3dResMdl *v2 = Billboard_GetModel(v1);
|
||||
NNS_G3dMdlSetMdlFogEnableFlagAll(v2, 0);
|
||||
}
|
||||
|
||||
|
|
@ -252,7 +250,7 @@ void ov5_021F5C58(OverworldAnimManager *param0)
|
|||
v0->unk_10 = 1;
|
||||
|
||||
if (v0->unk_40 != NULL) {
|
||||
sub_02021320(v0->unk_40, 0);
|
||||
Billboard_SetDrawFlag(v0->unk_40, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -319,7 +317,7 @@ static void ov5_021F5D38(OverworldAnimManager *param0, void *param1)
|
|||
{
|
||||
UnkStruct_ov5_021F5C4C *v0 = param1;
|
||||
|
||||
sub_020211FC(v0->unk_40);
|
||||
Billboard_Delete(v0->unk_40);
|
||||
|
||||
ov5_021F5A90(v0->unk_30.unk_08, v0->unk_30.unk_00);
|
||||
ov5_021F5C04(v0->unk_30.unk_08, v0->unk_30.unk_00);
|
||||
|
|
@ -340,7 +338,7 @@ static void ov5_021F5D54(OverworldAnimManager *param0, void *param1)
|
|||
v0.y += v1->unk_18.y;
|
||||
v0.z += v1->unk_18.z;
|
||||
|
||||
sub_020212A8(v1->unk_40, &v0);
|
||||
Billboard_SetPos(v1->unk_40, &v0);
|
||||
}
|
||||
|
||||
OverworldAnimManager *ov5_021F5D8C(MapObject *param0, int param1, int param2, int param3)
|
||||
|
|
@ -484,11 +482,11 @@ static void ov5_021F5F24(OverworldAnimManager *param0, void *param1)
|
|||
break;
|
||||
case 2:
|
||||
v0->unk_40 = ov5_021F5C18(v0->unk_30.unk_04, v0->unk_30.unk_00, &v2, v0->unk_30.unk_08->unk_06);
|
||||
sub_02021320(v0->unk_40, 0);
|
||||
Billboard_SetDrawFlag(v0->unk_40, 0);
|
||||
v0->unk_00++;
|
||||
break;
|
||||
case 3:
|
||||
sub_02021320(v0->unk_40, 1);
|
||||
Billboard_SetDrawFlag(v0->unk_40, 1);
|
||||
v0->unk_10 = 0;
|
||||
|
||||
if (OverworldAnimManager_GetID(param0) == 1) {
|
||||
|
|
@ -546,7 +544,7 @@ static const OverworldAnimManagerFuncs Unk_ov5_02200BAC = {
|
|||
ov5_021F5D54
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_02200BC0[] = {
|
||||
static const BillboardAnim Unk_ov5_02200BC0[] = {
|
||||
{ 0x0, 0x1, 0x0 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,16 +3,14 @@
|
|||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
|
||||
#include "field/field_system.h"
|
||||
#include "overlay005/field_effect_manager.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "map_object.h"
|
||||
#include "overworld_anim_manager.h"
|
||||
#include "unk_02020AEC.h"
|
||||
|
||||
typedef struct UnkStruct_ov5_021F600C_t {
|
||||
FieldEffectManager *unk_00;
|
||||
|
|
@ -31,14 +29,14 @@ typedef struct {
|
|||
int unk_08;
|
||||
int unk_0C;
|
||||
UnkStruct_ov5_021F6094 unk_10;
|
||||
UnkStruct_020216E0 *unk_20;
|
||||
Billboard *unk_20;
|
||||
} UnkStruct_ov5_021F6134;
|
||||
|
||||
static void ov5_021F6038(UnkStruct_ov5_021F600C *param0);
|
||||
static void ov5_021F6074(UnkStruct_ov5_021F600C *param0);
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_02200BD8;
|
||||
const UnkStruct_020217F4 Unk_ov5_02200BEC[];
|
||||
const BillboardAnim Unk_ov5_02200BEC[];
|
||||
|
||||
void *ov5_021F600C(FieldEffectManager *param0)
|
||||
{
|
||||
|
|
@ -116,7 +114,7 @@ static int ov5_021F60E4(OverworldAnimManager *param0, void *param1)
|
|||
static void ov5_021F6134(OverworldAnimManager *param0, void *param1)
|
||||
{
|
||||
UnkStruct_ov5_021F6134 *v0 = param1;
|
||||
sub_020211FC(v0->unk_20);
|
||||
Billboard_Delete(v0->unk_20);
|
||||
}
|
||||
|
||||
static void ov5_021F6140(OverworldAnimManager *param0, void *param1)
|
||||
|
|
@ -149,7 +147,7 @@ static void ov5_021F615C(OverworldAnimManager *param0, void *param1)
|
|||
v0.z += v1.z;
|
||||
v0.z += FX32_ONE * 12;
|
||||
|
||||
sub_020212A8(v2->unk_20, &v0);
|
||||
Billboard_SetPos(v2->unk_20, &v0);
|
||||
}
|
||||
|
||||
static const OverworldAnimManagerFuncs Unk_ov5_02200BD8 = {
|
||||
|
|
@ -160,7 +158,7 @@ static const OverworldAnimManagerFuncs Unk_ov5_02200BD8 = {
|
|||
ov5_021F615C
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_02200BEC[] = {
|
||||
static const BillboardAnim Unk_ov5_02200BEC[] = {
|
||||
{ 0x0, 0x1, 0x1 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
#include "generated/items.h"
|
||||
#include "generated/species.h"
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_020308A0_decl.h"
|
||||
#include "struct_decls/struct_02061830_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
|
|
@ -21,6 +20,7 @@
|
|||
#include "bag.h"
|
||||
#include "berry_patch_graphics.h"
|
||||
#include "bg_window.h"
|
||||
#include "billboard.h"
|
||||
#include "field_script_context.h"
|
||||
#include "font.h"
|
||||
#include "game_records.h"
|
||||
|
|
@ -48,7 +48,6 @@
|
|||
#include "sys_task.h"
|
||||
#include "sys_task_manager.h"
|
||||
#include "system_vars.h"
|
||||
#include "unk_02020AEC.h"
|
||||
#include "unk_0202C858.h"
|
||||
#include "unk_02030880.h"
|
||||
#include "unk_02038F8C.h"
|
||||
|
|
@ -964,7 +963,7 @@ BOOL ScrCmd_32D(ScriptContext *ctx)
|
|||
{
|
||||
fx32 v0;
|
||||
VecFx32 v1;
|
||||
UnkStruct_020216E0 *v2;
|
||||
Billboard *v2;
|
||||
int v3 = 0;
|
||||
FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
MapObjectManager *mapObjMan = fieldSystem->mapObjMan;
|
||||
|
|
@ -996,7 +995,7 @@ BOOL ScrCmd_32D(ScriptContext *ctx)
|
|||
|
||||
if (v2 != NULL) {
|
||||
ov5_021EDEB4(v7, v2);
|
||||
sub_02021320(v2, 1);
|
||||
Billboard_SetDrawFlag(v2, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1024,7 +1023,7 @@ BOOL ScrCmd_32E(ScriptContext *ctx)
|
|||
static void ov5_021F7654(MapObject *param0, int param1)
|
||||
{
|
||||
VecFx32 v0;
|
||||
UnkStruct_020216E0 *v1;
|
||||
Billboard *v1;
|
||||
|
||||
MapObject_SetStatusFlagOn(param0, MAP_OBJ_STATUS_13);
|
||||
MapObject_GetPosPtr(param0, &v0);
|
||||
|
|
@ -1038,7 +1037,7 @@ static void ov5_021F7654(MapObject *param0, int param1)
|
|||
|
||||
if (v1 != NULL) {
|
||||
ov5_021EDEB4(param0, v1);
|
||||
sub_02021320(v1, 1);
|
||||
Billboard_SetDrawFlag(v1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@
|
|||
|
||||
#include "generated/object_events_gfx.h"
|
||||
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
|
||||
#include "overlay005/berry_graphics_data.h"
|
||||
#include "overlay005/berry_graphics_table.h"
|
||||
#include "overlay005/const_ov5_021FAF40.h"
|
||||
|
|
@ -969,7 +967,7 @@ const UnkStruct_ov5_021ED2D0 Unk_ov5_021FB5BC[] = {
|
|||
{ 0xffff, 0x0 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB380[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB380[] = {
|
||||
{ 0x0, 0xF, 0x0 },
|
||||
{ 0x10, 0x1F, 0x0 },
|
||||
{ 0x20, 0x2F, 0x0 },
|
||||
|
|
@ -981,7 +979,7 @@ static const UnkStruct_020217F4 Unk_ov5_021FB380[] = {
|
|||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB3EC[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB3EC[] = {
|
||||
{ 0x0, 0xF, 0x0 },
|
||||
{ 0x10, 0x1F, 0x0 },
|
||||
{ 0x20, 0x2F, 0x0 },
|
||||
|
|
@ -995,7 +993,7 @@ static const UnkStruct_020217F4 Unk_ov5_021FB3EC[] = {
|
|||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB284[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB284[] = {
|
||||
{ 0x0, 0x2, 0x0 },
|
||||
{ 0x3, 0x5, 0x0 },
|
||||
{ 0x6, 0x9, 0x0 },
|
||||
|
|
@ -1003,18 +1001,18 @@ static const UnkStruct_020217F4 Unk_ov5_021FB284[] = {
|
|||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB134[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB134[] = {
|
||||
{ 0x0, 0xA, 0x1 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB200[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB200[] = {
|
||||
{ 0x0, 0xF, 0x0 },
|
||||
{ 0x10, 0x1C, 0x0 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB2C0[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB2C0[] = {
|
||||
{ 0x0, 0xF, 0x0 },
|
||||
{ 0x10, 0x1F, 0x0 },
|
||||
{ 0x20, 0x2F, 0x0 },
|
||||
|
|
@ -1022,7 +1020,7 @@ static const UnkStruct_020217F4 Unk_ov5_021FB2C0[] = {
|
|||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB338[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB338[] = {
|
||||
{ 0x0, 0xF, 0x0 },
|
||||
{ 0x10, 0x1F, 0x0 },
|
||||
{ 0x20, 0x2F, 0x0 },
|
||||
|
|
@ -1031,28 +1029,28 @@ static const UnkStruct_020217F4 Unk_ov5_021FB338[] = {
|
|||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB17C[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB17C[] = {
|
||||
{ 0x0, 0x3C, 0x0 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB224[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB224[] = {
|
||||
{ 0x0, 0x7, 0x0 },
|
||||
{ 0x8, 0x10, 0x0 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB1AC[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB1AC[] = {
|
||||
{ 0x0, 0x10, 0x0 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB1C4[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB1C4[] = {
|
||||
{ 0x0, 0x10, 0x0 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB2FC[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB2FC[] = {
|
||||
{ 0x0, 0xF, 0x1 },
|
||||
{ 0x10, 0x1F, 0x1 },
|
||||
{ 0x20, 0x2F, 0x1 },
|
||||
|
|
@ -1060,12 +1058,12 @@ static const UnkStruct_020217F4 Unk_ov5_021FB2FC[] = {
|
|||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB104[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB104[] = {
|
||||
{ 0x0, 0x20, 0x0 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB248[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB248[] = {
|
||||
{ 0x0, 0xB, 0x1 },
|
||||
{ 0xC, 0x17, 0x1 },
|
||||
{ 0x18, 0x23, 0x1 },
|
||||
|
|
@ -1073,28 +1071,28 @@ static const UnkStruct_020217F4 Unk_ov5_021FB248[] = {
|
|||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB11C[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB11C[] = {
|
||||
{ 0x0, 0x8, 0x1 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB1DC[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB1DC[] = {
|
||||
{ 0x0, 0x14, 0x1 },
|
||||
{ 0x15, 0x29, 0x1 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB14C[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB14C[] = {
|
||||
{ 0x0, 0x14, 0x0 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB164[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB164[] = {
|
||||
{ 0x0, 0x13, 0x0 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_021FB194[] = {
|
||||
static const BillboardAnim Unk_ov5_021FB194[] = {
|
||||
{ 0x0, 0x3B, 0x1 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "billboard_vram_transfer.h"
|
||||
#include "heap.h"
|
||||
#include "narc.h"
|
||||
#include "particle_system.h"
|
||||
#include "unk_0201DD00.h"
|
||||
#include "vram_transfer.h"
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -93,13 +93,13 @@ static int TextureResourceManager_LoadSingleTexture(FieldTextureManager *texture
|
|||
return -1;
|
||||
}
|
||||
|
||||
textureManager->textureSlots[slotIndex].textureData = sub_0201DF50(textureResource, textureManager->dataHeader->animationData[textureIndex].name);
|
||||
textureManager->textureSlots[slotIndex].textureData = GetTextureDataBufferFromResourceName(textureResource, textureManager->dataHeader->animationData[textureIndex].name);
|
||||
|
||||
if (textureManager->textureSlots[slotIndex].textureData == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
textureManager->textureSlots[slotIndex].textureSize = sub_0201DFE4(textureResource, textureManager->dataHeader->animationData[textureIndex].name);
|
||||
textureManager->textureSlots[slotIndex].textureSize = CalcTextureDataSizeFromResourceName(textureResource, textureManager->dataHeader->animationData[textureIndex].name);
|
||||
sprintf(debugString, "data/fld_anime%d.bin", textureIndex);
|
||||
textureManager->textureSlots[slotIndex].animationData = &(textureManager->dataHeader->animationData[textureIndex]);
|
||||
textureManager->textureSlots[slotIndex].narcData = NARC_AllocAndReadWholeMember(narc, textureIndex + 1, 4);
|
||||
|
|
@ -129,7 +129,7 @@ void TextureResourceManager_Free(FieldTextureManager *textureManager)
|
|||
textureSlot->currentFrame = 0;
|
||||
}
|
||||
|
||||
VramTransfer_Request(NNS_GFD_DST_3D_TEX_VRAM, (u32)textureSlot->textureData, sub_0201DEAC(textureSlot->textureResource, textureSlot->animationData->animationData[textureSlot->currentFrame][0]), textureSlot->textureSize);
|
||||
VramTransfer_Request(NNS_GFD_DST_3D_TEX_VRAM, (u32)textureSlot->textureData, GetTextureDataVRAMBuffer(textureSlot->textureResource, textureSlot->animationData->animationData[textureSlot->currentFrame][0]), textureSlot->textureSize);
|
||||
} else {
|
||||
textureSlot->frameCounter++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
#include "generated/movement_actions.h"
|
||||
#include "generated/sdat.h"
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_0205E884_decl.h"
|
||||
#include "struct_decls/struct_02061830_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
|
|
@ -37,6 +36,7 @@
|
|||
#include "overlay009/struct_ov9_0224F6EC_decl.h"
|
||||
|
||||
#include "bg_window.h"
|
||||
#include "billboard.h"
|
||||
#include "camera.h"
|
||||
#include "field_system.h"
|
||||
#include "field_task.h"
|
||||
|
|
@ -67,7 +67,6 @@
|
|||
#include "sys_task_manager.h"
|
||||
#include "system_flags.h"
|
||||
#include "system_vars.h"
|
||||
#include "unk_02020AEC.h"
|
||||
#include "unk_0205F180.h"
|
||||
#include "unk_020655F4.h"
|
||||
#include "vars_flags.h"
|
||||
|
|
@ -442,7 +441,7 @@ typedef struct {
|
|||
u16 unk_14;
|
||||
u16 unk_16;
|
||||
MapObject *unk_18;
|
||||
UnkStruct_020216E0 *unk_1C;
|
||||
Billboard *unk_1C;
|
||||
} UnkStruct_ov9_0224A294;
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -1029,15 +1028,15 @@ static void CameraFree(DistWorldSystem *system);
|
|||
static void CameraTransitionTask(SysTask *sysTask, void *sysTaskParam);
|
||||
static BOOL DoCameraTransition(DistWorldSystem *system, const DistWorldCameraAngleTemplate *cameraAngleTemplate);
|
||||
static void ov9_0224A1E4(DistWorldSystem *param0, int param1);
|
||||
static void ov9_0224A228(UnkStruct_ov9_0224A228 *param0, UnkStruct_ov9_0224A294 *param1, UnkStruct_020216E0 *param2);
|
||||
static void ov9_0224A228(UnkStruct_ov9_0224A228 *param0, UnkStruct_ov9_0224A294 *param1, Billboard *param2);
|
||||
static void ov9_0224A294(UnkStruct_ov9_0224A228 *param0, UnkStruct_ov9_0224A294 *param1);
|
||||
static void ov9_0224A2AC(UnkStruct_ov9_0224A228 *param0, UnkStruct_ov9_0224A294 *param1);
|
||||
static void ov9_0224A334(DistWorldSystem *param0);
|
||||
static void ov9_0224A390(DistWorldSystem *param0, MapObject *param1, int param2);
|
||||
static void ov9_0224A3C4(DistWorldSystem *param0, UnkStruct_020216E0 *param1, int param2);
|
||||
static void ov9_0224A408(DistWorldSystem *param0, const UnkStruct_020216E0 *param1);
|
||||
static void ov9_0224A3C4(DistWorldSystem *param0, Billboard *param1, int param2);
|
||||
static void ov9_0224A408(DistWorldSystem *param0, const Billboard *param1);
|
||||
static void ov9_0224A49C(DistWorldSystem *param0);
|
||||
static void ov9_0224A4C8(UnkStruct_020216E0 *param0, void *param1);
|
||||
static void ov9_0224A4C8(Billboard *param0, void *param1);
|
||||
static void ov9_0224A4D0(DistWorldSystem *param0, MapObject *param1, int param2, int param3);
|
||||
static void FieldTaskContextNoOp1(DistWorldSystem *system);
|
||||
static void FieldTaskContextNoOp2(DistWorldSystem *system);
|
||||
|
|
@ -1861,11 +1860,11 @@ static void ov9_0224A1E4(DistWorldSystem *param0, int param1)
|
|||
v0->unk_0C = NNS_G3dGetAnmByIdx(v0->unk_08, 0);
|
||||
}
|
||||
|
||||
static void ov9_0224A228(UnkStruct_ov9_0224A228 *param0, UnkStruct_ov9_0224A294 *param1, UnkStruct_020216E0 *param2)
|
||||
static void ov9_0224A228(UnkStruct_ov9_0224A228 *param0, UnkStruct_ov9_0224A294 *param1, Billboard *param2)
|
||||
{
|
||||
NNSG3dResMdl *v0 = sub_02021430(param2);
|
||||
NNSG3dResTex *v1 = sub_02021438(param2);
|
||||
NNSG3dRenderObj *v2 = sub_02021440(param2);
|
||||
NNSG3dResMdl *v0 = Billboard_GetModel2(param2);
|
||||
NNSG3dResTex *v1 = Billboard_GetTexture(param2);
|
||||
NNSG3dRenderObj *v2 = Billboard_GetRenderObj(param2);
|
||||
|
||||
GF_ASSERT(param1->unk_10 == NULL);
|
||||
|
||||
|
|
@ -1875,7 +1874,7 @@ static void ov9_0224A228(UnkStruct_ov9_0224A228 *param0, UnkStruct_ov9_0224A294
|
|||
NNS_G3dAnmObjInit(param1->unk_10, param0->unk_0C, v0, v1);
|
||||
NNS_G3dRenderObjAddAnmObj(v2, param1->unk_10);
|
||||
|
||||
sub_02021444(param2, ov9_0224A4C8, param1);
|
||||
Billboard_SetCallback(param2, ov9_0224A4C8, param1);
|
||||
|
||||
if (param1->unk_18 != NULL) {
|
||||
param1->unk_14 = MapObject_GetGraphicsID(param1->unk_18);
|
||||
|
|
@ -1900,7 +1899,7 @@ static void ov9_0224A2C0(UnkStruct_ov9_0224A228 *param0, UnkStruct_ov9_0224A294
|
|||
{
|
||||
if (param1->unk_18 != NULL) {
|
||||
if (param1->unk_10 == NULL) {
|
||||
UnkStruct_020216E0 *v0 = ov5_021EB1A0(param1->unk_18);
|
||||
Billboard *v0 = ov5_021EB1A0(param1->unk_18);
|
||||
|
||||
if (v0 == NULL) {
|
||||
return;
|
||||
|
|
@ -1927,7 +1926,7 @@ static int ov9_0224A2E4(UnkStruct_ov9_0224A294 *param0)
|
|||
return 2;
|
||||
}
|
||||
}
|
||||
} else if (sub_02021404(param0->unk_1C) == 0) {
|
||||
} else if (Billboard_GetState(param0->unk_1C) == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -1984,7 +1983,7 @@ static void ov9_0224A390(DistWorldSystem *param0, MapObject *param1, int param2)
|
|||
GF_ASSERT(0);
|
||||
}
|
||||
|
||||
static void ov9_0224A3C4(DistWorldSystem *param0, UnkStruct_020216E0 *param1, int param2)
|
||||
static void ov9_0224A3C4(DistWorldSystem *param0, Billboard *param1, int param2)
|
||||
{
|
||||
int v0 = 0;
|
||||
UnkStruct_ov9_0224A228 *v1 = ¶m0->unk_188;
|
||||
|
|
@ -2004,7 +2003,7 @@ static void ov9_0224A3C4(DistWorldSystem *param0, UnkStruct_020216E0 *param1, in
|
|||
GF_ASSERT(0);
|
||||
}
|
||||
|
||||
static void ov9_0224A408(DistWorldSystem *param0, const UnkStruct_020216E0 *param1)
|
||||
static void ov9_0224A408(DistWorldSystem *param0, const Billboard *param1)
|
||||
{
|
||||
int v0 = 0;
|
||||
UnkStruct_ov9_0224A228 *v1 = ¶m0->unk_188;
|
||||
|
|
@ -2067,7 +2066,7 @@ static void ov9_0224A49C(DistWorldSystem *param0)
|
|||
}
|
||||
}
|
||||
|
||||
static void ov9_0224A4C8(UnkStruct_020216E0 *param0, void *param1)
|
||||
static void ov9_0224A4C8(Billboard *param0, void *param1)
|
||||
{
|
||||
UnkStruct_ov9_0224A294 *v0 = param1;
|
||||
NNS_G3dAnmObjSetFrame(v0->unk_10, v0->unk_0C);
|
||||
|
|
@ -2116,13 +2115,13 @@ int ov9_0224A520(FieldSystem *fieldSystem, MapObject *param1)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void ov9_0224A558(FieldSystem *fieldSystem, UnkStruct_020216E0 *param1, int param2)
|
||||
void ov9_0224A558(FieldSystem *fieldSystem, Billboard *param1, int param2)
|
||||
{
|
||||
DistWorldSystem *v0 = fieldSystem->unk_04->dynamicMapFeaturesData;
|
||||
ov9_0224A3C4(v0, param1, param2);
|
||||
}
|
||||
|
||||
void ov9_0224A564(FieldSystem *fieldSystem, const UnkStruct_020216E0 *param1)
|
||||
void ov9_0224A564(FieldSystem *fieldSystem, const Billboard *param1)
|
||||
{
|
||||
DistWorldSystem *v0 = fieldSystem->unk_04->dynamicMapFeaturesData;
|
||||
ov9_0224A408(v0, param1);
|
||||
|
|
@ -7106,7 +7105,7 @@ static BOOL ov9_0224EF64(DistWorldSystem *param0, MapObject **param1, const UnkS
|
|||
MapObject_SetStatusFlagOn(*param1, MAP_OBJ_STATUS_13);
|
||||
|
||||
if (v0 == NULL) {
|
||||
UnkStruct_020216E0 *v1;
|
||||
Billboard *v1;
|
||||
|
||||
MapObject_SetPosDirFromCoords(*param1, param2->unk_08.x, (((param2->unk_08.y) >> 3) / FX32_ONE), param2->unk_08.z, param2->unk_08.dir);
|
||||
|
||||
|
|
@ -8720,7 +8719,7 @@ static int ov9_022507C4(DistWorldSystem *param0, FieldTask *param1, u16 *param2,
|
|||
static int ov9_022507FC(DistWorldSystem *param0, FieldTask *param1, u16 *param2, const void *param3)
|
||||
{
|
||||
UnkStruct_ov9_0225074C *v1 = ov9_0224E39C(param0);
|
||||
UnkStruct_020216E0 *v0 = ov5_021EB1A0(v1->unk_18);
|
||||
Billboard *v0 = ov5_021EB1A0(v1->unk_18);
|
||||
|
||||
if (v0 != NULL) {
|
||||
v1->unk_00 = (FX32_ONE * 16);
|
||||
|
|
@ -8767,11 +8766,11 @@ static int ov9_02250854(DistWorldSystem *param0, FieldTask *param1, u16 *param2,
|
|||
|
||||
static int ov9_022508C0(DistWorldSystem *param0, FieldTask *param1, u16 *param2, const void *param3)
|
||||
{
|
||||
UnkStruct_020216E0 *v0;
|
||||
Billboard *v0;
|
||||
NNSG3dResMdl *v1;
|
||||
UnkStruct_ov9_0225074C *v2 = ov9_0224E39C(param0);
|
||||
v0 = ov5_021EB1A0(v2->unk_18);
|
||||
v1 = sub_02021430(v0);
|
||||
v1 = Billboard_GetModel2(v0);
|
||||
|
||||
v2->unk_00 -= (FX32_ONE * 16) / (3 * 30);
|
||||
|
||||
|
|
@ -9559,7 +9558,7 @@ static void PlaySoundIfNotActive(u16 seqID)
|
|||
|
||||
static void ov9_022511F4(MapObject *param0, const VecFx32 *param1)
|
||||
{
|
||||
UnkStruct_020216E0 *v0;
|
||||
Billboard *v0;
|
||||
|
||||
MapObject_SetPos(param0, param1);
|
||||
v0 = ov5_021EB1A0(param0);
|
||||
|
|
|
|||
|
|
@ -3,20 +3,13 @@
|
|||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_02020C44_decl.h"
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
#include "struct_defs/struct_02024184.h"
|
||||
|
||||
#include "overlay005/struct_ov5_021DF7F8.h"
|
||||
#include "overlay005/struct_ov5_021DF84C.h"
|
||||
#include "overlay005/struct_ov5_021EDDAC.h"
|
||||
#include "overlay063/ov63_0222BE18.h"
|
||||
#include "overlay063/struct_ov63_0222BEC0_decl.h"
|
||||
#include "overlay063/struct_ov63_0222CC3C.h"
|
||||
#include "overlay066/ov66_02231428.h"
|
||||
#include "overlay070/ov70_0225C700.h"
|
||||
|
||||
#include "billboard.h"
|
||||
#include "easy3d.h"
|
||||
#include "easy3d_object.h"
|
||||
#include "gfx_box_test.h"
|
||||
|
|
@ -24,8 +17,6 @@
|
|||
#include "heap.h"
|
||||
#include "narc.h"
|
||||
#include "resource_collection.h"
|
||||
#include "unk_02020AEC.h"
|
||||
#include "unk_0202414C.h"
|
||||
|
||||
typedef struct {
|
||||
u16 unk_00;
|
||||
|
|
@ -47,7 +38,7 @@ typedef struct UnkStruct_ov66_02234798_t {
|
|||
u8 unk_02;
|
||||
u8 unk_03;
|
||||
const UnkStruct_ov63_0222BEC0 *unk_04;
|
||||
UnkStruct_020216E0 *unk_08;
|
||||
Billboard *unk_08;
|
||||
Easy3DObject unk_0C;
|
||||
u8 unk_84;
|
||||
u8 unk_85;
|
||||
|
|
@ -60,7 +51,7 @@ typedef struct UnkStruct_ov66_02234548_t {
|
|||
ResourceCollection *unk_00;
|
||||
ResourceCollection *unk_04;
|
||||
TextureResourceManager *unk_08;
|
||||
UnkStruct_02020C44 *unk_0C;
|
||||
BillboardList *unk_0C;
|
||||
UnkStruct_ov66_02234798 *unk_10;
|
||||
u32 unk_14;
|
||||
UnkStruct_ov66_02234958 unk_18;
|
||||
|
|
@ -91,8 +82,8 @@ static void ov66_02234C70(UnkStruct_ov66_02234798 *param0);
|
|||
static BOOL ov66_02234CD8(u32 param0);
|
||||
static void ov66_02234D08(UnkStruct_ov66_02234798 *param0);
|
||||
static void ov66_02234D3C(UnkStruct_ov66_02234798 *param0);
|
||||
static void ov66_02234D78(UnkStruct_020216E0 *param0, void *param1);
|
||||
static BOOL ov66_02234D8C(UnkStruct_020216E0 *param0);
|
||||
static void ov66_02234D78(Billboard *param0, void *param1);
|
||||
static BOOL ov66_02234D8C(Billboard *param0);
|
||||
|
||||
static const u8 Unk_ov66_02258B24[4] = {
|
||||
0x1,
|
||||
|
|
@ -106,7 +97,7 @@ static const u16 Unk_ov66_02258B28[2] = {
|
|||
0x1BE
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov66_02258B88[] = {
|
||||
static const BillboardAnim Unk_ov66_02258B88[] = {
|
||||
{ 0x0, 0xF, 0x0 },
|
||||
{ 0x10, 0x1F, 0x0 },
|
||||
{ 0x20, 0x2F, 0x0 },
|
||||
|
|
@ -162,13 +153,13 @@ UnkStruct_ov66_02234548 *ov66_022343A8(u32 param0, u32 param1, enum HeapID heapI
|
|||
v0->unk_08 = TextureResourceManager_New(20, heapID);
|
||||
|
||||
{
|
||||
UnkStruct_ov5_021EDDAC v2;
|
||||
BillboardListParams v2;
|
||||
|
||||
sub_02020B90(1, heapID);
|
||||
BillboardLists_Create(1, heapID);
|
||||
|
||||
v2.unk_00 = param0;
|
||||
v2.maxElements = param0;
|
||||
v2.heapID = heapID;
|
||||
v0->unk_0C = sub_02020C44(&v2);
|
||||
v0->unk_0C = BillboardList_New(&v2);
|
||||
}
|
||||
|
||||
{
|
||||
|
|
@ -253,8 +244,8 @@ void ov66_02234548(UnkStruct_ov66_02234548 *param0)
|
|||
}
|
||||
|
||||
{
|
||||
sub_02020CCC(param0->unk_0C);
|
||||
sub_02020BD0();
|
||||
BillboardList_Delete(param0->unk_0C);
|
||||
BillboardLists_Delete();
|
||||
}
|
||||
|
||||
TextureResourceManager_Delete(param0->unk_08);
|
||||
|
|
@ -279,7 +270,7 @@ void ov66_022345C4(UnkStruct_ov66_02234548 *param0)
|
|||
{
|
||||
int v0;
|
||||
|
||||
sub_02020C08();
|
||||
BillboardLists_Draw();
|
||||
|
||||
if (ov66_0223496C(¶m0->unk_18) > 0) {
|
||||
for (v0 = 0; v0 < param0->unk_14; v0++) {
|
||||
|
|
@ -292,7 +283,7 @@ void ov66_022345C4(UnkStruct_ov66_02234548 *param0)
|
|||
|
||||
void ov66_02234604(UnkStruct_ov66_02234548 *param0)
|
||||
{
|
||||
sub_02020D68(param0->unk_0C);
|
||||
BillboardList_ResetRedraw(param0->unk_0C);
|
||||
}
|
||||
|
||||
void ov66_02234610(UnkStruct_ov66_02234548 *param0, u32 param1)
|
||||
|
|
@ -307,14 +298,14 @@ UnkStruct_ov66_02234798 *ov66_0223461C(UnkStruct_ov66_02234548 *param0, const Un
|
|||
|
||||
{
|
||||
const UnkStruct_ov66_02258B38 *v1;
|
||||
UnkStruct_ov5_021DF84C v2;
|
||||
UnkStruct_ov5_021DF7F8 v3;
|
||||
BillboardResources v2;
|
||||
BillboardTemplate v3;
|
||||
Resource *v4;
|
||||
TextureResource *v5;
|
||||
u32 v6;
|
||||
void *v7;
|
||||
const NNSG3dResTex *v8;
|
||||
UnkStruct_02024184 v9;
|
||||
BillboardGfxSequence v9;
|
||||
NNSGfdTexKey v10;
|
||||
NNSGfdTexKey v11;
|
||||
NNSGfdPlttKey v12;
|
||||
|
|
@ -347,17 +338,17 @@ UnkStruct_ov66_02234798 *ov66_0223461C(UnkStruct_ov66_02234548 *param0, const Un
|
|||
v4 = ResourceCollection_FindResource(param0->unk_04, v15);
|
||||
v16 = Resource_GetData(v4);
|
||||
|
||||
sub_02024184(v16, &v9);
|
||||
BillboardGfxSequence_SetData(v16, &v9);
|
||||
}
|
||||
|
||||
if (v1->unk_02_15 == 1) {
|
||||
sub_02021284(&v2, v7, v8, Unk_ov66_02258B88, &v9);
|
||||
BillboardResources_SetWithoutKeys(&v2, v7, v8, Unk_ov66_02258B88, &v9);
|
||||
} else {
|
||||
v10 = TextureResource_GetTexKey(v5);
|
||||
v11 = TextureResource_GetTex4x4Key(v5);
|
||||
v12 = TextureResource_GetPaletteKey(v5);
|
||||
|
||||
sub_0202125C(&v2, v7, v8, Unk_ov66_02258B88, &v9, v10, v11, v12);
|
||||
BillboardResources_Set(&v2, v7, v8, Unk_ov66_02258B88, &v9, v10, v11, v12);
|
||||
}
|
||||
|
||||
{
|
||||
|
|
@ -368,13 +359,13 @@ UnkStruct_ov66_02234798 *ov66_0223461C(UnkStruct_ov66_02234548 *param0, const Un
|
|||
v13.z += (FX32_CONST(16));
|
||||
}
|
||||
|
||||
v3.unk_00 = param0->unk_0C;
|
||||
v3.unk_04 = &v2;
|
||||
v3.unk_08 = v13;
|
||||
v3.unk_14 = v14;
|
||||
v0->unk_08 = sub_0202119C(&v3);
|
||||
v3.list = param0->unk_0C;
|
||||
v3.resources = &v2;
|
||||
v3.pos = v13;
|
||||
v3.scale = v14;
|
||||
v0->unk_08 = BillboardList_Append(&v3);
|
||||
|
||||
sub_02021444(v0->unk_08, ov66_02234D78, v0);
|
||||
Billboard_SetCallback(v0->unk_08, ov66_02234D78, v0);
|
||||
ov66_02234970(¶m0->unk_18, &v0->unk_0C);
|
||||
Easy3DObject_SetPosition(&v0->unk_0C, v13.x + 0, ((FX32_CONST(0)) + FX32_CONST(2)), v13.z + (FX32_CONST(-8)));
|
||||
}
|
||||
|
|
@ -389,7 +380,7 @@ UnkStruct_ov66_02234798 *ov66_0223461C(UnkStruct_ov66_02234548 *param0, const Un
|
|||
|
||||
void ov66_02234798(UnkStruct_ov66_02234798 *param0)
|
||||
{
|
||||
sub_020211FC(param0->unk_08);
|
||||
Billboard_Delete(param0->unk_08);
|
||||
memset(param0, 0, sizeof(UnkStruct_ov66_02234798));
|
||||
}
|
||||
|
||||
|
|
@ -419,13 +410,13 @@ void ov66_022347D4(UnkStruct_ov66_02234798 *param0, const UnkStruct_ov63_0222CC3
|
|||
|
||||
void ov66_022347F8(UnkStruct_ov66_02234798 *param0, const VecFx32 *param1)
|
||||
{
|
||||
sub_020212A8(param0->unk_08, param1);
|
||||
Billboard_SetPos(param0->unk_08, param1);
|
||||
Easy3DObject_SetPosition(¶m0->unk_0C, param1->x + 0, ((FX32_CONST(0)) + FX32_CONST(2)), param1->z + (FX32_CONST(-8)));
|
||||
}
|
||||
|
||||
void ov66_0223481C(const UnkStruct_ov66_02234798 *param0, VecFx32 *param1)
|
||||
{
|
||||
const VecFx32 *v0 = sub_020212C0(param0->unk_08);
|
||||
const VecFx32 *v0 = Billboard_GetPos(param0->unk_08);
|
||||
*param1 = *v0;
|
||||
}
|
||||
|
||||
|
|
@ -433,8 +424,8 @@ void ov66_02234834(UnkStruct_ov66_02234798 *param0, int param1)
|
|||
{
|
||||
u32 v0 = ov66_022348D8(1, param1);
|
||||
|
||||
sub_02021344(param0->unk_08, v0);
|
||||
sub_020213A4(param0->unk_08, 0);
|
||||
Billboard_SetAnimNum(param0->unk_08, v0);
|
||||
Billboard_SetAnimFrameNum(param0->unk_08, 0);
|
||||
}
|
||||
|
||||
void ov66_02234850(UnkStruct_ov66_02234798 *param0, int param1)
|
||||
|
|
@ -599,8 +590,8 @@ static void ov66_022349E0(UnkStruct_ov66_02234798 *param0)
|
|||
|
||||
if ((param0->unk_86 > v1) || (param0->unk_84 != v0)) {
|
||||
if (ov66_02234CD8(param0->unk_84) == 1) {
|
||||
param0->unk_85 = sub_02021358(param0->unk_08);
|
||||
param0->unk_88 = sub_020213D4(param0->unk_08);
|
||||
param0->unk_85 = Billboard_GetAnimNum(param0->unk_08);
|
||||
param0->unk_88 = Billboard_GetAnimFrameNum(param0->unk_08);
|
||||
}
|
||||
|
||||
param0->unk_84 = v0;
|
||||
|
|
@ -622,8 +613,8 @@ static void ov66_02234A78(UnkStruct_ov66_02234798 *param0)
|
|||
v0 = ov63_0222BF90(param0->unk_04, 6);
|
||||
v1 = ov66_022348D8(1, v0);
|
||||
|
||||
sub_02021344(param0->unk_08, v1);
|
||||
sub_020213A4(param0->unk_08, 0);
|
||||
Billboard_SetAnimNum(param0->unk_08, v1);
|
||||
Billboard_SetAnimFrameNum(param0->unk_08, 0);
|
||||
}
|
||||
|
||||
static void ov66_02234AA0(UnkStruct_ov66_02234798 *param0)
|
||||
|
|
@ -640,14 +631,14 @@ static void ov66_02234AA0(UnkStruct_ov66_02234798 *param0)
|
|||
v4 = ov63_0222BF90(param0->unk_04, 8);
|
||||
v2 = ov66_022348E4(v3, v4, 8);
|
||||
|
||||
sub_02021344(param0->unk_08, v1);
|
||||
Billboard_SetAnimNum(param0->unk_08, v1);
|
||||
|
||||
if (param0->unk_85 == v1) {
|
||||
sub_020213A4(param0->unk_08, 0);
|
||||
sub_02021368(param0->unk_08, v2 + param0->unk_88);
|
||||
Billboard_SetAnimFrameNum(param0->unk_08, 0);
|
||||
Billboard_AdvanceAnim(param0->unk_08, v2 + param0->unk_88);
|
||||
} else {
|
||||
sub_020213A4(param0->unk_08, 0);
|
||||
sub_02021368(param0->unk_08, v2);
|
||||
Billboard_SetAnimFrameNum(param0->unk_08, 0);
|
||||
Billboard_AdvanceAnim(param0->unk_08, v2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -658,13 +649,13 @@ static void ov66_02234B10(UnkStruct_ov66_02234798 *param0)
|
|||
u16 v2 = ov63_0222BF90(param0->unk_04, 8);
|
||||
|
||||
if (v2 < 4) {
|
||||
sub_020213A4(param0->unk_08, 4 * FX32_ONE);
|
||||
Billboard_SetAnimFrameNum(param0->unk_08, 4 * FX32_ONE);
|
||||
} else {
|
||||
v0 = ov63_0222BF90(param0->unk_04, 6);
|
||||
v1 = ov66_022348D8(1, v0);
|
||||
|
||||
sub_02021344(param0->unk_08, v1);
|
||||
sub_020213A4(param0->unk_08, 0);
|
||||
Billboard_SetAnimNum(param0->unk_08, v1);
|
||||
Billboard_SetAnimFrameNum(param0->unk_08, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -682,14 +673,14 @@ static void ov66_02234B54(UnkStruct_ov66_02234798 *param0)
|
|||
v4 = ov63_0222BF90(param0->unk_04, 8);
|
||||
v2 = ov66_022348E4(v3, v4, 4);
|
||||
|
||||
sub_02021344(param0->unk_08, v1);
|
||||
Billboard_SetAnimNum(param0->unk_08, v1);
|
||||
|
||||
if (param0->unk_85 == v1) {
|
||||
sub_020213A4(param0->unk_08, 0);
|
||||
sub_02021368(param0->unk_08, v2 + param0->unk_88);
|
||||
Billboard_SetAnimFrameNum(param0->unk_08, 0);
|
||||
Billboard_AdvanceAnim(param0->unk_08, v2 + param0->unk_88);
|
||||
} else {
|
||||
sub_020213A4(param0->unk_08, 0);
|
||||
sub_02021368(param0->unk_08, v2);
|
||||
Billboard_SetAnimFrameNum(param0->unk_08, 0);
|
||||
Billboard_AdvanceAnim(param0->unk_08, v2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -715,8 +706,8 @@ static void ov66_02234BEC(UnkStruct_ov66_02234798 *param0)
|
|||
v0 = param0->unk_02 / 4;
|
||||
v1 = ov66_022348D8(1, Unk_ov66_02258B24[v0]);
|
||||
|
||||
sub_02021344(param0->unk_08, v1);
|
||||
sub_020213A4(param0->unk_08, 0);
|
||||
Billboard_SetAnimNum(param0->unk_08, v1);
|
||||
Billboard_SetAnimFrameNum(param0->unk_08, 0);
|
||||
}
|
||||
|
||||
if ((param0->unk_02 + param0->unk_03) < (4 * 4)) {
|
||||
|
|
@ -736,8 +727,8 @@ static void ov66_02234C34(UnkStruct_ov66_02234798 *param0)
|
|||
v0 = ov63_0222BF90(param0->unk_04, 6);
|
||||
v1 = ov66_022348D8(1, v0);
|
||||
|
||||
sub_02021344(param0->unk_08, v1);
|
||||
sub_020213A4(param0->unk_08, 4 * FX32_ONE);
|
||||
Billboard_SetAnimNum(param0->unk_08, v1);
|
||||
Billboard_SetAnimFrameNum(param0->unk_08, 4 * FX32_ONE);
|
||||
|
||||
param0->unk_02++;
|
||||
}
|
||||
|
|
@ -752,14 +743,14 @@ static void ov66_02234C70(UnkStruct_ov66_02234798 *param0)
|
|||
v0 = ov63_0222BF90(param0->unk_04, 6);
|
||||
v1 = ov66_022348D8(1, v0);
|
||||
|
||||
sub_02021344(param0->unk_08, v1);
|
||||
sub_020213A4(param0->unk_08, 4 * FX32_ONE);
|
||||
Billboard_SetAnimNum(param0->unk_08, v1);
|
||||
Billboard_SetAnimFrameNum(param0->unk_08, 4 * FX32_ONE);
|
||||
} else if (param0->unk_02 == 4) {
|
||||
v0 = ov63_0222BF90(param0->unk_04, 6);
|
||||
v1 = ov66_022348D8(1, v0);
|
||||
|
||||
sub_02021344(param0->unk_08, v1);
|
||||
sub_020213A4(param0->unk_08, (4 * 3) * FX32_ONE);
|
||||
Billboard_SetAnimNum(param0->unk_08, v1);
|
||||
Billboard_SetAnimFrameNum(param0->unk_08, (4 * 3) * FX32_ONE);
|
||||
}
|
||||
|
||||
param0->unk_02 = (param0->unk_02 + 1) % (4 * 2);
|
||||
|
|
@ -802,22 +793,22 @@ static void ov66_02234D08(UnkStruct_ov66_02234798 *param0)
|
|||
static void ov66_02234D3C(UnkStruct_ov66_02234798 *param0)
|
||||
{
|
||||
if ((param0->unk_00_4 == 0) && (param0->unk_00_6 == 1)) {
|
||||
sub_02021320(param0->unk_08, 1);
|
||||
Billboard_SetDrawFlag(param0->unk_08, 1);
|
||||
Easy3DObject_SetVisible(¶m0->unk_0C, 1);
|
||||
} else {
|
||||
sub_02021320(param0->unk_08, 0);
|
||||
Billboard_SetDrawFlag(param0->unk_08, 0);
|
||||
Easy3DObject_SetVisible(¶m0->unk_0C, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void ov66_02234D78(UnkStruct_020216E0 *param0, void *param1)
|
||||
static void ov66_02234D78(Billboard *param0, void *param1)
|
||||
{
|
||||
UnkStruct_ov66_02234798 *v0 = param1;
|
||||
NNSG3dResMdl *v1 = sub_02021430(param0);
|
||||
NNSG3dResMdl *v1 = Billboard_GetModel2(param0);
|
||||
NNS_G3dMdlSetMdlLightEnableFlagAll(v1, v0->unk_8C);
|
||||
}
|
||||
|
||||
static BOOL ov66_02234D8C(UnkStruct_020216E0 *param0)
|
||||
static BOOL ov66_02234D8C(Billboard *param0)
|
||||
{
|
||||
BOOL v0;
|
||||
VecFx32 v1;
|
||||
|
|
@ -826,9 +817,9 @@ static BOOL ov66_02234D8C(UnkStruct_020216E0 *param0)
|
|||
GFXTestBox v4;
|
||||
MtxFx33 v5;
|
||||
|
||||
v3 = sub_020213F4(param0);
|
||||
v3 = Billboard_GetModel(param0);
|
||||
v2 = NNS_G3dGetMdlInfo(v3);
|
||||
v1 = *sub_020212C0(param0);
|
||||
v1 = *Billboard_GetPos(param0);
|
||||
|
||||
v4.width = v2->boxW;
|
||||
v4.height = v2->boxH;
|
||||
|
|
@ -844,7 +835,7 @@ static BOOL ov66_02234D8C(UnkStruct_020216E0 *param0)
|
|||
|
||||
MTX_Identity33(&v5);
|
||||
NNS_G3dGlbSetBaseRot(&v5);
|
||||
NNS_G3dGlbSetBaseScale(sub_020212EC(param0));
|
||||
NNS_G3dGlbSetBaseScale(Billboard_GetScale(param0));
|
||||
|
||||
v0 = GFXBoxTest_IsBoxAtPositionInView(&v1, &v4);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,258 +0,0 @@
|
|||
#include "unk_0201DD00.h"
|
||||
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_defs/struct_0202144C.h"
|
||||
#include "struct_defs/struct_02024184.h"
|
||||
|
||||
#include "ascii_util.h"
|
||||
#include "heap.h"
|
||||
#include "unk_0202414C.h"
|
||||
#include "vram_transfer.h"
|
||||
|
||||
typedef struct UnkStruct_0201DDF4_t {
|
||||
const UnkStruct_02024184 *unk_00;
|
||||
const NNSG3dResTex *unk_04;
|
||||
NNSGfdTexKey unk_08;
|
||||
NNSGfdPlttKey unk_0C;
|
||||
u8 unk_10;
|
||||
u8 unk_11;
|
||||
} UnkStruct_0201DDF4;
|
||||
|
||||
typedef struct UnkStruct_0201DD00_t {
|
||||
UnkStruct_0201DDF4 *unk_00;
|
||||
int unk_04;
|
||||
} UnkStruct_0201DD00;
|
||||
|
||||
static void sub_0201DDF4(UnkStruct_0201DDF4 *param0, const u16 param1);
|
||||
static void *sub_0201DE94(UnkStruct_0201DDF4 *param0, const UnkStruct_0202144C *param1);
|
||||
static void *sub_0201DEA0(UnkStruct_0201DDF4 *param0, const UnkStruct_0202144C *param1);
|
||||
static void sub_0201DDE4(UnkStruct_0201DDF4 *param0);
|
||||
static void sub_0201DE3C(UnkStruct_0201DDF4 *param0, const UnkStruct_0202144C *param1);
|
||||
static void sub_0201DE68(UnkStruct_0201DDF4 *param0, const UnkStruct_0202144C *param1);
|
||||
|
||||
UnkStruct_0201DD00 *sub_0201DD00(int param0, enum HeapID heapID)
|
||||
{
|
||||
UnkStruct_0201DD00 *v0;
|
||||
int v1;
|
||||
|
||||
v0 = Heap_Alloc(heapID, sizeof(UnkStruct_0201DD00));
|
||||
|
||||
v0->unk_00 = Heap_Alloc(heapID, sizeof(UnkStruct_0201DDF4) * param0);
|
||||
v0->unk_04 = param0;
|
||||
|
||||
for (v1 = 0; v1 < v0->unk_04; v1++) {
|
||||
sub_0201DDE4(&v0->unk_00[v1]);
|
||||
}
|
||||
|
||||
return v0;
|
||||
}
|
||||
|
||||
void sub_0201DD3C(UnkStruct_0201DD00 *param0)
|
||||
{
|
||||
sub_0201DDB4(param0);
|
||||
Heap_Free(param0->unk_00);
|
||||
Heap_Free(param0);
|
||||
}
|
||||
|
||||
UnkStruct_0201DDF4 *sub_0201DD54(UnkStruct_0201DD00 *param0, const UnkStruct_02024184 *param1, const NNSG3dResTex *param2, NNSGfdTexKey param3, NNSGfdPlttKey param4, const fx32 param5)
|
||||
{
|
||||
UnkStruct_0201DDF4 *v0;
|
||||
u32 v1;
|
||||
int v2;
|
||||
|
||||
v0 = NULL;
|
||||
|
||||
for (v2 = 0; v2 < param0->unk_04; v2++) {
|
||||
if (param0->unk_00[v2].unk_00 == NULL) {
|
||||
v0 = ¶m0->unk_00[v2];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (v0 == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
v0->unk_00 = param1;
|
||||
v0->unk_04 = param2;
|
||||
v0->unk_08 = param3;
|
||||
v0->unk_0C = param4;
|
||||
v0->unk_10 = -1;
|
||||
v0->unk_11 = -1;
|
||||
|
||||
sub_0201DDF4(v0, param5 >> FX32_SHIFT);
|
||||
|
||||
return v0;
|
||||
}
|
||||
|
||||
void sub_0201DDAC(UnkStruct_0201DDF4 *param0)
|
||||
{
|
||||
sub_0201DDE4(param0);
|
||||
}
|
||||
|
||||
void sub_0201DDB4(UnkStruct_0201DD00 *param0)
|
||||
{
|
||||
int v0;
|
||||
|
||||
for (v0 = 0; v0 < param0->unk_04; v0++) {
|
||||
sub_0201DDE4(param0->unk_00 + v0);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0201DDD8(UnkStruct_0201DDF4 *param0, const fx32 param1)
|
||||
{
|
||||
u16 v0 = param1 >> FX32_SHIFT;
|
||||
|
||||
sub_0201DDF4(param0, v0);
|
||||
}
|
||||
|
||||
static void sub_0201DDE4(UnkStruct_0201DDF4 *param0)
|
||||
{
|
||||
param0->unk_00 = NULL;
|
||||
param0->unk_04 = NULL;
|
||||
param0->unk_08 = 0;
|
||||
param0->unk_0C = 0;
|
||||
param0->unk_10 = 0;
|
||||
param0->unk_11 = 0;
|
||||
}
|
||||
|
||||
static void sub_0201DDF4(UnkStruct_0201DDF4 *param0, const u16 param1)
|
||||
{
|
||||
UnkStruct_0202144C v0;
|
||||
|
||||
v0 = sub_0202414C(param0->unk_00, param1);
|
||||
|
||||
if (param0->unk_10 != v0.unk_00) {
|
||||
sub_0201DE3C(param0, &v0);
|
||||
}
|
||||
|
||||
if (param0->unk_11 != v0.unk_01) {
|
||||
sub_0201DE68(param0, &v0);
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_0201DE3C(UnkStruct_0201DDF4 *param0, const UnkStruct_0202144C *param1)
|
||||
{
|
||||
void *v0 = sub_0201DE94(param0, param1);
|
||||
|
||||
VramTransfer_Request(NNS_GFD_DST_3D_TEX_VRAM, NNS_GfdGetTexKeyAddr(param0->unk_08), v0, NNS_GfdGetTexKeySize(param0->unk_08));
|
||||
param0->unk_10 = param1->unk_00;
|
||||
}
|
||||
|
||||
static void sub_0201DE68(UnkStruct_0201DDF4 *param0, const UnkStruct_0202144C *param1)
|
||||
{
|
||||
void *v0 = sub_0201DEA0(param0, param1);
|
||||
VramTransfer_Request(NNS_GFD_DST_3D_TEX_PLTT, NNS_GfdGetPlttKeyAddr(param0->unk_0C), v0, NNS_GfdGetPlttKeySize(param0->unk_0C));
|
||||
|
||||
param0->unk_11 = param1->unk_01;
|
||||
}
|
||||
|
||||
static void *sub_0201DE94(UnkStruct_0201DDF4 *param0, const UnkStruct_0202144C *param1)
|
||||
{
|
||||
return sub_0201DEAC((NNSG3dResTex *)param0->unk_04, param1->unk_00);
|
||||
}
|
||||
|
||||
static void *sub_0201DEA0(UnkStruct_0201DDF4 *param0, const UnkStruct_0202144C *param1)
|
||||
{
|
||||
return sub_0201DEFC((NNSG3dResTex *)param0->unk_04, param1->unk_01);
|
||||
}
|
||||
|
||||
void *sub_0201DEAC(NNSG3dResTex *param0, const u8 param1)
|
||||
{
|
||||
u32 v0;
|
||||
const NNSG3dResDictTexData *v1 = NNS_G3dGetTexDataByIdx(param0, param1);
|
||||
|
||||
if (v1 == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
v0 = (v1->texImageParam & NNS_G3D_TEXIMAGE_PARAM_TEX_ADDR_MASK) + param0->texInfo.vramKey;
|
||||
return (void *)((u8 *)param0 + param0->texInfo.ofsTex + (v0 << 3));
|
||||
}
|
||||
|
||||
void *sub_0201DEFC(NNSG3dResTex *param0, const u8 param1)
|
||||
{
|
||||
const NNSG3dResDictPlttData *v0 = NNS_G3dGetPlttDataByIdx(param0, param1);
|
||||
|
||||
if (v0 == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return (void *)((u8 *)param0 + param0->plttInfo.ofsPlttData + (v0->offset << 3));
|
||||
}
|
||||
|
||||
static void *sub_0201DF40(NNSG3dResTex *param0, const NNSG3dResDictTexData *param1)
|
||||
{
|
||||
u32 v0 = (param1->texImageParam & NNS_G3D_TEXIMAGE_PARAM_TEX_ADDR_MASK) << 3;
|
||||
|
||||
v0 += NNS_GfdGetTexKeyAddr(param0->texInfo.vramKey);
|
||||
return (void *)(v0);
|
||||
}
|
||||
|
||||
void *sub_0201DF50(NNSG3dResTex *param0, const char *param1)
|
||||
{
|
||||
NNSG3dResName v0;
|
||||
const NNSG3dResDictTexData *v1;
|
||||
|
||||
Ascii_SetResourceName(&v0, param1);
|
||||
v1 = NNS_G3dGetTexDataByName(param0, &v0);
|
||||
|
||||
if (v1 == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return sub_0201DF40(param0, v1);
|
||||
}
|
||||
|
||||
static int sub_0201DF84(NNSG3dResTex *param0, const NNSG3dResDictTexData *param1)
|
||||
{
|
||||
u32 v0;
|
||||
u32 v1;
|
||||
u32 v2, v3;
|
||||
u32 v4;
|
||||
|
||||
v1 = (param1->texImageParam & NNS_G3D_TEXIMAGE_PARAM_TEXFMT_MASK) >> NNS_G3D_TEXIMAGE_PARAM_TEXFMT_SHIFT;
|
||||
|
||||
switch (v1) {
|
||||
case GX_TEXFMT_PLTT4:
|
||||
v4 = 4;
|
||||
break;
|
||||
case GX_TEXFMT_PLTT16:
|
||||
v4 = 2;
|
||||
break;
|
||||
case GX_TEXFMT_PLTT256:
|
||||
v4 = 1;
|
||||
break;
|
||||
case GX_TEXFMT_A3I5:
|
||||
v4 = 1;
|
||||
break;
|
||||
case GX_TEXFMT_A5I3:
|
||||
v4 = 1;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
v3 = (param1->texImageParam & NNS_G3D_TEXIMAGE_PARAM_S_SIZE_MASK) >> NNS_G3D_TEXIMAGE_PARAM_S_SIZE_SHIFT;
|
||||
v3 <<= 4;
|
||||
|
||||
v2 = (param1->texImageParam & NNS_G3D_TEXIMAGE_PARAM_T_SIZE_MASK) >> NNS_G3D_TEXIMAGE_PARAM_T_SIZE_SHIFT;
|
||||
v2 <<= 4;
|
||||
|
||||
v0 = (v3 * v2) / v4;
|
||||
|
||||
return v0;
|
||||
}
|
||||
|
||||
int sub_0201DFE4(NNSG3dResTex *param0, const char *param1)
|
||||
{
|
||||
const NNSG3dResDictTexData *v0;
|
||||
NNSG3dResName v1;
|
||||
|
||||
Ascii_SetResourceName(&v1, param1);
|
||||
v0 = NNS_G3dGetTexDataByName(param0, &v1);
|
||||
|
||||
return sub_0201DF84(param0, v0);
|
||||
}
|
||||
|
|
@ -1,965 +0,0 @@
|
|||
#include "unk_02020AEC.h"
|
||||
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_0201DD00_decl.h"
|
||||
#include "struct_decls/struct_0201DDF4_decl.h"
|
||||
#include "struct_defs/struct_0202144C.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
#include "struct_defs/struct_02024184.h"
|
||||
|
||||
#include "functypes/funcptr_02021444.h"
|
||||
#include "overlay005/struct_ov5_021DF7F8.h"
|
||||
#include "overlay005/struct_ov5_021DF84C.h"
|
||||
#include "overlay005/struct_ov5_021EDDAC.h"
|
||||
|
||||
#include "easy3d.h"
|
||||
#include "heap.h"
|
||||
#include "unk_0201DD00.h"
|
||||
#include "unk_0202414C.h"
|
||||
|
||||
typedef struct UnkStruct_020216E0_t {
|
||||
VecFx32 unk_00;
|
||||
VecFx32 unk_0C;
|
||||
const MtxFx33 *unk_18;
|
||||
void *unk_1C;
|
||||
UnkFuncPtr_02021444 unk_20;
|
||||
u8 unk_24;
|
||||
void *unk_28;
|
||||
const UnkStruct_020217F4 *unk_2C;
|
||||
NNSG3dRenderObj unk_30;
|
||||
NNSG3dResMdlSet *unk_84;
|
||||
NNSG3dResMdl *unk_88;
|
||||
NNSG3dResTex *unk_8C;
|
||||
const NNSG3dResTex *unk_90;
|
||||
NNSGfdTexKey unk_94;
|
||||
NNSGfdTexKey unk_98;
|
||||
NNSGfdPlttKey unk_9C;
|
||||
UnkStruct_02024184 unk_A0;
|
||||
UnkStruct_0201DDF4 *unk_B0;
|
||||
u8 unk_B4;
|
||||
u16 unk_B6;
|
||||
fx32 unk_B8;
|
||||
struct UnkStruct_020216E0_t *unk_BC;
|
||||
struct UnkStruct_020216E0_t *unk_C0;
|
||||
} UnkStruct_020216E0;
|
||||
|
||||
typedef struct UnkStruct_02020C44_t {
|
||||
u8 unk_00;
|
||||
u8 unk_01;
|
||||
u8 unk_02;
|
||||
u8 unk_03;
|
||||
UnkStruct_020216E0 *unk_04;
|
||||
int unk_08;
|
||||
UnkStruct_020216E0 unk_0C;
|
||||
UnkStruct_020216E0 **unk_CC;
|
||||
int unk_D0;
|
||||
NNSFndAllocator *unk_D4;
|
||||
UnkStruct_0201DD00 *unk_D8;
|
||||
} UnkStruct_02020C44;
|
||||
|
||||
static UnkStruct_02020C44 *sub_02020D74(void);
|
||||
static void sub_02020AEC(UnkStruct_02020C44 *param0);
|
||||
static void sub_02020DA8(UnkStruct_02020C44 *param0);
|
||||
static void sub_0202144C(UnkStruct_020216E0 *param0);
|
||||
static void sub_0202149C(NNSG3dResMdl *param0, const NNSG3dResTex *param1, u8 param2);
|
||||
static void sub_02021524(NNSG3dResMat *param0, const NNSG3dResDictTexToMatIdxData *param1, u32 param2);
|
||||
static void sub_020215A0(NNSG3dResMdl *param0, const NNSG3dResTex *param1, u8 param2);
|
||||
static void sub_0202162C(NNSG3dResMat *param0, const NNSG3dResDictPlttToMatIdxData *param1, u32 param2);
|
||||
static void sub_020216A8(UnkStruct_02020C44 *param0);
|
||||
static UnkStruct_020216E0 *sub_020216E0(UnkStruct_02020C44 *param0);
|
||||
static BOOL sub_0202170C(UnkStruct_02020C44 *param0, UnkStruct_020216E0 *param1);
|
||||
static void sub_02021744(UnkStruct_020216E0 *param0, UnkStruct_020216E0 *param1);
|
||||
static void sub_02021768(UnkStruct_020216E0 *param0);
|
||||
static void sub_0202185C(UnkStruct_020216E0 *param0);
|
||||
static void sub_0202187C(UnkStruct_020216E0 *param0);
|
||||
static void *sub_0202189C(const UnkStruct_ov5_021DF84C *param0, int param1);
|
||||
static const UnkStruct_020217F4 *sub_020218B4(const UnkStruct_020217F4 *param0, int param1);
|
||||
static NNSG3dResMdlSet *sub_02021788(const UnkStruct_ov5_021DF84C *param0, NNSG3dResMdl **param1, NNSG3dResTex **param2);
|
||||
static NNSG3dResTex *sub_020217D4(const UnkStruct_ov5_021DF84C *param0);
|
||||
static void sub_020217E0(UnkStruct_020216E0 *param0, const UnkStruct_ov5_021DF84C *param1);
|
||||
static void sub_02020E28(UnkStruct_020216E0 *param0, const UnkStruct_ov5_021DF84C *param1);
|
||||
static void sub_02020E78(UnkStruct_020216E0 *param0, const UnkStruct_ov5_021DF84C *param1);
|
||||
static fx32 sub_020217F4(const UnkStruct_020216E0 *param0, int param1);
|
||||
static int sub_02021804(UnkStruct_020216E0 *param0, fx32 param1);
|
||||
static int sub_02021824(const UnkStruct_020217F4 *param0, fx32 *param1, fx32 param2);
|
||||
static void sub_02020EF8(const NNSG3dResTex *param0, NNSG3dTexKey *param1, NNSG3dTexKey *param2, NNSG3dPlttKey *param3);
|
||||
static void sub_02020F90(NNSG3dResTex *param0, NNSG3dTexKey *param1, NNSG3dTexKey *param2, NNSG3dPlttKey *param3);
|
||||
static void sub_02020FA4(NNSG3dResTex *param0, NNSG3dResMdlSet *param1, NNSG3dTexKey *param2, NNSG3dTexKey *param3, NNSG3dPlttKey *param4);
|
||||
static void sub_02020FC8(NNSG3dTexKey *param0, NNSG3dTexKey *param1, NNSG3dPlttKey *param2);
|
||||
static BOOL sub_02020FFC(const NNSG3dResTex *param0, const NNSG3dResTex *param1);
|
||||
static void sub_0202105C(UnkStruct_02020C44 *param0, UnkStruct_020216E0 *param1);
|
||||
static void sub_02021078(UnkStruct_020216E0 *param0, const UnkStruct_ov5_021DF84C *param1);
|
||||
static void sub_020210F4(const UnkStruct_02020C44 *param0, UnkStruct_020216E0 *param1, const UnkStruct_ov5_021DF84C *param2);
|
||||
static void sub_02021148(UnkStruct_020216E0 *param0, const UnkStruct_ov5_021DF84C *param1);
|
||||
static void sub_0202117C(UnkStruct_020216E0 *param0, const UnkStruct_ov5_021DF84C *param1);
|
||||
|
||||
static UnkStruct_02020C44 *Unk_021C0774 = NULL;
|
||||
static int Unk_021C0778 = 0;
|
||||
|
||||
static void sub_02020AEC(UnkStruct_02020C44 *param0)
|
||||
{
|
||||
param0->unk_00 = 0;
|
||||
param0->unk_01 = 0;
|
||||
param0->unk_04 = NULL;
|
||||
param0->unk_08 = 0;
|
||||
param0->unk_CC = NULL;
|
||||
param0->unk_D0 = 0;
|
||||
param0->unk_D4 = NULL;
|
||||
param0->unk_D8 = NULL;
|
||||
param0->unk_03 = 0;
|
||||
}
|
||||
|
||||
void sub_02020B14(UnkStruct_020216E0 *param0)
|
||||
{
|
||||
u8 v0 = 0;
|
||||
|
||||
param0->unk_28 = NULL;
|
||||
param0->unk_2C = NULL;
|
||||
param0->unk_84 = NULL;
|
||||
param0->unk_88 = NULL;
|
||||
param0->unk_8C = NULL;
|
||||
param0->unk_90 = NULL;
|
||||
|
||||
memset(¶m0->unk_A0, 0, sizeof(UnkStruct_02024184));
|
||||
|
||||
param0->unk_94 = (NNS_GFD_ALLOC_ERROR_TEXKEY);
|
||||
param0->unk_98 = (NNS_GFD_ALLOC_ERROR_TEXKEY);
|
||||
param0->unk_9C = (NNS_GFD_ALLOC_ERROR_PLTTKEY);
|
||||
param0->unk_B0 = NULL;
|
||||
|
||||
VEC_Set(&(param0->unk_00), 0, 0, 0);
|
||||
VEC_Set(&(param0->unk_0C), FX32_ONE, FX32_ONE, FX32_ONE);
|
||||
|
||||
param0->unk_18 = NULL;
|
||||
param0->unk_B6 = 0;
|
||||
param0->unk_B4 = 0;
|
||||
param0->unk_BC = NULL;
|
||||
param0->unk_C0 = NULL;
|
||||
param0->unk_24 = 0;
|
||||
param0->unk_20 = NULL;
|
||||
}
|
||||
|
||||
void sub_02020B90(int param0, enum HeapID heapID)
|
||||
{
|
||||
int v0;
|
||||
|
||||
GF_ASSERT(Unk_021C0774 == NULL);
|
||||
|
||||
Unk_021C0774 = Heap_Alloc(heapID, sizeof(UnkStruct_02020C44) * param0);
|
||||
Unk_021C0778 = param0;
|
||||
|
||||
for (v0 = 0; v0 < param0; v0++) {
|
||||
sub_02020AEC(&Unk_021C0774[v0]);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_02020BD0(void)
|
||||
{
|
||||
int v0;
|
||||
|
||||
for (v0 = 0; v0 < Unk_021C0778; v0++) {
|
||||
sub_02020CCC(Unk_021C0774 + v0);
|
||||
}
|
||||
|
||||
Heap_Free(Unk_021C0774);
|
||||
|
||||
Unk_021C0774 = NULL;
|
||||
Unk_021C0778 = 0;
|
||||
}
|
||||
|
||||
void sub_02020C08(void)
|
||||
{
|
||||
int v0;
|
||||
|
||||
for (v0 = 0; v0 < Unk_021C0778; v0++) {
|
||||
if (Unk_021C0774[v0].unk_01 == 1) {
|
||||
sub_02020DA8(&Unk_021C0774[v0]);
|
||||
}
|
||||
|
||||
if (Unk_021C0774[v0].unk_03 == 1) {
|
||||
Unk_021C0774[v0].unk_03 = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UnkStruct_02020C44 *sub_02020C44(const UnkStruct_ov5_021EDDAC *param0)
|
||||
{
|
||||
UnkStruct_02020C44 *v0 = sub_02020D74();
|
||||
|
||||
if (v0 == NULL) {
|
||||
GF_ASSERT(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
v0->unk_00 = 1;
|
||||
v0->unk_01 = 1;
|
||||
v0->unk_04 = Heap_Alloc(param0->heapID, sizeof(UnkStruct_020216E0) * param0->unk_00);
|
||||
v0->unk_08 = param0->unk_00;
|
||||
|
||||
sub_02020B14(&v0->unk_0C);
|
||||
|
||||
v0->unk_0C.unk_BC = &v0->unk_0C;
|
||||
v0->unk_0C.unk_C0 = &v0->unk_0C;
|
||||
v0->unk_CC = Heap_Alloc(param0->heapID, sizeof(UnkStruct_020216E0 *) * param0->unk_00);
|
||||
|
||||
sub_020216A8(v0);
|
||||
v0->unk_D4 = Heap_Alloc(param0->heapID, sizeof(NNSFndAllocator));
|
||||
|
||||
HeapExp_FndInitAllocator(v0->unk_D4, param0->heapID, 4);
|
||||
v0->unk_D8 = sub_0201DD00(param0->unk_00, param0->heapID);
|
||||
|
||||
return v0;
|
||||
}
|
||||
|
||||
BOOL sub_02020CCC(UnkStruct_02020C44 *param0)
|
||||
{
|
||||
if (param0 == NULL) {
|
||||
GF_ASSERT(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (param0->unk_00 != 0) {
|
||||
sub_02020D14(param0);
|
||||
Heap_Free(param0->unk_04);
|
||||
Heap_Free(param0->unk_CC);
|
||||
Heap_Free(param0->unk_D4);
|
||||
sub_0201DD3C(param0->unk_D8);
|
||||
sub_02020AEC(param0);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
BOOL sub_02020D14(UnkStruct_02020C44 *param0)
|
||||
{
|
||||
UnkStruct_020216E0 *v0;
|
||||
UnkStruct_020216E0 *v1;
|
||||
|
||||
if (param0 == NULL) {
|
||||
GF_ASSERT(param0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (param0->unk_00 != 0) {
|
||||
v0 = param0->unk_0C.unk_BC;
|
||||
|
||||
while (v0 != ¶m0->unk_0C) {
|
||||
v1 = v0->unk_BC;
|
||||
sub_020211FC(v0);
|
||||
v0 = v1;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
BOOL sub_02020D50(UnkStruct_02020C44 *param0)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
|
||||
if (param0->unk_03 == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void sub_02020D68(UnkStruct_02020C44 *param0)
|
||||
{
|
||||
if (param0->unk_03 == 2) {
|
||||
param0->unk_03 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static UnkStruct_02020C44 *sub_02020D74(void)
|
||||
{
|
||||
int v0;
|
||||
|
||||
for (v0 = 0; v0 < Unk_021C0778; v0++) {
|
||||
if (Unk_021C0774[v0].unk_00 == 0) {
|
||||
return &Unk_021C0774[v0];
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void sub_02020DA8(UnkStruct_02020C44 *param0)
|
||||
{
|
||||
UnkStruct_020216E0 *v0;
|
||||
VecFx32 v1;
|
||||
MtxFx33 v2;
|
||||
const MtxFx33 *v3;
|
||||
|
||||
GF_ASSERT(param0);
|
||||
MTX_Identity33(&v2);
|
||||
|
||||
v0 = param0->unk_0C.unk_BC;
|
||||
|
||||
while (v0 != ¶m0->unk_0C) {
|
||||
if (v0->unk_24 == 1) {
|
||||
if (v0->unk_20 != NULL) {
|
||||
v0->unk_20(v0, v0->unk_1C);
|
||||
}
|
||||
|
||||
sub_0202185C(v0);
|
||||
|
||||
if (v0->unk_B4 == 3) {
|
||||
sub_0202144C(v0);
|
||||
} else {
|
||||
if (v0->unk_B4 == 2) {
|
||||
sub_02021414(v0);
|
||||
}
|
||||
}
|
||||
|
||||
v3 = v0->unk_18;
|
||||
|
||||
if (v3 == NULL) {
|
||||
v3 = &v2;
|
||||
}
|
||||
|
||||
Easy3D_DrawRenderObj(&v0->unk_30, &v0->unk_00, v3, &v0->unk_0C);
|
||||
sub_0202187C(v0);
|
||||
}
|
||||
|
||||
v0 = v0->unk_BC;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_02020E28(UnkStruct_020216E0 *param0, const UnkStruct_ov5_021DF84C *param1)
|
||||
{
|
||||
UnkStruct_02020C44 *v0 = (UnkStruct_02020C44 *)param0->unk_28;
|
||||
|
||||
sub_0202105C(v0, param0);
|
||||
sub_02021078(param0, param1);
|
||||
sub_020210F4(v0, param0, param1);
|
||||
|
||||
if (param0->unk_B4 == 1) {
|
||||
sub_02021744(&v0->unk_0C, param0);
|
||||
}
|
||||
|
||||
param0->unk_B4 = 2;
|
||||
param0->unk_2C = param1->unk_08;
|
||||
param0->unk_B6 = 0;
|
||||
param0->unk_B8 = 0;
|
||||
}
|
||||
|
||||
static void sub_02020E78(UnkStruct_020216E0 *param0, const UnkStruct_ov5_021DF84C *param1)
|
||||
{
|
||||
UnkStruct_02020C44 *v0 = param0->unk_28;
|
||||
|
||||
sub_0202105C(v0, param0);
|
||||
|
||||
if (param0->unk_B4 == 2) {
|
||||
sub_02020FC8(¶m0->unk_94, ¶m0->unk_98, ¶m0->unk_9C);
|
||||
}
|
||||
|
||||
param0->unk_94 = param1->unk_1C;
|
||||
param0->unk_98 = param1->unk_20;
|
||||
param0->unk_9C = param1->unk_24;
|
||||
|
||||
sub_02021148(param0, param1);
|
||||
sub_0202117C(param0, param1);
|
||||
|
||||
if (param0->unk_B4 == 1) {
|
||||
sub_02021744(&v0->unk_0C, param0);
|
||||
}
|
||||
|
||||
param0->unk_B4 = 3;
|
||||
param0->unk_2C = param1->unk_08;
|
||||
param0->unk_B6 = 0;
|
||||
param0->unk_B8 = 0;
|
||||
}
|
||||
|
||||
static void sub_02020EF8(const NNSG3dResTex *param0, NNSG3dTexKey *param1, NNSG3dTexKey *param2, NNSG3dPlttKey *param3)
|
||||
{
|
||||
u32 v0 = NNS_G3dTexGetRequiredSize(param0);
|
||||
u32 v1 = NNS_G3dTex4x4GetRequiredSize(param0);
|
||||
u32 v2 = NNS_G3dPlttGetRequiredSize(param0);
|
||||
|
||||
if (v0 > 0) {
|
||||
*param1 = NNS_GfdAllocTexVram(v0, 0, 0);
|
||||
GF_ASSERT(*param1 != (NNS_GFD_ALLOC_ERROR_TEXKEY));
|
||||
} else {
|
||||
*param1 = 0;
|
||||
}
|
||||
|
||||
if (v1 > 0) {
|
||||
*param2 = NNS_GfdAllocTexVram(v1, 1, 0);
|
||||
GF_ASSERT(*param2 != (NNS_GFD_ALLOC_ERROR_TEXKEY));
|
||||
} else {
|
||||
*param2 = 0;
|
||||
}
|
||||
|
||||
if (v2 > 0) {
|
||||
*param3 = NNS_GfdAllocPlttVram(v2, param0->tex4x4Info.flag & NNS_G3D_RESPLTT_USEPLTT4, 0);
|
||||
GF_ASSERT(*param3 != (NNS_GFD_ALLOC_ERROR_PLTTKEY));
|
||||
} else {
|
||||
*param3 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_02020F90(NNSG3dResTex *param0, NNSG3dTexKey *param1, NNSG3dTexKey *param2, NNSG3dPlttKey *param3)
|
||||
{
|
||||
NNS_G3dTexReleaseTexKey(param0, param1, param2);
|
||||
*param3 = NNS_G3dPlttReleasePlttKey(param0);
|
||||
}
|
||||
|
||||
static void sub_02020FA4(NNSG3dResTex *param0, NNSG3dResMdlSet *param1, NNSG3dTexKey *param2, NNSG3dTexKey *param3, NNSG3dPlttKey *param4)
|
||||
{
|
||||
NNS_G3dTexSetTexKey(param0, *param2, *param3);
|
||||
NNS_G3dPlttSetPlttKey(param0, *param4);
|
||||
NNS_G3dBindMdlSet(param1, param0);
|
||||
}
|
||||
|
||||
static void sub_02020FC8(NNSG3dTexKey *param0, NNSG3dTexKey *param1, NNSG3dPlttKey *param2)
|
||||
{
|
||||
if (*param0 != (NNS_GFD_ALLOC_ERROR_TEXKEY)) {
|
||||
NNS_GfdFreeTexVram(*param0);
|
||||
}
|
||||
|
||||
if (*param1 != (NNS_GFD_ALLOC_ERROR_TEXKEY)) {
|
||||
NNS_GfdFreeTexVram(*param1);
|
||||
}
|
||||
|
||||
if (*param2 != (NNS_GFD_ALLOC_ERROR_PLTTKEY)) {
|
||||
NNS_GfdFreePlttVram(*param2);
|
||||
}
|
||||
}
|
||||
|
||||
static BOOL sub_02020FFC(const NNSG3dResTex *param0, const NNSG3dResTex *param1)
|
||||
{
|
||||
u32 v0, v1, v2;
|
||||
u32 v3, v4, v5;
|
||||
BOOL v6;
|
||||
|
||||
if ((param0 == NULL) || (param1 == NULL)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
v0 = NNS_G3dTexGetRequiredSize(param0);
|
||||
v1 = NNS_G3dTex4x4GetRequiredSize(param0);
|
||||
v2 = NNS_G3dPlttGetRequiredSize(param0);
|
||||
v3 = NNS_G3dTexGetRequiredSize(param1);
|
||||
v4 = NNS_G3dTex4x4GetRequiredSize(param1);
|
||||
v5 = NNS_G3dPlttGetRequiredSize(param1);
|
||||
|
||||
if ((v0 != v3) || (v1 != v4) || (v2 != v5)) {
|
||||
v6 = 0;
|
||||
} else {
|
||||
v6 = 1;
|
||||
}
|
||||
|
||||
return v6;
|
||||
}
|
||||
|
||||
static void sub_0202105C(UnkStruct_02020C44 *param0, UnkStruct_020216E0 *param1)
|
||||
{
|
||||
if (param1->unk_B0) {
|
||||
sub_0201DDAC(param1->unk_B0);
|
||||
param1->unk_B0 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_02021078(UnkStruct_020216E0 *param0, const UnkStruct_ov5_021DF84C *param1)
|
||||
{
|
||||
NNSG3dResTex *v0;
|
||||
int v1;
|
||||
|
||||
v0 = param0->unk_8C;
|
||||
param0->unk_84 = sub_02021788(param1, ¶m0->unk_88, ¶m0->unk_8C);
|
||||
|
||||
NNS_G3dRenderObjInit(¶m0->unk_30, param0->unk_88);
|
||||
|
||||
if (param0->unk_B4 != 3) {
|
||||
v1 = sub_02020FFC(v0, param0->unk_8C);
|
||||
} else {
|
||||
v1 = 0;
|
||||
}
|
||||
|
||||
if (v1 == 0) {
|
||||
if (param0->unk_B4 == 2) {
|
||||
sub_02020FC8(&(param0->unk_94), &(param0->unk_98), &(param0->unk_9C));
|
||||
}
|
||||
|
||||
sub_02020EF8(param0->unk_8C, &(param0->unk_94), &(param0->unk_98), &(param0->unk_9C));
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_020210F4(const UnkStruct_02020C44 *param0, UnkStruct_020216E0 *param1, const UnkStruct_ov5_021DF84C *param2)
|
||||
{
|
||||
param1->unk_90 = sub_020217D4(param2);
|
||||
param1->unk_A0 = param2->unk_0C;
|
||||
param1->unk_B0 = sub_0201DD54(param0->unk_D8, ¶m1->unk_A0, param1->unk_90, param1->unk_94, param1->unk_9C, param1->unk_B8);
|
||||
}
|
||||
|
||||
static void sub_02021148(UnkStruct_020216E0 *param0, const UnkStruct_ov5_021DF84C *param1)
|
||||
{
|
||||
param0->unk_84 = sub_02021788(param1, ¶m0->unk_88, ¶m0->unk_8C);
|
||||
NNS_G3dRenderObjInit(¶m0->unk_30, param0->unk_88);
|
||||
param0->unk_90 = sub_020217D4(param1);
|
||||
}
|
||||
|
||||
static void sub_0202117C(UnkStruct_020216E0 *param0, const UnkStruct_ov5_021DF84C *param1)
|
||||
{
|
||||
param0->unk_A0 = param1->unk_0C;
|
||||
param0->unk_B0 = NULL;
|
||||
}
|
||||
|
||||
UnkStruct_020216E0 *sub_0202119C(const UnkStruct_ov5_021DF7F8 *param0)
|
||||
{
|
||||
UnkStruct_020216E0 *v0;
|
||||
UnkStruct_02020C44 *v1;
|
||||
|
||||
if (param0->unk_00 == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
v1 = param0->unk_00;
|
||||
v0 = sub_020216E0(v1);
|
||||
|
||||
if (v0 == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
v0->unk_28 = v1;
|
||||
v0->unk_00 = param0->unk_08;
|
||||
v0->unk_0C = param0->unk_14;
|
||||
v0->unk_B6 = 0;
|
||||
v0->unk_24 = 1;
|
||||
v0->unk_B4 = 1;
|
||||
|
||||
sub_020217E0(v0, param0->unk_04);
|
||||
|
||||
return v0;
|
||||
}
|
||||
|
||||
BOOL sub_020211FC(UnkStruct_020216E0 *param0)
|
||||
{
|
||||
UnkStruct_02020C44 *v0;
|
||||
|
||||
GF_ASSERT(param0);
|
||||
GF_ASSERT(param0->unk_B4 != 1);
|
||||
|
||||
v0 = (UnkStruct_02020C44 *)param0->unk_28;
|
||||
|
||||
if (param0->unk_B4 == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub_02021768(param0);
|
||||
|
||||
if (param0->unk_B4 == 2) {
|
||||
sub_02020FC8(&(param0->unk_94), &(param0->unk_98), &(param0->unk_9C));
|
||||
}
|
||||
|
||||
sub_0202105C(v0, param0);
|
||||
sub_0202170C(v0, param0);
|
||||
|
||||
v0->unk_03 = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void sub_0202125C(UnkStruct_ov5_021DF84C *param0, void *param1, const NNSG3dResTex *param2, const UnkStruct_020217F4 *param3, const UnkStruct_02024184 *param4, NNSGfdTexKey param5, NNSGfdTexKey param6, NNSGfdPlttKey param7)
|
||||
{
|
||||
param0->unk_00 = param1;
|
||||
param0->unk_04 = param2;
|
||||
param0->unk_08 = param3;
|
||||
param0->unk_0C = *param4;
|
||||
param0->unk_1C = param5;
|
||||
param0->unk_20 = param6;
|
||||
param0->unk_24 = param7;
|
||||
}
|
||||
|
||||
void sub_02021284(UnkStruct_ov5_021DF84C *param0, void *param1, const NNSG3dResTex *param2, const UnkStruct_020217F4 *param3, const UnkStruct_02024184 *param4)
|
||||
{
|
||||
param0->unk_00 = param1;
|
||||
param0->unk_04 = param2;
|
||||
param0->unk_08 = param3;
|
||||
param0->unk_0C = *param4;
|
||||
param0->unk_1C = (NNS_GFD_ALLOC_ERROR_TEXKEY);
|
||||
param0->unk_20 = (NNS_GFD_ALLOC_ERROR_TEXKEY);
|
||||
param0->unk_24 = (NNS_GFD_ALLOC_ERROR_PLTTKEY);
|
||||
}
|
||||
|
||||
void sub_020212A8(UnkStruct_020216E0 *param0, const VecFx32 *param1)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
param0->unk_00 = *param1;
|
||||
}
|
||||
|
||||
const VecFx32 *sub_020212C0(const UnkStruct_020216E0 *param0)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
return ¶m0->unk_00;
|
||||
}
|
||||
|
||||
void sub_020212D0(UnkStruct_020216E0 *param0, const VecFx32 *param1)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
param0->unk_0C = *param1;
|
||||
}
|
||||
|
||||
const VecFx32 *sub_020212EC(const UnkStruct_020216E0 *param0)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
return ¶m0->unk_0C;
|
||||
}
|
||||
|
||||
void sub_020212FC(UnkStruct_020216E0 *param0, const MtxFx33 *param1)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
param0->unk_18 = param1;
|
||||
}
|
||||
|
||||
const MtxFx33 *sub_02021310(const UnkStruct_020216E0 *param0)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
return param0->unk_18;
|
||||
}
|
||||
|
||||
void sub_02021320(UnkStruct_020216E0 *param0, u8 param1)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
param0->unk_24 = param1;
|
||||
}
|
||||
|
||||
u8 sub_02021334(const UnkStruct_020216E0 *param0)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
return param0->unk_24;
|
||||
}
|
||||
|
||||
void sub_02021344(UnkStruct_020216E0 *param0, int param1)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
param0->unk_B6 = param1;
|
||||
}
|
||||
|
||||
int sub_02021358(const UnkStruct_020216E0 *param0)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
return param0->unk_B6;
|
||||
}
|
||||
|
||||
int sub_02021368(UnkStruct_020216E0 *param0, fx32 param1)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
|
||||
return sub_02021804(param0, param1);
|
||||
}
|
||||
|
||||
void sub_02021380(UnkStruct_020216E0 *param0, fx32 param1)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
param0->unk_B8 = param1;
|
||||
}
|
||||
|
||||
fx32 sub_02021394(const UnkStruct_020216E0 *param0)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
return param0->unk_B8;
|
||||
}
|
||||
|
||||
void sub_020213A4(UnkStruct_020216E0 *param0, fx32 param1)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
|
||||
param0->unk_B8 = sub_020217F4(param0, param0->unk_B6);
|
||||
param0->unk_B8 += param1;
|
||||
}
|
||||
|
||||
fx32 sub_020213D4(const UnkStruct_020216E0 *param0)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
return param0->unk_B8 - sub_020217F4(param0, param0->unk_B6);
|
||||
}
|
||||
|
||||
NNSG3dResMdl *sub_020213F4(const UnkStruct_020216E0 *param0)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
return param0->unk_88;
|
||||
}
|
||||
|
||||
int sub_02021404(const UnkStruct_020216E0 *param0)
|
||||
{
|
||||
GF_ASSERT(param0);
|
||||
return param0->unk_B4;
|
||||
}
|
||||
|
||||
void sub_02021414(UnkStruct_020216E0 *param0)
|
||||
{
|
||||
if (param0->unk_B4 == 2) {
|
||||
sub_0201DDD8(param0->unk_B0, param0->unk_B8);
|
||||
}
|
||||
}
|
||||
|
||||
NNSG3dResMdl *sub_02021430(UnkStruct_020216E0 *param0)
|
||||
{
|
||||
return param0->unk_88;
|
||||
}
|
||||
|
||||
NNSG3dResTex *sub_02021438(UnkStruct_020216E0 *param0)
|
||||
{
|
||||
return param0->unk_8C;
|
||||
}
|
||||
|
||||
NNSG3dRenderObj *sub_02021440(UnkStruct_020216E0 *param0)
|
||||
{
|
||||
return ¶m0->unk_30;
|
||||
}
|
||||
|
||||
void sub_02021444(UnkStruct_020216E0 *param0, UnkFuncPtr_02021444 param1, void *param2)
|
||||
{
|
||||
param0->unk_1C = param2;
|
||||
param0->unk_20 = param1;
|
||||
}
|
||||
|
||||
static void sub_0202144C(UnkStruct_020216E0 *param0)
|
||||
{
|
||||
UnkStruct_0202144C v0;
|
||||
|
||||
v0 = sub_0202414C(¶m0->unk_A0, param0->unk_B8 >> FX32_SHIFT);
|
||||
|
||||
sub_0202149C(param0->unk_88, param0->unk_90, v0.unk_00);
|
||||
sub_020215A0(param0->unk_88, param0->unk_90, v0.unk_01);
|
||||
}
|
||||
|
||||
static void sub_0202149C(NNSG3dResMdl *param0, const NNSG3dResTex *param1, u8 param2)
|
||||
{
|
||||
NNSG3dResMat *v0;
|
||||
const NNSG3dResDict *v1;
|
||||
const NNSG3dResDictTexToMatIdxData *v2;
|
||||
const NNSG3dResDictTexData *v3;
|
||||
u32 v4;
|
||||
int v5;
|
||||
|
||||
v0 = NNS_G3dGetMat(param0);
|
||||
v1 = (NNSG3dResDict *)((u8 *)v0 + v0->ofsDictTexToMatList);
|
||||
v3 = NNS_G3dGetTexDataByIdx(param1, param2);
|
||||
v4 = (v3->texImageParam & NNS_G3D_TEXIMAGE_PARAM_TEX_ADDR_MASK);
|
||||
|
||||
for (v5 = 0; v5 < v1->numEntry; ++v5) {
|
||||
v2 = (NNSG3dResDictTexToMatIdxData *)NNS_G3dGetResDataByIdx(v1, v5);
|
||||
|
||||
if (v2->flag & 1) {
|
||||
sub_02021524(v0, v2, v4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_02021524(NNSG3dResMat *param0, const NNSG3dResDictTexToMatIdxData *param1, u32 param2)
|
||||
{
|
||||
u8 *v0;
|
||||
int v1;
|
||||
NNSG3dResMatData *v2;
|
||||
|
||||
v0 = (u8 *)param0 + param1->offset;
|
||||
|
||||
for (v1 = 0; v1 < param1->numIdx; v1++) {
|
||||
v2 = NNS_G3dGetMatDataByIdx(param0, *(v0 + v1));
|
||||
GF_ASSERT(((v2->texImageParam & NNS_G3D_TEXIMAGE_PARAM_TEX_ADDR_MASK) + param2) <= NNS_G3D_TEXIMAGE_PARAM_TEX_ADDR_MASK);
|
||||
v2->texImageParam += param2;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_020215A0(NNSG3dResMdl *param0, const NNSG3dResTex *param1, u8 param2)
|
||||
{
|
||||
NNSG3dResMat *v0;
|
||||
const NNSG3dResDict *v1;
|
||||
const NNSG3dResDictPlttToMatIdxData *v2;
|
||||
const NNSG3dResDictPlttData *v3;
|
||||
u32 v4;
|
||||
u32 v5;
|
||||
|
||||
v0 = NNS_G3dGetMat(param0);
|
||||
v1 = (NNSG3dResDict *)((u8 *)v0 + v0->ofsDictPlttToMatList);
|
||||
v3 = NNS_G3dGetPlttDataByIdx(param1, param2);
|
||||
v4 = v3->offset;
|
||||
|
||||
if (!(v3->flag & 1)) {
|
||||
v4 >>= 1;
|
||||
}
|
||||
|
||||
for (v5 = 0; v5 < v1->numEntry; ++v5) {
|
||||
v2 = (NNSG3dResDictPlttToMatIdxData *)NNS_G3dGetResDataByIdx(v1, v5);
|
||||
|
||||
if (v2->flag & 1) {
|
||||
sub_0202162C(v0, v2, v4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_0202162C(NNSG3dResMat *param0, const NNSG3dResDictPlttToMatIdxData *param1, u32 param2)
|
||||
{
|
||||
u8 *v0;
|
||||
u32 v1;
|
||||
|
||||
v0 = (u8 *)param0 + param1->offset;
|
||||
|
||||
for (v1 = 0; v1 < param1->numIdx; v1++) {
|
||||
NNSG3dResMatData *v2 = NNS_G3dGetMatDataByIdx(param0, *(v0 + v1));
|
||||
|
||||
GF_ASSERT(((v2->texPlttBase & 0x1fff) + param2) <= 0x1fff);
|
||||
v2->texPlttBase += param2;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_020216A8(UnkStruct_02020C44 *param0)
|
||||
{
|
||||
int v0;
|
||||
|
||||
for (v0 = 0; v0 < param0->unk_08; v0++) {
|
||||
sub_02020B14(¶m0->unk_04[v0]);
|
||||
param0->unk_CC[v0] = param0->unk_04 + v0;
|
||||
}
|
||||
|
||||
param0->unk_D0 = 0;
|
||||
}
|
||||
|
||||
static UnkStruct_020216E0 *sub_020216E0(UnkStruct_02020C44 *param0)
|
||||
{
|
||||
UnkStruct_020216E0 *v0;
|
||||
|
||||
if (param0->unk_D0 >= param0->unk_08) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
v0 = param0->unk_CC[param0->unk_D0];
|
||||
param0->unk_D0++;
|
||||
|
||||
return v0;
|
||||
}
|
||||
|
||||
static BOOL sub_0202170C(UnkStruct_02020C44 *param0, UnkStruct_020216E0 *param1)
|
||||
{
|
||||
if (param0->unk_D0 <= 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub_02020B14(param1);
|
||||
|
||||
param0->unk_D0--;
|
||||
param0->unk_CC[param0->unk_D0] = param1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void sub_02021744(UnkStruct_020216E0 *param0, UnkStruct_020216E0 *param1)
|
||||
{
|
||||
param1->unk_C0 = param0->unk_C0;
|
||||
param0->unk_C0->unk_BC = param1;
|
||||
param1->unk_BC = param0;
|
||||
param0->unk_C0 = param1;
|
||||
}
|
||||
|
||||
static void sub_02021768(UnkStruct_020216E0 *param0)
|
||||
{
|
||||
param0->unk_C0->unk_BC = param0->unk_BC;
|
||||
param0->unk_BC->unk_C0 = param0->unk_C0;
|
||||
}
|
||||
|
||||
static NNSG3dResMdlSet *sub_02021788(const UnkStruct_ov5_021DF84C *param0, NNSG3dResMdl **param1, NNSG3dResTex **param2)
|
||||
{
|
||||
void *v0 = sub_0202189C(param0, 0);
|
||||
NNSG3dResMdlSet *v1 = NNS_G3dGetMdlSet(v0);
|
||||
|
||||
*param1 = NNS_G3dGetMdlByIdx(v1, 0);
|
||||
|
||||
if (param2) {
|
||||
*param2 = NNS_G3dGetTex(v0);
|
||||
}
|
||||
|
||||
return v1;
|
||||
}
|
||||
|
||||
static NNSG3dResTex *sub_020217D4(const UnkStruct_ov5_021DF84C *param0)
|
||||
{
|
||||
NNSG3dResTex *v0 = (NNSG3dResTex *)sub_0202189C(param0, 1);
|
||||
return v0;
|
||||
}
|
||||
|
||||
static void sub_020217E0(UnkStruct_020216E0 *param0, const UnkStruct_ov5_021DF84C *param1)
|
||||
{
|
||||
if (param1->unk_1C == (NNS_GFD_ALLOC_ERROR_TEXKEY)) {
|
||||
sub_02020E28(param0, param1);
|
||||
} else {
|
||||
sub_02020E78(param0, param1);
|
||||
}
|
||||
}
|
||||
|
||||
static fx32 sub_020217F4(const UnkStruct_020216E0 *param0, int param1)
|
||||
{
|
||||
const UnkStruct_020217F4 *v0 = sub_020218B4(param0->unk_2C, param1);
|
||||
return v0->unk_00 << FX32_SHIFT;
|
||||
}
|
||||
|
||||
static int sub_02021804(UnkStruct_020216E0 *param0, fx32 param1)
|
||||
{
|
||||
const UnkStruct_020217F4 *v0 = sub_020218B4(param0->unk_2C, param0->unk_B6);
|
||||
return sub_02021824(v0, ¶m0->unk_B8, param1);
|
||||
}
|
||||
|
||||
static int sub_02021824(const UnkStruct_020217F4 *param0, fx32 *param1, fx32 param2)
|
||||
{
|
||||
int v0 = 0;
|
||||
|
||||
if (((param0->unk_00 * FX32_ONE) > *param1) || ((param0->unk_04 * FX32_ONE) < *param1)) {
|
||||
*param1 = (param0->unk_00 * FX32_ONE);
|
||||
} else {
|
||||
if ((param0->unk_04 * FX32_ONE) < *param1 + param2) {
|
||||
if (param0->unk_08 == 0) {
|
||||
*param1 = (param0->unk_00 * FX32_ONE);
|
||||
} else {
|
||||
v0 = 1;
|
||||
*param1 = (param0->unk_04 * FX32_ONE);
|
||||
}
|
||||
} else {
|
||||
*param1 += param2;
|
||||
}
|
||||
}
|
||||
|
||||
return v0;
|
||||
}
|
||||
|
||||
static void sub_0202185C(UnkStruct_020216E0 *param0)
|
||||
{
|
||||
sub_02020FA4(param0->unk_8C, param0->unk_84, ¶m0->unk_94, ¶m0->unk_98, ¶m0->unk_9C);
|
||||
}
|
||||
|
||||
static void sub_0202187C(UnkStruct_020216E0 *param0)
|
||||
{
|
||||
NNSG3dTexKey v0;
|
||||
NNSG3dTexKey v1;
|
||||
NNSG3dPlttKey v2;
|
||||
|
||||
NNS_G3dReleaseMdlSet(param0->unk_84);
|
||||
sub_02020F90(param0->unk_8C, &v1, &v0, &v2);
|
||||
}
|
||||
|
||||
static void *sub_0202189C(const UnkStruct_ov5_021DF84C *param0, int param1)
|
||||
{
|
||||
void *v0;
|
||||
|
||||
switch (param1) {
|
||||
case 0:
|
||||
v0 = param0->unk_00;
|
||||
break;
|
||||
case 1:
|
||||
v0 = (void *)param0->unk_04;
|
||||
break;
|
||||
default:
|
||||
v0 = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
return v0;
|
||||
}
|
||||
|
||||
static const UnkStruct_020217F4 *sub_020218B4(const UnkStruct_020217F4 *param0, int param1)
|
||||
{
|
||||
return param0 + param1;
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
#include "unk_0202414C.h"
|
||||
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_defs/struct_0202144C.h"
|
||||
#include "struct_defs/struct_02024184.h"
|
||||
|
||||
UnkStruct_0202144C sub_0202414C(const UnkStruct_02024184 *param0, const u16 param1)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_0202144C v1;
|
||||
|
||||
for (v0 = 0; v0 < param0->unk_0C - 1; v0++) {
|
||||
if (param0->unk_00[v0 + 1] > param1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
v1.unk_00 = param0->unk_04[v0];
|
||||
v1.unk_01 = param0->unk_08[v0];
|
||||
|
||||
return v1;
|
||||
}
|
||||
|
||||
void sub_02024184(const void *param0, UnkStruct_02024184 *param1)
|
||||
{
|
||||
const u8 *v0 = param0;
|
||||
param1->unk_0C = *((u32 *)v0);
|
||||
|
||||
v0 = v0 + sizeof(u32);
|
||||
param1->unk_00 = (u16 *)v0;
|
||||
|
||||
v0 = v0 + (sizeof(u16) * param1->unk_0C);
|
||||
param1->unk_04 = (u8 *)v0;
|
||||
|
||||
v0 = v0 + (sizeof(u8) * param1->unk_0C);
|
||||
param1->unk_08 = (u8 *)v0;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user