DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
dungeonmap.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "common.h"
4
5#include <libvu0.h>
6
7#include "character.hpp"
8#include "collision.hpp"
9#include "dataalloc_fwd.hpp"
10#include "dungeonparts.hpp"
11#include "fireomni.hpp"
12#include "water.hpp"
13
17// clang-format off
24
25// clang-format on
26
30// clang-format off
44
45// clang-format on
46
50// clang-format off
55
56// clang-format on
57
61// clang-format off
68
69// clang-format on
70
71// Forward declarations for the types these declarations name. The skeleton
72// headers are generated from the retail symbol table, which knows the type
73// names but not where they live.
74class CCameraFollow;
75
84struct MAPPARTS {
88 s32 visible;
89};
90
91typedef MAPPARTS MAP_CELL;
92
96struct ROOM_INFO {
97 s32 x;
98 s32 y;
99 s32 width;
100 s32 height;
101};
102
107 s32 used;
108 u8 unk_04[12];
109 sceVu0FVECTOR pos;
111 s32 closed;
112 s32 kind;
113 float lid_angle;
115 u8 unk_34[12];
116};
117
121struct ATRA_BOLL {
122 float pos[4];
124 s32 used;
125 float phase;
126 s32 unk_1C;
127};
128
133 float pos[4];
134 s32 state;
135 s32 kind;
136 float timer;
137 s32 unk_1C;
138};
139
144 s32 door_x;
145 s32 door_y;
146 float item_x;
147 float item_y;
148 s32 used;
149 s32 unk_14;
150};
151
158 s32 kind;
160 float pos[4];
161 s32 unk_20;
162 float radius;
163 s32 index;
165 u8 unk_30[32];
166};
167
173 float pos[4];
174 float rot[4];
176 s32 used;
179 float draw_pos[16][4];
180 s32 draw_param[16];
182 u8 unk_1324[12];
183
193};
194
199public:
200 s32 unk_0000;
201 s32 unk_0004;
202 s32 room_seen[16];
208 sceVu0FVECTOR dummy_pos[8];
209 s32 dummy_model[8];
216 s32 mask[400];
246 void SetNPC(int npc_no, unsigned int *pack, int parts_no, sceVu0FVECTOR pos, sceVu0FVECTOR rot, int visible, int motion_no, CDataAlloc2<1> *alloc);
247
255 void ClearNPC_Cash();
256
264 void ReservNPC_Draw(int npc_no, float x, float y, float z, int direction);
265
272 void DrawNPCDraw();
273
282 void StepNPC();
283
291 void NPCSetMotion(int npc_no, int motion_no);
292
300 void NPCSetMotion(int npc_no, int motion_no, float speed, int motion_flags);
301
309 CFrame *GetFrameSearch(char *name);
310
319 void DrawMapFreeStyle();
320
327 void DrawMapCalc(int mode);
328
336 void DrawMap(CCameraFollow *camera, CFrameVu1 *player);
337
346 void DrawBGModel(CCamera *camera);
347
355 void DrawDummyModel(CCamera *camera);
356
364 void DrawMiniMap(float *pos, float angle);
365
374 void checkMask(float x, float z);
375
383 void FlushCheckMask();
384
392 void DrawFireFreeStyle(CFrameVu1 *frame, CCameraFollow *camera);
393
401 void DrawFire(CFrameVu1 *frame, CCameraFollow *camera);
402
410 void DrawRaster(CFrameVu1 *frame);
411
421 void DrawWater(float *pos, int mute);
422
430 void DrawItemBox(float *pos);
431
439 void DrawAtraBoll(float *pos);
440
449 int CreateCollision(CCPoly *poly, CBoxVu0 box, int num);
450
458 void initTrapCircle();
459
467 float *CheckTrapCircle(float *pos, float dist);
468
476 void SetupTrapCircle(float *pos);
477
484 void DrawTrapCircle();
485
494
502 void StepTrapCircle();
503
511 int CheckTreasureBox(float *pos, float dist);
512
520 int CheckAtra(float *pos, float dist);
521
528 void SetAtraBoll(float *pos, int atra_no);
529
537 int SetTreasureBox(float *pos, int item_no, int kind, int trap_no);
538
546 void buildEventData(int floor_no, int enabled, int place_atla);
547
554 void SetMimicEvent(float x, float y, float z, int item_no, int kind);
555
563 void RsetMimicEvent();
564
572 int GetActiveIvent(CFrameVu1 *frame);
573
580 void buildDummyModel();
581
589 void GetRoomLinkInfo();
590
598 void SetUnderLoad();
599
605 int CreatPartsList(int *list, int max, int first_part, int last_part);
606
614
620 int SetCharaDoor(int chara_no);
621
630 void buildRandomMap(int room_max, int first_build);
631
638 void initSubmap(CDataAlloc2<1> *alloc);
639
646 void initalize();
647};
648
656void mapPartsFilter();
657
658STATIC_ASSERT(sizeof(MAP_CELL) == 0x10);
659STATIC_ASSERT(sizeof(ROOM_INFO) == 0x10);
660STATIC_ASSERT(sizeof(TREASURE_BOX) == 0x40);
661STATIC_ASSERT(sizeof(ATRA_BOLL) == 0x20);
662STATIC_ASSERT(sizeof(MAP_TRAP_CIRCLE) == 0x20);
663STATIC_ASSERT(sizeof(ROOM_LINK_RESULT) == 0x18);
664STATIC_ASSERT(sizeof(DUNGEON_EVENT) == 0x50);
665STATIC_ASSERT(sizeof(MAP_NPC_MODEL) == 0x1330);
666STATIC_ASSERT(sizeof(CDungeonMap) == 0x10B10);
sceVu0FVECTOR dummy_pos[8]
CFrame * GetFrameSearch(char *name)
int SetTreasureBox(float *pos, int item_no, int kind, int trap_no)
ROOM_LINK_RESULT room_link[4]
s32 room_seen[16]
void DrawFire(CFrameVu1 *frame, CCameraFollow *camera)
void DrawFireFreeStyle(CFrameVu1 *frame, CCameraFollow *camera)
MAP_TRAP_CIRCLE * DistTrapCircle()
void DrawItemBox(float *pos)
MAP_TRAP_CIRCLE trap_circle[3]
void SetupTrapCircle(float *pos)
MAP_NPC_MODEL npc[4]
void SetUnderLoad()
s32 mask[400]
int SetCharaDoor(int chara_no)
void DrawMapFreeStyle()
void DrawRaster(CFrameVu1 *frame)
TREASURE_BOX boxes[24]
void ClearNPC_Cash()
int CreatPartsList(int *list, int max, int first_part, int last_part)
void initSubmap(CDataAlloc2< 1 > *alloc)
s32 dummy_model[8]
void DrawWater(float *pos, int mute)
void DrawBGModel(CCamera *camera)
void buildDummyModel()
CFireOmni fire
void NPCSetMotion(int npc_no, int motion_no)
CFrame * dummy_frame[3]
int CreateCollision(CCPoly *poly, CBoxVu0 box, int num)
int CheckTreasureBox(float *pos, float dist)
MAP_CELL cells[400]
float draw_dist_scale
ATRA_BOLL atra[8]
CFrame * box_collision_model
CFrame * chest_collision_model
DUNGEON_EVENT events[48]
ROOM_INFO rooms[16]
void FlushCheckMask()
CFrame * bg_model[6]
void DrawDummyModel(CCamera *camera)
int GetActiveIvent(CFrameVu1 *frame)
void SetNPC(int npc_no, unsigned int *pack, int parts_no, sceVu0FVECTOR pos, sceVu0FVECTOR rot, int visible, int motion_no, CDataAlloc2< 1 > *alloc)
void DrawMap(CCameraFollow *camera, CFrameVu1 *player)
CFrame * collision_model
void DrawMiniMap(float *pos, float angle)
CFrame * atra_model
CFrame * box_body_model
void BuildCharaSpecialParts()
CFrame * box_lid_model
void DrawNPCDraw()
void StepTrapCircle()
void SetMimicEvent(float x, float y, float z, int item_no, int kind)
void buildEventData(int floor_no, int enabled, int place_atla)
float * CheckTrapCircle(float *pos, float dist)
CDungeonParts parts[72]
CFrame * chest_body_model
void RsetMimicEvent()
void GetRoomLinkInfo()
CFrame * chest_lid_model
void checkMask(float x, float z)
void DrawMapCalc(int mode)
void DrawTrapCircle()
void initTrapCircle()
int CheckAtra(float *pos, float dist)
void SetAtraBoll(float *pos, int atra_no)
void ReservNPC_Draw(int npc_no, float x, float y, float z, int direction)
void buildRandomMap(int room_max, int first_build)
void DrawAtraBoll(float *pos)
CFrame * fall_model
void mapPartsFilter()
TreasureBoxKind
@ TREASURE_BOX_LARGE
@ TREASURE_BOX_SMALL
MapDirection
@ MAP_DIR_SOUTH
@ MAP_DIR_WEST
@ MAP_DIR_NORTH
@ MAP_DIR_EAST
DungeonEventKind
@ DNG_EVENT_ATRA
@ DNG_EVENT_TREASURE_BOX
@ DNG_EVENT_MIMIC
@ DNG_EVENT_NONE
TrapCircleKind
@ TRAP_CIRCLE_WHP_CURE
@ TRAP_CIRCLE_COUNT
@ TRAP_CIRCLE_MONEY_UP
@ TRAP_CIRCLE_ABS_FULL
@ TRAP_CIRCLE_STAT_DOWN
@ TRAP_CIRCLE_WHP_DOWN
@ TRAP_CIRCLE_WHP_QUARTER
@ TRAP_CIRCLE_STAMINA
@ TRAP_CIRCLE_WHP_UP
@ TRAP_CIRCLE_MONEY_DOWN
@ TRAP_CIRCLE_ALL_MONSTER_STAMINA
float pos[4]
s32 direction
float camera_dist
MAP_NPC_MODEL & operator=(const MAP_NPC_MODEL &other)
CCharacter chara
float draw_pos[16][4]
s32 draw_param[16]
sceVu0FVECTOR pos