Introduce space.h header
This commit is contained in:
parent
bbafa85ac0
commit
3c8cc0d46c
4 changed files with 57 additions and 18 deletions
|
|
@ -2,9 +2,6 @@
|
|||
#define _BOARD_BASIC_SPACE_H
|
||||
|
||||
#include "dolphin.h"
|
||||
#include "game/process.h"
|
||||
|
||||
extern Process *boardObjMan;
|
||||
|
||||
void BoardEventLandBlue(s32, s16);
|
||||
void BoardEventLandRed(s32, s16);
|
||||
|
|
|
|||
52
include/game/board/space.h
Normal file
52
include/game/board/space.h
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
#ifndef _BOARD_SPACE_H
|
||||
#define _BOARD_SPACE_H
|
||||
|
||||
#include "dolphin.h"
|
||||
|
||||
#define BOARD_SPACE_LINKMAX 4
|
||||
|
||||
typedef s32 (*BoardSpaceEventFunc)(void);
|
||||
|
||||
typedef struct board_space {
|
||||
Vec pos;
|
||||
u32 flag;
|
||||
Vec scale;
|
||||
Vec rot;
|
||||
u16 type;
|
||||
u16 link_cnt;
|
||||
u16 link[BOARD_SPACE_LINKMAX+1];
|
||||
} BoardSpace;
|
||||
|
||||
void BoardSpaceWalkEventFuncSet(BoardSpaceEventFunc func);
|
||||
void BoardSpaceWalkMiniEventFuncSet(BoardSpaceEventFunc func);
|
||||
void BoardSpaceLandEventFuncSet(BoardSpaceEventFunc func);
|
||||
s32 BoardSpaceWalkEventExec(void);
|
||||
s32 BoardSpaceWalkMiniEventExec(void);
|
||||
s16 BoardSpaceCountGet(s32 layer);
|
||||
s16 BoardSpaceCountGet(s32 layer);
|
||||
BoardSpace *BoardSpaceGet(s32 layer, s32 index);
|
||||
void BoardSpaceAttrSet(s32 layer, u32 attr);
|
||||
void BoardSpaceAttrReset(s32 layer, u32 attr);
|
||||
u32 BoardSpaceFlagGet(s32 layer, s32 index);
|
||||
s32 BoardSpaceTypeGet(s32 layer, s32 index);
|
||||
void BoardSpaceTypeSet(s32 layer, s32 index, s32 type);
|
||||
s32 BoardSpacePosGet(s32 layer, s32 index, Vec *pos);
|
||||
void BoardSpaceCornerPosGet(s32 index, s32 corner, Vec *pos);
|
||||
s32 BoardSpaceFlagSearch(s32 layer, u32 flag);
|
||||
s32 BoardSpaceFlagPosGet(s32 layer, u32 flag, Vec *pos);
|
||||
s32 BoardSpaceLinkFlagSearch(s32 layer, s32 index, u32 flag);
|
||||
s32 BoardSpaceLinkTypeListGet(s32 layer, s32 index, s32 type, s16 *list);
|
||||
s32 BoardSpaceLinkTargetListGet(s32 layer, s32 target, s16 *list);
|
||||
s32 BoardSpaceLinkTypeSearch(s32 layer, s32 target, u16 type);
|
||||
s32 BoardSpaceLinkTransformGet(s32 flag, Vec *pos, Vec *rot, Vec *scale);
|
||||
void BoardSpaceStarSet(s32 space);
|
||||
void BoardSpaceStarSetIndex(s32 index);
|
||||
s32 BoardSpaceStarGetNext(void);
|
||||
s32 BoardSpaceStarGetRandom(s32 excl_pos);
|
||||
void BoardSpaceStarMove(void);
|
||||
s32 BoardSpaceStarGet(s32 index);
|
||||
s32 BoardSpaceStarGetCurr(void);
|
||||
s32 BoardSpaceStarCheck(s32 index);
|
||||
void BoardSpaceLandExec(s32 player, s32 space);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
#include "game/board/basic_space.h"
|
||||
#include "game/board/main.h"
|
||||
#include "game/data.h"
|
||||
#include "game/flag.h"
|
||||
#include "game/object.h"
|
||||
|
|
|
|||
|
|
@ -1,23 +1,13 @@
|
|||
#include "game/gamework_data.h"
|
||||
#include "game/flag.h"
|
||||
#include "game/board/main.h"
|
||||
#include "game/board/space.h"
|
||||
|
||||
#include "math.h"
|
||||
|
||||
extern s16 BoardStarHostMdlGet(void);
|
||||
extern void BoardModelPosSetV(s16 model, Vec *pos);
|
||||
|
||||
typedef s32 (*BoardSpaceEventFunc)(void);
|
||||
|
||||
typedef struct board_space {
|
||||
Vec pos;
|
||||
u32 flag;
|
||||
Vec scale;
|
||||
Vec rot;
|
||||
u16 type;
|
||||
u16 link_cnt;
|
||||
u16 link[5];
|
||||
} BoardSpace;
|
||||
|
||||
static GXTexObj spaceHiliteTex;
|
||||
static GXTexObj spaceTex;
|
||||
|
|
@ -112,7 +102,7 @@ u32 BoardSpaceFlagGet(s32 layer, s32 index)
|
|||
}
|
||||
}
|
||||
|
||||
int BoardSpaceTypeGet(s32 layer, s32 index)
|
||||
s32 BoardSpaceTypeGet(s32 layer, s32 index)
|
||||
{
|
||||
if(index <= 0 || index > spaceCnt[layer]) {
|
||||
return 0;
|
||||
|
|
@ -121,7 +111,7 @@ int BoardSpaceTypeGet(s32 layer, s32 index)
|
|||
}
|
||||
}
|
||||
|
||||
void BoardSpaceTypeSet(s32 layer, s32 index, int type)
|
||||
void BoardSpaceTypeSet(s32 layer, s32 index, s32 type)
|
||||
{
|
||||
if(index <= 0 || index > spaceCnt[layer]) {
|
||||
return;
|
||||
|
|
@ -213,7 +203,7 @@ s32 BoardSpaceLinkFlagSearch(s32 layer, s32 index, u32 flag)
|
|||
return -1;
|
||||
}
|
||||
|
||||
s32 BoardSpaceLinkTypeListGet(s32 layer, s32 index, int type, s16 *list)
|
||||
s32 BoardSpaceLinkTypeListGet(s32 layer, s32 index, s32 type, s16 *list)
|
||||
{
|
||||
s32 count;
|
||||
BoardSpace *space = BoardSpaceGet(layer, index);
|
||||
|
|
@ -457,7 +447,6 @@ s32 BoardSpaceStarGetRandom(s32 excl_pos)
|
|||
return new_pos;
|
||||
}
|
||||
|
||||
//Fix GWSystem.star_total truncation and double GWSystem load
|
||||
void BoardSpaceStarMove(void)
|
||||
{
|
||||
u8 star_total;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue