Files
ac-decomp/include/m_field_make.h
T
2023-05-14 11:08:39 -04:00

45 lines
1.1 KiB
C

#ifndef M_FIELD_MAKE_H
#define M_FIELD_MAKE_H
#include "types.h"
#include "m_actor_type.h"
#ifdef __cplusplus
extern "C" {
#endif
#define BLOCK_X_NUM 7
#define BLOCK_Z_NUM 10
#define BLOCK_TOTAL_NUM (BLOCK_X_NUM * BLOCK_Z_NUM)
#define FG_BLOCK_X_NUM (BLOCK_X_NUM - 2) /* 5 */
#define FG_BLOCK_Z_NUM (BLOCK_Z_NUM - 4) /* 6 */
#define FG_BLOCK_TOTAL_NUM (FG_BLOCK_X_NUM * FG_BLOCK_Z_NUM)
#define UT_X_NUM 16 /* Spaces per block (acre) in x direction */
#define UT_Z_NUM 16 /* Spaces per block (acre) in z direction */
#define UT_TOTAL_NUM (UT_X_NUM * UT_Z_NUM)
#define IDX_2_UT_X(idx) ((idx) & (UT_X_NUM - 1))
#define IDX_2_UT_Z(idx) (((idx) / UT_X_NUM) & (UT_Z_NUM - 1))
#define FGIDX_2_BLOCK_X(idx) ((idx) % FG_BLOCK_X_NUM + 1)
#define FGIDX_2_BLOCK_Z(idx) ((idx) / FG_BLOCK_X_NUM + 1)
/* sizeof(mFM_combination_c) == 2 */
typedef struct block_combination_s {
/* 0x00 */ u16 combination_type:14; /* acre type index */
/* 0x00 */ u16 height:2; /* 0, 1, 2, or 3 (unused) */
} mFM_combination_c;
/* sizeof(mFM_fg_c) == 0x200 */
typedef struct fg_items_s {
/* 0x000 */ mActor_name_t items[UT_Z_NUM][UT_X_NUM];
} mFM_fg_c;
#ifdef __cplusplus
}
#endif
#endif