Create main and player headers
This commit is contained in:
parent
2a1c4b808d
commit
b2186e5d09
6 changed files with 266 additions and 197 deletions
132
include/game/board/main.h
Normal file
132
include/game/board/main.h
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
#ifndef _BOARD_MAIN_H
|
||||
#define _BOARD_MAIN_H
|
||||
|
||||
#include "game/gamework_data.h"
|
||||
#include "game/object.h"
|
||||
#include "game/data.h"
|
||||
#include "dolphin.h"
|
||||
|
||||
typedef struct board_focus_data {
|
||||
u16 view_type;
|
||||
s16 time;
|
||||
s16 max_time;
|
||||
float fov_start;
|
||||
float fov_end;
|
||||
float zoom_start;
|
||||
float zoom_end;
|
||||
Vec rot_start;
|
||||
Vec rot_end;
|
||||
Vec target_start;
|
||||
Vec target_end;
|
||||
} BoardFocusData;
|
||||
|
||||
typedef struct board_camera_data {
|
||||
struct {
|
||||
u8 hide_all : 1;
|
||||
u8 moving : 1;
|
||||
u8 quaking : 1;
|
||||
};
|
||||
u16 mask;
|
||||
s16 target_mdl;
|
||||
s16 target_space;
|
||||
s32 quake_timer;
|
||||
float quake_strength;
|
||||
float fov;
|
||||
float near;
|
||||
float far;
|
||||
float aspect;
|
||||
float viewport_x;
|
||||
float viewport_y;
|
||||
float viewport_w;
|
||||
float viewport_h;
|
||||
float viewport_near;
|
||||
float viewport_far;
|
||||
Vec pos;
|
||||
Vec up;
|
||||
Vec target;
|
||||
Vec offset;
|
||||
Vec rot;
|
||||
float zoom;
|
||||
void (*pos_calc)(struct board_camera_data *);
|
||||
BoardFocusData focus;
|
||||
} BoardCameraData;
|
||||
|
||||
static inline s32 BoardCurrGet()
|
||||
{
|
||||
return GWSystem.board;
|
||||
}
|
||||
|
||||
static inline s32 BoardPartyFlagGet()
|
||||
{
|
||||
s32 value = GWSystem.party;
|
||||
return value;
|
||||
}
|
||||
|
||||
extern BoardCameraData boardCamera;
|
||||
extern Process *boardObjMan;
|
||||
extern Process *boardMainProc;
|
||||
extern u32 boardRandSeed;
|
||||
extern omObjData *boardMainObj;
|
||||
|
||||
typedef void (*BoardFunc)(void);
|
||||
|
||||
typedef void (*BoardLightHook)(void);
|
||||
typedef void (*BoardCameraPosCalcFunc)(BoardCameraData *camera);
|
||||
|
||||
void BoardCommonInit(BoardFunc create, BoardFunc destroy);
|
||||
void BoardKill(void);
|
||||
s32 BoardIsKill(void);
|
||||
void BoardPauseEnableSet(s32 value);
|
||||
s32 BoardPauseEnableGet();
|
||||
void BoardSaveInit(s32 board);
|
||||
void BoardStoryConfigSet(s32 mg_type, s32 diff_story);
|
||||
void BoardPartyConfigSet(s32 team, s32 bonus_star, s32 mg_type, s32 max_turn, s32 p1_handicap, s32 p2_handicap, s32 p3_handicap, s32 p4_handicap);
|
||||
BOOL BoardTurnNext(void);
|
||||
void BoardNextOvlSet(OverlayID overlay);
|
||||
s32 BoardStartCheck(void);
|
||||
void BoardCameraBackup(void);
|
||||
void BoardCameraRestore(void);
|
||||
void BoardCameraScissorSet(s32 x, s32 y, s32 w, s32 h);
|
||||
void BoardCameraViewSet(s32 type);
|
||||
s32 BoardCameraPosGet(Vec *dst);
|
||||
s32 BoardCameraTargetGet(Vec *dst);
|
||||
s32 BoardCameraRotGet(Vec *dst);
|
||||
float BoardCameraZoomGet();
|
||||
s32 BoardCameraDirGet(Vec *dst);
|
||||
s32 BoardCameraPointDirGet(Vec *point, Vec *dst);
|
||||
void BoardCameraMaskSet(u16 mask);
|
||||
void BoardCameraMoveSet(s32 move);
|
||||
void BoardCameraOffsetSet(float x, float y, float z);
|
||||
void BoardCameraTargetPlayerSet(s32 player);
|
||||
void BoardCameraTargetModelSet(s16 model);
|
||||
void BoardCameraTargetSpaceSet(s32 space);
|
||||
void BoardCameraPosCalcFuncSet(BoardCameraPosCalcFunc func);
|
||||
void BoardCameraQuakeSet(s32 duration, float strength);
|
||||
void BoardCameraQuakeReset();
|
||||
void BoardCameraTargetSet(float x, float y, float z);
|
||||
void BoardCameraPosSet(float x, float y, float z);
|
||||
void BoardCameraXRotZoomSet(float zoom, float x_rot);
|
||||
void BoardCameraZoomSet(float zoom);
|
||||
void BoardCameraRotSet(float x, float y);
|
||||
void BoardCameraNearFarSet(float near, float far);
|
||||
void BoardCameraNearFarGet(float *near, float *far);
|
||||
void BoardCameraMotionStart(s16 model_target, Vec *rot_target, float zoom_target, float fov_target);
|
||||
void BoardCameraMotionStartEx(s16 model_target, Vec *rot_target, Vec *offset_end, float zoom_target, float fov_target, s16 max_time);
|
||||
void BoardCameraFovSet(float fov);
|
||||
s32 BoardCameraCullCheck(Vec *point, float radius);
|
||||
s32 BoardCameraMotionIsDone(void);
|
||||
void BoardCameraMotionWait(void);
|
||||
void BoardCameraInit(void);
|
||||
float BoardArcSin(float value);
|
||||
float BoardArcCos(float value);
|
||||
void BoardRandInit(void);
|
||||
u32 BoardRand(void);
|
||||
u32 BoardRandMod(u32 value);
|
||||
float BoardRandFloat(void);
|
||||
float BoardVecDistXZCalc(Vec *vec1, Vec *vec2);
|
||||
s32 BoardVecMaxDistXZCheck(Vec *vec1, Vec *vec2, float max_dist);
|
||||
s32 BoardVecMinDistCheck(Vec *vec1, Vec *vec2, float min_dist);
|
||||
s32 BoardDataDirReadAsync(s32 data_num);
|
||||
void BoardDataAsyncWait(s32 status);
|
||||
|
||||
#endif
|
||||
43
include/game/board/player.h
Normal file
43
include/game/board/player.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#ifndef _BOARD_PLAYER_H
|
||||
#define _BOARD_PLAYER_H
|
||||
|
||||
#include "game/gamework_data.h"
|
||||
|
||||
extern s16 boardPlayerMdl[4];
|
||||
|
||||
static inline s16 BoardPlayerHandicapGet(s32 player)
|
||||
{
|
||||
return GWPlayer[player].handicap;
|
||||
}
|
||||
|
||||
static inline s32 BoardPlayerGetCurrIdx()
|
||||
{
|
||||
return GWSystem.player_curr;
|
||||
}
|
||||
|
||||
static inline PlayerState *BoardPlayerGet(s32 player)
|
||||
{
|
||||
return &GWPlayer[player];
|
||||
}
|
||||
|
||||
static inline PlayerState *BoardPlayerGetCurr()
|
||||
{
|
||||
return &GWPlayer[BoardPlayerGetCurrIdx()];
|
||||
}
|
||||
|
||||
static inline s16 BoardPlayerModelGet(s32 player)
|
||||
{
|
||||
PlayerState *player_ptr = BoardPlayerGet(player);
|
||||
return boardPlayerMdl[player_ptr->player_idx];
|
||||
}
|
||||
|
||||
static inline s16 BoardPlayerModelGetCurr()
|
||||
{
|
||||
PlayerState *player = BoardPlayerGetCurr();
|
||||
return boardPlayerMdl[player->player_idx];
|
||||
}
|
||||
|
||||
void BoardPlayerCoinsSet(s32 player, s32 value);
|
||||
void BoardPlayerAutoSizeSet(s32 player, s32 value);
|
||||
|
||||
#endif
|
||||
|
|
@ -57,7 +57,7 @@ typedef struct player_state {
|
|||
u16 com : 1;
|
||||
u16 character : 4;
|
||||
u16 auto_size : 2;
|
||||
u16 field01_bit9 : 1;
|
||||
u16 field00_bit9 : 1;
|
||||
};
|
||||
/* 0x02 */ struct {
|
||||
u8 team : 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue