Files
tp/libs/Z2AudioLib/Z2StatusMgr.cpp
T

132 lines
3.1 KiB
C++
Raw Normal View History

2020-12-13 12:43:16 -08:00
#include "Z2AudioLib/Z2StatusMgr/Z2StatusMgr.h"
#include "JSystem/JAudio2/JAISoundParamsMove.h"
#include "Z2AudioLib/Z2Calc/Z2Calc.h"
#include "Z2AudioLib/Z2FxLineMgr/Z2FxLineMgr.h"
2020-12-13 12:43:16 -08:00
#include "Z2AudioLib/Z2SceneMgr/Z2SceneMgr.h"
#include "Z2AudioLib/Z2SeMgr/Z2SeMgr.h"
2020-12-26 11:31:49 -05:00
#include "Z2AudioLib/Z2SeqMgr/Z2SeqMgr.h"
2020-12-13 12:43:16 -08:00
#include "d/d_com/d_com_inf_game/d_com_inf_game.h"
#include "msl_c/string.h"
2021-01-31 15:33:34 -05:00
2020-12-26 11:31:49 -05:00
Z2StatusMgr::Z2StatusMgr() {
2020-12-13 12:43:16 -08:00
lbl_80450B7C = this;
this->hour = 0;
this->minute = 0;
this->weekday = 0;
this->unk3 = 0;
this->time = 3072;
this->event_bit = (void*)0;
this->is_menu_in = false;
this->camera_map_info = 0;
float polygon_pos_init = lbl_80455A18;
this->polygon_position.x = polygon_pos_init;
this->polygon_position.y = polygon_pos_init;
this->polygon_position.z = polygon_pos_init;
float depth_init = lbl_80455A1C;
this->underwater_depth = depth_init;
this->camera_in_water_depth_ratio = depth_init;
this->demo_status = 0;
this->heart_gauge_on = 0;
}
2020-12-26 11:31:49 -05:00
void Z2StatusMgr::heartGaugeOn(void) {
2020-12-13 12:43:16 -08:00
this->heart_gauge_on = 2;
}
2020-12-26 11:31:49 -05:00
asm void Z2StatusMgr::processHeartGaugeSound(void) {
2020-12-13 12:43:16 -08:00
nofralloc
2020-12-26 11:31:49 -05:00
#include "Z2AudioLib/Z2StatusMgr/asm/func_802B5F7C.s"
2020-12-13 12:43:16 -08:00
}
2020-12-26 11:31:49 -05:00
void Z2StatusMgr::talkIn(void) {
2020-12-13 12:43:16 -08:00
u8 is_demo;
is_demo = isMovieDemo();
2020-12-26 11:31:49 -05:00
if (is_demo == false) {
2020-12-13 12:43:16 -08:00
lbl_80450B84->talkInBgm();
lbl_80450B88->talkInSe();
}
}
2020-12-26 11:31:49 -05:00
void Z2StatusMgr::talkOut(void) {
2020-12-13 12:43:16 -08:00
u8 is_demo;
is_demo = isMovieDemo();
2020-12-26 11:31:49 -05:00
if (is_demo == false) {
2020-12-13 12:43:16 -08:00
lbl_80450B84->talkOutBgm();
lbl_80450B88->talkOutSe();
}
}
2020-12-26 11:31:49 -05:00
void Z2StatusMgr::menuIn() {
2020-12-13 12:43:16 -08:00
lbl_80450B84->menuInBgm();
lbl_80450B88->menuInSe();
2020-12-26 11:31:49 -05:00
2020-12-13 12:43:16 -08:00
this->is_menu_in = true;
}
2020-12-26 11:31:49 -05:00
void Z2StatusMgr::menuOut() {
2020-12-13 12:43:16 -08:00
lbl_80450B84->menuOutBgm();
lbl_80450B88->talkOutSe();
2020-12-26 11:31:49 -05:00
2020-12-13 12:43:16 -08:00
this->is_menu_in = false;
}
2020-12-26 11:31:49 -05:00
// right instructions, wrong registers
2020-12-13 12:43:16 -08:00
#ifdef NONMATCHING
2020-12-26 11:31:49 -05:00
bool Z2StatusMgr::isMovieDemo(void) {
2020-12-13 12:43:16 -08:00
bool uvar2;
uvar2 = false;
2020-12-26 11:31:49 -05:00
if (this->demo_status == 2 || this->demo_status == 8 || this->demo_status == 9) {
2020-12-13 12:43:16 -08:00
uvar2 = true;
}
return uvar2;
}
#else
2020-12-26 11:31:49 -05:00
asm bool Z2StatusMgr::isMovieDemo(void) {
2020-12-13 12:43:16 -08:00
nofralloc
2020-12-26 11:31:49 -05:00
#include "Z2AudioLib/Z2StatusMgr/asm/func_802B61BC.s"
2020-12-13 12:43:16 -08:00
}
#endif
2020-12-26 11:31:49 -05:00
asm void Z2StatusMgr::setDemoName(char*) {
2020-12-13 12:43:16 -08:00
nofralloc
2020-12-26 11:31:49 -05:00
#include "Z2AudioLib/Z2StatusMgr/asm/func_802B61E8.s"
2020-12-13 12:43:16 -08:00
}
2020-12-26 11:31:49 -05:00
void Z2StatusMgr::processTime(void) {
2020-12-13 12:43:16 -08:00
u16 temp = this->hour * 256;
this->time = temp + minute;
}
2020-12-26 11:31:49 -05:00
bool Z2StatusMgr::checkDayTime(void) {
if (this->hour >= 6 && this->hour < 19) {
2020-12-13 12:43:16 -08:00
return true;
2020-12-26 11:31:49 -05:00
} else {
2020-12-13 12:43:16 -08:00
return false;
}
}
2020-12-26 11:31:49 -05:00
void Z2StatusMgr::setEventBit(void* event_bit) {
2020-12-13 12:43:16 -08:00
this->event_bit = event_bit;
}
2020-12-26 11:31:49 -05:00
void Z2StatusMgr::setCameraPolygonPos(Vec* polygon_pos) {
if (polygon_pos == 0) {
2020-12-13 12:43:16 -08:00
return;
2020-12-26 11:31:49 -05:00
} else {
2020-12-13 12:43:16 -08:00
this->polygon_position.x = polygon_pos->x;
this->polygon_position.y = polygon_pos->y;
this->polygon_position.z = polygon_pos->z;
}
}
2020-12-26 11:31:49 -05:00
void Z2StatusMgr::setCameraGroupInfo(u8 param1) {
2020-12-13 12:43:16 -08:00
return;
}
2020-12-26 11:31:49 -05:00
asm void Z2StatusMgr::setCameraInWaterDepth(float) {
2020-12-13 12:43:16 -08:00
nofralloc
2020-12-26 11:31:49 -05:00
#include "Z2AudioLib/Z2StatusMgr/asm/func_802B6788.s"
2020-12-13 12:43:16 -08:00
}