Implement & link m_player_lib

This commit is contained in:
Cuyler36
2024-09-12 08:04:10 -04:00
parent 3dfe1591ae
commit 5d0abe3198
30 changed files with 5158 additions and 1408 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ static void aNRTC_think_title(NPC_ACTOR* actor, GAME_PLAY* play) {
play->fb_wipe_type = 3;
play->fb_fade_type = 4;
mPlib_request_main_invade_type1(play);
mPlib_request_main_invade_type1((GAME*)play);
Actor_info_save_actor(play);
rtc->think_idx = aNRTC_THINK_WAIT;
}
+13 -11
View File
@@ -19,17 +19,19 @@ static void aTUMB_actor_ct(ACTOR* actor, GAME* game);
static void aTUMB_actor_move(ACTOR* actor, GAME* game);
static void aTUMB_actor_draw(ACTOR* actor, GAME* game);
ACTOR_PROFILE T_Umbrella_Profile = { mAc_PROFILE_T_UMBRELLA,
ACTOR_PART_BG,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_UMBRELLA,
sizeof(UMBRELLA_ACTOR),
&aTUMB_actor_ct,
NONE_ACTOR_PROC,
&aTUMB_actor_move,
&aTUMB_actor_draw,
NULL };
ACTOR_PROFILE T_Umbrella_Profile = {
mAc_PROFILE_T_UMBRELLA,
ACTOR_PART_BG,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_UMBRELLA,
sizeof(UMBRELLA_ACTOR),
&aTUMB_actor_ct,
NONE_ACTOR_PROC,
&aTUMB_actor_move,
&aTUMB_actor_draw,
NULL,
};
extern Gfx e_umb01_model[];
extern Gfx kasa_umb01_model[];
+73 -61
View File
@@ -19,8 +19,8 @@ static void Weather_Actor_dt(ACTOR* actor, GAME* game);
static void Weather_Actor_move(ACTOR* actor, GAME* game);
static void Weather_Actor_draw(ACTOR* actor, GAME* game);
static void aWeather_SetNowProfile(WEATHER_ACTOR* weather, s16 id);
static int aWeather_CountWeatherPrivate(WEATHER_ACTOR* weather);
static void aWeather_SetNowProfile(ACTOR* actorx, s16 id);
static int aWeather_CountWeatherPrivate(ACTOR* actorx);
static aWeather_Profile_c* profile_tbl[] = {
&iam_weather_fine, &iam_weather_rain, &iam_weather_snow, &iam_weather_sakura, &iam_weather_leaf,
@@ -58,12 +58,14 @@ static void aWeather_SysLevCall_MoveEnd(WEATHER_ACTOR* weather) {
}
static void aWeather_SysLevStart(u8 flag) {
Common_Get(clip.weather_clip)->actor->start_sound_effect = flag;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
weather->start_sound_effect = flag;
}
static void aWeather_SysLevStop(u8 flag) {
int stopFlag = flag;
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
if (weather->start_sound_effect == stopFlag) {
weather->start_sound_effect = 0;
@@ -97,13 +99,12 @@ static void aWeather_RequestChangeWeather(ACTOR* actor, s16 status, s16 level) {
}
extern void aWeather_RequestChangeWeatherToIsland() {
aWeather_RequestChangeWeather(&Common_Get(clip.weather_clip)->actor->actor_class, Common_Get(island_weather),
aWeather_RequestChangeWeather(Common_Get(clip.weather_clip)->actor, Common_Get(island_weather),
Common_Get(island_weather_intensity));
}
extern void aWeather_RequestChangeWeatherFromIsland() {
aWeather_RequestChangeWeather(&Common_Get(clip.weather_clip)->actor->actor_class,
mEnv_SAVE_GET_WEATHER_TYPE(Save_Get(weather)),
aWeather_RequestChangeWeather(Common_Get(clip.weather_clip)->actor, mEnv_SAVE_GET_WEATHER_TYPE(Save_Get(weather)),
mEnv_SAVE_GET_WEATHER_INTENSITY(Save_Get(weather)));
}
@@ -158,8 +159,7 @@ static aWeather_Priv* aWeather_GetWeatherPrv(u8 status, s16 timer, xyz_t* pos, x
}
static int aWeather_StopSysLevSE() {
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
u8 current = weather->current_sound_effect;
if (weather->sound_flag == 0) {
@@ -174,8 +174,7 @@ static int aWeather_StopSysLevSE() {
}
static int aWeather_StartSysLevSE() {
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
u8 current = weather->current_sound_effect;
if (weather->sound_flag == 1) {
@@ -202,7 +201,8 @@ static int aWeather_StartSysLevSE() {
return 0;
}
static void aWeather_ChangeWeatherInstance(WEATHER_ACTOR* weather, s16 status, s16 level) {
static void aWeather_ChangeWeatherInstance(ACTOR* actorx, s16 status, s16 level) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
weather->next_status = status;
weather->next_level = level;
@@ -210,9 +210,9 @@ static void aWeather_ChangeWeatherInstance(WEATHER_ACTOR* weather, s16 status, s
weather->current_level = 0;
weather->request_change = TRUE;
if (!aWeather_CountWeatherPrivate(weather)) {
if (!aWeather_CountWeatherPrivate(actorx)) {
weather->current_status = weather->next_status;
aWeather_SetNowProfile(weather, weather->current_status);
aWeather_SetNowProfile(actorx, weather->current_status);
aWeather_weatherinfo_CommonSet(weather->current_status, weather->next_level);
weather->current_level = level;
weather->current_aim_level = weather->next_level;
@@ -229,7 +229,8 @@ static int aWeather_IsLand_Event_Check() {
return 0;
}
static int aWeather_Basement_Event_Check(WEATHER_ACTOR* weather) {
static int aWeather_Basement_Event_Check(ACTOR* actorx) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
if ((weather->basement_event == 1) || (weather->basement_event == 2)) {
return 1;
@@ -237,7 +238,8 @@ static int aWeather_Basement_Event_Check(WEATHER_ACTOR* weather) {
return 0;
}
static void aWeather_ChangeEnvSE(WEATHER_ACTOR* weather, GAME_PLAY* play, s16 status, s16 level) {
static void aWeather_ChangeEnvSE(ACTOR* actorx, GAME* game, s16 status, s16 level) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
u8 current = weather->current_sound_effect;
if (weather->sound_flag == 1 || weather->sound_flag == 2)
@@ -256,7 +258,7 @@ static void aWeather_ChangeEnvSE(WEATHER_ACTOR* weather, GAME_PLAY* play, s16 st
if ((status == 1) && (weather->current_sound_effect == -1000)) {
switch (level) {
case 1:
if (mPlib_check_player_open_umbrella(play) != 0) {
if (mPlib_check_player_open_umbrella(game) != 0) {
aWeather_SysLevStart(0x12);
weather->current_sound_effect = 0x12;
return;
@@ -265,7 +267,7 @@ static void aWeather_ChangeEnvSE(WEATHER_ACTOR* weather, GAME_PLAY* play, s16 st
weather->current_sound_effect = 7;
break;
case 2:
if (mPlib_check_player_open_umbrella(play) != 0) {
if (mPlib_check_player_open_umbrella(game) != 0) {
aWeather_SysLevStart(0x13);
weather->current_sound_effect = 0x13;
return;
@@ -274,7 +276,7 @@ static void aWeather_ChangeEnvSE(WEATHER_ACTOR* weather, GAME_PLAY* play, s16 st
weather->current_sound_effect = 8;
break;
case 3:
if (mPlib_check_player_open_umbrella(play) != 0) {
if (mPlib_check_player_open_umbrella(game) != 0) {
aWeather_SysLevStart(0x14);
weather->current_sound_effect = 0x14;
return;
@@ -293,7 +295,7 @@ static void aWeather_EndEnvSE(ACTOR* actor) {
if ((sAdo_GameframeEnd_Check() == 1) ||
((sAdo_GameframeEnd_Check() == 2) &&
((aWeather_IsLand_Event_Check() != 0) || (aWeather_Basement_Event_Check(weather) != 0)))) {
((aWeather_IsLand_Event_Check() != 0) || (aWeather_Basement_Event_Check(actor) != 0)))) {
if (((u8)(current - 7) <= 2) || ((u8)(current - 0x12) <= 1) || (u8)(current == 0x14)) {
aWeather_SysLevStop(current);
weather->current_sound_effect = -1000;
@@ -305,7 +307,8 @@ static void aWeather_EndEnvSE(ACTOR* actor) {
aWeather_SysLevCall_MoveEnd(weather);
}
static void aWeather_SetNowProfile(WEATHER_ACTOR* weather, s16 id) {
static void aWeather_SetNowProfile(ACTOR* actorx, s16 id) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
if (!mFI_GET_TYPE(mFI_GetFieldId())) {
weather->current_profile = profile_tbl[id];
@@ -314,11 +317,11 @@ static void aWeather_SetNowProfile(WEATHER_ACTOR* weather, s16 id) {
}
}
static void aWeather_SecureWeatherPrivateWork(WEATHER_ACTOR* weather) {
static void aWeather_SecureWeatherPrivateWork(ACTOR* actorx) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
int i;
weather->priv = zelda_malloc(sizeof(aWeather_Priv) * 100);
if (weather->priv != NULL) {
for (i = 0; i < 100; i++) {
bzero(&weather->priv[i], sizeof(aWeather_Priv));
@@ -326,14 +329,16 @@ static void aWeather_SecureWeatherPrivateWork(WEATHER_ACTOR* weather) {
}
}
static void aWeather_SetClip(WEATHER_ACTOR* weather, int flag) {
static void aWeather_SetClip(ACTOR* actorx, int flag) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
aWeather_Clip_c* clip;
if (flag != 0) {
Common_Set(clip.weather_clip, NULL);
} else {
clip = &weather->clip;
clip->actor = weather;
clip->actor = actorx;
clip->change_weather = aWeather_RequestChangeWeather;
clip->get_priv_num = aWeather_GetWeatherPrvNum;
clip->remove_priv = aWeather_AbolishPrivate;
@@ -346,7 +351,8 @@ static void aWeather_SetClip(WEATHER_ACTOR* weather, int flag) {
}
}
static void aWeather_RenewWindInfo(WEATHER_ACTOR* weather) {
static void aWeather_RenewWindInfo(ACTOR* actorx) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
s_xyz pos = Common_Get(wind); // multiply by 1 means inline ?
f32 speed = Common_Get(wind_speed) * 0.01f;
f32 factor = 1.0f;
@@ -356,12 +362,12 @@ static void aWeather_RenewWindInfo(WEATHER_ACTOR* weather) {
weather->wind_info.z = pos.z * speed * factor;
}
static void aWeather_SnowInAdvance(WEATHER_ACTOR* weather, GAME_PLAY* play, int moves) {
static void aWeather_SnowInAdvance(ACTOR* actorx, GAME* game, int moves) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
int i;
for (i = 0; i < moves; i++) {
Weather_Actor_move(&weather->actor_class, &play->game);
Weather_Actor_move(actorx, game);
}
}
@@ -375,7 +381,7 @@ static void Weather_Actor_ct(ACTOR* actor, GAME* game) {
int cur;
xyz_t* pos = Camera2_getCenterPos_p();
aWeather_SetClip(weather, 0);
aWeather_SetClip(actor, 0);
if (mEv_CheckTitleDemo() > 0) {
cur = mEv_CheckTitleDemo() - 1;
@@ -408,17 +414,17 @@ static void Weather_Actor_ct(ACTOR* actor, GAME* game) {
weather->lightning_timer2 = 30;
weather->sound_flag = 0;
aWeather_RenewWindInfo(weather);
aWeather_RenewWindInfo(actor);
if (!mFI_GET_TYPE(mFI_GetFieldId())) {
aWeather_SecureWeatherPrivateWork(weather);
aWeather_SecureWeatherPrivateWork(actor);
}
aWeather_SetNowProfile(weather, weather->current_status);
aWeather_SetNowProfile(actor, weather->current_status);
if ((weather->current_status == 2) || (weather->current_status == 3)) {
weather->pos.y -= 50.0f;
aWeather_SnowInAdvance(weather, play, 0x28);
aWeather_SnowInAdvance(actor, game, 0x28);
weather->pos.y += 50.0f;
}
@@ -437,11 +443,11 @@ static void Weather_Actor_ct(ACTOR* actor, GAME* game) {
weather->basement_event = 0;
}
if ((play->fb_wipe_type == 6) && (aWeather_IsLand_Event_Check() == 0) &&
(aWeather_Basement_Event_Check(weather) == 0)) {
(aWeather_Basement_Event_Check(actor) == 0)) {
weather->current_sound_effect = Common_Get(current_sound_effect);
} else {
weather->current_sound_effect = -1000;
aWeather_ChangeEnvSE(weather, play, weather->current_status, weather->current_level);
aWeather_ChangeEnvSE(actor, game, weather->current_status, weather->current_level);
aWeather_SysLevCall_MoveEnd(weather);
}
}
@@ -453,7 +459,7 @@ static void Weather_Actor_dt(ACTOR* actor, GAME* game) {
zelda_free(weather->priv);
}
aWeather_SetClip(weather, 1);
aWeather_SetClip(actor, 1);
}
static void aWeather_DrawWeatherPrv(ACTOR* actor, GAME* game) {
@@ -495,7 +501,8 @@ static void aWeather_MakeWeatherPrv(ACTOR* actor, GAME* game) {
}
}
static void aWeather_MoveWeatherPrv(WEATHER_ACTOR* weather, GAME* game) {
static void aWeather_MoveWeatherPrv(ACTOR* actorx, GAME* game) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
aWeather_Priv* priv;
int i;
@@ -509,7 +516,7 @@ static void aWeather_MoveWeatherPrv(WEATHER_ACTOR* weather, GAME* game) {
if (priv->timer != -100) {
priv->timer--;
if (priv->timer <= 0) {
aWeather_AbolishPrivate(&weather->actor_class, i);
aWeather_AbolishPrivate(actorx, i);
}
}
}
@@ -517,7 +524,8 @@ static void aWeather_MoveWeatherPrv(WEATHER_ACTOR* weather, GAME* game) {
}
}
static int aWeather_CountWeatherPrivate(WEATHER_ACTOR* weather) {
static int aWeather_CountWeatherPrivate(ACTOR* actorx) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
int i;
int count;
aWeather_Priv* priv = weather->priv;
@@ -534,7 +542,8 @@ static int aWeather_CountWeatherPrivate(WEATHER_ACTOR* weather) {
return count;
}
static void aWeather_ChangeWeather(WEATHER_ACTOR* weather, GAME_PLAY* play) {
static void aWeather_ChangeWeather(ACTOR* actorx, GAME* game) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
if ((weather->request_change == TRUE) && (weather->current_level == 0)) {
if (mFI_GET_TYPE(mFI_GetFieldId())) {
@@ -542,27 +551,28 @@ static void aWeather_ChangeWeather(WEATHER_ACTOR* weather, GAME_PLAY* play) {
aWeather_weatherinfo_CommonSet(weather->current_status, weather->next_level);
weather->current_level = 1;
weather->current_aim_level = weather->next_level;
aWeather_ChangeEnvSE(weather, play, weather->current_status, weather->current_level);
aWeather_ChangeEnvSE(actorx, game, weather->current_status, weather->current_level);
weather->request_change = FALSE;
} else if (aWeather_CountWeatherPrivate(weather) == 0) {
} else if (aWeather_CountWeatherPrivate(actorx) == 0) {
weather->current_status = weather->next_status;
aWeather_SetNowProfile(weather, weather->current_status);
aWeather_SetNowProfile(actorx, weather->current_status);
aWeather_weatherinfo_CommonSet(weather->current_status, weather->next_level);
weather->current_level = 1;
weather->current_aim_level = weather->next_level;
aWeather_ChangeEnvSE(weather, play, weather->current_status, weather->current_level);
aWeather_ChangeEnvSE(actorx, game, weather->current_status, weather->current_level);
weather->request_change = FALSE;
}
}
}
static void aWeather_CheckWeatherTimer() {
static void aWeather_CheckWeatherTimer(ACTOR* actorx) {
s_xyz dir;
mEnv_DecideWindDirect(&dir, 0x3000, 0x3000);
}
static void aWeather_RenewWeatherLevel(WEATHER_ACTOR* weather, GAME_PLAY* play) {
static void aWeather_RenewWeatherLevel(ACTOR* actorx, GAME* game) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
s16 level;
if (weather->current_level != weather->current_aim_level) {
@@ -574,12 +584,13 @@ static void aWeather_RenewWeatherLevel(WEATHER_ACTOR* weather, GAME_PLAY* play)
weather->current_level--;
else
weather->current_level++;
aWeather_ChangeEnvSE(weather, play, weather->current_status, weather->current_level);
aWeather_ChangeEnvSE(actorx, game, weather->current_status, weather->current_level);
}
}
}
static void aWeather_ChangeWeatherTime0(WEATHER_ACTOR* weather) {
static void aWeather_ChangeWeatherTime0(ACTOR* actorx) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
s16 rndWeather, rndIntensity;
s16 evWeather, evIntensity;
s16 save_weather;
@@ -611,14 +622,15 @@ static void aWeather_ChangeWeatherTime0(WEATHER_ACTOR* weather) {
Save_Set(weather, rndIntensity | (rndWeather * 16));
if (((mEv_CheckTitleDemo() != -9) || (weather->sound_flag != 1)) && (mFI_CheckInIsland() == 0)) {
aWeather_RequestChangeWeather(&weather->actor_class, rndWeather, rndIntensity);
aWeather_RequestChangeWeather(actorx, rndWeather, rndIntensity);
}
Common_Set(weather_time, Common_Get(time.rtc_time));
}
}
}
static void aWeather_MakeKaminari(WEATHER_ACTOR* weather) {
static void aWeather_MakeKaminari(ACTOR* actorx) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
lbRTC_time_c time = Common_Get(time.rtc_time);
u8 month = time.month;
s16 timer;
@@ -660,21 +672,21 @@ static void Weather_Actor_move(ACTOR* actor, GAME* game) {
camera = &play->camera;
angle = search_position_angleY(&camera->lookat.center, &camera->lookat.eye);
aWeather_MakeKaminari(weather);
aWeather_CheckWeatherTimer(weather);
aWeather_MakeKaminari(actor);
aWeather_CheckWeatherTimer(actor);
aWeather_MakeWeatherPrv(actor, game);
aWeather_RenewWeatherLevel(weather, play);
aWeather_MoveWeatherPrv(weather, game);
aWeather_ChangeWeather(weather, play);
aWeather_RenewWeatherLevel(actor, game);
aWeather_MoveWeatherPrv(actor, game);
aWeather_ChangeWeather(actor, game);
weather->pos = *pos;
aWeather_ChangeWeatherTime0(weather);
aWeather_ChangeWeatherTime0(actor);
if (Common_Get(weather) == 1) {
umbrella = mPlib_check_player_open_umbrella(play);
umbrella = mPlib_check_player_open_umbrella(game);
if (umbrella != weather->umbrella_flag) {
aWeather_ChangeEnvSE(weather, play, weather->current_status, weather->current_level);
aWeather_ChangeEnvSE(actor, game, weather->current_status, weather->current_level);
}
weather->umbrella_flag = umbrella;
@@ -689,10 +701,10 @@ static void Weather_Actor_move(ACTOR* actor, GAME* game) {
}
extern int aWeather_ChangingWeather() {
if (Common_Get(clip.weather_clip) != NULL) {
if (Common_Get(clip.weather_clip->actor) != NULL) {
return Common_Get(clip.weather_clip->actor)->request_change == TRUE;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip).weather_clip->actor;
return weather->request_change == TRUE;
}
}
+60 -67
View File
@@ -27,50 +27,46 @@ Gfx* ef_otiba_model_tbl[] = {
};
aWeather_Profile_c iam_weather_leaf = {
aWeatherLeaf_make,
aWeatherLeaf_ct,
aWeatherLeaf_move,
aWeatherLeaf_set,
aWeatherLeaf_draw,
aWeatherLeaf_make, aWeatherLeaf_ct, aWeatherLeaf_move, aWeatherLeaf_set, aWeatherLeaf_draw,
};
static int aWeatherLeaf_DecideMakeLeafCount(ACTOR* actor, GAME* game){
static int aWeatherLeaf_DecideMakeLeafCount(ACTOR* actor, GAME* game) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
if(weather->current_level == 1){
if (weather->current_level == 1) {
return (game->frame_counter & 15) == 0;
}
return (game->frame_counter & 7) == 0;
return (game->frame_counter & 7) == 0;
}
static void aWeatherLeaf_make(ACTOR* actor, GAME* game){
static void aWeatherLeaf_make(ACTOR* actor, GAME* game) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
GAME_PLAY* play = (GAME_PLAY*)game;
aWeather_Priv* priv;
f32 x,z;
aWeather_Priv* priv;
f32 x, z;
xyz_t pos = weather->pos;
f32 y = 230.0f + pos.y;
int count = Common_Get(clip.weather_clip)->get_priv_num(actor);
xyz_t base = {0.0f, 0.0f, 0.0f};
int count = Common_Get(clip.weather_clip)->get_priv_num(actor);
xyz_t base = { 0.0f, 0.0f, 0.0f };
xyz_t mod_pos;
if(aWeatherLeaf_DecideMakeLeafCount(actor, game) != 0){
if (aWeatherLeaf_DecideMakeLeafCount(actor, game) != 0) {
base.y = -0.8f + (RANDOM_F(-0.0999999642372f));
if(count != -1){
if (count != -1) {
x = -100.0f + (RANDOM_F(200.0f));
z = -200.0f + (RANDOM_F(380.0f));
mod_pos = pos;
mod_pos.x += x;
mod_pos.z += z;
mod_pos.y = y;
priv = Common_Get(clip.weather_clip)->get_priv(4, 280, &mod_pos, &base, actor, count);
if(priv != NULL){
if (priv != NULL) {
aWeatherLeaf_ct(priv, game);
priv->work[3]= 0;
priv->work[3] = 0;
priv->work[4] = 156.5f + (RANDOM_F(260.5));
priv->currentY = y;
}
@@ -78,36 +74,34 @@ static void aWeatherLeaf_make(ACTOR* actor, GAME* game){
}
}
static void aWeatherLeaf_ct(aWeather_Priv* priv, GAME*){
static void aWeatherLeaf_ct(aWeather_Priv* priv, GAME*) {
priv->work[0] = RANDOM_F(3.0f);
priv->work[1] = RANDOM_F(65535.0f);
priv->work[2] = RANDOM_F(65535.0f);
}
static int aWeatherLeaf_CheckLeafBorder(aWeather_Priv* priv){
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
static int aWeatherLeaf_CheckLeafBorder(aWeather_Priv* priv) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
int ret = 0;
f32 leafTemp;
xyz_t pos;
if(weather != NULL){
pos = weather->pos;
leafTemp =priv->pos.x;
if(leafTemp < (-100.0f + pos.x)){
if (weather != NULL) {
pos = weather->pos;
leafTemp = priv->pos.x;
if (leafTemp < (-100.0f + pos.x)) {
ret |= 2;
}
if(leafTemp > (100.0f + pos.x)){
if (leafTemp > (100.0f + pos.x)) {
ret |= 8;
}
leafTemp =priv->pos.z;
leafTemp = priv->pos.z;
if(leafTemp > (180.0f + pos.z)){
if (leafTemp > (180.0f + pos.z)) {
ret |= 4;
}
if(leafTemp < (-200.0f + pos.z)){
if (leafTemp < (-200.0f + pos.z)) {
ret |= 1;
}
}
@@ -115,58 +109,58 @@ static int aWeatherLeaf_CheckLeafBorder(aWeather_Priv* priv){
return ret;
}
static void aWeatherLeaf_CheckLeafScroll(aWeather_Priv* priv){
static void aWeatherLeaf_CheckLeafScroll(aWeather_Priv* priv) {
int border = aWeatherLeaf_CheckLeafBorder(priv);
if(border != 0){
if((border >> 1) & 1){
if (border != 0) {
if ((border >> 1) & 1) {
priv->pos.x += 200.0f;
}
if((border >> 3) & 1){
if ((border >> 3) & 1) {
priv->pos.x -= 200.0f;
}
if((border >> 2) & 1){
if ((border >> 2) & 1) {
priv->pos.z -= 380.0f;
}
if(border & 1){
if (border & 1) {
priv->pos.z += 380.0f;
}
}
if(Common_Get(clip.weather_clip) != NULL){
if (Common_Get(clip.weather_clip) != NULL) {
f32 y;
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
if(weather != NULL){
if (weather != NULL) {
y = 230.0f + weather->pos.y;
if(priv->pos.y < + weather->pos.y){
if (priv->pos.y < +weather->pos.y) {
priv->pos.y = (y + (priv->pos.y - priv->currentY));
priv->currentY = y;
priv->currentY = y;
}
}
}
}
static void aWeatherLeaf_SetWind2Leaf(aWeather_Priv* priv){
static void aWeatherLeaf_SetWind2Leaf(aWeather_Priv* priv) {
priv->pos.x += 0.45f;
}
static void aWeatherLeaf_move(aWeather_Priv* priv, GAME* game){
GAME_PLAY* play = (GAME_PLAY*) game;
static void aWeatherLeaf_move(aWeather_Priv* priv, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
priv->pos.x += priv->speed.x;
priv->pos.y += priv->speed.y;
priv->pos.z += priv->speed.z;
priv->work[3] += priv->work[4];
aWeatherLeaf_SetWind2Leaf(priv);
aWeatherLeaf_CheckLeafScroll(priv);
priv->work[1] += 0x8DC;
priv->work[2] += 0x474;
priv->work[2] += 0x474;
}
static void aWeatherLeaf_set(GAME* game){
static void aWeatherLeaf_set(GAME* game) {
_texture_z_light_fog_prim_xlu(game->graph);
@@ -174,39 +168,38 @@ static void aWeatherLeaf_set(GAME* game){
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_otiba01_setmode);
CLOSE_DISP(game->graph);
}
void aWeatherLeaf_draw(aWeather_Priv* priv, GAME* game){
GAME_PLAY* play = (GAME_PLAY*) game;
void aWeatherLeaf_draw(aWeather_Priv* priv, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
Mtx* work;
f32 scale;
f32 min;
xyz_t pos;
xyz_t screen_pos;
xyz_t screen_pos;
pos.x = priv->pos.x + (6.0f * sin_s(priv->work[3]));
pos.z = priv->pos.z + (6.0f * cos_s(priv->work[3]));
pos.y = priv->pos.y;
pos.y = priv->pos.y;
Game_play_Projection_Trans(play, &pos, &screen_pos);
if(( screen_pos.x >= 0.0f) && (screen_pos.x < SCREEN_WIDTH_F) && ( screen_pos.y >= 0.0f) && (screen_pos.y < SCREEN_HEIGHT_F)){
if ((screen_pos.x >= 0.0f) && (screen_pos.x < SCREEN_WIDTH_F) && (screen_pos.y >= 0.0f) &&
(screen_pos.y < SCREEN_HEIGHT_F)) {
work = GRAPH_ALLOC_TYPE(game->graph, Mtx, 1);
OPEN_DISP(game->graph);
suMtxMakeSRT(work, 0.00499999988824f, 0.00499999988824f, 0.00499999988824f, priv->work[2], priv->work[1], priv->work[2], pos.x, pos.y, pos.z);
OPEN_DISP(game->graph);
suMtxMakeSRT(work, 0.00499999988824f, 0.00499999988824f, 0.00499999988824f, priv->work[2], priv->work[1],
priv->work[2], pos.x, pos.y, pos.z);
gSPMatrix(NEXT_POLY_XLU_DISP, work, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_otiba_model_tbl[priv->work[0]]);
CLOSE_DISP( game->graph);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_otiba_model_tbl[priv->work[0]]);
CLOSE_DISP(game->graph);
}
}
+63 -69
View File
@@ -29,24 +29,20 @@ static void aWeatherRain_set(GAME*);
static void aWeatherRain_draw(aWeather_Priv*, GAME*);
aWeather_Profile_c iam_weather_rain = {
aWeatherRain_make,
aWeatherRain_ct,
aWeatherRain_move,
aWeatherRain_set,
aWeatherRain_draw,
aWeatherRain_make, aWeatherRain_ct, aWeatherRain_move, aWeatherRain_set, aWeatherRain_draw,
};
static int aWeatherRain_DecideMakeRainCount(ACTOR* actor){
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
static int aWeatherRain_DecideMakeRainCount(ACTOR* actor) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
if(weather->current_level == 1){
if (weather->current_level == 1) {
return 1;
}
return( weather->current_level -2 ? 0 : -1) + 3;
return (weather->current_level - 2 ? 0 : -1) + 3;
}
static void aWeatherRain_make(ACTOR* actor, GAME* game){
static void aWeatherRain_make(ACTOR* actor, GAME* game) {
aWeather_Priv* priv;
xyz_t pos;
xyz_t pos_mod;
@@ -57,84 +53,79 @@ static void aWeatherRain_make(ACTOR* actor, GAME* game){
GAME_PLAY* play = (GAME_PLAY*)game;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
f32 x,y,z;
f32 x, y, z;
count = aWeatherRain_DecideMakeRainCount(actor);
pos = weather->pos;
for(i = 0; i < count; i++){
for (i = 0; i < count; i++) {
priv_num = Common_Get(clip.weather_clip)->get_priv_num(&weather->actor_class);
if (priv_num != -1){
if (priv_num != -1) {
x = -130.0f + (RANDOM_F(260.0f));
z = -200.0f + (RANDOM_F(360.0f));
pos_mod = pos;
speed = ZeroVec;
speed.y = -9.5f + (RANDOM_F(-2.5f));
speed.y = -9.5f + (RANDOM_F(-2.5f));
speed.y += -2.0f;
pos_mod.x += x;
pos_mod.z += z;
if(mEv_CheckTitleDemo() == -9){
if (mEv_CheckTitleDemo() == -9) {
PLAYER_ACTOR* player = get_player_actor_withoutCheck(play);
pos_mod.y = 70.0f + (120.0f + player->actor_class.world.position.y);
}
else{
} else {
pos_mod.y = 70.0f + (120.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(pos_mod, 0.0f));
}
priv = Common_Get(clip.weather_clip)->get_priv(1, 1000, &pos_mod, &speed, actor, priv_num);
if(priv != NULL){
aWeatherRain_ct(priv,game);
if (priv != NULL) {
aWeatherRain_ct(priv, game);
priv->work[0] = 0;
}
}
}
}
static void aWeatherRain_ct(aWeather_Priv*, GAME*){
static void aWeatherRain_ct(aWeather_Priv*, GAME*) {
}
static void aWeatherRain_MoveRain(aWeather_Priv* priv) {
static void aWeatherRain_MoveRain(aWeather_Priv* priv){
priv->pos.x += priv->speed.x;
priv->pos.y += priv->speed.y;
priv->pos.z += priv->speed.z;
priv->pos.x += priv->speed.x;
priv->pos.y += priv->speed.y;
priv->pos.z += priv->speed.z;
}
static void aWeatherRain_MakePicha(ACTOR* actor, GAME* game, xyz_t pos){
static void aWeatherRain_MakePicha(ACTOR* actor, GAME* game, xyz_t pos) {
int priv_num = Common_Get(clip.weather_clip)->get_priv_num(actor);
GAME_PLAY* play = (GAME_PLAY*)game;
aWeather_Priv* priv;
f32 y;
if(priv_num != -1){
if(mEv_CheckTitleDemo() == -9){
if (priv_num != -1) {
if (mEv_CheckTitleDemo() == -9) {
PLAYER_ACTOR* player = get_player_actor_withoutCheck(play);
y = player->actor_class.world.position.y;
pos.y = y;
}
else{
} else {
y = mCoBG_GetBgY_OnlyCenter_FromWpos(pos, 0.0f);
pos.y = y;
}
priv = Common_Get(clip.weather_clip)->get_priv(1, 8, &pos, NULL, actor, priv_num);
if(priv != NULL){
aWeatherRain_ct(priv,game);
if (priv != NULL) {
aWeatherRain_ct(priv, game);
priv->work[0] = 1;
}
}
}
static void aWeatherRain_set(GAME* game){
static void aWeatherRain_set(GAME* game) {
_texture_z_light_fog_prim_xlu(game->graph);
@@ -142,75 +133,78 @@ static void aWeatherRain_set(GAME* game){
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_ame02_setmode);
CLOSE_DISP(game->graph);
}
static void aWeatherRain_move(aWeather_Priv* priv, GAME* game){
static void aWeatherRain_move(aWeather_Priv* priv, GAME* game) {
WEATHER_ACTOR* weather;
s16 timer = (1000 - priv->timer);
if(priv->work[0] == 0){
if (priv->work[0] == 0) {
aWeatherRain_MoveRain(priv);
if((timer >= 10) && (Common_Get(clip.weather_clip) != NULL)){
weather = Common_Get(clip.weather_clip)->actor;
if(weather != NULL){
(Common_Get(clip.weather_clip)->remove_priv(&weather->actor_class, priv->id));
if ((timer >= 10) && (Common_Get(clip.weather_clip) != NULL)) {
weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
if (weather != NULL) {
(Common_Get(clip.weather_clip)->remove_priv(&weather->actor_class, priv->id));
aWeatherRain_MakePicha(&weather->actor_class, game, priv->pos);
}
}
}
}
void aWeatherRain_draw(aWeather_Priv* priv, GAME* game){
void aWeatherRain_draw(aWeather_Priv* priv, GAME* game) {
static f32 rain_scale[] = {
0.000299999985145f, 0.035f, 0.01f,
0.000299999985145f,
0.035f,
0.01f,
};
static f32 picha_scale[] = {
0.0033f,0.0033f,0.0033f,
0.0033f,
0.0033f,
0.0033f,
};
GAME_PLAY* play = (GAME_PLAY*)game;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
s16 disp;
s16 disp;
xyz_t pos;
s16 angle;
GRAPH* graph;
Mtx* work;
angle = Common_Get(clip.weather_clip)->actor->current_yAngle;
disp = 8 - priv->timer;
angle = weather->current_yAngle;
disp = 8 - priv->timer;
pos = priv->pos;
if(priv->work[0] == 1){
if (priv->work[0] == 1) {
graph = play->game.graph;
disp = disp >> 1;
Matrix_translate(pos.x,pos.y,pos.z, FALSE);
Matrix_translate(pos.x, pos.y, pos.z, FALSE);
Matrix_mult(&play->billboard_matrix, 1);
Matrix_scale(picha_scale[0], picha_scale[1], picha_scale[2], TRUE);
OPEN_DISP(graph);
OPEN_DISP(graph);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(play->game.graph),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, aWeather_rain_picha_disp[(disp)]);
CLOSE_DISP(graph);
}
else if(priv->work[0] == 0){
} else if (priv->work[0] == 0) {
work = GRAPH_ALLOC_TYPE(game->graph, Mtx, 1);
OPEN_DISP( play->game.graph);
suMtxMakeSRT(work, rain_scale[0], rain_scale[1], rain_scale[2], 0, angle, 0, pos.x, pos.y, pos.z);
OPEN_DISP(play->game.graph);
suMtxMakeSRT(work, rain_scale[0], rain_scale[1], rain_scale[2], 0, angle, 0, pos.x, pos.y, pos.z);
gSPMatrix(NEXT_POLY_XLU_DISP, work, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_ame02_04_modelT);
CLOSE_DISP( play->game.graph);
CLOSE_DISP(play->game.graph);
}
}
+59 -67
View File
@@ -20,50 +20,46 @@ static void aWeatherSakura_set(GAME*);
static void aWeatherSakura_draw(aWeather_Priv*, GAME*);
aWeather_Profile_c iam_weather_sakura = {
aWeatherSakura_make,
aWeatherSakura_ct,
aWeatherSakura_move,
aWeatherSakura_set,
aWeatherSakura_draw,
aWeatherSakura_make, aWeatherSakura_ct, aWeatherSakura_move, aWeatherSakura_set, aWeatherSakura_draw,
};
static int aWeatherSakura_DecideMakeSakuraCount(ACTOR* actor, GAME* game){
static int aWeatherSakura_DecideMakeSakuraCount(ACTOR* actor, GAME* game) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
if(weather->current_level == 1){
if (weather->current_level == 1) {
return (game->frame_counter & 7) == 0;
}
return (game->frame_counter & 3) == 0;
return (game->frame_counter & 3) == 0;
}
static void aWeatherSakura_make(ACTOR* actor, GAME* game){
static void aWeatherSakura_make(ACTOR* actor, GAME* game) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
GAME_PLAY* play = (GAME_PLAY*)game;
aWeather_Priv* priv;
f32 x,z;
aWeather_Priv* priv;
f32 x, z;
xyz_t pos = weather->pos;
f32 y = 230.0f + pos.y;
int count = Common_Get(clip.weather_clip)->get_priv_num(actor);
xyz_t base = {0.0f, 0.0f, 0.0f};
int count = Common_Get(clip.weather_clip)->get_priv_num(actor);
xyz_t base = { 0.0f, 0.0f, 0.0f };
xyz_t mod_pos;
if(aWeatherSakura_DecideMakeSakuraCount(actor, game) != 0){
if (aWeatherSakura_DecideMakeSakuraCount(actor, game) != 0) {
base.y = -0.8f + (RANDOM_F(-0.0999999642372f));
if(count != -1){
if (count != -1) {
x = -100.0f + (RANDOM_F(200.0f));
z = -200.0f + (RANDOM_F(380.0f));
mod_pos = pos;
mod_pos.x += x;
mod_pos.z += z;
mod_pos.y = y;
priv = Common_Get(clip.weather_clip)->get_priv(3, 280, &mod_pos, &base, actor, count);
if(priv != NULL){
if (priv != NULL) {
aWeatherSakura_ct(priv, game);
priv->work[3]= 0;
priv->work[3] = 0;
priv->work[4] = 156.5f + (RANDOM_F(260.5));
priv->currentY = y;
}
@@ -71,36 +67,34 @@ static void aWeatherSakura_make(ACTOR* actor, GAME* game){
}
}
static void aWeatherSakura_ct(aWeather_Priv* priv, GAME*){
static void aWeatherSakura_ct(aWeather_Priv* priv, GAME*) {
priv->work[0] = RANDOM_F(65535.0f);
priv->work[1] = RANDOM_F(65535.0f);
priv->work[2] = RANDOM_F(65535.0f);
}
static int aWeatherSakura_CheckSakuraBorder(aWeather_Priv* priv){
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
static int aWeatherSakura_CheckSakuraBorder(aWeather_Priv* priv) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
int ret = 0;
f32 sakuraTemp;
xyz_t pos;
if(weather != NULL){
pos = weather->pos;
sakuraTemp =priv->pos.x;
if(sakuraTemp < (-100.0f + pos.x)){
if (weather != NULL) {
pos = weather->pos;
sakuraTemp = priv->pos.x;
if (sakuraTemp < (-100.0f + pos.x)) {
ret |= 2;
}
if(sakuraTemp > (100.0f + pos.x)){
if (sakuraTemp > (100.0f + pos.x)) {
ret |= 8;
}
sakuraTemp =priv->pos.z;
sakuraTemp = priv->pos.z;
if(sakuraTemp > (180.0f + pos.z)){
if (sakuraTemp > (180.0f + pos.z)) {
ret |= 4;
}
if(sakuraTemp < (-200.0f + pos.z)){
if (sakuraTemp < (-200.0f + pos.z)) {
ret |= 1;
}
}
@@ -108,59 +102,59 @@ static int aWeatherSakura_CheckSakuraBorder(aWeather_Priv* priv){
return ret;
}
static void aWeatherSakura_CheckSakuraScroll(aWeather_Priv* priv){
static void aWeatherSakura_CheckSakuraScroll(aWeather_Priv* priv) {
int border = aWeatherSakura_CheckSakuraBorder(priv);
if(border != 0){
if((border >> 1) & 1){
if (border != 0) {
if ((border >> 1) & 1) {
priv->pos.x += 200.0f;
}
if((border >> 3) & 1){
if ((border >> 3) & 1) {
priv->pos.x -= 200.0f;
}
if((border >> 2) & 1){
if ((border >> 2) & 1) {
priv->pos.z -= 380.0f;
}
if(border & 1){
if (border & 1) {
priv->pos.z += 380.0f;
}
}
if(Common_Get(clip.weather_clip) != NULL){
if (Common_Get(clip.weather_clip) != NULL) {
f32 y;
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
if(weather != NULL){
if (weather != NULL) {
y = 230.0f + weather->pos.y;
if(priv->pos.y < + weather->pos.y){
if (priv->pos.y < +weather->pos.y) {
priv->pos.y = (y + (priv->pos.y - priv->currentY));
priv->currentY = y;
priv->currentY = y;
}
}
}
}
static void aWeatherSakura_SetWind2Sakura(aWeather_Priv* priv){
static void aWeatherSakura_SetWind2Sakura(aWeather_Priv* priv) {
priv->pos.x += 0.45f;
}
static void aWeatherSakura_move(aWeather_Priv* priv, GAME* game){
GAME_PLAY* play = (GAME_PLAY*) game;
static void aWeatherSakura_move(aWeather_Priv* priv, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
priv->pos.x += priv->speed.x;
priv->pos.y += priv->speed.y;
priv->pos.z += priv->speed.z;
priv->work[3] += priv->work[4];
aWeatherSakura_SetWind2Sakura(priv);
aWeatherSakura_CheckSakuraScroll(priv);
priv->work[0] += 0x200;
priv->work[1] += 0x8DC;
priv->work[2] += 0x474;
priv->work[2] += 0x474;
}
static void aWeatherSakura_set(GAME* game){
static void aWeatherSakura_set(GAME* game) {
_texture_z_light_fog_prim_xlu(game->graph);
@@ -168,41 +162,39 @@ static void aWeatherSakura_set(GAME* game){
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_hanabira01_00_setmode);
CLOSE_DISP(game->graph);
}
void aWeatherSakura_draw(aWeather_Priv* priv, GAME* game){
GAME_PLAY* play = (GAME_PLAY*) game;
void aWeatherSakura_draw(aWeather_Priv* priv, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
xyz_t base = { 0.05f, 0.05f, 0.05f };
xyz_t base = {0.05f, 0.05f, 0.05f};
Mtx* work;
f32 scale;
f32 min;
xyz_t pos;
xyz_t screen_pos;
xyz_t screen_pos;
pos.x = priv->pos.x + (6.0f * sin_s(priv->work[3]));
pos.z = priv->pos.z + (6.0f * cos_s(priv->work[3]));
pos.y = priv->pos.y;
pos.y = priv->pos.y;
Game_play_Projection_Trans(play, &pos, &screen_pos);
if(( screen_pos.x >= 0.0f) && (screen_pos.x < SCREEN_WIDTH_F) && ( screen_pos.y >= 0.0f) && (screen_pos.y < SCREEN_HEIGHT_F)){
if ((screen_pos.x >= 0.0f) && (screen_pos.x < SCREEN_WIDTH_F) && (screen_pos.y >= 0.0f) &&
(screen_pos.y < SCREEN_HEIGHT_F)) {
work = GRAPH_ALLOC_TYPE(game->graph, Mtx, 1);
OPEN_DISP(game->graph);
OPEN_DISP(game->graph);
suMtxMakeSRT(work, base.x, base.y, base.z, priv->work[2], priv->work[1], priv->work[2], pos.x, pos.y, pos.z);
gSPMatrix(NEXT_POLY_XLU_DISP, work, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_hanabira01_00_modelT);
CLOSE_DISP( game->graph);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_hanabira01_00_modelT);
CLOSE_DISP(game->graph);
}
}
+3 -3
View File
@@ -72,7 +72,7 @@ static void aWeatherSnow_ct(aWeather_Priv*, GAME*) {
}
static int aWeatherSnow_CheckSnowBorder(aWeather_Priv* priv, GAME_PLAY* play) {
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
int ret = 0;
f32 wtemp, ptemp;
if (weather != NULL) {
@@ -120,7 +120,7 @@ static void aWeatherSnow_CheckSnowScroll(aWeather_Priv* priv, GAME_PLAY* play) {
if (Common_Get(clip.weather_clip) != NULL) {
f32 y;
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
if (weather != NULL) {
y = 230.0f + weather->pos.y;
@@ -135,7 +135,7 @@ static void aWeatherSnow_CheckSnowScroll(aWeather_Priv* priv, GAME_PLAY* play) {
static void aWeatherSnow_SetWind2Snow(aWeather_Priv* priv) {
if (Common_Get(clip.weather_clip) != NULL) {
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
if (weather != NULL) {
priv->pos.x += weather->wind_info.x;
priv->pos.y += weather->wind_info.y;
+716 -802
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -2010,11 +2010,11 @@ extern void mFI_InitMoveActorBitData() {
static int l_player_wade;
extern void mFI_SetPlayerWade(GAME_PLAY* play) {
PLAYER_ACTOR* player = get_player_actor_withoutCheck(play);
extern void mFI_SetPlayerWade(GAME* game) {
PLAYER_ACTOR* player = GET_PLAYER_ACTOR_GAME(game);
if (player != NULL) {
if (mPlib_check_player_actor_main_index_AllWade(play) == TRUE) {
if (mPlib_check_player_actor_main_index_AllWade(game) == TRUE) {
if (l_player_wade == mFI_WADE_NONE || l_player_wade == mFI_WADE_END) {
l_player_wade = mFI_WADE_START;
} else {
+1 -2
View File
@@ -373,7 +373,6 @@ extern void mNpc_AddFriendship(Anmmem_c* memory, int amount) {
friendship = memory->friendship + amount;
#ifndef BUGFIXES
if (memory == NULL) {
return; //???
@@ -1760,7 +1759,7 @@ static void mNpc_SendEventPresentMailSex(int* selected, u8* type, Animal_c* anim
/* this used to be mNpc_SendEventPresentMail_common in DnM and DnM+ (handled both valentine's day & white day) */
extern int mNpc_SendVtdayMail() {
extern int mNpc_SendVtdayMail(int type) {
u8 types[ANIMAL_NUM_MAX];
int other_sex_best_friends[ANIMAL_NUM_MAX];
Animal_c* animal_p;
+3 -3
View File
@@ -8130,8 +8130,8 @@ static int Player_actor_Check_AbleRadioExercise(ACTOR* actorx) {
static int Player_actor_Get_RadioExerciseCommandRingBufferIndex(int base_idx, int ofs) {
base_idx += ofs;
if (base_idx >= mPlayer_RADIO_EXCERCISE_COMMAND_RING_BUFFER_SIZE) {
return base_idx - mPlayer_RADIO_EXCERCISE_COMMAND_RING_BUFFER_SIZE;
if (base_idx >= mPlayer_RADIO_EXERCISE_COMMAND_RING_BUFFER_SIZE) {
return base_idx - mPlayer_RADIO_EXERCISE_COMMAND_RING_BUFFER_SIZE;
} else {
return base_idx;
}
@@ -8141,7 +8141,7 @@ static s8 Player_actor_Get_RadioExerciseCommand(int base_idx, s8* command_ring_b
int idx = Player_actor_Get_RadioExerciseCommandRingBufferIndex(base_idx, ofs);
/* @BUG - this should probably be || idx >= mPlayer_RADIO_EXCERCISE_COMMAND_RING_BUFFER_SIZE */
if (idx < 0 && idx < mPlayer_RADIO_EXCERCISE_COMMAND_RING_BUFFER_SIZE) {
if (idx < 0 && idx < mPlayer_RADIO_EXERCISE_COMMAND_RING_BUFFER_SIZE) {
idx = 0;
}
+11 -10
View File
@@ -5,7 +5,8 @@ static int Player_actor_CheckController_forPickup(GAME* game) {
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
s8 kind = Player_actor_Get_ItemKind(actorx, player->now_main_index);
return !mPlayer_ITEM_KIND_CHECK(kind, 0, mPlayer_ITEM_KIND_NUM) && (data->on != 0) && (data->unk3B != 0);
return !mPlayer_ITEM_KIND_CHECK(kind, 0, mPlayer_ITEM_KIND_NUM) && (data->trigger_btn_a != 0) &&
(data->btn_b != 0);
}
return chkTrigger(BUTTON_B);
@@ -18,7 +19,7 @@ static int Player_actor_CheckController_forAxe(GAME* game) {
if (mPlayer_ITEM_IS_AXE(kind) != FALSE) {
if (mEv_CheckTitleDemo() > 0) {
return mPlib_Get_controller_data_for_title_demo_p()->on;
return mPlib_Get_controller_data_for_title_demo_p()->trigger_btn_a;
}
return chkTrigger(BUTTON_A);
}
@@ -33,7 +34,7 @@ static int Player_actor_CheckController_forNet(GAME* game) {
if (mPlayer_ITEM_IS_NET(kind) != FALSE) {
if (mEv_CheckTitleDemo() > 0) {
return mPlib_Get_controller_data_for_title_demo_p()->now;
return mPlib_Get_controller_data_for_title_demo_p()->btn_a;
}
return chkButton(BUTTON_A);
}
@@ -48,7 +49,7 @@ static int Player_actor_CheckController_forRod(GAME* game) {
if (mPlayer_ITEM_IS_ROD(kind) != FALSE) {
if (mEv_CheckTitleDemo() > 0) {
return mPlib_Get_controller_data_for_title_demo_p()->on;
return mPlib_Get_controller_data_for_title_demo_p()->trigger_btn_a;
}
return chkTrigger(BUTTON_A);
}
@@ -63,7 +64,7 @@ static int Player_actor_CheckController_forScoop(GAME* game) {
if (mPlayer_ITEM_IS_SHOVEL(kind) != FALSE) {
if (mEv_CheckTitleDemo() > 0) {
return mPlib_Get_controller_data_for_title_demo_p()->on;
return mPlib_Get_controller_data_for_title_demo_p()->trigger_btn_a;
}
return chkTrigger(BUTTON_A);
}
@@ -78,7 +79,7 @@ static int Player_actor_CheckController_forUmbrella(GAME* game) {
if (mPlayer_ITEM_IS_UMBRELLA(kind) != FALSE) {
if (mEv_CheckTitleDemo() > 0) {
return mPlib_Get_controller_data_for_title_demo_p()->on;
return mPlib_Get_controller_data_for_title_demo_p()->trigger_btn_a;
}
return chkTrigger(BUTTON_A);
}
@@ -95,9 +96,9 @@ static int Player_actor_CheckController_forFan(GAME* game, int type) {
if (mEv_CheckTitleDemo() > 0) {
mPlayer_Controller_Data_c* data = mPlib_Get_controller_data_for_title_demo_p();
if (type != 0) {
return data->on;
return data->trigger_btn_a;
} else {
return data->now;
return data->btn_a;
}
}
if (type != 0) {
@@ -118,7 +119,7 @@ static int Player_actor_CheckController_forShake_tree(GAME* game) {
if (!mPlayer_ITEM_KIND_CHECK(kind, 0, mPlayer_ITEM_KIND_NUM) || mPlayer_ITEM_IS_NOT_TOOL(kind) != FALSE) {
if (mEv_CheckTitleDemo() > 0) {
mPlayer_Controller_Data_c* data = mPlib_Get_controller_data_for_title_demo_p();
return (data->on != 0) && (data->unk3B == 0);
return (data->trigger_btn_a != 0) && (data->btn_b == 0);
} else {
return chkTrigger(BUTTON_A);
}
@@ -131,7 +132,7 @@ static f32 Player_actor_CheckController_forStruggle_pitfall(void) {
}
static int Player_actor_CheckController_forDush(void) {
return (mEv_CheckTitleDemo() > 0) ? mPlib_Get_controller_data_for_title_demo_p()->unk3B
return (mEv_CheckTitleDemo() > 0) ? mPlib_Get_controller_data_for_title_demo_p()->btn_b
: mPlib_CheckButtonOnly_forDush();
}
+3710
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -39,7 +39,7 @@ static void Player_actor_setup_main_Rotate_octagon(ACTOR* actorx, GAME* game) {
Player_actor_setup_main_Base(actorx, game);
}
static void Player_actor_settle_main_Rotate_octagon(ACTOR* actorx) {
static void Player_actor_settle_main_Rotate_octagon(ACTOR* actorx, GAME* game) {
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
+2 -4
View File
@@ -6,8 +6,7 @@ void Player_actor_ct_other_func1(ACTOR* actor, GAME* game) {
actor->unknown_b4 = 1;
Actor_info_make_actor(&play->actor_info, game, mAc_PROFILE_FIELD_DRAW, actor->world.position.x,
actor->world.position.y, actor->world.position.z, 0, 0, 0, -1, -1,
-1, EMPTY_NO, -1, -1, -1);
actor->world.position.y, actor->world.position.z, 0, 0, 0, -1, -1, -1, EMPTY_NO, -1, -1, -1);
}
void Player_actor_setup_main_Wade_other_func1(ACTOR* actor, GAME* game) {
@@ -253,13 +252,12 @@ void Player_actor_move_other_func1(ACTOR* actor, GAME* game) {
void Player_actor_move_other_func2(ACTOR* actor, GAME* game) {
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
GAME_PLAY* play = (GAME_PLAY*)game;
Player_actor_set_eye_PositionAndAngle(actor);
Player_actor_sound_SetStatus(actor);
Player_actor_Set_Indoor_Camera_Index(actor, game);
Player_actor_check_forward(actor, game);
mFI_SetPlayerWade(play);
mFI_SetPlayerWade(game);
Player_actor_check_little_shake_tree(actor, game);
Player_actor_check_shake_tree_timer(actor);
Player_actor_check_pitfall(actor, game);
+1 -1
View File
@@ -511,7 +511,7 @@ extern int goto_other_scene(GAME_PLAY* play, Door_data_c* door_data, int update_
play->next_scene_no = door_data->next_scene_id;
if (update_player_mode) {
mPlib_request_main_invade_type1(play);
mPlib_request_main_invade_type1((GAME*)play);
}
restore_fgdata_all(play);
+1 -1
View File
@@ -126,7 +126,7 @@ static void mTD_game_end_init(GAME_PLAY* play) {
play->fb_fade_type = 10; // TODO: enum/define
play->fb_wipe_type = 3; // TODO: enum/define
mPlib_request_main_invade_type1(play);
mPlib_request_main_invade_type1((GAME*)play);
mBGMPsComp_make_ps_wipe(0x521C); // TODO: enum/define
}