DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
CEditArea Class Reference

#include <editarea.hpp>

Public Member Functions

void SetSize (int width, int height, float unit_size, float unit_alt)
 
void GetPos (CVector3_i_ *position, float x, float y, float z)
 
void GetPos (CVector3_f_ *position, int x, int y, int z)
 
void SetPartsNo (int x, int y, int parts_no)
 
void SetPartsID (int x, int y, int parts_id)
 
void SetPartsExtra (int x, int y, int parts_extra)
 
void SetCode (int x, int y, int code)
 
int GetPartsID (int x, int y)
 
int GetCode (int x, int y)
 
void SetAlt (int x, int y, int altitude)
 
int GetAlt_i (int x, int y)
 
float GetAlt (int x, int y)
 
float GetAlt (float x, float y, float z)
 
int GetAlt_i (float x, float y, float z)
 
int GetPartsExtra (int x, int y)
 
int SetMapParts (int parts_id, CMapParts *parts, float x, float y, float z, int rot_y)
 
int DeleteMapParts (int parts_no, CMapParts *parts, float x, float y, float z)
 
int SetRiverParts (int x, int y)
 
int SetRoadParts (int x, int y)
 
int SearchPartsID (float x, float y, float z)
 
int SearchPartsExtra (float x, float y, float z)
 
void GetGrid (CVector3_f_ *snapped, float x, float y, float z)
 
void RemakeGrid ()
 
void GetPartsBox (CBoxVu0 *box)
 
void MakePartsBox ()
 
int CheckArea (float x, float y, float z)
 
int CheckAreaRect (float x, float y, float z, int rect_width, int rect_height)
 
int CheckParts (CMapParts *parts, float x, float y, float z, int rotation)
 
int PickUpPoly (CCPoly *polygons, float x, float y, float z)
 
int PickUpPoly (CCPoly *polygons, CRect_i_ rect)
 
int PickUpPoly (CCPoly *polygons, CBoxVu0 box)
 
int GetPartsRect (CRect_i_ &rect, int *parts_ids, int capacity)
 
void ChainWorkClear ()
 
int CheckRiverChain (int x, int y, int target_x, int target_y)
 
void DrawGrid ()
 
void Clear ()
 
void Initialize ()
 
void SetMapInfo (int map_no, int area_id)
 
int GetMapNo ()
 
int GetAreaID ()
 
void SetGridFrame (CFrameVu1 *frame)
 
CFrameVu1 * GetGridFrame ()
 
void SetOffset (float x, float y, float z)
 
void GetOffset (float *offset)
 
int GetWidth ()
 
int GetHeight ()
 
void AddAlt (int x, int y, int altitude_delta)
 
float GetUnitSize ()
 
float GetUnitAlt ()
 
 CEditArea ()
 

Public Attributes

int area_id
 
int map_no
 
int width
 
int height
 
float offset_x
 
float offset_y
 
float offset_z
 
int unk_1c
 
float unit_size
 
float unit_alt
 
CEditAreaCell grid [16][16]
 
int chain_work [16][16]
 
CFrameVu1 * grid_frame
 
int unk_202c
 
CBoxVu0 parts_box
 
int grid_redraw
 
int grid_redraw_count
 

Detailed Description

Maintains the editable map grid and its world-space dimensions.

Definition at line 35 of file editarea.hpp.

Constructor & Destructor Documentation

◆ CEditArea()

CEditArea::CEditArea ( )

Constructs an initialized editable area.

Mangled name:
__ct__9CEditAreaFv
Address:
0x170220
Size:
0x30

Definition at line 1120 of file editarea.cpp.

Member Function Documentation

◆ SetSize()

void CEditArea::SetSize ( int  width,
int  height,
float  unit_size,
float  unit_alt 
)

Sets the active grid dimensions and world-space unit scales.

Mangled name:
SetSize__9CEditAreaFiiff
Address:
0x16D860
Size:
0x18

Definition at line 54 of file editarea.cpp.

◆ GetPos() [1/2]

void CEditArea::GetPos ( CVector3_i_ *  position,
float  x,
float  y,
float  z 
)

Converts a world-space position to integral grid coordinates.

Mangled name:
GetPos__9CEditAreaFP11CVector3_i_fff
Address:
0x16D880
Size:
0xA0

Definition at line 61 of file editarea.cpp.

◆ GetPos() [2/2]

void CEditArea::GetPos ( CVector3_f_ *  position,
int  x,
int  y,
int  z 
)

Converts grid coordinates to a world-space position.

Mangled name:
GetPos__9CEditAreaFP11CVector3_f_iii
Address:
0x16D920
Size:
0x68

Definition at line 72 of file editarea.cpp.

◆ SetPartsNo()

void CEditArea::SetPartsNo ( int  x,
int  y,
int  parts_no 
)

Sets the map-part number stored at one grid coordinate.

Mangled name:
SetPartsNo__9CEditAreaFiii
Address:
0x16D990
Size:
0x6C

Definition at line 78 of file editarea.cpp.

◆ SetPartsID()

void CEditArea::SetPartsID ( int  x,
int  y,
int  parts_id 
)

Sets the map-part identifier stored at one grid coordinate.

Mangled name:
SetPartsID__9CEditAreaFiii
Address:
0x16DA00
Size:
0x6C

Definition at line 90 of file editarea.cpp.

◆ SetPartsExtra()

void CEditArea::SetPartsExtra ( int  x,
int  y,
int  parts_extra 
)

Sets the area-specific part attribute at one grid coordinate.

Mangled name:
SetPartsExtra__9CEditAreaFiii
Address:
0x16DA70
Size:
0x6C

Definition at line 102 of file editarea.cpp.

◆ SetCode()

void CEditArea::SetCode ( int  x,
int  y,
int  code 
)

Sets the geometry code stored at one grid coordinate.

Mangled name:
SetCode__9CEditAreaFiii
Address:
0x16DAE0
Size:
0x6C

Definition at line 114 of file editarea.cpp.

◆ GetPartsID()

int CEditArea::GetPartsID ( int  x,
int  y 
)

Returns the map-part identifier at one grid coordinate.

Mangled name:
GetPartsID__9CEditAreaFii
Address:
0x16DB50
Size:
0x78

Definition at line 126 of file editarea.cpp.

◆ GetCode()

int CEditArea::GetCode ( int  x,
int  y 
)

Returns the geometry code at one grid coordinate.

Mangled name:
GetCode__9CEditAreaFii
Address:
0x16DBD0
Size:
0x78

Definition at line 138 of file editarea.cpp.

◆ SetAlt()

void CEditArea::SetAlt ( int  x,
int  y,
int  altitude 
)

Sets a clamped integral altitude at one grid coordinate.

Mangled name:
SetAlt__9CEditAreaFiii
Address:
0x16DC50
Size:
0x88

Definition at line 150 of file editarea.cpp.

◆ GetAlt_i() [1/2]

int CEditArea::GetAlt_i ( int  x,
int  y 
)

Returns the integral altitude at one grid coordinate.

Mangled name:
GetAlt_i__9CEditAreaFii
Address:
0x16DCE0
Size:
0x78

Definition at line 170 of file editarea.cpp.

◆ GetAlt() [1/2]

float CEditArea::GetAlt ( int  x,
int  y 
)

Returns the world-space altitude at one grid coordinate.

Mangled name:
GetAlt__9CEditAreaFii
Address:
0x16DD60
Size:
0x88

Definition at line 182 of file editarea.cpp.

◆ GetAlt() [2/2]

float CEditArea::GetAlt ( float  x,
float  y,
float  z 
)

Returns the world-space altitude at one world position.

Mangled name:
GetAlt__9CEditAreaFfff
Address:
0x16DDF0
Size:
0x44

Definition at line 194 of file editarea.cpp.

◆ GetAlt_i() [2/2]

int CEditArea::GetAlt_i ( float  x,
float  y,
float  z 
)

Returns the integral altitude at one world position.

Mangled name:
GetAlt_i__9CEditAreaFfff
Address:
0x16DE40
Size:
0x44

Definition at line 200 of file editarea.cpp.

◆ GetPartsExtra()

int CEditArea::GetPartsExtra ( int  x,
int  y 
)

Returns the area-specific part attribute at one grid coordinate.

Mangled name:
GetPartsExtra__9CEditAreaFii
Address:
0x16DE90
Size:
0x180

Definition at line 206 of file editarea.cpp.

◆ SetMapParts()

int CEditArea::SetMapParts ( int  parts_id,
CMapParts *  parts,
float  x,
float  y,
float  z,
int  rot_y 
)

Projects one map part into the editable grid.

Mangled name:
SetMapParts__9CEditAreaFiP9CMapPartsfffi
Address:
0x16E010
Size:
0x1FC

Definition at line 254 of file editarea.cpp.

◆ DeleteMapParts()

int CEditArea::DeleteMapParts ( int  parts_no,
CMapParts *  parts,
float  x,
float  y,
float  z 
)

Removes one map part from the editable grid.

Mangled name:
DeleteMapParts__9CEditAreaFiP9CMapPartsfff
Address:
0x16E210
Size:
0x25C

Definition at line 290 of file editarea.cpp.

◆ SetRiverParts()

int CEditArea::SetRiverParts ( int  x,
int  y 
)

Determines the river connection code at one grid coordinate.

Mangled name:
SetRiverParts__9CEditAreaFii
Address:
0x16E470
Size:
0x440

Definition at line 336 of file editarea.cpp.

◆ SetRoadParts()

int CEditArea::SetRoadParts ( int  x,
int  y 
)

Determines the road connection code at one grid coordinate.

Mangled name:
SetRoadParts__9CEditAreaFii
Address:
0x16E8B0
Size:
0x32C

Definition at line 466 of file editarea.cpp.

◆ SearchPartsID()

int CEditArea::SearchPartsID ( float  x,
float  y,
float  z 
)

Returns the map-part identifier at one world position.

Mangled name:
SearchPartsID__9CEditAreaFfff
Address:
0x16EBE0
Size:
0x5C

Definition at line 586 of file editarea.cpp.

◆ SearchPartsExtra()

int CEditArea::SearchPartsExtra ( float  x,
float  y,
float  z 
)

Returns the area-specific part attribute at one world position.

Mangled name:
SearchPartsExtra__9CEditAreaFfff
Address:
0x16EC40
Size:
0x44

Definition at line 592 of file editarea.cpp.

◆ GetGrid()

void CEditArea::GetGrid ( CVector3_f_ *  snapped,
float  x,
float  y,
float  z 
)

Snaps a world-space position to the editable grid.

Mangled name:
GetGrid__9CEditAreaFP11CVector3_f_fff
Address:
0x16EC90
Size:
0x58

Definition at line 598 of file editarea.cpp.

◆ RemakeGrid()

void CEditArea::RemakeGrid ( )

Rebuilds the frame geometry used to draw the grid.

Mangled name:
RemakeGrid__9CEditAreaFv
Address:
0x16ECF0
Size:
0x1D8

Definition at line 604 of file editarea.cpp.

◆ GetPartsBox()

void CEditArea::GetPartsBox ( CBoxVu0 *  box)

Copies the occupied-parts bounding box to the caller.

Mangled name:
GetPartsBox__9CEditAreaFP7CBoxVu0
Address:
0x16EED0
Size:
0x30

Definition at line 648 of file editarea.cpp.

◆ MakePartsBox()

void CEditArea::MakePartsBox ( )

Recomputes the occupied-parts bounding box.

Mangled name:
MakePartsBox__9CEditAreaFv
Address:
0x16EF00
Size:
0x188

Definition at line 652 of file editarea.cpp.

◆ CheckArea()

int CEditArea::CheckArea ( float  x,
float  y,
float  z 
)

Returns whether a world position lies inside the editable area.

Mangled name:
CheckArea__9CEditAreaFfff
Address:
0x16F090
Size:
0xA8

Definition at line 693 of file editarea.cpp.

◆ CheckAreaRect()

int CEditArea::CheckAreaRect ( float  x,
float  y,
float  z,
int  rect_width,
int  rect_height 
)

Returns whether a centered grid rectangle fits inside the area.

Mangled name:
CheckAreaRect__9CEditAreaFfffii
Address:
0x16F140
Size:
0xBC

Definition at line 713 of file editarea.cpp.

◆ CheckParts()

int CEditArea::CheckParts ( CMapParts *  parts,
float  x,
float  y,
float  z,
int  rotation 
)

Returns whether a map part can occupy the requested world position.

Mangled name:
CheckParts__9CEditAreaFP9CMapPartsfffi
Address:
0x16F200
Size:
0x454

Definition at line 738 of file editarea.cpp.

◆ PickUpPoly() [1/3]

int CEditArea::PickUpPoly ( CCPoly *  polygons,
float  x,
float  y,
float  z 
)

Collects collision polygons around one world position.

Mangled name:
PickUpPoly__9CEditAreaFP6CCPolyfff
Address:
0x16F660
Size:
0xC4

Definition at line 849 of file editarea.cpp.

◆ PickUpPoly() [2/3]

int CEditArea::PickUpPoly ( CCPoly *  polygons,
CRect_i_  rect 
)

Collects collision polygons from one grid rectangle.

Mangled name:
PickUpPoly__9CEditAreaFP6CCPoly8CRect_i_
Address:
0x16F730
Size:
0x338

Definition at line 861 of file editarea.cpp.

◆ PickUpPoly() [3/3]

int CEditArea::PickUpPoly ( CCPoly *  polygons,
CBoxVu0  box 
)

Collects collision polygons overlapping one world-space box.

Mangled name:
PickUpPoly__9CEditAreaFP6CCPoly7CBoxVu0
Address:
0x16FA70
Size:
0xE0

Definition at line 910 of file editarea.cpp.

◆ GetPartsRect()

int CEditArea::GetPartsRect ( CRect_i_ &  rect,
int *  parts_ids,
int  capacity 
)

Collects part identifiers from one grid rectangle.

Mangled name:
GetPartsRect__9CEditAreaFR8CRect_i_Pii
Address:
0x16FB50
Size:
0x150

Definition at line 927 of file editarea.cpp.

◆ ChainWorkClear()

void CEditArea::ChainWorkClear ( )

Clears the river-chain traversal marks.

Mangled name:
ChainWorkClear__9CEditAreaFv
Address:
0x16FCA0
Size:
0x54

Definition at line 962 of file editarea.cpp.

◆ CheckRiverChain()

int CEditArea::CheckRiverChain ( int  x,
int  y,
int  target_x,
int  target_y 
)

Returns whether two river cells belong to one connected chain.

Mangled name:
CheckRiverChain__9CEditAreaFiiii
Address:
0x16FD00
Size:
0x1F0

Definition at line 970 of file editarea.cpp.

◆ DrawGrid()

void CEditArea::DrawGrid ( )

Updates and draws the editable grid overlay.

Mangled name:
DrawGrid__9CEditAreaFv
Address:
0x16FEF0
Size:
0xD0

Definition at line 1006 of file editarea.cpp.

◆ Clear()

void CEditArea::Clear ( )

Resets every active grid cell to its empty state.

Mangled name:
Clear__9CEditAreaFv
Address:
0x16FFC0
Size:
0x98

Definition at line 1040 of file editarea.cpp.

◆ Initialize()

void CEditArea::Initialize ( )

Initializes the editable area to an empty 16 by 16 grid.

Mangled name:
Initialize__9CEditAreaFv
Address:
0x170060
Size:
0x78

Definition at line 1057 of file editarea.cpp.

◆ SetMapInfo()

void CEditArea::SetMapInfo ( int  map_no,
int  area_id 
)

Selects the map number and area identifier represented by the grid.

Mangled name:
SetMapInfo__9CEditAreaFii
Address:
0x1700E0
Size:
0x10

Definition at line 1067 of file editarea.cpp.

◆ GetMapNo()

int CEditArea::GetMapNo ( )

Returns the selected map number.

Mangled name:
GetMapNo__9CEditAreaFv
Address:
0x1700F0
Size:
0xC

Definition at line 1072 of file editarea.cpp.

◆ GetAreaID()

int CEditArea::GetAreaID ( )

Returns the selected area identifier.

Mangled name:
GetAreaID__9CEditAreaFv
Address:
0x170100
Size:
0xC

Definition at line 1076 of file editarea.cpp.

◆ SetGridFrame()

void CEditArea::SetGridFrame ( CFrameVu1 *  frame)

Selects the frame used to render the grid overlay.

Mangled name:
SetGridFrame__9CEditAreaFP9CFrameVu1
Address:
0x170110
Size:
0xC

Definition at line 1080 of file editarea.cpp.

◆ GetGridFrame()

CFrameVu1 * CEditArea::GetGridFrame ( )

Returns the frame used to render the grid overlay.

Mangled name:
GetGridFrame__9CEditAreaFv
Address:
0x170120
Size:
0xC

Definition at line 1084 of file editarea.cpp.

◆ SetOffset()

void CEditArea::SetOffset ( float  x,
float  y,
float  z 
)

Sets the world-space origin of the editable grid.

Mangled name:
SetOffset__9CEditAreaFfff
Address:
0x170130
Size:
0x14

Definition at line 1088 of file editarea.cpp.

◆ GetOffset()

void CEditArea::GetOffset ( float *  offset)

Copies the world-space grid origin to the caller.

Mangled name:
GetOffset__9CEditAreaFPf
Address:
0x170150
Size:
0x20

Definition at line 1094 of file editarea.cpp.

◆ GetWidth()

int CEditArea::GetWidth ( )

Returns the active grid width.

Mangled name:
GetWidth__9CEditAreaFv
Address:
0x170170
Size:
0xC

Definition at line 1100 of file editarea.cpp.

◆ GetHeight()

int CEditArea::GetHeight ( )

Returns the active grid height.

Mangled name:
GetHeight__9CEditAreaFv
Address:
0x170180
Size:
0xC

Definition at line 1104 of file editarea.cpp.

◆ AddAlt()

void CEditArea::AddAlt ( int  x,
int  y,
int  altitude_delta 
)

Adds an integral altitude delta to one grid coordinate.

Mangled name:
AddAlt__9CEditAreaFiii
Address:
0x170190
Size:
0x68

Definition at line 1108 of file editarea.cpp.

◆ GetUnitSize()

float CEditArea::GetUnitSize ( )

Returns one cell's horizontal world-space extent.

Mangled name:
GetUnitSize__9CEditAreaFv
Address:
0x170200
Size:
0xC

Definition at line 1112 of file editarea.cpp.

◆ GetUnitAlt()

float CEditArea::GetUnitAlt ( )

Returns one elevation unit's world-space extent.

Mangled name:
GetUnitAlt__9CEditAreaFv
Address:
0x170210
Size:
0xC

Definition at line 1116 of file editarea.cpp.

Member Data Documentation

◆ area_id

int CEditArea::area_id

Selects the area's special grid rules.

Definition at line 37 of file editarea.hpp.

◆ map_no

int CEditArea::map_no

Identifies the map represented by the grid.

Definition at line 38 of file editarea.hpp.

◆ width

int CEditArea::width

Gives the active grid width in cells.

Definition at line 39 of file editarea.hpp.

◆ height

int CEditArea::height

Gives the active grid height in cells.

Definition at line 40 of file editarea.hpp.

◆ offset_x

float CEditArea::offset_x

Gives the grid origin on the world X axis.

Definition at line 41 of file editarea.hpp.

◆ offset_y

float CEditArea::offset_y

Gives the grid origin on the world Y axis.

Definition at line 42 of file editarea.hpp.

◆ offset_z

float CEditArea::offset_z

Gives the grid origin on the world Z axis.

Definition at line 43 of file editarea.hpp.

◆ unk_1c

int CEditArea::unk_1c

Definition at line 44 of file editarea.hpp.

◆ unit_size

float CEditArea::unit_size

Gives one cell's horizontal world-space extent.

Definition at line 45 of file editarea.hpp.

◆ unit_alt

float CEditArea::unit_alt

Gives one elevation unit's world-space extent.

Definition at line 46 of file editarea.hpp.

◆ grid

CEditAreaCell CEditArea::grid[16][16]

Stores the editable cells in grid coordinates.

Definition at line 47 of file editarea.hpp.

◆ chain_work

int CEditArea::chain_work[16][16]

Marks cells visited while following river chains.

Definition at line 48 of file editarea.hpp.

◆ grid_frame

CFrameVu1* CEditArea::grid_frame

Holds the frame used to render the grid overlay.

Definition at line 49 of file editarea.hpp.

◆ unk_202c

int CEditArea::unk_202c

Definition at line 50 of file editarea.hpp.

◆ parts_box

CBoxVu0 CEditArea::parts_box

Bounds all occupied cells in world space.

Definition at line 51 of file editarea.hpp.

◆ grid_redraw

int CEditArea::grid_redraw

Set to have DrawGrid rebuild the grid overlay.

Definition at line 52 of file editarea.hpp.

◆ grid_redraw_count

int CEditArea::grid_redraw_count

Draws left that rebuild the grid overlay.

Definition at line 53 of file editarea.hpp.