4#include <game/mLib/m_3d.hpp>
7#define MAX_POINT_COUNT (192)
8#define MAX_SUBROUTE_COUNT (160)
9#define MAX_ROUTE_COUNT (64)
11#define MAX_POINT_NAME_LEN (5)
12#define MAX_ROUTE_NAME_LEN (10)
13#define MAX_FLAG_DATA_LEN (10)
15#define MAX_OPEN_POINT_COUNT (4)
16#define MAX_OPEN_ROUTE_COUNT (16)
17#define MAX_FLAG_DATA_COUNT (2)
19#define SUBWORLD_CHAR_OFFSET (10)
27 POINT_URA = BIT_FLAG(0),
28 POINT_STOP = BIT_FLAG(1),
29 POINT_LINK1 = BIT_FLAG(2),
30 POINT_LINK2 = BIT_FLAG(3),
31 POINT_LINK3 = BIT_FLAG(4),
32 POINT_LINK4 = BIT_FLAG(5),
33 POINT_LINK5 = BIT_FLAG(6),
34 POINT_SCROLL = BIT_FLAG(7),
35 POINT_SCALE = BIT_FLAG(8),
36 POINT_DOKAN = BIT_FLAG(10),
37 POINT_SWITCH = BIT_FLAG(11),
38 POINT_ANCHOR_X = BIT_FLAG(12),
39 POINT_ANCHOR_Y = BIT_FLAG(13),
40 POINT_TILT = BIT_FLAG(14),
41 POINT_DEMO1 = BIT_FLAG(15),
42 POINT_DEMO2 = BIT_FLAG(16),
43 POINT_DEMO3 = BIT_FLAG(17),
44 POINT_CROSSROAD = BIT_FLAG(18),
45 POINT_FOCUS = BIT_FLAG(19),
46 POINT_BOARD = BIT_FLAG(20),
47 POINT_DEMOSTOP = BIT_FLAG(21),
48 POINT_SCROLL_Y = BIT_FLAG(22),
49 POINT_SAND = BIT_FLAG(23),
50 POINT_ICE = BIT_FLAG(24),
51 POINT_DEMO4 = BIT_FLAG(25),
52 POINT_DEMO5 = BIT_FLAG(26),
53 POINT_DEMO6 = BIT_FLAG(27),
54 POINT_DEMO7 = BIT_FLAG(28),
55 POINT_CAMSTOP = BIT_FLAG(29),
56 POINT_NOSHIFT = BIT_FLAG(30),
57 POINT_SCROLL_A = BIT_FLAG(31)
62 ENEMY_KURIBO1 = BIT_FLAG(1),
63 ENEMY_KURIBO2 = BIT_FLAG(2),
64 ENEMY_PUKU1 = BIT_FLAG(3),
65 ENEMY_PUKU2 = BIT_FLAG(4),
66 ENEMY_PAK1 = BIT_FLAG(5),
67 ENEMY_PAK2 = BIT_FLAG(6),
68 ENEMY_PAK3 = BIT_FLAG(7),
69 ENEMY_HBROS1 = BIT_FLAG(8),
70 ENEMY_TRAP1 = BIT_FLAG(10),
71 ENEMY_TRAP2 = BIT_FLAG(11)
76 ACTION_TYPE_NONE = -1,
85 ACTION_TYPE_ICE_SLOPE,
86 ACTION_TYPE_SWITCH_BLOCK = 14,
88 ACTION_TYPE_QUICKSAND,
93 ACTION_TYPE_LEFT_LADDER,
94 ACTION_TYPE_RIGHT_LADDER,
96 ACTION_TYPE_ROCK_LADDER,
97 ACTION_TYPE_ROPE_LADDER,
152 void ReadFlagData(
char *csv,
int &pos,
bool regularExit);
165 const char *
GetOpenPointName(
bool regularExit,
int idx,
int openPointIdx)
const;
167 const char *
GetOpenRouteName(
bool regularExit,
int idx,
int openRouteIdx)
const;
227 static const int c_COURSE_ID;
228 static const int c_GHOST_ID;
229 static const int c_TOWER_ID;
230 static const int c_CASTLE_ID;
231 static const int c_KINOKO_ID;
232 static const int c_ENEMY_ID;
233 static const int c_CANON_ID;
234 static const int c_TRSHIP_ID;
235 static const int c_AIRSHIP_ID;
236 static const int c_START_ID;
237 static const int c_PEACH_ID;
Loader for world map point / route data.
u32 GetPointFlags(int idx, PointFlag_e flags) const
Returns the flags ANDed with flags.
Route_s mRoutes[(64)]
The loaded route data.
SubRoute_s mSubRoutes[(160)]
The loaded subroute data.
int GetOpenPointNum(bool regularExit, int idx) const
Returns the number of points that are opened from a regular or secret exit from this point.
bool findSubRoutesForRoute(const char *startPointName, const char *endPointName, Route_s *route, int maxLevel, bool resetLevel=true)
Searches the subroute graph for a path between two points and writes the length of the path to route.
virtual ~dCsvData_c()
Destroys the class.
bool isLineEnd(char *csv, int pos)
Returns whether the the CSV has a line ending at the specified position.
const char * GetRouteAnimName(bool regularExit, int idx, int animIdx)
Returns the value of a flag data entry for a point.
ActionType_e GetActionLabel(const char *route)
Gets the action type for a given route name.
const char * GetOpenRouteName(bool regularExit, int idx, int openRouteIdx) const
Returns the name of a route that is opened from a regular or secret exit from this point.
int GetPointNum(int idx)
Returns the number of points that are part of a route at the specified index.
void ReadPointType(char *csv, int &pos)
Reads a point type from a CSV entry.
int mWorld
The world number for which to load the point and route data.
void RouteInfoInit()
Resets all currently loaded point and route data.
int GetOpenRouteNum(bool regularExit, int idx) const
Returns the number of routes that are opened from a regular or secret exit from this point.
const char * GetChildPointName(int idx, int childIdx)
Returns the name of a point that is part of a route at the specified index.
void ReadRouteFlag(char *csv, int &pos)
Reads the route flag data from a CSV entry.
int mSubrouteCount
The number of loaded subroutes in mSubRoutes.
int mRouteCount
The number of loaded routes in mRoutes.
void ReadOpenRouteName(char *csv, int &pos, bool regularExit)
Reads an open route name from a CSV entry.
u32 GetSubRouteFlag(int idx)
Returns the flags for a route at the specified index.
int GetSubRouteIdx(const char *pointA, const char *pointB)
Returns the index of a route connecting two points.
int mPointCount
The number of loaded points in mPoints.
void ReadPointName(char *csv, int &pos)
Reads a point name from a CSV entry.
const char * GetPointName(int idx) const
Returns the name of a point at the specified index.
const char * GetOpenPointName(bool regularExit, int idx, int openPointIdx) const
Returns the name of a point that is opened from a regular or secret exit from this point.
void SetRouteInfo(const m3d::mdl_c &model)
Creates a route from a model and adds it to the route list.
void initialize(int world, int subworld)
Initializes the class and loads the CSV data for the specified world and subworld.
void ReadOpenPointName(char *csv, int &pos, bool regularExit)
Reads an open point name from a CSV entry.
u32 GetEnemyPointFlags(int idx, EnemyFlag_e flags) const
Returns the enemy flags ANDed with flags.
static void initRouteStruct(Route_s *route, int childCount)
Initializes a route with the specified number of child points.
void ReadCsvData()
Loads the CSV point and route data for the specified world and subworld.
void ReadAnimeRouteName(char *csv, int &pos)
Reads a route name from a CSV entry.
const char * GetRouteName(int idx)
Returns the name of a route at the specified index.
int GetIndexFromPointName(const char *pointName)
Gets the index of a point.
Point_s mPoints[(192)]
The loaded point data.
const char * GetSubRouteName(int idx)
Returns the name of a subroute at the specified index.
bool appendChildFromSubRoute(const char *startPointName, const char *endPointName, Route_s *route, int maxLevel, bool resetLevel=true)
Searches the subroute graph for a path between two points and appends the child points to route.
int GetRouteAnimNum(bool regularExit, int idx)
Returns the number of flag data entries for a point.
int mSubworld
The subworld number for which to load the point and route data.
void appendChildFromModel(const nw4r::g3d::ResNode &node, int)
Appends the child points of a route from a model to route.
void ReadFlagData(char *csv, int &pos, bool regularExit)
Reads the point flag data from a CSV entry.
static void destroyRouteStruct(Route_s *route)
Destroys a route and frees its child point data.
void ReadAction(char *csv, int &pos)
Reads a route action type from a CSV entry.
void addKeyPoint(const m3d::mdl_c &model)
Adds a key point from a model.
u32 GetPointParam(int idx)
Returns the parameter value for this point.
void adjustChildInfo(Route_s *route)
Reverses the order of the child points of a route.
Contains the data for a single point on the world map.
int mOpenPointNumSecret
The number of points in mOpenPointNameSecret.
u32 mFlagsEnemy
A bitfield of EnemyFlag_e values.
int mFlagDataNumRegular
The number of entries in mFlagDataRegular.
char mOpenPointNameSecret[(4)][(5)]
The points to be opened by the secret exit.
char mFlagDataSecret[(2)][(10)]
The point flag data for the secret exit.
u8 mParam
A parameter value for the point.
char mName[(5)]
The name of the point.
int mFlagDataNumSecret
The number of entries in mFlagDataSecret.
char mRouteNameRegular[(16)][(10)]
The routes to be opened by the regular exit.
char mFlagDataRegular[(2)][(10)]
The point flag data for the regular exit.
char mOpenPointNameRegular[(4)][(5)]
The points to be opened by the regular exit.
int mOpenRouteNumSecret
The number of routes in mRouteNameSecret.
int mOpenPointNumRegular
The number of points in mOpenPointNameRegular.
int mOpenRouteNumRegular
The number of routes in mRouteNameRegular.
char mRouteNameSecret[(16)][(10)]
The routes to be opened by the secret exit.
u32 mFlags
A bitfield of PointFlag_e values.
Contains the points of a route on the world map.
int mChildPointNum
The number of occupied entries in mChildPoints.
char mName[(10)]
The name of the route.
char(* mChildPoints)[(5)]
The points that make up the route.
int mNumSubroutes
The number of subroutes this route is made up of.
Contains the data for a point-to-point route on the world map.
ActionType_e mActionType
The action type of the route.
char mName[(10)]
The name of the route.