-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This mainly documents the `ov5_021E15F4.c` file, which is in charge of reading 3D map objects from the land data NARC, managing them, and rendering them. A "3D map object" is defined here as a 3D model that is separate from the map 3D model, and that can be positioned, rotated, and scaled independently. For instance, they are usually used to place buildings on the various maps. Signed-off-by: Kuruyia <[email protected]>
- Loading branch information
Showing
31 changed files
with
675 additions
and
707 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef POKEPLATINUM_CONSTANTS_BUILDING_H | ||
#define POKEPLATINUM_CONSTANTS_BUILDING_H | ||
|
||
enum BuildingId { | ||
BUILDING_ID_HONEY_TREE = 26, | ||
BUILDING_ID_UNK_242 = 242, | ||
BUILDING_ID_UNK_258 = 258, | ||
BUILDING_ID_UNK_475 = 475, | ||
}; | ||
|
||
#endif // POKEPLATINUM_CONSTANTS_BUILDING_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#ifndef POKEPLATINUM_OV5_BUILDING_H | ||
#define POKEPLATINUM_OV5_BUILDING_H | ||
|
||
#include <nitro/fx/fx.h> | ||
#include <nnsys.h> | ||
|
||
#include "overlay005/struct_ov5_021D3CAC_decl.h" | ||
#include "overlay005/struct_ov5_021D5894.h" | ||
#include "overlay005/struct_ov5_021EF76C_decl.h" | ||
|
||
#include "narc.h" | ||
|
||
#define MAX_LOADED_BUILDINGS 32 | ||
|
||
typedef struct Building { | ||
int id; | ||
BOOL loaded; | ||
BOOL hidden; | ||
BOOL applyRotation; | ||
NNSG3dRenderObj renderObj; | ||
NNSG3dResMdl *model; | ||
VecFx32 position; | ||
VecFx32 rotation; | ||
VecFx32 scale; | ||
} Building; | ||
|
||
typedef struct BuildingManager { | ||
Building loadedObjects[MAX_LOADED_BUILDINGS]; | ||
} BuildingManager; | ||
|
||
BuildingManager *BuildingManager_New(const u8 heapId); | ||
void BuildingManager_Free(BuildingManager *buildingManager); | ||
void BuildingManager_Init(BuildingManager *buildingManager); | ||
void BuildingManager_InitOne(const int index, BuildingManager *buildingManager); | ||
void BuildingManager_Load(NARC *landDataNARC, const int buildingFilesSize, UnkStruct_ov5_021EF76C *const param2, BuildingManager *buildingManager, UnkStruct_ov5_021D3CAC *param4); | ||
void BuildingManager_Render(const VecFx32 *positionOffset, const UnkStruct_ov5_021EF76C *param1, const BOOL param2, UnkStruct_ov5_021D5894 *const param3, BuildingManager *buildingManager); | ||
VecFx32 *Building_GetRotation(Building *building); | ||
VecFx32 Building_GetPosition(const Building *building); | ||
void Building_SetPosition(Building *building, const VecFx32 *position); | ||
void Building_SetHidden(Building *building, const BOOL hidden); | ||
int Building_GetId(const Building *building); | ||
NNSG3dRenderObj *Building_GetRenderObj(const Building *building); | ||
NNSG3dResMdl *Building_GetModel(const Building *building); | ||
Building *BuildingManager_GetLoadedObject(BuildingManager *buildingManager, const u8 index); | ||
Building *BuildingManager_FindLoadedObjectById(BuildingManager *buildingManager, const int id); | ||
Building *BuildingManager_GetLoadedObjectSafely(BuildingManager *buildingManager, const int index); | ||
u8 BuildingManager_LoadOne(BuildingManager *buildingManager, UnkStruct_ov5_021EF76C *const param1, const int id, const VecFx32 *position, const VecFx32 *rotation, UnkStruct_ov5_021D3CAC *param5); | ||
void BuildingManager_Render2(BuildingManager *buildingManager, UnkStruct_ov5_021EF76C *const param1); | ||
|
||
#endif // POKEPLATINUM_OV5_BUILDING_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#ifndef POKEPLATINUM_FUNCPTR_OV5_021E9630_H | ||
#define POKEPLATINUM_FUNCPTR_OV5_021E9630_H | ||
|
||
#include "overlay005/struct_ov5_021E1608_decl.h" | ||
#include "overlay005/building.h" | ||
|
||
typedef void (*UnkFuncPtr_ov5_021E9630)(void *, const int, UnkStruct_ov5_021E1608 *const); | ||
typedef void (*UnkFuncPtr_ov5_021E9630)(void *, const int, BuildingManager *const); | ||
|
||
#endif // POKEPLATINUM_FUNCPTR_OV5_021E9630_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.