mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-22 22:24:16 -04:00
Link m_map_ovl.c
This commit is contained in:
@@ -299,6 +299,11 @@ m_bank_ovl.c:
|
||||
.rodata: [0x8064AE58, 0x8064AE90]
|
||||
.data: [0x806C7B90, 0x806C7BE0]
|
||||
.bss: [0x8133E0A8, 0x8133E0C0]
|
||||
m_map_ovl.c:
|
||||
.text: [0x805E5EFC, 0x805E7A54]
|
||||
.rodata: [0x8064B628, 0x8064B6B0]
|
||||
.data: [0x806CD9C0, 0x806CE008]
|
||||
.bss: [0x81340468, 0x81340488]
|
||||
m_select.c:
|
||||
.text: [0x80627F88, 0x80629CA8]
|
||||
.rodata: [0x8064D1B0, 0x8064D1B8]
|
||||
|
||||
@@ -113,6 +113,10 @@ struct map_overlay_s {
|
||||
int unk_3F4;
|
||||
};
|
||||
|
||||
extern void mMP_map_ovl_set_proc(Submenu* submenu);
|
||||
extern void mMP_map_ovl_construct(Submenu* submenu);
|
||||
extern void mMP_map_ovl_destruct(Submenu* submenu);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
+249
-44
@@ -12,8 +12,212 @@
|
||||
#include "m_malloc.h"
|
||||
#include "m_common_data.h"
|
||||
|
||||
static u8* l_map_texture[108];
|
||||
static u8 l_map_pal[108];
|
||||
extern u8 kan_tizu_f_TA_tex_txt[];
|
||||
extern u8 kan_tizu_tst1_TA_tex_txt[];
|
||||
extern u8 kan_tizu_t_TA_tex_txt[];
|
||||
extern u8 kan_tizu_tr1_TA_tex_txt[];
|
||||
extern u8 kan_tizu_fmh_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c1_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c2_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c3_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c4_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c5_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c6_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c7_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c1r1_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c2r1_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c3r1_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c4r1_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c5r1_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c6r1_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c7r1_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c1r2_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c2r2_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c3r2_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c4r2_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c5r2_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c1r2_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c4r2_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c5r2_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c6r3_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c7r3_TA_tex_txt[];
|
||||
extern u8 kan_tizu_r1_TA_tex_txt[];
|
||||
extern u8 kan_tizu_r2_TA_tex_txt[];
|
||||
extern u8 kan_tizu_r2_TA_tex_txt[];
|
||||
extern u8 kan_tizu_r4_TA_tex_txt[];
|
||||
extern u8 kan_tizu_r5_TA_tex_txt[];
|
||||
extern u8 kan_tizu_r6_TA_tex_txt[];
|
||||
extern u8 kan_tizu_r7_TA_tex_txt[];
|
||||
extern u8 kan_tizu_r1b_TA_tex_txt[];
|
||||
extern u8 kan_tizu_r2b_TA_tex_txt[];
|
||||
extern u8 kan_tizu_r2b_TA_tex_txt[];
|
||||
extern u8 kan_tizu_r4b_TA_tex_txt[];
|
||||
extern u8 kan_tizu_r5b_TA_tex_txt[];
|
||||
extern u8 kan_tizu_r6b_TA_tex_txt[];
|
||||
extern u8 kan_tizu_r7b_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c1s_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c2s_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c3s_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c4s_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c5s_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c6s_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c7s_TA_tex_txt[];
|
||||
extern u8 kan_tizu_m_TA_tex_txt[];
|
||||
extern u8 kan_tizu_mr1_TA_tex_txt[];
|
||||
extern u8 kan_tizu_fsh_TA_tex_txt[];
|
||||
extern u8 kan_tizu_fpk_TA_tex_txt[];
|
||||
extern u8 kan_tizu_fpo_TA_tex_txt[];
|
||||
extern u8 kan_tizu_fko_TA_tex_txt[];
|
||||
extern u8 kan_tizu_pr1_TA_tex_txt[];
|
||||
extern u8 kan_tizu_pr2_TA_tex_txt[];
|
||||
extern u8 kan_tizu_pr2_TA_tex_txt[];
|
||||
extern u8 kan_tizu_pr4_TA_tex_txt[];
|
||||
extern u8 kan_tizu_pr5_TA_tex_txt[];
|
||||
extern u8 kan_tizu_pr6_TA_tex_txt[];
|
||||
extern u8 kan_tizu_pr7_TA_tex_txt[];
|
||||
extern u8 kan_tizu_mr1b_TA_tex_txt[];
|
||||
extern u8 kan_tizu_fmu_TA_tex_txt[];
|
||||
extern u8 kan_tizu_fta_TA_tex_txt[];
|
||||
extern u8 kan_tizu_tr1b_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c1r2b_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c3r1b_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c4r1b_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c4r2b_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c5r2b_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c6r1b_TA_tex_txt[];
|
||||
extern u8 kan_tizu_c7r1b_TA_tex_txt[];
|
||||
extern u8 kan_tizu_mwf_TA_tex_txt[];
|
||||
|
||||
static u8* l_map_texture[108] = {
|
||||
kan_tizu_f_TA_tex_txt,
|
||||
kan_tizu_f_TA_tex_txt,
|
||||
kan_tizu_f_TA_tex_txt,
|
||||
kan_tizu_f_TA_tex_txt,
|
||||
kan_tizu_f_TA_tex_txt,
|
||||
kan_tizu_f_TA_tex_txt,
|
||||
kan_tizu_f_TA_tex_txt,
|
||||
kan_tizu_f_TA_tex_txt,
|
||||
kan_tizu_f_TA_tex_txt,
|
||||
kan_tizu_f_TA_tex_txt,
|
||||
kan_tizu_f_TA_tex_txt,
|
||||
kan_tizu_tst1_TA_tex_txt,
|
||||
kan_tizu_t_TA_tex_txt,
|
||||
kan_tizu_tr1_TA_tex_txt,
|
||||
kan_tizu_fmh_TA_tex_txt,
|
||||
kan_tizu_c1_TA_tex_txt,
|
||||
kan_tizu_c2_TA_tex_txt,
|
||||
kan_tizu_c3_TA_tex_txt,
|
||||
kan_tizu_c4_TA_tex_txt,
|
||||
kan_tizu_c5_TA_tex_txt,
|
||||
kan_tizu_c6_TA_tex_txt,
|
||||
kan_tizu_c7_TA_tex_txt,
|
||||
kan_tizu_c1r1_TA_tex_txt,
|
||||
kan_tizu_c2r1_TA_tex_txt,
|
||||
kan_tizu_c3r1_TA_tex_txt,
|
||||
kan_tizu_c4r1_TA_tex_txt,
|
||||
kan_tizu_c5r1_TA_tex_txt,
|
||||
kan_tizu_c6r1_TA_tex_txt,
|
||||
kan_tizu_c7r1_TA_tex_txt,
|
||||
kan_tizu_c1r2_TA_tex_txt,
|
||||
kan_tizu_c2r2_TA_tex_txt,
|
||||
kan_tizu_c3r2_TA_tex_txt,
|
||||
kan_tizu_c4r2_TA_tex_txt,
|
||||
kan_tizu_c5r2_TA_tex_txt,
|
||||
kan_tizu_c1r2_TA_tex_txt,
|
||||
kan_tizu_c4r2_TA_tex_txt,
|
||||
kan_tizu_c5r2_TA_tex_txt,
|
||||
kan_tizu_c6r3_TA_tex_txt,
|
||||
kan_tizu_c7r3_TA_tex_txt,
|
||||
kan_tizu_f_TA_tex_txt,
|
||||
kan_tizu_r1_TA_tex_txt,
|
||||
kan_tizu_r2_TA_tex_txt,
|
||||
kan_tizu_r2_TA_tex_txt,
|
||||
kan_tizu_r4_TA_tex_txt,
|
||||
kan_tizu_r5_TA_tex_txt,
|
||||
kan_tizu_r6_TA_tex_txt,
|
||||
kan_tizu_r7_TA_tex_txt,
|
||||
kan_tizu_r1b_TA_tex_txt,
|
||||
kan_tizu_r2b_TA_tex_txt,
|
||||
kan_tizu_r2b_TA_tex_txt,
|
||||
kan_tizu_r4b_TA_tex_txt,
|
||||
kan_tizu_r5b_TA_tex_txt,
|
||||
kan_tizu_r6b_TA_tex_txt,
|
||||
kan_tizu_r7b_TA_tex_txt,
|
||||
kan_tizu_c1s_TA_tex_txt,
|
||||
kan_tizu_c2s_TA_tex_txt,
|
||||
kan_tizu_c3s_TA_tex_txt,
|
||||
kan_tizu_c4s_TA_tex_txt,
|
||||
kan_tizu_c5s_TA_tex_txt,
|
||||
kan_tizu_c6s_TA_tex_txt,
|
||||
kan_tizu_c7s_TA_tex_txt,
|
||||
kan_tizu_f_TA_tex_txt,
|
||||
kan_tizu_f_TA_tex_txt,
|
||||
kan_tizu_m_TA_tex_txt,
|
||||
kan_tizu_mr1_TA_tex_txt,
|
||||
kan_tizu_fsh_TA_tex_txt,
|
||||
kan_tizu_fpk_TA_tex_txt,
|
||||
kan_tizu_fpo_TA_tex_txt,
|
||||
kan_tizu_fko_TA_tex_txt,
|
||||
kan_tizu_pr1_TA_tex_txt,
|
||||
kan_tizu_pr2_TA_tex_txt,
|
||||
kan_tizu_pr2_TA_tex_txt,
|
||||
kan_tizu_pr4_TA_tex_txt,
|
||||
kan_tizu_pr5_TA_tex_txt,
|
||||
kan_tizu_pr6_TA_tex_txt,
|
||||
kan_tizu_pr7_TA_tex_txt,
|
||||
kan_tizu_f_TA_tex_txt,
|
||||
kan_tizu_r1_TA_tex_txt,
|
||||
kan_tizu_c1_TA_tex_txt,
|
||||
kan_tizu_c1_TA_tex_txt,
|
||||
kan_tizu_c1_TA_tex_txt,
|
||||
kan_tizu_c1_TA_tex_txt,
|
||||
kan_tizu_mr1b_TA_tex_txt,
|
||||
kan_tizu_mr1_TA_tex_txt,
|
||||
kan_tizu_fmu_TA_tex_txt,
|
||||
kan_tizu_fta_TA_tex_txt,
|
||||
kan_tizu_tr1b_TA_tex_txt,
|
||||
kan_tizu_c1r2b_TA_tex_txt,
|
||||
kan_tizu_c3r1b_TA_tex_txt,
|
||||
kan_tizu_c4r1b_TA_tex_txt,
|
||||
kan_tizu_c4r2b_TA_tex_txt,
|
||||
kan_tizu_c5r2b_TA_tex_txt,
|
||||
kan_tizu_c6r1b_TA_tex_txt,
|
||||
kan_tizu_c7r1b_TA_tex_txt,
|
||||
kan_tizu_c7r1b_TA_tex_txt,
|
||||
kan_tizu_c7r1b_TA_tex_txt,
|
||||
kan_tizu_c7r1b_TA_tex_txt,
|
||||
kan_tizu_c7r1b_TA_tex_txt,
|
||||
kan_tizu_c7r1b_TA_tex_txt,
|
||||
kan_tizu_c7r1b_TA_tex_txt,
|
||||
kan_tizu_mwf_TA_tex_txt,
|
||||
kan_tizu_mwf_TA_tex_txt,
|
||||
kan_tizu_mwf_TA_tex_txt,
|
||||
kan_tizu_mwf_TA_tex_txt,
|
||||
kan_tizu_mwf_TA_tex_txt,
|
||||
kan_tizu_c1r2b_TA_tex_txt,
|
||||
kan_tizu_c4r2b_TA_tex_txt,
|
||||
kan_tizu_c5r2b_TA_tex_txt
|
||||
};
|
||||
|
||||
static u8 l_map_pal[108] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
|
||||
1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0
|
||||
};
|
||||
|
||||
static u8 pluss_bridge[108] = {
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x56, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x58, 0x59, 0xff, 0x5c, 0x5d, 0x57, 0xff, 0xff,
|
||||
0x5a, 0x5b, 0x69, 0x6a, 0x6b, 0xff, 0xff, 0xff, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x52, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
|
||||
};
|
||||
|
||||
extern Gfx kan_win_model[];
|
||||
extern Gfx kan_win_model2[];
|
||||
@@ -38,12 +242,14 @@ extern mMP_HousePos_c mMP_house_pos_list[];
|
||||
|
||||
extern Gfx kan_win_mode[];
|
||||
|
||||
static u16 kan_tizu1_pal[16] = {
|
||||
|
||||
static u16 kan_tizu1_pal[16] ATTRIBUTE_ALIGN(32) = {
|
||||
0x0000, 0xc3b0, 0x9e87, 0xd294, 0xca52, 0xbdef, 0xb5ad, 0xb9ce,
|
||||
0xa2e8, 0xb18c, 0xa705, 0xdaff, 0xab4a, 0xffff, 0xb635, 0xbe9f
|
||||
};
|
||||
|
||||
static u16 kan_tizu2_pal[16] = {
|
||||
|
||||
static u16 kan_tizu2_pal[16] ATTRIBUTE_ALIGN(32) = {
|
||||
0x0000, 0xc3b0, 0x9e87, 0xc94a, 0xe70d, 0xe1ce, 0xb5ad, 0xb195,
|
||||
0xf390, 0xb18c, 0xa705, 0xffff, 0xd54a, 0xdaff, 0xb635, 0xbe9f
|
||||
};
|
||||
|
||||
static u16* l_kan_tizu_pal[2] = {
|
||||
@@ -337,8 +543,6 @@ static int mMP_check_bg_kind(u8 kind) {
|
||||
return res;
|
||||
}
|
||||
|
||||
static u8 pluss_bridge[108] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x56, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x58, 0x59, 0xff, 0x5c, 0x5d, 0x57, 0xff, 0xff, 0x5a, 0x5b, 0x69, 0x6a, 0x6b, 0xff, 0xff, 0xff, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x52, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
|
||||
static void mMP_make_max_no_table(int* max_no_table, int count) {
|
||||
int bz;
|
||||
int i;
|
||||
@@ -398,8 +602,8 @@ static mActor_name_t mMP_GetFgBlockName(mMP_Overlay_c* map_ovl, int block_x, int
|
||||
static void mMP_set_house_data(mMP_Overlay_c* map_ovl, mSM_MenuInfo_c* menu) {
|
||||
static u8 akiya_str[PLAYER_NAME_LEN] = { CHAR_f, CHAR_r, CHAR_e, CHAR_e, CHAR_SPACE, CHAR_SPACE, CHAR_SPACE, CHAR_SPACE };
|
||||
|
||||
mMP_LabelInfo_c* player_block_label = &map_ovl->label_info[1][2];
|
||||
mMP_ResidentInfo_c* resident_p = &map_ovl->player_info[0];
|
||||
mMP_LabelInfo_c* player_block_label = &map_ovl->label_info[1][2];
|
||||
Private_c* priv = Save_Get(private);
|
||||
mMP_HousePos_c* house_pos2;
|
||||
Animal_c* animal = Save_Get(animals);
|
||||
@@ -429,13 +633,12 @@ static void mMP_set_house_data(mMP_Overlay_c* map_ovl, mSM_MenuInfo_c* menu) {
|
||||
priv++;
|
||||
}
|
||||
|
||||
for (residents; residents < PLAYER_NUM; residents++) {
|
||||
for (residents; residents < PLAYER_NUM; residents++, resident_p++) {
|
||||
mPr_CopyPlayerName(resident_p->name, akiya_str);
|
||||
resident_p->sex = -1;
|
||||
resident_p->house_layer = 0;
|
||||
|
||||
player_block_label->residents[residents] = resident_p;
|
||||
resident_p++;
|
||||
}
|
||||
|
||||
house_pos2 = mMP_house_pos_list;
|
||||
@@ -443,7 +646,7 @@ static void mMP_set_house_data(mMP_Overlay_c* map_ovl, mSM_MenuInfo_c* menu) {
|
||||
resident_p = &map_ovl->animal_info[0];
|
||||
residents = 0;
|
||||
|
||||
for (i = 0; i < ANIMAL_NUM_MAX; i++) {
|
||||
for (i = 0; i < ANIMAL_NUM_MAX; i++, animal++, resident_p++) {
|
||||
if (mNpc_CheckFreeAnimalInfo(animal) == FALSE) {
|
||||
Anmhome_c* home = &animal->home_info;
|
||||
mNpc_GetNpcWorldNameAnm(resident_p->name, &animal->id);
|
||||
@@ -487,9 +690,6 @@ static void mMP_set_house_data(mMP_Overlay_c* map_ovl, mSM_MenuInfo_c* menu) {
|
||||
label_info->label_no = mMP_LABEL_NPC;
|
||||
}
|
||||
}
|
||||
|
||||
resident_p++;
|
||||
animal++;
|
||||
}
|
||||
|
||||
/* Sort villager houses by layer, with lower layers coming first */
|
||||
@@ -709,7 +909,6 @@ static void mMP_map_ovl_move(Submenu* submenu) {
|
||||
(*ovl_move_proc[menu->proc_status])(submenu, menu);
|
||||
}
|
||||
|
||||
#pragma pool_data on
|
||||
static void mMP_map_draw_init() {
|
||||
kan_win_wakuT_model_p = kan_win_wakuT_model;
|
||||
kan_win_waku1T_model_p = kan_waku_w1T_model;
|
||||
@@ -719,7 +918,6 @@ static void mMP_map_draw_init() {
|
||||
kan_win_color0_mode_p = kan_win_color0_mode;
|
||||
kan_win_color1_mode_p = kan_win_color1_mode;
|
||||
}
|
||||
#pragma pool_data reset
|
||||
|
||||
static int mMP_get_label_cnt(mMP_LabelInfo_c* label_info) {
|
||||
int label_no = label_info->label_no;
|
||||
@@ -730,20 +928,25 @@ static int mMP_get_label_cnt(mMP_LabelInfo_c* label_info) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* TODO: this function needs to be matched. We first need to fix pooling so that .rodata has pooling off and .data & .bss have pooling on */
|
||||
#pragma pool_data on
|
||||
static void mMP_set_house_dl(GRAPH* graph, mMP_Overlay_c* map_ovl, f32 pos_x, f32 pos_y) {
|
||||
static f32 offset_x[3] = { 5.0f, 13.0f, 17.0f };
|
||||
static f32 offset_y[3] = { -4.0f, -11.0f, -18.0f };
|
||||
|
||||
Gfx* gfx;
|
||||
mMP_LabelInfo_c* label_info = (mMP_LabelInfo_c*)map_ovl->label_info;
|
||||
f32 y = pos_y + 45.7f;
|
||||
f32 base_y = y + (0.5f * mMP_BLOCK_SIZE_F);
|
||||
f32 base_x = (pos_x + 11.7f) - (0.5f * mMP_BLOCK_SIZE_F);
|
||||
f32 x_save;
|
||||
int bx;
|
||||
mMP_LabelInfo_c* label_info;
|
||||
f32 y;
|
||||
f32 base_x;
|
||||
f32 temp_x;
|
||||
f32 base_y;
|
||||
mMP_ResidentInfo_c** resident_p;
|
||||
int bz;
|
||||
int bx;
|
||||
int i;
|
||||
Gfx* gfx;
|
||||
|
||||
label_info = (mMP_LabelInfo_c*)map_ovl->label_info;
|
||||
|
||||
base_y = (pos_y + 45.7f) + (0.5f * mMP_BLOCK_SIZE_F);
|
||||
base_x = (pos_x + 11.7f) - (0.5f * mMP_BLOCK_SIZE_F);
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
@@ -753,15 +956,19 @@ static void mMP_set_house_dl(GRAPH* graph, mMP_Overlay_c* map_ovl, f32 pos_x, f3
|
||||
/* draw all villager houses */
|
||||
|
||||
for (bz = 0; bz < FG_BLOCK_Z_NUM; bz++) {
|
||||
x_save = base_x;
|
||||
temp_x = (pos_x + 11.7f) - (0.5f * mMP_BLOCK_SIZE_F);
|
||||
for (bx = 0; bx < FG_BLOCK_X_NUM; bx++) {
|
||||
if (label_info->label_no == mMP_LABEL_NPC) {
|
||||
mMP_ResidentInfo_c** resident_p = label_info->residents;
|
||||
int i;
|
||||
resident_p = label_info->residents;
|
||||
|
||||
for (i = 0; i < label_info->label_cnt; i++) {
|
||||
Matrix_scale(16.0f, 16.0f, 1.0f, 0);
|
||||
Matrix_translate(base_x + offset_x[(*resident_p)->house_idx % 3], (base_y + 11.0f) + offset_y[(*resident_p)->house_idx / 3], 140.0f, 1);
|
||||
Matrix_translate(
|
||||
temp_x + offset_x[(*resident_p)->house_idx % 3],
|
||||
base_y + offset_y[(*resident_p)->house_idx / 3],
|
||||
140.0f,
|
||||
1
|
||||
);
|
||||
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfx++, kan_win_npc2T_table[(*resident_p)->house_layer]);
|
||||
@@ -770,19 +977,20 @@ static void mMP_set_house_dl(GRAPH* graph, mMP_Overlay_c* map_ovl, f32 pos_x, f3
|
||||
}
|
||||
}
|
||||
|
||||
base_x += mMP_BLOCK_SIZE_F;
|
||||
temp_x += mMP_BLOCK_SIZE_F;
|
||||
label_info++;
|
||||
}
|
||||
|
||||
base_x = x_save;
|
||||
base_y -= mMP_BLOCK_SIZE_F;
|
||||
//base_x = x_save;
|
||||
}
|
||||
|
||||
/* draw "current acre" icon */
|
||||
|
||||
Matrix_scale(16.0f, 16.0f, 1.0f, 0);
|
||||
Matrix_translate(
|
||||
(x_save + (f32)map_ovl->player_bx * mMP_BLOCK_SIZE_F) + 3.0f + 5.0f,
|
||||
(y - (0.5f * mMP_BLOCK_SIZE_F) - (f32)map_ovl->player_bz * mMP_BLOCK_SIZE_F) + 4.0f + 5.0f,
|
||||
((pos_x + 11.7f) - (0.5f * mMP_BLOCK_SIZE_F) + (f32)map_ovl->player_bx * mMP_BLOCK_SIZE_F) + 3.0f + 5.0f,
|
||||
(pos_y + 45.7f - (0.5f * mMP_BLOCK_SIZE_F) - (f32)map_ovl->player_bz * mMP_BLOCK_SIZE_F) + 4.0f + 5.0f,
|
||||
140.0f,
|
||||
1
|
||||
);
|
||||
@@ -793,7 +1001,6 @@ static void mMP_set_house_dl(GRAPH* graph, mMP_Overlay_c* map_ovl, f32 pos_x, f3
|
||||
SET_POLY_OPA_DISP(gfx);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
#pragma pool_data reset
|
||||
|
||||
static void mMP_set_map_dl(GRAPH* graph, mMP_Overlay_c* map_ovl) {
|
||||
int bz;
|
||||
@@ -933,7 +1140,7 @@ static void mMP_set_label_dl(GAME* game, mMP_LabelInfo_c* label_info, f32 xpos,
|
||||
base_x + word->ofs_x, base_y - word->ofs_y,
|
||||
255, 75, 40, 255,
|
||||
FALSE, TRUE,
|
||||
scale_x, 1.8125f,
|
||||
scale_x, 0.75f,
|
||||
mFont_MODE_POLY
|
||||
);
|
||||
}
|
||||
@@ -944,7 +1151,7 @@ static void mMP_set_label_dl(GAME* game, mMP_LabelInfo_c* label_info, f32 xpos,
|
||||
base_x + word->ofs_x, base_y - word->ofs_y,
|
||||
165, 145, 140, 255,
|
||||
FALSE, TRUE,
|
||||
scale_x, 1.8125f,
|
||||
scale_x, 0.75f,
|
||||
mFont_MODE_POLY
|
||||
);
|
||||
}
|
||||
@@ -961,7 +1168,7 @@ static void mMP_set_label_dl(GAME* game, mMP_LabelInfo_c* label_info, f32 xpos,
|
||||
base_x + word->ofs_x, base_y - word->ofs_y,
|
||||
120, 95, 205, 255,
|
||||
FALSE, TRUE,
|
||||
1.8125f, 1.8125f,
|
||||
0.75f, 0.75f,
|
||||
mFont_MODE_POLY
|
||||
);
|
||||
}
|
||||
@@ -990,7 +1197,6 @@ static void mMP_set_base_dl(GRAPH* graph, mSM_MenuInfo_c* menu) {
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
#pragma pool_data on
|
||||
static void mMP_set_win_dl(GRAPH* graph, mMP_Overlay_c* map_ovl, mMP_LabelInfo_c* label_info) {
|
||||
int label_count = label_info->label_cnt;
|
||||
Gfx* gfx;
|
||||
@@ -1025,7 +1231,6 @@ static void mMP_set_win_dl(GRAPH* graph, mMP_Overlay_c* map_ovl, mMP_LabelInfo_c
|
||||
SET_POLY_OPA_DISP(gfx);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
#pragma pool_data reset
|
||||
|
||||
static void mMP_set_label_top_dl(GRAPH* graph, mMP_LabelInfo_c* label_info) {
|
||||
mMP_Label_c* label = mMP_label_data[label_info->label_no];
|
||||
@@ -1113,7 +1318,7 @@ static void mMP_set_dl(Submenu* submenu, GAME* game, mSM_MenuInfo_c* menu) {
|
||||
str_xpos + 160.0f, 120.0f - str_ypos,
|
||||
col[0], col[1], col[2], 255,
|
||||
FALSE, TRUE,
|
||||
1.875f, 1.875f,
|
||||
1.0f, 1.0f,
|
||||
mFont_MODE_POLY
|
||||
);
|
||||
|
||||
@@ -1128,7 +1333,7 @@ static void mMP_map_ovl_draw(Submenu* submenu, GAME* game) {
|
||||
mMP_set_dl(submenu, game, menu);
|
||||
}
|
||||
|
||||
static void mMP_map_ovl_set_proc(Submenu* submenu) {
|
||||
extern void mMP_map_ovl_set_proc(Submenu* submenu) {
|
||||
Submenu_Overlay_c* overlay = submenu->overlay;
|
||||
|
||||
overlay->menu_control.menu_move_func = &mMP_map_ovl_move;
|
||||
@@ -1146,7 +1351,7 @@ static void mMP_map_ovl_init(Submenu* submenu) {
|
||||
mMP_set_init_data(submenu->overlay->map_ovl, menu);
|
||||
}
|
||||
|
||||
static void mMP_map_ovl_construct(Submenu* submenu) {
|
||||
extern void mMP_map_ovl_construct(Submenu* submenu) {
|
||||
Submenu_Overlay_c* overlay = submenu->overlay;
|
||||
|
||||
if (overlay->map_ovl == NULL) {
|
||||
@@ -1160,7 +1365,7 @@ static void mMP_map_ovl_construct(Submenu* submenu) {
|
||||
mMP_map_ovl_set_proc(submenu);
|
||||
}
|
||||
|
||||
static void mMP_map_ovl_destruct(Submenu* submenu) {
|
||||
extern void mMP_map_ovl_destruct(Submenu* submenu) {
|
||||
mMP_Overlay_c* map_ovl = submenu->overlay->map_ovl;
|
||||
|
||||
if (map_ovl != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user