mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-17 04:31:37 -04:00
Merge branch 'main' of github.com:TwilitRealm/dusk into mapmirror
This commit is contained in:
@@ -468,9 +468,20 @@ s16 cLib_targetAngleX(cXyz const* lhs, cXyz const* rhs) {
|
||||
void cLib_offsetPos(cXyz* pdest, cXyz const* psrc, s16 angle, cXyz const* vec) {
|
||||
f32 cos = cM_scos(angle);
|
||||
f32 sin = cM_ssin(angle);
|
||||
// MWCC loads vec members into registers before writing to pdest; other compilers may not,
|
||||
// which corrupts results when pdest and vec alias the same memory.
|
||||
#if !__MWERKS__
|
||||
f32 vx = vec->x;
|
||||
f32 vy = vec->y;
|
||||
f32 vz = vec->z;
|
||||
pdest->x = psrc->x + (vx * cos + vz * sin);
|
||||
pdest->y = psrc->y + vy;
|
||||
pdest->z = psrc->z + (vz * cos - vx * sin);
|
||||
#else
|
||||
pdest->x = psrc->x + (vec->x * cos + vec->z * sin);
|
||||
pdest->y = psrc->y + vec->y;
|
||||
pdest->z = psrc->z + (vec->z * cos - vec->x * sin);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -117,8 +117,8 @@ static Z2WolfHowlLine sNewSong3[9] = {
|
||||
|
||||
#if TARGET_PC
|
||||
static Z2WolfHowlLine sHowlTimeSong[6] = {
|
||||
{HOWL_LINE_MID, 20}, {HOWL_LINE_LOW, 20}, {HOWL_LINE_HIGH, 40},
|
||||
{HOWL_LINE_MID, 20}, {HOWL_LINE_LOW, 20}, {HOWL_LINE_HIGH, 40},
|
||||
{HOWL_LINE_MID, 15}, {HOWL_LINE_LOW, 15}, {HOWL_LINE_HIGH, 30},
|
||||
{HOWL_LINE_MID, 15}, {HOWL_LINE_LOW, 15}, {HOWL_LINE_HIGH, 30},
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -368,9 +368,9 @@ void Z2WolfHowlMgr::setCorrectData(s8 curveID, Z2WolfHowlData* data) {
|
||||
break;
|
||||
#if TARGET_PC
|
||||
case Z2WOLFHOWL_TIMESONG:
|
||||
cPitchUp = 1.259906f;
|
||||
cPitchCenter = 0.94387f;
|
||||
cPitchDown = 0.840885f;
|
||||
cPitchUp = 1.3348f;
|
||||
cPitchCenter = 0.8909f;
|
||||
cPitchDown = 0.7937f;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
||||
@@ -4258,6 +4258,12 @@ int daAlink_c::createHeap() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
// lets try to zero-initialize the arrays instead of having garbage values
|
||||
std::memset(sp1C, 0, sizeof(J3DTransformInfo) * sp38);
|
||||
std::memset(sp30, 0, sizeof(Quaternion) * sp38);
|
||||
#endif
|
||||
|
||||
field_0x2060 = JKR_NEW mDoExt_MtxCalcOldFrame(sp1C, sp30);
|
||||
if (field_0x2060 == NULL) {
|
||||
return 0;
|
||||
@@ -5871,6 +5877,11 @@ void daAlink_c::setItemMatrix(int param_0) {
|
||||
modelCalc(mSheathModel);
|
||||
|
||||
int var_r26;
|
||||
|
||||
#if AVOID_UB
|
||||
var_r26 = 0;
|
||||
#endif
|
||||
|
||||
if (!checkNoResetFlg3(FLG3_UNK_4000000)) {
|
||||
if (mEquipItem == 0x103 || param_0 != 0) {
|
||||
mSwordModel->setBaseTRMtx(mpLinkModel->getAnmMtx(mLeftItemJntNo));
|
||||
@@ -18930,11 +18941,20 @@ void daAlink_c::setDrawHand() {
|
||||
mpLinkHandModel->setBaseTRMtx(mpLinkModel->getBaseTRMtx());
|
||||
mpLinkHandModel->calc();
|
||||
|
||||
#if TARGET_PC
|
||||
// FRAME INTERP NOTE: Always set these, otherwise the hands occasionally zip to origin.
|
||||
// Doing it regardless of interpolation being active seems harmless.
|
||||
mpLinkHandModel->setAnmMtx(1, mpLinkModel->getAnmMtx(9));
|
||||
mpLinkHandModel->setAnmMtx(2, mpLinkModel->getAnmMtx(0xE));
|
||||
#endif
|
||||
|
||||
if (var_r30 == 0xFE || var_r30 == 0xFB) {
|
||||
field_0x06d0 = field_0x06d8;
|
||||
} else {
|
||||
field_0x06d0 = mpLinkHandModel->getModelData()->getMaterialNodePointer(var_r30)->getShape();
|
||||
#if !TARGET_PC
|
||||
mpLinkHandModel->setAnmMtx(1, mpLinkModel->getAnmMtx(9));
|
||||
#endif
|
||||
}
|
||||
|
||||
if (var_r30 == 0xFB) {
|
||||
@@ -18953,7 +18973,9 @@ void daAlink_c::setDrawHand() {
|
||||
field_0x06d4 = field_0x06dc;
|
||||
} else {
|
||||
field_0x06d4 = mpLinkHandModel->getModelData()->getMaterialNodePointer(var_r29)->getShape();
|
||||
#if !TARGET_PC
|
||||
mpLinkHandModel->setAnmMtx(2, mpLinkModel->getAnmMtx(0xE));
|
||||
#endif
|
||||
}
|
||||
|
||||
if (var_r29 == 0xFB) {
|
||||
|
||||
@@ -37,18 +37,40 @@ void daAlink_c::setCrawlMoveDirectionArrow() {
|
||||
}
|
||||
|
||||
if (field_0x3198 & 4) {
|
||||
if (!bvar) {
|
||||
direction |= data_80452F38;
|
||||
} else {
|
||||
direction |= data_80452F39;
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
if (!bvar) {
|
||||
direction |= data_80452F39;
|
||||
} else {
|
||||
direction |= data_80452F38;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
if (!bvar) {
|
||||
direction |= data_80452F38;
|
||||
} else {
|
||||
direction |= data_80452F39;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (field_0x3198 & 8) {
|
||||
if (!bvar) {
|
||||
direction |= data_80452F39;
|
||||
} else {
|
||||
direction |= data_80452F38;
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
if (!bvar) {
|
||||
direction |= data_80452F38;
|
||||
} else {
|
||||
direction |= data_80452F39;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
if (!bvar) {
|
||||
direction |= data_80452F39;
|
||||
} else {
|
||||
direction |= data_80452F38;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -817,6 +817,12 @@ BOOL daAlink_c::checkDownAttackState() {
|
||||
}
|
||||
|
||||
BOOL daAlink_c::checkCutLargeTurnState() const {
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.alwaysGreatspin) {
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ((dComIfGs_isEventBit(dSv_event_flag_c::F_0344) || checkNoResetFlg3(FLG3_TRANING_CUT_LARGE_TURN))
|
||||
&& dComIfGs_getLife() == dComIfGs_getMaxLifeGauge()
|
||||
)
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "d/actor/d_a_npc_tkc.h"
|
||||
#include <cstring>
|
||||
|
||||
#include "dusk/imgui/ImGuiConsole.hpp"
|
||||
#include "dusk/settings.h"
|
||||
|
||||
BOOL daAlink_c::checkEventRun() const {
|
||||
@@ -4005,6 +4006,15 @@ int daAlink_c::procGanonFinishInit() {
|
||||
|
||||
field_0x37c8 = current.pos;
|
||||
onEndResetFlg1(ERFLG1_SHIELD_BACKBONE);
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.speedrunMode) {
|
||||
if (dusk::m_speedrunInfo.m_isRunStarted) {
|
||||
dusk::m_speedrunInfo.stopRun();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ void daAlink_c::handleWolfHowl() {
|
||||
return;
|
||||
}
|
||||
|
||||
bool canTransform = false;
|
||||
bool canHowl = false;
|
||||
|
||||
if (mLinkAcch.ChkGroundHit() && !checkModeFlg(MODE_PLAYER_FLY) && !checkMagneBootsOn()) {
|
||||
if (!checkForestOldCentury()) {
|
||||
@@ -52,12 +52,17 @@ void daAlink_c::handleWolfHowl() {
|
||||
(checkEventRun() || getMidnaActor()->checkMetamorphoseEnable()) &&
|
||||
(checkModeFlg(4) || dComIfGp_checkPlayerStatus0(0, 0x10))))
|
||||
{
|
||||
canTransform = true;
|
||||
canHowl = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!canHowl) {
|
||||
Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
getWolfHowlMgrP()->setCorrectCurve(9);
|
||||
procWolfHowlDemoInit();
|
||||
}
|
||||
@@ -143,15 +148,18 @@ void daAlink_c::handleQuickTransform() {
|
||||
procCoMetamorphoseInit();
|
||||
}
|
||||
|
||||
bool daAlink_c::checkGyroAimItemContext() {
|
||||
if (checkWolf()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool daAlink_c::checkGyroAimContext() {
|
||||
switch (mProcID) {
|
||||
case PROC_SUBJECTIVITY:
|
||||
case PROC_SWIM_SUBJECTIVITY:
|
||||
case PROC_HORSE_SUBJECTIVITY:
|
||||
case PROC_CANOE_SUBJECTIVITY:
|
||||
case PROC_BOARD_SUBJECTIVITY:
|
||||
case PROC_WOLF_ROPE_SUBJECTIVITY:
|
||||
case PROC_BOW_SUBJECT:
|
||||
case PROC_BOOMERANG_SUBJECT:
|
||||
case PROC_COPY_ROD_SUBJECT:
|
||||
case PROC_HAWK_SUBJECT:
|
||||
case PROC_HOOKSHOT_SUBJECT:
|
||||
case PROC_SWIM_HOOKSHOT_SUBJECT:
|
||||
case PROC_HORSE_BOW_SUBJECT:
|
||||
|
||||
@@ -290,6 +290,12 @@ BOOL daAlink_c::checkHookshotStickBG(cBgS_PolyInfo& i_polyinfo) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.superClawshot) {
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (dComIfG_Bgsp().ChkPolyHSStick(i_polyinfo)) {
|
||||
dBgW_Base* bgw_p = dComIfG_Bgsp().GetBgWBasePointer(i_polyinfo);
|
||||
if (bgw_p != NULL && bgw_p->ChkPushPullOk()) {
|
||||
@@ -448,6 +454,12 @@ void daAlink_c::setHookshotSight() {
|
||||
max_length = mpHIO->mItem.mHookshot.m.mMaxLength;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.superClawshot) {
|
||||
max_length = 69420.0f;
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOL line_cross = checkSightLine(max_length, &sight_pos);
|
||||
|
||||
if (mHookTargetAcKeep.getActor() != NULL) {
|
||||
@@ -890,6 +902,14 @@ void daAlink_c::setHookshotPos() {
|
||||
max_length = mpHIO->mItem.mHookshot.m.mMaxLength;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.superClawshot) {
|
||||
return_speed = 2870.0f;
|
||||
shoot_speed = 2870.0f;
|
||||
max_length = 69420.0f;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (mItemMode == HS_MODE_RETURN_e) {
|
||||
if (targetAc_p != NULL) {
|
||||
if (checkLv7BossRoom()) {
|
||||
@@ -899,6 +919,12 @@ void daAlink_c::setHookshotPos() {
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.superClawshot) {
|
||||
return_speed = 500.0f;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (checkModeFlg(0x400)) {
|
||||
return_speed += current.pos.abs(field_0x3798);
|
||||
}
|
||||
@@ -1548,6 +1574,12 @@ int daAlink_c::procHookshotFly() {
|
||||
f32 temp_f31 = field_0x37d4.abs();
|
||||
f32 temp_f30 = mpHIO->mItem.mHookshot.m.mStickReturnSpeed + spAC.abs(mHookshotTopPos);
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.superClawshot) {
|
||||
temp_f30 = 500.0f + spAC.abs(mHookshotTopPos);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (temp_f31 < temp_f30 || mProcVar1.field_0x300a == 0) {
|
||||
setHookshotReturnEnd();
|
||||
} else {
|
||||
|
||||
@@ -180,12 +180,7 @@ void daAlink_c::preKandelaarDraw() {
|
||||
mat_p->setTevColor(2, &color);
|
||||
|
||||
cXyz proj;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&mKandelaarFlamePos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&mKandelaarFlamePos, &proj);
|
||||
#endif
|
||||
|
||||
camera_process_class* camera_p = dComIfGp_getCamera(0);
|
||||
f32 trimHeight;
|
||||
|
||||
@@ -130,7 +130,7 @@ BOOL daAlink_c::setBodyAngleToCamera() {
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableGyroAim && checkGyroAimItemContext()) {
|
||||
if (dusk::getSettings().game.enableGyroAim && checkGyroAimContext()) {
|
||||
f32 gyro_scale = 1.0f;
|
||||
if (checkWolfEyeUp()) {
|
||||
gyro_scale *= 0.6f;
|
||||
@@ -142,17 +142,7 @@ BOOL daAlink_c::setBodyAngleToCamera() {
|
||||
|
||||
f32 gy_yaw = 0.f;
|
||||
f32 gy_pitch = 0.f;
|
||||
dusk::gyro::consumeAimDeltas(gy_yaw, gy_pitch);
|
||||
|
||||
if (dusk::getSettings().game.gyroAimInvertPitch) {
|
||||
gy_pitch = -gy_pitch;
|
||||
}
|
||||
if (dusk::getSettings().game.gyroAimInvertYaw) {
|
||||
gy_yaw = -gy_yaw;
|
||||
}
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
gy_yaw = -gy_yaw;
|
||||
}
|
||||
dusk::gyro::getAimDeltas(gy_yaw, gy_pitch);
|
||||
|
||||
shape_angle.y = shape_angle.y + cM_rad2s(gy_yaw * gyro_scale);
|
||||
sp8 = sp8 + cM_rad2s(gy_pitch * gyro_scale);
|
||||
|
||||
@@ -149,6 +149,23 @@ void daAlink_c::changeWolf() {
|
||||
|
||||
mpLinkModel = initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_wArcName, 14)), 0x20200);
|
||||
|
||||
#ifdef TARGET_PC
|
||||
// Update Wolf Link's eye maxLOD to prevent the eyes from disappearing
|
||||
{
|
||||
J3DTexture* tex = mpLinkModel->getModelData()->getTexture();
|
||||
JUTNameTab* nametable = mpLinkModel->getModelData()->getTextureName();
|
||||
if (tex != nullptr && nametable != nullptr) {
|
||||
for (u16 i = 0; i < tex->getNum(); i++) {
|
||||
const char* tex_name = nametable->getName(i);
|
||||
if (tex_name != NULL && strcmp(tex_name, "wl_eyeball") == 0) {
|
||||
ResTIMG* timg = tex->getResTIMG(i);
|
||||
timg->maxLOD = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
J3DModelData* chainModelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(l_wArcName, 15));
|
||||
for (u16 i = 0; i < 4; i++) {
|
||||
mpWlChainModels[i] = initModel(chainModelData, 0);
|
||||
@@ -162,6 +179,23 @@ void daAlink_c::changeWolf() {
|
||||
mpWlMidnaHairModel =
|
||||
initModelEnv(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_wArcName, 11)), 0x1000000);
|
||||
|
||||
#ifdef TARGET_PC
|
||||
// Update Midna's eye maxLOD to prevent the eyes from disappearing
|
||||
{
|
||||
J3DTexture* tex = mpWlMidnaModel->getModelData()->getTexture();
|
||||
JUTNameTab* nametable = mpWlMidnaModel->getModelData()->getTextureName();
|
||||
if (tex != nullptr && nametable != nullptr) {
|
||||
for (u16 i = 0; i < tex->getNum(); i++) {
|
||||
const char* tex_name = nametable->getName(i);
|
||||
if (tex_name != NULL && strcmp(tex_name, "midona_eyeball") == 0) {
|
||||
ResTIMG* timg = tex->getResTIMG(i);
|
||||
timg->maxLOD = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
mpDMidnaBrk = static_cast<J3DAnmTevRegKey*>(dComIfG_getObjectRes(l_wArcName, 18));
|
||||
mpDMidnaBrk->searchUpdateMaterialID(mpWlMidnaModel->getModelData());
|
||||
mpWlMidnaModel->getModelData()->entryTevRegAnimator(mpDMidnaBrk);
|
||||
@@ -342,6 +376,26 @@ void daAlink_c::changeLink(int param_0) {
|
||||
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "zl_face.bmd")), 0x20200);
|
||||
}
|
||||
|
||||
#ifdef TARGET_PC
|
||||
// Update Adult Link's eye maxLOD to prevent the eyes from disappearing
|
||||
{
|
||||
J3DTexture* tex = mpLinkFaceModel->getModelData()->getTexture();
|
||||
JUTNameTab* nametable = mpLinkFaceModel->getModelData()->getTextureName();
|
||||
if (tex != nullptr && nametable != nullptr) {
|
||||
for (u16 i = 0; i < tex->getNum(); i++) {
|
||||
const char* tex_name = nametable->getName(i);
|
||||
if (tex_name != nullptr &&
|
||||
(strcmp(tex_name, "al_eyeball") == 0 || strcmp(tex_name, "highlight02") == 0 ||
|
||||
strcmp(tex_name, "eye_kage01") == 0))
|
||||
{
|
||||
ResTIMG* timg = tex->getResTIMG(i);
|
||||
timg->maxLOD = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "al_bootsH.bmd"));
|
||||
u16 i;
|
||||
for (i = 0; i < 2; i++) {
|
||||
|
||||
@@ -2059,7 +2059,15 @@ static void demo_camera(b_bq_class* i_this) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
static u16 g_e_i[] = {0x83EB, 0x83EC, 0x83ED, 0x83EE, 0x83EF};
|
||||
|
||||
dComIfGp_particle_set(g_e_i[i], &pos, NULL, NULL);
|
||||
#if TARGET_PC
|
||||
if (i == 0) {
|
||||
static const cXyz effWideScale = {mDoGph_gInf_c::getAspect(), 1.0f, 1.0f};
|
||||
dComIfGp_particle_set(g_e_i[i], &pos, NULL, &effWideScale);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
dComIfGp_particle_set(g_e_i[i], &pos, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
i_this->mSound.startCreatureSound(Z2SE_EN_BOSS_CONVERGE, 0, 0);
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include "dusk/settings.h"
|
||||
|
||||
class daB_GND_HIO_c : public JORReflexible {
|
||||
public:
|
||||
daB_GND_HIO_c();
|
||||
@@ -279,6 +282,30 @@ static int h_nodeCallBack(J3DJoint* i_joint, int param_2) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
static void b_gnd_rein_interp_callback(bool isSimFrame, void* pUserWork) {
|
||||
b_gnd_class* i_this = (b_gnd_class*)pUserWork;
|
||||
if (!i_this->mReinsInterpPrevValid || !i_this->mReinsInterpCurrValid) {
|
||||
return;
|
||||
}
|
||||
const f32 alpha = dusk::frame_interp::get_interpolation_step();
|
||||
for (int r = 0; r < 2; r++) {
|
||||
cXyz* dst = i_this->mHorseReins[r].getPos(0);
|
||||
for (int i = 0; i < 16; i++) {
|
||||
const cXyz& p0 = i_this->mReinsInterpPrev[r][i];
|
||||
const cXyz& p1 = i_this->mReinsInterpCurr[r][i];
|
||||
dst[i] = p0 + (p1 - p0) * alpha;
|
||||
}
|
||||
}
|
||||
cXyz* dst = i_this->field_0x21e8.getPos(0);
|
||||
for (int i = 0; i < 2; i++) {
|
||||
const cXyz& p0 = i_this->mReinsTexInterpPrev[i];
|
||||
const cXyz& p1 = i_this->mReinsTexInterpCurr[i];
|
||||
dst[i] = p0 + (p1 - p0) * alpha;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static int daB_GND_Draw(b_gnd_class* i_this) {
|
||||
fopAc_ac_c* a_this = (fopAc_ac_c*)i_this;
|
||||
|
||||
@@ -366,6 +393,21 @@ static int daB_GND_Draw(b_gnd_class* i_this) {
|
||||
|
||||
i_this->field_0x21e8.update(2, l_color, &a_this->tevStr);
|
||||
dComIfGd_set3DlineMat(&i_this->field_0x21e8);
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableFrameInterpolation) {
|
||||
if (i_this->mReinsInterpCurrValid) {
|
||||
memcpy(i_this->mReinsInterpPrev, i_this->mReinsInterpCurr, sizeof(i_this->mReinsInterpCurr));
|
||||
memcpy(i_this->mReinsTexInterpPrev, i_this->mReinsTexInterpCurr, sizeof(i_this->mReinsTexInterpCurr));
|
||||
i_this->mReinsInterpPrevValid = true;
|
||||
}
|
||||
for (int r = 0; r < 2; r++) {
|
||||
memcpy(i_this->mReinsInterpCurr[r], i_this->mHorseReins[r].getPos(0), 16 * sizeof(cXyz));
|
||||
}
|
||||
memcpy(i_this->mReinsTexInterpCurr, i_this->field_0x21e8.getPos(0), 2 * sizeof(cXyz));
|
||||
i_this->mReinsInterpCurrValid = true;
|
||||
dusk::frame_interp::add_interpolation_callback(&b_gnd_rein_interp_callback, i_this);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -1189,10 +1231,16 @@ static void b_gnd_h_end(b_gnd_class* i_this) {
|
||||
|
||||
if (i_this->mDemoCamMode < 32) {
|
||||
i_this->mDemoCamMode = 32;
|
||||
#if TARGET_PC
|
||||
i_this->mDemoCamSyncTicks = 2;
|
||||
#endif
|
||||
} else {
|
||||
i_this->mDemoCamMode = 34;
|
||||
i_this->mDemoCamTimer = 0;
|
||||
i_this->mMoveMode = 2;
|
||||
#if TARGET_PC
|
||||
i_this->mDemoCamSyncTicks = 2;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2887,6 +2935,9 @@ static void demo_camera(b_gnd_class* i_this) {
|
||||
cXyz spF0;
|
||||
|
||||
s8 sp8 = false;
|
||||
#if TARGET_PC
|
||||
const s16 entry_demo_cam_mode = i_this->mDemoCamMode;
|
||||
#endif
|
||||
switch (i_this->mDemoCamMode) {
|
||||
case 0:
|
||||
break;
|
||||
@@ -3725,6 +3776,15 @@ static void demo_camera(b_gnd_class* i_this) {
|
||||
i_this->mDemoCamTimer = 10000;
|
||||
}
|
||||
}
|
||||
#if TARGET_PC
|
||||
if (entry_demo_cam_mode != i_this->mDemoCamMode) {
|
||||
i_this->mDemoCamSyncTicks = 2;
|
||||
}
|
||||
if (i_this->mDemoCamSyncTicks > 0) {
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
i_this->mDemoCamSyncTicks--;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void anm_se_set(b_gnd_class* i_this) {
|
||||
|
||||
@@ -2725,7 +2725,16 @@ static void demo_camera(b_ob_class* i_this) {
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
static u16 ex_eff[] = {dPa_RM(ID_ZI_S_OI_CONVERGE_FILTER), dPa_RM(ID_ZI_S_OI_CONVERGE_FILTEROUT), dPa_RM(ID_ZI_S_OI_CONVERGE_HIDE), dPa_RM(ID_ZI_S_OI_CONVERGE_POLYGON_A), dPa_RM(ID_ZI_S_OI_CONVERGE_POLYGON_B)};
|
||||
dComIfGp_particle_set(ex_eff[i], &room_pos, NULL, &sc);
|
||||
|
||||
#if TARGET_PC
|
||||
if (i == 0) {
|
||||
static const cXyz effWideScale = {mDoGph_gInf_c::getAspect() * 10.0f, 10.0f, 10.0f};
|
||||
dComIfGp_particle_set(ex_eff[i], &room_pos, NULL, &effWideScale);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
dComIfGp_particle_set(ex_eff[i], &room_pos, NULL, &sc);
|
||||
}
|
||||
}
|
||||
|
||||
i_this->mDemoCamEye.set(-4820.0f, -18600.0f, -510.0f);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
||||
|
||||
#include "d/actor/d_a_balloon_2D.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include "JSystem/J2DGraph/J2DGrafContext.h"
|
||||
#include "JSystem/J2DGraph/J2DScreen.h"
|
||||
#include "JSystem/J2DGraph/J2DTextBox.h"
|
||||
@@ -318,11 +319,7 @@ void daBalloon2D_c::addScoreCount(cXyz* param_1, u32 param_2, u8 param_3) {
|
||||
field_0x5f8[current].field_0xf = field_0x5f8[prev].field_0xf;
|
||||
}
|
||||
cXyz acStack_2c;
|
||||
#if TARGET_PC
|
||||
mDoLib_project(param_1, &acStack_2c, { 0, 0, FB_WIDTH, FB_HEIGHT });
|
||||
#else
|
||||
mDoLib_project(param_1, &acStack_2c);
|
||||
#endif
|
||||
field_0x5f8[0].field_0x0.set(acStack_2c);
|
||||
field_0x5f8[0].field_0xc = param_2;
|
||||
field_0x5f8[0].field_0xe = 60;
|
||||
@@ -442,7 +439,12 @@ void daBalloon2D_c::setComboAlpha() {
|
||||
void daBalloon2D_c::drawAddScore() {
|
||||
for (s32 i = 19; i >= 0; i--) {
|
||||
if (field_0x5f8[i].field_0xe != 0) {
|
||||
field_0x5f8[i].field_0xe--;
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
field_0x5f8[i].field_0xe--;
|
||||
}
|
||||
s32 score3;
|
||||
s32 score2;
|
||||
s32 score = field_0x5f8[i].field_0xc;
|
||||
@@ -450,8 +452,13 @@ void daBalloon2D_c::drawAddScore() {
|
||||
u8 local_88 = 0xff;
|
||||
f32 dVar11 = 30.0f;
|
||||
f32 dVar9 = 30.0f;
|
||||
field_0x5f8[i].field_0x0.x += cM_ssin(temp0) * 0.3f;
|
||||
field_0x5f8[i].field_0x0.y -= 1.0f;
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
field_0x5f8[i].field_0x0.x += cM_ssin(temp0) * 0.3f;
|
||||
field_0x5f8[i].field_0x0.y -= 1.0f;
|
||||
}
|
||||
if (field_0x5f8[i].field_0xe < 10) {
|
||||
f32 fVar5 = field_0x5f8[i].field_0xe / 10.0f;
|
||||
local_88 = fVar5 * 255.0f;
|
||||
|
||||
@@ -623,6 +623,11 @@ int daBg_c::create() {
|
||||
|
||||
dComIfGp_roomControl_onStatusFlag(roomNo, 0x10);
|
||||
OS_REPORT("<BG> room%d\n", roomNo);
|
||||
|
||||
#if TARGET_PC
|
||||
draw_interp_frame = true;
|
||||
#endif
|
||||
|
||||
return cPhs_COMPLEATE_e;
|
||||
}
|
||||
|
||||
|
||||
@@ -337,13 +337,7 @@ void daBoomerang_sight_c::setSight(const cXyz* i_pos, int i_no) {
|
||||
}
|
||||
|
||||
Vec proj;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&m_pos[i_no], &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&m_pos[i_no], &proj);
|
||||
#endif
|
||||
|
||||
m_proj_posX[i_no] = proj.x;
|
||||
m_proj_posY[i_no] = proj.y;
|
||||
}
|
||||
|
||||
@@ -1658,12 +1658,7 @@ int daDemo00_c::draw() {
|
||||
MTXCopy(mModel.field_0x5d4->getAnmMtx(0), mDoMtx_stack_c::get());
|
||||
spb0.set(0.0f, 0.0f, 0.0f);
|
||||
mDoMtx_stack_c::multVec(&spb0, &sp98);
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&sp98, &spa4, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&sp98, &spa4);
|
||||
#endif
|
||||
|
||||
if (spa4.x >= -700.0f && spa4.x < 1600.0f && spa4.y >= -200.0f && spa4.y < 600.0f) {
|
||||
if (mModel.mID.field_0x18 == 0 || mModel.mID.field_0x18 == 1) {
|
||||
|
||||
@@ -215,15 +215,14 @@ int daDsh_c::create() {
|
||||
|
||||
mType = getType();
|
||||
|
||||
#ifdef TARGET_PC
|
||||
const char* l_resName[] = {l_arcName[mType], ""};
|
||||
#else
|
||||
// !@bug By making this static, it is only initialized the first time it runs
|
||||
// If gate types that use other arcs are loaded later (without reloading the code)
|
||||
// this array never gets updated and will load the incorrect arc
|
||||
// On GC/Wii, REL loading causes this to reset/reinitialize so the bug is avoided
|
||||
// but TPHD is all statically linked so daDsh_c::CreateHeap fails to get model data and the gate unloads
|
||||
// !@bug Static-init only runs once, so slot 0 keeps the first mType's arc name forever.
|
||||
// GC/Wii dodges this via REL reload; TPHD is statically linked so later gates of a
|
||||
// different type load the wrong arc and CreateHeap fails. The storage must stay static
|
||||
// because mResLoader.load holds the pointer past create(), so we just overwrite slot 0
|
||||
// each call instead.
|
||||
static const char* l_resName[] = {l_arcName[mType], ""};
|
||||
#ifdef TARGET_PC
|
||||
l_resName[0] = l_arcName[mType];
|
||||
#endif
|
||||
|
||||
int phase = mResLoader.load(l_resName, NULL);
|
||||
|
||||
@@ -429,13 +429,7 @@ void daE_FK_c::DamageAction() {
|
||||
|
||||
bool daE_FK_c::checkViewArea() {
|
||||
Vec proj;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(¤t.pos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(¤t.pos, &proj);
|
||||
#endif
|
||||
|
||||
return (proj.x >= 0.0f && proj.x <= FB_WIDTH) && (proj.y >= 0.0f && proj.y <= FB_HEIGHT);
|
||||
}
|
||||
|
||||
|
||||
@@ -1677,7 +1677,16 @@ static void demo_camera(e_fm_class* i_this) {
|
||||
cXyz spBC(0.0f, 0.0f, 0.0f);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
static u16 g_e_i[] = {0x847B, 0x847C, 0x847D, 0x847E};
|
||||
dComIfGp_particle_set(g_e_i[i], &spBC, NULL, NULL);
|
||||
|
||||
#if TARGET_PC
|
||||
if (i == 0) {
|
||||
static const cXyz effWideScale = {mDoGph_gInf_c::getAspect(), 1.0f, 1.0f};
|
||||
dComIfGp_particle_set(g_e_i[i], &spBC, NULL, &effWideScale);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
dComIfGp_particle_set(g_e_i[i], &spBC, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
i_this->mDemoCamFovy = 55.0f + NREG_F(10);
|
||||
|
||||
@@ -463,13 +463,7 @@ static void damage_check(e_fs_class* i_this) {
|
||||
|
||||
static bool checkViewArea(cXyz* i_pos) {
|
||||
Vec proj;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(i_pos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(i_pos, &proj);
|
||||
#endif
|
||||
|
||||
bool ret = false;
|
||||
if (proj.x >= 0.0f && proj.x <= FB_WIDTH && proj.y >= 0.0f && proj.y <= FB_HEIGHT) {
|
||||
ret = true;
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "d/d_bomb.h"
|
||||
#include "c/c_damagereaction.h"
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include "dusk/settings.h"
|
||||
|
||||
#define ACTION_STANDBY 0
|
||||
#define ACTION_WALK1 1
|
||||
@@ -63,6 +65,22 @@ static void anm_init(e_mb_class* i_this, int i_anmID, f32 i_morf, u8 i_attr, f32
|
||||
i_this->mAnm = i_anmID;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
static void e_mb_rope_interp_callback(bool isSimFrame, void* pUserWork) {
|
||||
e_mb_class* i_this = (e_mb_class*)pUserWork;
|
||||
if (!i_this->mRopeInterpPrevValid || !i_this->mRopeInterpCurrValid) {
|
||||
return;
|
||||
}
|
||||
const f32 alpha = dusk::frame_interp::get_interpolation_step();
|
||||
cXyz* dst = i_this->mRopeMat.getPos(0);
|
||||
for (int i = 0; i < 16; i++) {
|
||||
const cXyz& p0 = i_this->mRopeInterpPrev[i];
|
||||
const cXyz& p1 = i_this->mRopeInterpCurr[i];
|
||||
dst[i] = p0 + (p1 - p0) * alpha;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static int daE_MB_Draw(e_mb_class* i_this) {
|
||||
fopAc_ac_c* a_this = (fopAc_ac_c*)i_this;
|
||||
|
||||
@@ -86,6 +104,17 @@ static int daE_MB_Draw(e_mb_class* i_this) {
|
||||
static GXColor l_color = {0x14, 0x0F, 0x00, 0xFF};
|
||||
i_this->mRopeMat.update(16, l_color, &a_this->tevStr);
|
||||
dComIfGd_set3DlineMat(&i_this->mRopeMat);
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableFrameInterpolation) {
|
||||
if (i_this->mRopeInterpCurrValid) {
|
||||
memcpy(i_this->mRopeInterpPrev, i_this->mRopeInterpCurr, sizeof(i_this->mRopeInterpCurr));
|
||||
i_this->mRopeInterpPrevValid = true;
|
||||
}
|
||||
memcpy(i_this->mRopeInterpCurr, i_this->mRopeMat.getPos(0), 16 * sizeof(cXyz));
|
||||
i_this->mRopeInterpCurrValid = true;
|
||||
dusk::frame_interp::add_interpolation_callback(&e_mb_rope_interp_callback, i_this);
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -6601,13 +6601,14 @@ static int daE_RD_Execute(e_rd_class* i_this) {
|
||||
1.2f,
|
||||
};
|
||||
|
||||
#if AVOID_UB
|
||||
s16 x = 0;
|
||||
s16 y = 0;
|
||||
#endif
|
||||
for (int i = 0; i < 2; i++) {
|
||||
MtxPush();
|
||||
#if !AVOID_UB
|
||||
s16 x, y;
|
||||
|
||||
#if AVOID_UB
|
||||
x = 0;
|
||||
y = 0;
|
||||
#endif
|
||||
|
||||
if (i == 0) {
|
||||
|
||||
@@ -1362,13 +1362,7 @@ void daE_SM_c::E_SM_C_Hook() {
|
||||
|
||||
bool daE_SM_c::CheckViewArea() {
|
||||
Vec vec;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(¤t.pos, &vec, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(¤t.pos, &vec);
|
||||
#endif
|
||||
|
||||
bool rv = false;
|
||||
|
||||
if (vec.x >= 0.0f && vec.x <= FB_WIDTH && vec.y >= 0.0f && vec.y <= FB_HEIGHT) {
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
#include "f_op/f_op_camera_mng.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#endif
|
||||
|
||||
class daE_SM2_HIO_c : public fOpAcm_HIO_entry_c {
|
||||
public:
|
||||
daE_SM2_HIO_c();
|
||||
@@ -76,8 +80,62 @@ static int nodeCallBack(J3DJoint* i_joint, int param_1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
static void daE_SM2_interp_callback(bool isSimFrame, void* pUserWork) {
|
||||
e_sm2_class* i_this = static_cast<e_sm2_class*>(pUserWork);
|
||||
if (i_this == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->enemy;
|
||||
g_env_light.settingTevStruct(0, &actor->current.pos, &actor->tevStr);
|
||||
|
||||
if (!i_this->isPiece) {
|
||||
if (i_this->modelMorf == NULL) {
|
||||
return;
|
||||
}
|
||||
J3DModel* model = i_this->modelMorf->getModel();
|
||||
if (model == NULL) {
|
||||
return;
|
||||
}
|
||||
g_env_light.setLightTevColorType_MAJI(model, &actor->tevStr);
|
||||
|
||||
J3DMaterial* material = model->getModelData()->getMaterialNodePointer(0);
|
||||
material->getTevKColor(1)->r = i_this->color_R;
|
||||
material->getTevKColor(1)->g = i_this->color_G;
|
||||
material->getTevKColor(1)->b = i_this->color_B;
|
||||
material->getTevKColor(1)->a = 217.0f * i_this->color_alpha;
|
||||
|
||||
if (i_this->pbtk != NULL) {
|
||||
i_this->pbtk->entry(model->getModelData());
|
||||
}
|
||||
} else {
|
||||
if (i_this->pieceModelMorf == NULL) {
|
||||
return;
|
||||
}
|
||||
J3DModel* model = i_this->pieceModelMorf->getModel();
|
||||
if (model == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
J3DMaterial* material = model->getModelData()->getMaterialNodePointer(0);
|
||||
material->getTevKColor(1)->r = i_this->color_R;
|
||||
material->getTevKColor(1)->g = i_this->color_G;
|
||||
material->getTevKColor(1)->b = i_this->color_B;
|
||||
material->getTevKColor(1)->a = 217.0f * i_this->color_alpha;
|
||||
|
||||
g_env_light.setLightTevColorType_MAJI(model, &actor->tevStr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static int daE_SM2_Draw(e_sm2_class* i_this) {
|
||||
fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->enemy;
|
||||
|
||||
#if TARGET_PC
|
||||
dusk::frame_interp::add_interpolation_callback(&daE_SM2_interp_callback, i_this);
|
||||
#endif
|
||||
|
||||
g_env_light.settingTevStruct(0, &actor->current.pos, &actor->tevStr);
|
||||
|
||||
J3DModel* model;
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#include "m_Do/m_Do_controller_pad.h"
|
||||
#include "m_Do/m_Do_graphic.h"
|
||||
#include "res/Object/Always.h"
|
||||
#include "dusk/dusk.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include <cstring>
|
||||
|
||||
|
||||
@@ -184,6 +186,30 @@ static bool hio_set;
|
||||
|
||||
static daE_WB_HIO_c l_HIO;
|
||||
|
||||
#if TARGET_PC
|
||||
static void e_wb_rein_interp_callback(bool isSimFrame, void* pUserWork) {
|
||||
e_wb_class* i_this = (e_wb_class*)pUserWork;
|
||||
if (!i_this->himo_interp_prev_valid || !i_this->himo_interp_curr_valid) {
|
||||
return;
|
||||
}
|
||||
const f32 alpha = dusk::frame_interp::get_interpolation_step();
|
||||
for (int r = 0; r < 2; r++) {
|
||||
cXyz* dst = i_this->himo_mat[r].getPos(0);
|
||||
for (int i = 0; i < 16; i++) {
|
||||
const cXyz& p0 = i_this->himo_mat_interp_prev[r][i];
|
||||
const cXyz& p1 = i_this->himo_mat_interp_curr[r][i];
|
||||
dst[i] = p0 + (p1 - p0) * alpha;
|
||||
}
|
||||
}
|
||||
cXyz* dst = i_this->himo_tex.getPos(0);
|
||||
for (int i = 0; i < 2; i++) {
|
||||
const cXyz& p0 = i_this->himo_tex_interp_prev[i];
|
||||
const cXyz& p1 = i_this->himo_tex_interp_curr[i];
|
||||
dst[i] = p0 + (p1 - p0) * alpha;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void himo_control1(e_wb_class* i_this, cXyz* i_pos, int i_no, s8 param_3) {
|
||||
fopEn_enemy_c* enemy = &i_this->enemy;
|
||||
cXyz mae, ato;
|
||||
@@ -508,6 +534,21 @@ static int daE_WB_Draw(e_wb_class* i_this) {
|
||||
dComIfGd_set3DlineMat(&i_this->himo_mat[1]);
|
||||
i_this->himo_tex.update(2, l_color, &actor->tevStr);
|
||||
dComIfGd_set3DlineMat(&i_this->himo_tex);
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableFrameInterpolation) {
|
||||
if (i_this->himo_interp_curr_valid) {
|
||||
memcpy(i_this->himo_mat_interp_prev, i_this->himo_mat_interp_curr, sizeof(i_this->himo_mat_interp_curr));
|
||||
memcpy(i_this->himo_tex_interp_prev, i_this->himo_tex_interp_curr, sizeof(i_this->himo_tex_interp_curr));
|
||||
i_this->himo_interp_prev_valid = true;
|
||||
}
|
||||
for (int r = 0; r < 2; r++) {
|
||||
memcpy(i_this->himo_mat_interp_curr[r], i_this->himo_mat[r].getPos(0), 16 * sizeof(cXyz));
|
||||
}
|
||||
memcpy(i_this->himo_tex_interp_curr, i_this->himo_tex.getPos(0), 2 * sizeof(cXyz));
|
||||
i_this->himo_interp_curr_valid = true;
|
||||
dusk::frame_interp::add_interpolation_callback(&e_wb_rein_interp_callback, i_this);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -3726,6 +3767,9 @@ static void demo_camera(e_wb_class* i_this) {
|
||||
boss = (e_rdb_class*)fopAcM_SearchByName(fpcNm_E_RDB_e);
|
||||
}
|
||||
cXyz mae, ato, eye, center;
|
||||
#if TARGET_PC
|
||||
const s16 entry_demo_mode = i_this->demo_mode;
|
||||
#endif
|
||||
|
||||
switch (i_this->demo_mode) {
|
||||
case 1: {
|
||||
@@ -4255,6 +4299,9 @@ static void demo_camera(e_wb_class* i_this) {
|
||||
|
||||
if (i_this->demo_timer == 325) {
|
||||
fpcM_Search(s_wbZrevise_sub, i_this);
|
||||
#if TARGET_PC
|
||||
i_this->demo_cam_sync_ticks = 2;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (i_this->demo_timer == 335) {
|
||||
@@ -4495,6 +4542,9 @@ static void demo_camera(e_wb_class* i_this) {
|
||||
i_this->demo_cam_way_spd.z = fabsf(i_this->demo_cam_way.z - i_this->demo_cam_ctr.z);
|
||||
i_this->demo_cam_morf = 0;
|
||||
pla->setPlayerPosAndAngle(&pla->current.pos, pla->shape_angle.y - 4000, 0);
|
||||
#if TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
}
|
||||
if (i_this->demo_timer == 345) {
|
||||
daPy_getPlayerActorClass()->setThrowDamage(boss->enemy.shape_angle.y - 8000 + TREG_S(8),
|
||||
@@ -4741,6 +4791,9 @@ static void demo_camera(e_wb_class* i_this) {
|
||||
i_this->demo_cam_eye.x += 300.0f + VREG_F(8);
|
||||
i_this->demo_cam_eye.y += 150.0f + VREG_F(9);
|
||||
i_this->demo_cam_eye.z -= 1400.0f + VREG_F(10);
|
||||
#if TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
i_this->demo_cam_eye = enemy->current.pos;
|
||||
@@ -4996,6 +5049,15 @@ static void demo_camera(e_wb_class* i_this) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if TARGET_PC
|
||||
if (entry_demo_mode != i_this->demo_mode) {
|
||||
i_this->demo_cam_sync_ticks = 2;
|
||||
}
|
||||
if (i_this->demo_cam_sync_ticks > 0) {
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
i_this->demo_cam_sync_ticks--;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void anm_se_eff_set(e_wb_class* i_this) {
|
||||
|
||||
@@ -1069,7 +1069,7 @@ void daE_YM_c::executeDown() {
|
||||
if (mAcch.ChkGroundHit()) {
|
||||
if (mFlyType != 1) {
|
||||
#if TARGET_PC
|
||||
bckSet(6, 0, 0.0f, dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0 ? 2.0f : 1.0f);
|
||||
bckSet(6, 0, 0.0f, dusk::getSettings().game.fastTears ? 2.0f : 1.0f);
|
||||
#else
|
||||
bckSet(6, 0, 0.0f, 1.0f);
|
||||
#endif
|
||||
@@ -1093,7 +1093,7 @@ void daE_YM_c::executeDown() {
|
||||
mSound.startCreatureSound(Z2SE_CM_BODYFALL_WATER_M, 0, -1);
|
||||
mSound.startCreatureSound(Z2SE_EN_YM_MOGAKU, 0, -1);
|
||||
#if TARGET_PC
|
||||
bckSet(6, 0, 0.0f, dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0 ? 2.0f : 1.0f);
|
||||
bckSet(6, 0, 0.0f, dusk::getSettings().game.fastTears ? 2.0f : 1.0f);
|
||||
#else
|
||||
bckSet(6, 0, 0.0f, 1.0f);
|
||||
#endif
|
||||
@@ -1115,7 +1115,7 @@ void daE_YM_c::executeDown() {
|
||||
|| dComIfG_Bgsp().GetGroundCode(gnd_chk) == 5)
|
||||
{
|
||||
#if TARGET_PC
|
||||
bckSet(6, 0, 0.0f, dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0 ? 2.0f : 1.0f);
|
||||
bckSet(6, 0, 0.0f, dusk::getSettings().game.fastTears ? 2.0f : 1.0f);
|
||||
#else
|
||||
bckSet(6, 0, 0.0f, 1.0f);
|
||||
#endif
|
||||
|
||||
+128
-5
@@ -12,9 +12,13 @@
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/dvd_asset.hpp"
|
||||
static u8* l_Egnd_mantTEX_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", 0x1C00, 0x4000), true); return buf; }
|
||||
static u8* l_Egnd_mantTEX_U_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", 0x5C00, 0x4000), true); return buf; }
|
||||
static u8* l_Egnd_mantPAL_get() { alignas(32) static u8 buf[0x60]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", 0x9C00, 0x60), true); return buf; }
|
||||
#include "dusk/frame_interpolation.h"
|
||||
|
||||
using GameVersion = dusk::version::GameVersion;
|
||||
|
||||
static u8* l_Egnd_mantTEX_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x1C00}, {GameVersion::GcnPal, 0x1C00}}, 0x4000), true); return buf; }
|
||||
static u8* l_Egnd_mantTEX_U_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x5C00}, {GameVersion::GcnPal, 0x5C00}}, 0x4000), true); return buf; }
|
||||
static u8* l_Egnd_mantPAL_get() { alignas(32) static u8 buf[0x60]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x9C00}, {GameVersion::GcnPal, 0x9C00}}, 0x60), true); return buf; }
|
||||
#define l_Egnd_mantTEX (l_Egnd_mantTEX_get())
|
||||
#define l_Egnd_mantTEX_U (l_Egnd_mantTEX_U_get())
|
||||
#define l_Egnd_mantPAL (l_Egnd_mantPAL_get())
|
||||
@@ -250,7 +254,9 @@ static u32 l_texCoord[338] = {
|
||||
};
|
||||
|
||||
#if TARGET_PC
|
||||
static u8* l_Egnd_mantDL_get() { alignas(32) static u8 buf[0x3EC]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", 0xA9A0, 0x3EC), true); return buf; }
|
||||
using GameVersion = dusk::version::GameVersion;
|
||||
|
||||
static u8* l_Egnd_mantDL_get() { alignas(32) static u8 buf[0x3EC]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0xA9A0}, {GameVersion::GcnPal, 0xA9A0}}, 0x3EC), true); return buf; }
|
||||
#define l_Egnd_mantDL (l_Egnd_mantDL_get())
|
||||
#else
|
||||
#include "assets/l_Egnd_mantDL.h"
|
||||
@@ -267,6 +273,37 @@ static void* tex_d[2] = {
|
||||
|
||||
static char lbl_277_bss_0;
|
||||
|
||||
#if TARGET_PC
|
||||
static void mant_build_anchor_frame(const cXyz& anchor_a, const cXyz& anchor_b, Mtx out) {
|
||||
cXyz axis_x = anchor_b - anchor_a;
|
||||
if (!axis_x.normalizeRS()) {
|
||||
axis_x = cXyz::BaseX;
|
||||
}
|
||||
|
||||
cXyz helper = fabsf(axis_x.y) > 0.95f ? cXyz::BaseZ : cXyz::BaseY;
|
||||
cXyz axis_z = axis_x.getCrossProduct(helper);
|
||||
if (!axis_z.normalizeRS()) {
|
||||
axis_z = cXyz::BaseZ;
|
||||
}
|
||||
|
||||
cXyz axis_y = axis_z.getCrossProduct(axis_x);
|
||||
if (!axis_y.normalizeRS()) {
|
||||
axis_y = cXyz::BaseY;
|
||||
}
|
||||
|
||||
const cXyz center = anchor_a + ((anchor_b - anchor_a) * 0.5f);
|
||||
|
||||
const cXyz col[3] = { axis_x, axis_y, axis_z };
|
||||
const f32 t[3] = { center.x, center.y, center.z };
|
||||
for (int r = 0; r < 3; ++r) {
|
||||
out[r][0] = (&col[0].x)[r];
|
||||
out[r][1] = (&col[1].x)[r];
|
||||
out[r][2] = (&col[2].x)[r];
|
||||
out[r][3] = t[r];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void daMant_packet_c::draw() {
|
||||
#if TARGET_PC
|
||||
void* image = l_Egnd_mantTEX;
|
||||
@@ -290,8 +327,72 @@ void daMant_packet_c::draw() {
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_CLR_RGB, GX_F32, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_F32, 0);
|
||||
|
||||
#if TARGET_PC
|
||||
cXyz* draw_pos = &this->mNrm[0][0];
|
||||
{
|
||||
const u8 curr_buffer = this->field_0x74;
|
||||
const cXyz* curr_pos = &this->mPos[curr_buffer][0];
|
||||
const MtxP curr_frame = curr_buffer == 0 ? this->mMtx : this->mMtx2;
|
||||
|
||||
Mtx curr_frame_inverse;
|
||||
MTXInverse(curr_frame, curr_frame_inverse);
|
||||
|
||||
const u8 prev_buffer = curr_buffer ^ 1;
|
||||
const cXyz* prev_pos = &this->mPos[prev_buffer][0];
|
||||
Mtx prev_frame_inverse;
|
||||
MTXInverse(prev_buffer == 0 ? this->mMtx : this->mMtx2, prev_frame_inverse);
|
||||
|
||||
Mtx presented_frame;
|
||||
MTXCopy(curr_frame, presented_frame);
|
||||
|
||||
mant_class* mant_p = reinterpret_cast<mant_class*>(reinterpret_cast<u8*>(this) - offsetof(mant_class, field_0x0570));
|
||||
if (mant_p != NULL) {
|
||||
b_gnd_class* parent = (b_gnd_class*)fopAcM_SearchByID(mant_p->parentActorID);
|
||||
if (parent != NULL && parent->mpModelMorf != NULL) {
|
||||
J3DModel* model = parent->mpModelMorf->getModel();
|
||||
if (model != NULL) {
|
||||
MtxP src34 = model->getAnmMtx(34);
|
||||
MtxP src25 = model->getAnmMtx(25);
|
||||
Mtx joint_34_scratch;
|
||||
Mtx joint_25_scratch;
|
||||
MtxP joint_34 = dusk::frame_interp::lookup_replacement(src34, joint_34_scratch) ? joint_34_scratch : src34;
|
||||
MtxP joint_25 = dusk::frame_interp::lookup_replacement(src25, joint_25_scratch) ? joint_25_scratch : src25;
|
||||
|
||||
cXyz presented_anchor_a;
|
||||
cXyz presented_anchor_b;
|
||||
cXyz local_offset;
|
||||
|
||||
MTXCopy(joint_34, *calc_mtx);
|
||||
local_offset.set(10.0f, 5.0f, -17.0f);
|
||||
MtxPosition(&local_offset, &presented_anchor_a);
|
||||
|
||||
MTXCopy(joint_25, *calc_mtx);
|
||||
local_offset.set(10.0f, 5.0f, 17.0f);
|
||||
MtxPosition(&local_offset, &presented_anchor_b);
|
||||
|
||||
mant_build_anchor_frame(presented_anchor_a, presented_anchor_b, presented_frame);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const f32 step = dusk::frame_interp::get_interpolation_step();
|
||||
for (int i = 0; i < 169; ++i) {
|
||||
cXyz curr_local;
|
||||
MTXMultVec(curr_frame_inverse, &curr_pos[i], &curr_local);
|
||||
|
||||
cXyz prev_local;
|
||||
MTXMultVec(prev_frame_inverse, &prev_pos[i], &prev_local);
|
||||
cXyz local = prev_local + ((curr_local - prev_local) * step);
|
||||
|
||||
MTXMultVec(presented_frame, &local, &draw_pos[i]);
|
||||
}
|
||||
}
|
||||
GXSETARRAY(GX_VA_POS, draw_pos, sizeof(mNrm[0]), 12, true);
|
||||
GXSETARRAY(GX_VA_NRM, &l_normal, sizeof(l_normal), 12, false);
|
||||
#else
|
||||
GXSETARRAY(GX_VA_POS, this->getPos(), sizeof(mPos[0]), 12, true);
|
||||
GXSETARRAY(GX_VA_NRM, this->getNrm(), sizeof(mNrm[0]), 12, true);
|
||||
#endif
|
||||
GXSETARRAY(GX_VA_TEX0, &l_texCoord, sizeof(l_texCoord), 8, false); // TODO: set to true when converted to float literals
|
||||
|
||||
GXSetZCompLoc(0);
|
||||
@@ -329,9 +430,14 @@ void daMant_packet_c::draw() {
|
||||
|
||||
GXSetCullMode(GX_CULL_BACK);
|
||||
|
||||
GXLoadPosMtxImm(this->mMtx, GX_PNMTX0);
|
||||
Mtx MStack_54;
|
||||
#if TARGET_PC
|
||||
GXLoadPosMtxImm(j3dSys.getViewMtx(), GX_PNMTX0);
|
||||
cMtx_inverseTranspose(j3dSys.getViewMtx(), MStack_54);
|
||||
#else
|
||||
GXLoadPosMtxImm(this->mMtx, GX_PNMTX0);
|
||||
cMtx_inverseTranspose(this->mMtx, MStack_54);
|
||||
#endif
|
||||
|
||||
GXLoadNrmMtxImm(MStack_54, GX_PNMTX0);
|
||||
GXCallDisplayList(l_Egnd_mantDL, 0x3e0);
|
||||
@@ -347,8 +453,13 @@ void daMant_packet_c::draw() {
|
||||
GXSetTevKColor(GX_KCOLOR0, COMPOUND_LITERAL(GXColor){0, 0, 0, 0});
|
||||
|
||||
GXSetCullMode(GX_CULL_FRONT);
|
||||
#if TARGET_PC
|
||||
GXLoadPosMtxImm(j3dSys.getViewMtx(), GX_PNMTX0);
|
||||
cMtx_inverseTranspose(j3dSys.getViewMtx(), MStack_54);
|
||||
#else
|
||||
GXLoadPosMtxImm(this->mMtx2, GX_PNMTX0);
|
||||
cMtx_inverseTranspose(this->mMtx2, MStack_54);
|
||||
#endif
|
||||
|
||||
GXLoadNrmMtxImm(MStack_54, GX_PNMTX0);
|
||||
GXCallDisplayList(l_Egnd_mantDL, 0x3e0);
|
||||
@@ -360,11 +471,13 @@ void daMant_packet_c::draw() {
|
||||
static int daMant_Draw(mant_class* i_this) {
|
||||
g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr);
|
||||
|
||||
#if !TARGET_PC
|
||||
MtxTrans(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
cMtx_concat(j3dSys.getViewMtx(), *calc_mtx, i_this->field_0x0570.getMtx());
|
||||
|
||||
cMtx_concat(j3dSys.getViewMtx(), *calc_mtx, i_this->field_0x0570.getMtx2());
|
||||
#endif
|
||||
|
||||
i_this->field_0x0570.setTevStr(&i_this->tevStr);
|
||||
|
||||
@@ -635,8 +748,13 @@ static void mant_v_calc(mant_class* i_this) {
|
||||
}
|
||||
|
||||
static void mant_move(mant_class* i_this) {
|
||||
#if TARGET_PC
|
||||
u8 uVar1 = i_this->field_0x0570.field_0x74 ^ 1;
|
||||
cXyz* pcVar5 = &i_this->field_0x0570.mPos[uVar1][0];
|
||||
#else
|
||||
u8 uVar1 = i_this->field_0x0570.field_0x74;
|
||||
cXyz* pcVar5 = i_this->field_0x0570.getPos();
|
||||
#endif
|
||||
mant_v_calc(i_this);
|
||||
for (int i = 0; i < 13; i++) {
|
||||
for (int j = 0; j < 13; j++) {
|
||||
@@ -644,7 +762,12 @@ static void mant_move(mant_class* i_this) {
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
mant_build_anchor_frame(i_this->field_0x3928[0], i_this->field_0x3928[1], uVar1 == 0 ? i_this->field_0x0570.mMtx : i_this->field_0x0570.mMtx2);
|
||||
i_this->field_0x0570.field_0x74 = uVar1;
|
||||
#else
|
||||
DCStoreRangeNoSync(i_this->field_0x0570.getPos(), 0x7ec);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int mant_cut_type;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "d/d_s_play.h"
|
||||
#include "d/d_vibration.h"
|
||||
#include "f_op/f_op_kankyo_mng.h"
|
||||
#include "dusk/version.hpp"
|
||||
#include <cstring>
|
||||
|
||||
#define ANM_MG_FISH_MOUTH_CLOSE 4
|
||||
@@ -3230,7 +3231,17 @@ static int daMg_Fish_Execute(mg_fish_class* i_this) {
|
||||
|
||||
daPy_py_c* player = daPy_getPlayerActorClass();
|
||||
|
||||
#if VERSION == VERSION_GCN_JPN
|
||||
#if TARGET_PC
|
||||
if (dusk::version::isRegionJpn()) {
|
||||
lit_1008 = 0;
|
||||
} else if (dusk::version::isRegionPal()) {
|
||||
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_ENGLISH) {
|
||||
lit_1008 = 2;
|
||||
} else {
|
||||
lit_1008 = 0;
|
||||
}
|
||||
}
|
||||
#elif VERSION == VERSION_GCN_JPN
|
||||
lit_1008 = 0;
|
||||
#elif VERSION == VERSION_GCN_PAL
|
||||
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_ENGLISH) {
|
||||
@@ -3843,7 +3854,19 @@ static int daMg_Fish_Create(fopAc_ac_c* i_this) {
|
||||
a_this->mResName = "O_gD_bott";
|
||||
}
|
||||
|
||||
#if VERSION == VERSION_GCN_JPN
|
||||
#if TARGET_PC
|
||||
if (dusk::version::isRegionJpn()) {
|
||||
lit_1008 = 0;
|
||||
} else if (dusk::version::isRegionPal()) {
|
||||
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_ENGLISH) {
|
||||
lit_1008 = 2;
|
||||
} else {
|
||||
lit_1008 = 0;
|
||||
}
|
||||
} else {
|
||||
lit_1008 = 1;
|
||||
}
|
||||
#elif VERSION == VERSION_GCN_JPN
|
||||
lit_1008 = 0;
|
||||
#elif VERSION == VERSION_GCN_PAL
|
||||
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_ENGLISH) {
|
||||
|
||||
@@ -5,14 +5,15 @@
|
||||
|
||||
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
||||
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
#include "d/actor/d_a_mg_fish.h"
|
||||
#include "d/actor/d_a_mg_fshop.h"
|
||||
#include "d/actor/d_a_npc_henna.h"
|
||||
#include "d/actor/d_a_mg_fish.h"
|
||||
#include "d/actor/d_a_player.h"
|
||||
#include "f_op/f_op_camera_mng.h"
|
||||
#include "d/d_timer.h"
|
||||
#include "d/d_s_play.h"
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
#include "d/d_timer.h"
|
||||
#include "dusk/version.hpp"
|
||||
#include "f_op/f_op_camera_mng.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/gyro.h"
|
||||
@@ -761,6 +762,11 @@ static void koro2_game(fshop_class* i_this) {
|
||||
sp5C.x = mDoCPd_c::getStickX3D(PAD_1);
|
||||
sp5C.y = 0.0f;
|
||||
sp5C.z = mDoCPd_c::getStickY(PAD_1);
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
sp5C.x = -sp5C.x;
|
||||
}
|
||||
#endif
|
||||
MtxPosition(&sp5C, &sp68);
|
||||
|
||||
f32 reg_f31 = sp68.x;
|
||||
@@ -782,20 +788,15 @@ static void koro2_game(fshop_class* i_this) {
|
||||
reg_f30 = 0.0f;
|
||||
}
|
||||
|
||||
s16 gyro_ax = 0;
|
||||
s16 gyro_az = 0;
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableGyroRollgoal) {
|
||||
s16 rg_add_x;
|
||||
s16 rg_add_z;
|
||||
dusk::gyro::rollgoalTableOffset(rg_add_x, rg_add_z);
|
||||
s16 tgt_x = static_cast<s16>(reg_f30 * (-6000.0f + JREG_F(7))) + rg_add_x;
|
||||
s16 tgt_z = static_cast<s16>(reg_f31 * (-6000.0f + JREG_F(8))) + rg_add_z;
|
||||
cLib_addCalcAngleS2(&i_this->field_0x4020.x, tgt_x, 4, 0x200);
|
||||
cLib_addCalcAngleS2(&i_this->field_0x4020.z, tgt_z, 4, 0x200);
|
||||
dusk::gyro::rollgoalTableOffset(gyro_ax, gyro_az);
|
||||
}
|
||||
#else
|
||||
cLib_addCalcAngleS2(&i_this->field_0x4020.x, reg_f30 * (-6000.0f + JREG_F(7)), 4, 0x200);
|
||||
cLib_addCalcAngleS2(&i_this->field_0x4020.z, reg_f31 * (-6000.0f + JREG_F(8)), 4, 0x200);
|
||||
#endif
|
||||
cLib_addCalcAngleS2(&i_this->field_0x4020.x, reg_f30 * (-6000.0f + JREG_F(7)) + gyro_ax, 4, 0x200);
|
||||
cLib_addCalcAngleS2(&i_this->field_0x4020.z, reg_f31 * (-6000.0f + JREG_F(8)) + gyro_az, 4, 0x200);
|
||||
}
|
||||
#if TARGET_PC
|
||||
if (i_this->field_0x4010 != 2) {
|
||||
@@ -1742,7 +1743,18 @@ static int daFshop_Create(fopAc_ac_c* actor) {
|
||||
fopAcM_createChild(fpcNm_FSHOP_e, fopAcM_GetID(actor), 0xFFFFFF23, &actor->current.pos, fopAcM_GetRoomNo(actor), NULL, NULL, -1, NULL);
|
||||
|
||||
u8 sp10;
|
||||
#if VERSION == VERSION_GCN_PAL || VERSION == VERSION_WII_PAL
|
||||
#if TARGET_PC
|
||||
if (dusk::version::isRegionPal()) {
|
||||
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_ENGLISH) {
|
||||
sp10 = 2;
|
||||
} else {
|
||||
sp10 = 0;
|
||||
}
|
||||
} else {
|
||||
sp10 = 1;
|
||||
}
|
||||
|
||||
#elif VERSION == VERSION_GCN_PAL || VERSION == VERSION_WII_PAL
|
||||
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_ENGLISH) {
|
||||
sp10 = 2;
|
||||
} else {
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
|
||||
#include "dusk/version.hpp"
|
||||
|
||||
class dmg_rod_HIO_c : public JORReflexible {
|
||||
public:
|
||||
dmg_rod_HIO_c();
|
||||
@@ -5734,10 +5736,22 @@ static void play_camera_u(dmg_rod_class* i_this) {
|
||||
static int dmg_rod_Execute(dmg_rod_class* i_this) {
|
||||
fopAc_ac_c* actor = &i_this->actor;
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::version::isPalOrAtLeastWiiR2()) {
|
||||
if (dComIfGs_getPalLanguage() == 0) {
|
||||
data_804BBBD4 = 2;
|
||||
} else {
|
||||
data_804BBBD4 = 0;
|
||||
}
|
||||
} else if (dusk::version::isRegionJpn()) {
|
||||
data_804BBBD4 = 0;
|
||||
} else {
|
||||
data_804BBBD4 = 1;
|
||||
}
|
||||
//TODO: It seems possible that dComIfGs_getPalLanguage returns a constant value for non-PAL
|
||||
// versions (causing the first block to be elided), and it's also possible that the value
|
||||
// being compared against is an enum value with per-version definitions.
|
||||
#if VERSION == VERSION_SHIELD_DEBUG
|
||||
#elif VERSION == VERSION_SHIELD_DEBUG
|
||||
if (dComIfGs_getPalLanguage() == 1) {
|
||||
data_804BBBD4 = 2;
|
||||
} else {
|
||||
@@ -6303,7 +6317,19 @@ static int dmg_rod_Create(fopAc_ac_c* i_this) {
|
||||
heap_size = 0xC9A0;
|
||||
}
|
||||
|
||||
#if VERSION == VERSION_SHIELD_DEBUG
|
||||
#if TARGET_PC
|
||||
if (dusk::version::isPalOrAtLeastWiiR2()) {
|
||||
if (dComIfGs_getPalLanguage() == 0) {
|
||||
data_804BBBD4 = 2;
|
||||
} else {
|
||||
data_804BBBD4 = 0;
|
||||
}
|
||||
} else if (dusk::version::isRegionJpn()) {
|
||||
data_804BBBD4 = 0;
|
||||
} else {
|
||||
data_804BBBD4 = 1;
|
||||
}
|
||||
#elif VERSION == VERSION_SHIELD_DEBUG
|
||||
if (dComIfGs_getPalLanguage() == 1) {
|
||||
data_804BBBD4 = 2;
|
||||
} else {
|
||||
|
||||
@@ -1054,9 +1054,9 @@ void daMidna_c::setBodyPartMatrix() {
|
||||
}
|
||||
mpModel->calcWeightEnvelopeMtx();
|
||||
#ifdef TARGET_PC
|
||||
// Frame interpolation: Record weight envelopes for Midna here, as they are otherwise missed causing distortion
|
||||
// FRAME INTERP NOTE: Record weight envelopes for Midna here, as they are otherwise missed causing distortion
|
||||
for (u16 i = 0; i < mpModel->getModelData()->getWEvlpMtxNum(); i++) {
|
||||
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(mpModel->getWeightAnmMtx(i)), mpModel->getWeightAnmMtx(i));
|
||||
dusk::frame_interp::record_final_mtx(mpModel->getWeightAnmMtx(i));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
#include <gf/GFGeometry.h>
|
||||
#include <gf/GFLight.h>
|
||||
#include "m_Do/m_Do_lib.h"
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#endif
|
||||
|
||||
#ifndef __MWERKS__
|
||||
#include "dusk/math.h"
|
||||
@@ -27,11 +30,19 @@ static char* l_arcName = "Mirror";
|
||||
static char* l_arcName2 = "MR-Table";
|
||||
|
||||
dMirror_packet_c::dMirror_packet_c() {
|
||||
#ifdef TARGET_PC
|
||||
GXInitTexObj(&mTexObj, nullptr, 0, 0, static_cast<GXTexFmt>(-1), GX_MAX_TEXWRAPMODE,
|
||||
GX_MAX_TEXWRAPMODE, GX_FALSE);
|
||||
#endif
|
||||
reset();
|
||||
}
|
||||
|
||||
void dMirror_packet_c::reset() {
|
||||
#if TARGET_PC
|
||||
mbReset = true;
|
||||
#else
|
||||
mModelCount = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void dMirror_packet_c::calcMinMax() {
|
||||
@@ -581,6 +592,13 @@ int daMirror_c::execute() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (mPacket.mbReset) {
|
||||
mPacket.mModelCount = 0;
|
||||
mPacket.mbReset = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
daPy_py_c* player = daPy_getLinkPlayerActorClass();
|
||||
JUT_ASSERT(0, player != NULL);
|
||||
|
||||
|
||||
@@ -2855,7 +2855,7 @@ void* daMP_Reader(void*) {
|
||||
#endif
|
||||
}
|
||||
|
||||
static u8 daMP_ReadThreadStack[0x2000];
|
||||
static u8 daMP_ReadThreadStack[DUSK_IF_ELSE(8, 0x2000)];
|
||||
|
||||
#if TARGET_PC
|
||||
static BOOL VideoThreadCancelled;
|
||||
@@ -2880,7 +2880,7 @@ static BOOL daMP_CreateReadThread(s32 param_0) {
|
||||
|
||||
static OSThread daMP_VideoDecodeThread;
|
||||
|
||||
static u8 daMP_VideoDecodeThreadStack[0x64000];
|
||||
static u8 daMP_VideoDecodeThreadStack[DUSK_IF_ELSE(8, 0x64000)];
|
||||
|
||||
static OSMessageQueue daMP_FreeTextureSetQueue;
|
||||
|
||||
@@ -3132,7 +3132,7 @@ static BOOL AudioThreadCancelled;
|
||||
|
||||
static OSThread daMP_AudioDecodeThread;
|
||||
|
||||
static u8 daMP_AudioDecodeThreadStack[0x64000];
|
||||
static u8 daMP_AudioDecodeThreadStack[DUSK_IF_ELSE(8, 0x64000)];
|
||||
|
||||
static OSMessageQueue daMP_FreeAudioBufferQueue;
|
||||
|
||||
@@ -3342,13 +3342,8 @@ static void daMP_THPGXYuv2RgbSetup(const GXRenderModeObj* rmode) {
|
||||
Mtx44 m;
|
||||
Mtx e_m;
|
||||
|
||||
#if TARGET_PC
|
||||
w = JUTVideo::getManager()->getFbWidth();
|
||||
h = JUTVideo::getManager()->getEfbHeight();
|
||||
#else
|
||||
w = rmode->fbWidth;
|
||||
h = rmode->efbHeight;
|
||||
#endif
|
||||
var_f31 = 0.0f;
|
||||
|
||||
#if WIDESCREEN_SUPPORT
|
||||
@@ -4383,6 +4378,8 @@ static void daMP_ActivePlayer_Draw() {
|
||||
|
||||
daMP_DrawPosX = static_cast<u32>(rect.PosX);
|
||||
daMP_DrawPosY = static_cast<u32>(rect.PosY);
|
||||
|
||||
daMP_THPPlayerSetVolume((dusk::getSettings().audio.masterVolume / 100.0f) * 127.0f, 0);
|
||||
#endif
|
||||
|
||||
int frame = daMP_THPPlayerDrawCurrentFrame(
|
||||
@@ -4583,3 +4580,12 @@ actor_process_profile_definition g_profile_MOVIE_PLAYER = {
|
||||
};
|
||||
|
||||
AUDIO_INSTANCES;
|
||||
|
||||
#if TARGET_PC
|
||||
void dusk::MoviePlayerShutdown() {
|
||||
// We need to cleanly shut down the threads to avoid crashes on shutdown.
|
||||
if (daMP_c::m_myObj) {
|
||||
daMP_c::m_myObj->daMP_c_Finish();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -2694,12 +2694,7 @@ BOOL daNpcT_chkActorInScreen(fopAc_ac_c* i_ActorP, f32 param_1, f32 param_2, f32
|
||||
}
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&pos_array[i], &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&pos_array[i], &proj);
|
||||
#endif
|
||||
|
||||
if (0.0f < proj.x && proj.x < FB_WIDTH && 0.0f < proj.y && proj.y < FB_HEIGHT) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -110,6 +110,10 @@ static int daNpc_Inko_Execute(npc_inko_class* i_this) {
|
||||
}
|
||||
|
||||
f32 var_f31;
|
||||
|
||||
#if AVOID_UB
|
||||
var_f31 = 0.0f;
|
||||
#endif
|
||||
if (i_this->field_0x598 == 0) {
|
||||
if (i_this->field_0x59c[1] == 0) {
|
||||
i_this->field_0x59c[1] = 30.0f + cM_rndF(70.0f);
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "f_op/f_op_kankyo_mng.h"
|
||||
#include "c/c_damagereaction.h"
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include <cstring>
|
||||
|
||||
static home_path_pnt home_path[38] = {
|
||||
@@ -2655,6 +2656,9 @@ static void demo_camera(npc_ne_class* i_this) {
|
||||
i_this->mCameraFovY = 55.0f;
|
||||
camera->mCamera.SetTrimSize(3);
|
||||
daPy_getPlayerActorClass()->changeOriginalDemo();
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
// fallthrough
|
||||
|
||||
case 2:
|
||||
@@ -2683,6 +2687,9 @@ static void demo_camera(npc_ne_class* i_this) {
|
||||
if (i_this->mDemoCounter == 0) {
|
||||
i_this->mCameraCenter1.set(387.0f, 133.0f, -866.0f);
|
||||
i_this->mCameraEye1.set(284.0f, 208.0f, -585.0f);
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
}
|
||||
|
||||
if (i_this->mDemoCounter == 12) {
|
||||
@@ -2719,6 +2726,9 @@ static void demo_camera(npc_ne_class* i_this) {
|
||||
i_this->mCameraFovY = 45.0f;
|
||||
camera->mCamera.SetTrimSize(3);
|
||||
daPy_getPlayerActorClass()->changeOriginalDemo();
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
// fallthrough
|
||||
|
||||
case 11:
|
||||
@@ -2799,8 +2809,14 @@ static void demo_camera(npc_ne_class* i_this) {
|
||||
MtxPosition(&vec, &i_this->mCameraEye2);
|
||||
i_this->mCameraEye2 += player->current.pos;
|
||||
player->changeDemoParam2(2);
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
} else if (i_this->mDemoCounter == 120) {
|
||||
player->changeDemoParam2(0);
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2853,6 +2869,9 @@ static void demo_camera(npc_ne_class* i_this) {
|
||||
i_this->mCameraCenter1 = _this->current.pos;
|
||||
i_this->mCameraCenter1.y += 20.0f;
|
||||
i_this->mCameraFovY = 55.0f;
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
}
|
||||
|
||||
camera->mCamera.Set(i_this->mCameraCenter1, i_this->mCameraEye1,
|
||||
|
||||
@@ -170,7 +170,7 @@ void daObjLv5Key_c::Fall(int param_0) {
|
||||
|
||||
OS_REPORT("FALL SPD = %f\n", speed.y);
|
||||
|
||||
if (mAcch.ChkGroundHit()) {
|
||||
if (mAcch.ChkGroundHit() IF_DUSK(|| current.pos.abs(home.pos) > 200.0f)) {
|
||||
fopAcM_GetSpeed(this);
|
||||
fopAcM_SetSpeedF(this, 4.0f);
|
||||
fopAcM_SetSpeed(this, 0.0f, 22.0f, 0.0f);
|
||||
@@ -192,7 +192,7 @@ void daObjLv5Key_c::Fall(int param_0) {
|
||||
mAcch.CrrPos(dComIfG_Bgsp());
|
||||
current.pos.y = prev_y;
|
||||
|
||||
if (mAcch.ChkGroundHit()) {
|
||||
if (mAcch.ChkGroundHit() IF_DUSK(|| current.pos.abs(home.pos) > 200.0f)) {
|
||||
setAction(&daObjLv5Key_c::Land, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,13 +499,7 @@ void daObjARI_c::Z_BufferChk() {
|
||||
cXyz vec2, vec1;
|
||||
vec1 = current.pos;
|
||||
vec1.y += 20.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&vec1, &vec2, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&vec1, &vec2);
|
||||
#endif
|
||||
|
||||
f32 trim_height;
|
||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||
if (camera != NULL) {
|
||||
|
||||
@@ -205,6 +205,13 @@ int daObj_Balloon_c::_delete() {
|
||||
Z2GetAudioMgr()->seStop(Z2SE_OBJ_WATERMILL_ROUND, 0);
|
||||
if (mHIOInit) {
|
||||
hio_set = false;
|
||||
#ifdef TARGET_PC
|
||||
// !@bug d_a_obj_balloon.rel unload used to zero these file-statics; with static linking they dangle across scenes.
|
||||
m_combo_type = 0xFFFFFFFF;
|
||||
m_combo_count = 0;
|
||||
m_combo_next_score = 0;
|
||||
m_balloon_score = 0;
|
||||
#endif
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -285,13 +285,7 @@ bool Hahen_c::CheckCull() {
|
||||
|
||||
bool Hahen_c::checkViewArea() {
|
||||
Vec proj;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&pos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&pos, &proj);
|
||||
#endif
|
||||
|
||||
return (proj.x >= -50.0f && proj.x <= 658.0f) && (proj.y >= -50.0f && proj.y <= 498.0f);
|
||||
}
|
||||
|
||||
|
||||
@@ -289,13 +289,7 @@ void daObjCHO_c::Z_BufferChk() {
|
||||
cXyz vec2, vec1;
|
||||
vec1 = current.pos;
|
||||
vec1.y += 20.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&vec1, &vec2, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&vec1, &vec2);
|
||||
#endif
|
||||
|
||||
f32 trim_height;
|
||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||
if (camera != NULL) {
|
||||
|
||||
@@ -224,13 +224,7 @@ void daObjCRVFENCE_c::NormalAction() {
|
||||
|
||||
bool daObjCRVFENCE_c::checkViewArea(cXyz* param_1) {
|
||||
Vec sp24;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(param_1, &sp24, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(param_1, &sp24);
|
||||
#endif
|
||||
|
||||
bool rv = false;
|
||||
bool bVar1 = false;
|
||||
|
||||
|
||||
@@ -137,13 +137,7 @@ void daObjCRVHAHEN_c::CheckCull() {
|
||||
|
||||
bool daObjCRVHAHEN_c::checkViewArea(cXyz* i_this) {
|
||||
Vec proj;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(i_this, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(i_this, &proj);
|
||||
#endif
|
||||
|
||||
bool ret = false;
|
||||
|
||||
if (proj.x >= 0.0f && proj.x <= FB_WIDTH && proj.y >= 0.0f && proj.y <= FB_HEIGHT) {
|
||||
|
||||
@@ -267,13 +267,7 @@ void daObjDAN_c::Z_BufferChk() {
|
||||
cXyz vec2, vec1;
|
||||
vec1 = current.pos;
|
||||
vec1.y += 20.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&vec1, &vec2, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&vec1, &vec2);
|
||||
#endif
|
||||
|
||||
f32 trim_height;
|
||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||
if (camera != NULL) {
|
||||
|
||||
@@ -265,8 +265,8 @@ int daObjDrop_c::modeParentWait() {
|
||||
mModeAction = 1;
|
||||
|
||||
#if TARGET_PC
|
||||
mModeTimer = dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0 ? 20 : 40;
|
||||
if (dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0) {
|
||||
mModeTimer = dusk::getSettings().game.fastTears ? 0 : 40;
|
||||
if (dusk::getSettings().game.fastTears) {
|
||||
current.pos.y += 100.0f;
|
||||
} else {
|
||||
current.pos.y += 300.0f;
|
||||
@@ -285,7 +285,7 @@ int daObjDrop_c::modeParentWait() {
|
||||
case 2:
|
||||
createBodyEffect();
|
||||
#if TARGET_PC
|
||||
mModeTimer = dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0 ? 5 : 45;
|
||||
mModeTimer = dusk::getSettings().game.fastTears ? 0 : 45;
|
||||
#else
|
||||
mModeTimer = 45;
|
||||
#endif
|
||||
@@ -331,7 +331,7 @@ int daObjDrop_c::modeWait() {
|
||||
case 2:
|
||||
case 50:
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0) {
|
||||
if (dusk::getSettings().game.fastTears) {
|
||||
f32 player_dist = current.pos.abs(daPy_getPlayerActorClass()->current.pos);
|
||||
f32 home_dist = current.pos.abs(home.pos);
|
||||
|
||||
|
||||
@@ -201,13 +201,7 @@ void daObjGOMIKABE_c::CheckCull() {
|
||||
|
||||
bool daObjGOMIKABE_c::checkViewArea(cXyz param_1) {
|
||||
Vec local_24;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(¶m_1, &local_24, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(¶m_1, &local_24);
|
||||
#endif
|
||||
|
||||
bool rv = false;
|
||||
if (local_24.x >= 0.0f && local_24.x <= FB_WIDTH && local_24.y >= 0.0f && local_24.y <= FB_HEIGHT) {
|
||||
rv = true;
|
||||
|
||||
@@ -214,13 +214,7 @@ void daObjHHASHI_c::CheckCull() {
|
||||
|
||||
bool daObjHHASHI_c::checkViewArea(int param_1) {
|
||||
Vec local_20;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&field_0x5b0[param_1], &local_20, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&field_0x5b0[param_1], &local_20);
|
||||
#endif
|
||||
|
||||
bool rv = false;
|
||||
if (local_20.x >= 0.0f && local_20.x <= FB_WIDTH && local_20.y >= 0.0f && local_20.y <= FB_HEIGHT) {
|
||||
rv = true;
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
#include "f_op/f_op_camera_mng.h"
|
||||
#include "m_Do/m_Do_mtx.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#endif
|
||||
|
||||
static f32 Reflect(cXyz* i_vec, cBgS_PolyInfo const& i_polyinfo, f32 i_scale) {
|
||||
cM3dGPla plane;
|
||||
|
||||
@@ -31,6 +35,27 @@ static f32 Reflect(cXyz* i_vec, cBgS_PolyInfo const& i_polyinfo, f32 i_scale) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
static void d_a_obj_item_interp_callback(bool isSimFrame, void* pUserWork) {
|
||||
daItem_c* item = static_cast<daItem_c*>(pUserWork);
|
||||
if (item == NULL || item->mpModel == NULL || !item->chkDraw()) {
|
||||
return;
|
||||
}
|
||||
item->setTevStr();
|
||||
if (item->mpBrkAnm != NULL) {
|
||||
s8 tevFrm = item->getTevFrm();
|
||||
if (tevFrm != -1) {
|
||||
item->mpBrkAnm->entry(item->mpModel->getModelData(), tevFrm);
|
||||
} else {
|
||||
item->mpBrkAnm->entry(item->mpModel->getModelData());
|
||||
}
|
||||
}
|
||||
if (item->chkFlag(4)) {
|
||||
fopAcM_setEffectMtx(item, item->mpModel->getModelData());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
const daItemBase_data& daItemBase_c::getData() {
|
||||
return m_data;
|
||||
}
|
||||
@@ -353,6 +378,10 @@ int daItem_c::_daItem_draw() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
dusk::frame_interp::add_interpolation_callback(&d_a_obj_item_interp_callback, this);
|
||||
#endif
|
||||
|
||||
if (chkDraw()) {
|
||||
return DrawBase();
|
||||
}
|
||||
@@ -390,6 +419,9 @@ void daItem_c::procMainNormal() {
|
||||
cLib_chaseF(&scale.z, mItemScale.z, step_z);
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (!dusk::getSettings().game.enableIndefiniteItemDrops) {
|
||||
#endif
|
||||
if (mWaitTimer == 0) {
|
||||
if (mDisappearTimer == 0) {
|
||||
deleteItem();
|
||||
@@ -399,6 +431,9 @@ void daItem_c::procMainNormal() {
|
||||
changeDraw();
|
||||
}
|
||||
}
|
||||
#if TARGET_PC
|
||||
}
|
||||
#endif
|
||||
|
||||
mCcCyl.SetC(current.pos);
|
||||
dComIfG_Ccsp()->Set(&mCcCyl);
|
||||
@@ -1058,9 +1093,16 @@ int daItem_c::CountTimer() {
|
||||
if (checkCountTimer()) {
|
||||
if (mWaitTimer > 0) {
|
||||
mWaitTimer--;
|
||||
} else if (mDisappearTimer > 0) {
|
||||
}
|
||||
#if TARGET_PC
|
||||
else if (!dusk::getSettings().game.enableIndefiniteItemDrops && mDisappearTimer > 0) {
|
||||
mDisappearTimer--;
|
||||
}
|
||||
#else
|
||||
else if (mDisappearTimer > 0) {
|
||||
mDisappearTimer--;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
cLib_calcTimer<u8>(&mBoomWindTgTimer);
|
||||
|
||||
@@ -517,13 +517,7 @@ void daObjKAM_c::Z_BufferChk() {
|
||||
cXyz currentOffset;
|
||||
currentOffset = current.pos;
|
||||
currentOffset.y += 20.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(¤tOffset, ¤tProj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(¤tOffset, ¤tProj);
|
||||
#endif
|
||||
|
||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||
f32 cameraHeight;
|
||||
if (camera != NULL) {
|
||||
|
||||
@@ -611,13 +611,7 @@ void daObjKAT_c::Z_BufferChk() {
|
||||
cXyz curWithOff;
|
||||
curWithOff = current.pos;
|
||||
curWithOff.y += 20.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&curWithOff, &projected, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&curWithOff, &projected);
|
||||
#endif
|
||||
|
||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||
f32 unkFloat1;
|
||||
if (camera != NULL) {
|
||||
|
||||
@@ -528,13 +528,7 @@ void daObjKUW_c::Z_BufferChk() {
|
||||
|
||||
cStack_68 = current.pos;
|
||||
cStack_68.y += 20.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&cStack_68, &local_5c, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&cStack_68, &local_5c);
|
||||
#endif
|
||||
|
||||
camera_process_class* cc = dComIfGp_getCamera(0);
|
||||
f32 trimHeight;
|
||||
if (cc != NULL) {
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/d_path.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#endif
|
||||
|
||||
daOptiLift_HIO_c::daOptiLift_HIO_c() {
|
||||
mStopDisappearTime = 30;
|
||||
mStartMoveTime = 30;
|
||||
@@ -412,7 +416,44 @@ void daOptiLift_c::setNextPoint() {
|
||||
mCurrentPoint = next_point;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
static void daOptiLift_interp_callback(bool isSimFrame, void* pUserWork) {
|
||||
daOptiLift_c* lift = static_cast<daOptiLift_c*>(pUserWork);
|
||||
if (lift == NULL || lift->mpModel == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_env_light.settingTevStruct(0x10, &lift->current.pos, &lift->tevStr);
|
||||
g_env_light.setLightTevColorType_MAJI(lift->mpModel, &lift->tevStr);
|
||||
|
||||
J3DModelData* modelData = lift->mpModel->getModelData();
|
||||
J3DMaterial* materialp = modelData->getMaterialNodePointer(0);
|
||||
|
||||
if (materialp->getTexGenBlock()->getTexMtx(1) != NULL) {
|
||||
J3DTexMtxInfo* mtx_info = &materialp->getTexGenBlock()->getTexMtx(1)->getTexMtxInfo();
|
||||
if (mtx_info != NULL) {
|
||||
Mtx m;
|
||||
C_MTXLightOrtho(m, 100.0f, -100.0f, -100.0f, 100.0f, 1.0f, 1.0f, 0.0f, 0.0f);
|
||||
mDoMtx_stack_c::XrotS(0x4000);
|
||||
mDoMtx_stack_c::transM(-lift->current.pos.x, -lift->current.pos.y, -lift->current.pos.z);
|
||||
cMtx_concat(m, mDoMtx_stack_c::get(), mtx_info->mEffectMtx);
|
||||
}
|
||||
}
|
||||
|
||||
lift->mBtk.entry(modelData);
|
||||
|
||||
J3DGXColor* color = materialp->getTevKColor(1);
|
||||
color->r = l_HIO.mColorR;
|
||||
color->g = l_HIO.mColorG;
|
||||
color->b = l_HIO.mColorB;
|
||||
}
|
||||
#endif
|
||||
|
||||
int daOptiLift_c::Draw() {
|
||||
#if TARGET_PC
|
||||
dusk::frame_interp::add_interpolation_callback(&daOptiLift_interp_callback, this);
|
||||
#endif
|
||||
|
||||
g_env_light.settingTevStruct(0x10, ¤t.pos, &tevStr);
|
||||
g_env_light.setLightTevColorType_MAJI(mpModel, &tevStr);
|
||||
|
||||
|
||||
@@ -981,9 +981,7 @@ int daObjStone_c::draw() {
|
||||
if (!model) {
|
||||
f32 shadow_size = l_shadow_size[mStoneType];
|
||||
TGXTexObj* pTex = dDlst_shadowControl_c::getSimpleTex();
|
||||
cXyz pos = current.pos;
|
||||
|
||||
dComIfGd_setSimpleShadow(&pos, mChkObj.GetGroundH(), shadow_size, mChkObj.m_gnd, 0,
|
||||
dComIfGd_setSimpleShadow(¤t.pos, mChkObj.GetGroundH(), shadow_size, mChkObj.m_gnd, 0,
|
||||
1.0f, pTex);
|
||||
}
|
||||
return 1;
|
||||
|
||||
@@ -593,13 +593,7 @@ void daObjTEN_c::Z_BufferChk() {
|
||||
cXyz cStack_68;
|
||||
cStack_68 = current.pos;
|
||||
cStack_68.y += 20.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&cStack_68, &local_5c, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&cStack_68, &local_5c);
|
||||
#endif
|
||||
|
||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||
f32 trimHeight;
|
||||
if (camera != NULL) {
|
||||
|
||||
@@ -504,13 +504,7 @@ void daObjTOMBO_c::Z_BufferChk() {
|
||||
cXyz cStack_68;
|
||||
cStack_68 = current.pos;
|
||||
cStack_68.y += 20.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&cStack_68, &local_5c, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&cStack_68, &local_5c);
|
||||
#endif
|
||||
|
||||
camera_process_class* pCamera = dComIfGp_getCamera(0);
|
||||
f32 trimHeight;
|
||||
if (pCamera != NULL) {
|
||||
|
||||
@@ -38,12 +38,7 @@ BOOL daZraFreeze_c::chkActorInScreen() {
|
||||
mDoMtx_stack_c::transM(0.0f, 0.0f, 0.0f);
|
||||
PSMTXMultVecArray(mDoMtx_stack_c::get(), vec, vec, 8);
|
||||
for (int i = 0; i < 8; i++) {
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&vec[i], &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&vec[i], &proj);
|
||||
#endif
|
||||
|
||||
if (0.0f < proj.x && proj.x < FB_WIDTH && 0.0f < proj.y && proj.y < FB_HEIGHT) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -369,18 +369,17 @@ JKRHeap* daPy_anmHeap_c::setAnimeHeap() {
|
||||
#if !PLATFORM_WII
|
||||
#if TARGET_PC
|
||||
#include "dusk/dvd_asset.hpp"
|
||||
using GameVersion = dusk::version::GameVersion;
|
||||
static const u8* l_sightDL_get() {
|
||||
static u8 buf[0x89];
|
||||
static bool _ = (
|
||||
dusk::LoadDolAsset(
|
||||
buf,
|
||||
#if VERSION == VERSION_GCN_PAL
|
||||
0x803BBDA0,
|
||||
#elif VERSION == VERSION_GCN_JPN
|
||||
0x803B4220,
|
||||
#elif VERSION == VERSION_GCN_USA
|
||||
0x803BA0C0,
|
||||
#endif
|
||||
{
|
||||
{GameVersion::GcnUsa, 0x803BA0C0},
|
||||
{GameVersion::GcnPal, 0x803BBDA0},
|
||||
{GameVersion::GcnJpn, 0x803B4220}
|
||||
},
|
||||
0x89
|
||||
),
|
||||
true
|
||||
@@ -421,13 +420,7 @@ void daPy_sightPacket_c::draw() {
|
||||
|
||||
void daPy_sightPacket_c::setSight() {
|
||||
Vec proj;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&mPos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&mPos, &proj);
|
||||
#endif
|
||||
|
||||
mDoMtx_stack_c::transS(proj.x, proj.y, proj.z);
|
||||
mDoMtx_stack_c::scaleM(32.0f, 32.0f, 32.0f);
|
||||
mDoMtx_copy(mDoMtx_stack_c::get(), mProjMtx);
|
||||
|
||||
+17
-13
@@ -1,21 +1,22 @@
|
||||
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/J2DGraph/J2DScreen.h"
|
||||
#include "JSystem/J2DGraph/J2DTextBox.h"
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "JSystem/JKernel/JKRMemArchive.h"
|
||||
#include "d/actor/d_a_title.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/d_demo.h"
|
||||
#include "d/d_menu_collect.h"
|
||||
#include "d/d_pane_class_alpha.h"
|
||||
#include "d/d_s_logo.h"
|
||||
#include "d/d_s_play.h"
|
||||
#include "d/d_demo.h"
|
||||
#include "d/d_pane_class_alpha.h"
|
||||
#include "d/d_menu_collect.h"
|
||||
#include "dusk/version.hpp"
|
||||
#include "f_op/f_op_msg_mng.h"
|
||||
#include "f_op/f_op_overlap_mng.h"
|
||||
#include "f_op/f_op_scene_mng.h"
|
||||
#include "m_Do/m_Do_Reset.h"
|
||||
#include "m_Do/m_Do_controller_pad.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "f_op/f_op_overlap_mng.h"
|
||||
#include "f_op/f_op_msg_mng.h"
|
||||
#include "f_op/f_op_scene_mng.h"
|
||||
#include "JSystem/J2DGraph/J2DScreen.h"
|
||||
#include "JSystem/JKernel/JKRMemArchive.h"
|
||||
#include "JSystem/J2DGraph/J2DTextBox.h"
|
||||
#include "m_Do/m_Do_graphic.h"
|
||||
|
||||
#ifdef TARGET_PC
|
||||
@@ -49,7 +50,10 @@ static u8 const lit_3772[12] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
#if VERSION == VERSION_GCN_PAL
|
||||
#if TARGET_PC
|
||||
using namespace dusk::version;
|
||||
#define l_arcName versionSelect<const char*>({{GameVersion::GcnPal, "TitlePal"}}, "Title")
|
||||
#elif VERSION == VERSION_GCN_PAL
|
||||
static char const l_arcName[] = "TitlePal";
|
||||
#else
|
||||
static char const l_arcName[] = "Title";
|
||||
@@ -59,7 +63,7 @@ daTit_HIO_c::daTit_HIO_c() {
|
||||
mPSScaleX = 1.0f;
|
||||
mPSScaleY = 1.0f;
|
||||
|
||||
#if VERSION == VERSION_GCN_PAL
|
||||
#if TARGET_PC || VERSION == VERSION_GCN_PAL
|
||||
switch (OSGetLanguage()) {
|
||||
case OS_LANGUAGE_ENGLISH:
|
||||
case OS_LANGUAGE_GERMAN:
|
||||
|
||||
+32
-34
@@ -7,17 +7,13 @@
|
||||
|
||||
#include "dusk/frame_interpolation.h"
|
||||
|
||||
#if TARGET_PC
|
||||
const u16 l_J_Ohana00_64TEX__width = 64;
|
||||
const u16 l_J_Ohana00_64TEX__height = 64;
|
||||
#else
|
||||
const u16 l_J_Ohana00_64TEX__width = 63;
|
||||
const u16 l_J_Ohana00_64TEX__height = 63;
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/dvd_asset.hpp"
|
||||
static u8* l_J_Ohana00_64TEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x9060, 0x800), true); return buf; }
|
||||
using GameVersion = dusk::version::GameVersion;
|
||||
static u8* l_J_Ohana00_64TEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9060}, {GameVersion::GcnPal, 0x9060}}, 0x800), true); return buf; }
|
||||
#define l_J_Ohana00_64TEX (l_J_Ohana00_64TEX_get())
|
||||
#else
|
||||
#include "assets/l_J_Ohana00_64TEX.h"
|
||||
@@ -113,10 +109,12 @@ static u8 l_flowerTexCoord[] = {
|
||||
0x3E, 0xA7, 0x72, 0xD6, 0xBD, 0x2F, 0x46, 0xAA};
|
||||
|
||||
#if TARGET_PC
|
||||
static u8* l_J_hana00DL_get() { static u8 buf[0x150]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x9D20, 0x150), true); return buf; }
|
||||
static u8* l_J_hana00_cDL_get() { static u8 buf[0xDE]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x9E80, 0xDE), true); return buf; }
|
||||
static u8* l_matDL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x9F60, 0x99), true); return buf; }
|
||||
static u8* l_matLight4DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0xA000, 0x99), true); return buf; }
|
||||
using GameVersion = dusk::version::GameVersion;
|
||||
|
||||
static u8* l_J_hana00DL_get() { static u8 buf[0x150]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9D20}, {GameVersion::GcnPal, 0x9D20}}, 0x150), true); return buf; }
|
||||
static u8* l_J_hana00_cDL_get() { static u8 buf[0xDE]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9E80}, {GameVersion::GcnPal, 0x9E80}}, 0xDE), true); return buf; }
|
||||
static u8* l_matDL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9F60}, {GameVersion::GcnPal, 0x9F60}}, 0x99), true); return buf; }
|
||||
static u8* l_matLight4DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xA000}, {GameVersion::GcnPal, 0xA000}}, 0x99), true); return buf; }
|
||||
#define l_J_hana00DL (l_J_hana00DL_get())
|
||||
#define l_J_hana00_cDL (l_J_hana00_cDL_get())
|
||||
#define l_matDL (l_matDL_get())
|
||||
@@ -133,16 +131,12 @@ l_matDL__d_a_grass(l_J_Ohana00_64TEX)
|
||||
l_matLight4DL(l_J_Ohana00_64TEX)
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
const u16 l_J_Ohana01_64128_0419TEX__width = 64;
|
||||
const u16 l_J_Ohana01_64128_0419TEX__height = 128;
|
||||
#else
|
||||
const u16 l_J_Ohana01_64128_0419TEX__width = 63;
|
||||
const u16 l_J_Ohana01_64128_0419TEX__height = 127;
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
static u8* l_J_Ohana01_64128_0419TEX_get() { static u8 buf[0x1000]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0xA0A0, 0x1000), true); return buf; }
|
||||
using GameVersion = dusk::version::GameVersion;
|
||||
static u8* l_J_Ohana01_64128_0419TEX_get() { static u8 buf[0x1000]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xA0A0}, {GameVersion::GcnPal, 0xA0A0}}, 0x1000), true); return buf; }
|
||||
#define l_J_Ohana01_64128_0419TEX (l_J_Ohana01_64128_0419TEX_get())
|
||||
#else
|
||||
#include "assets/l_J_Ohana01_64128_0419TEX.h"
|
||||
@@ -274,11 +268,13 @@ static u8 l_flowerTexCoord2[] = {
|
||||
0x40, 0x1B, 0x7D, 0x52, 0x3F, 0x80, 0x3F, 0x79, 0x40, 0x1B, 0x7D, 0x52, 0x3F, 0x51, 0x10, 0x6F};
|
||||
|
||||
#if TARGET_PC
|
||||
static u8* l_J_hana01DL_get() { static u8 buf[0x138]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0xB7C0, 0x138), true); return buf; }
|
||||
static u8* l_J_hana01_c_00DL_get() { static u8 buf[0xDE]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0xB900, 0xDE), true); return buf; }
|
||||
static u8* l_J_hana01_c_01DL_get() { static u8 buf[0x128]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0xB9E0, 0x128), true); return buf; }
|
||||
static u8* l_mat2DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0xBB20, 0x99), true); return buf; }
|
||||
static u8* l_mat2Light4DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0xBBC0, 0x99), true); return buf; }
|
||||
using GameVersion = dusk::version::GameVersion;
|
||||
|
||||
static u8* l_J_hana01DL_get() { static u8 buf[0x138]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xB7C0}, {GameVersion::GcnPal, 0xB7C0}}, 0x138), true); return buf; }
|
||||
static u8* l_J_hana01_c_00DL_get() { static u8 buf[0xDE]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xB900}, {GameVersion::GcnPal, 0xB900}}, 0xDE), true); return buf; }
|
||||
static u8* l_J_hana01_c_01DL_get() { static u8 buf[0x128]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xB9E0}, {GameVersion::GcnPal, 0xB9E0}}, 0x128), true); return buf; }
|
||||
static u8* l_mat2DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xBB20}, {GameVersion::GcnPal, 0xBB20}}, 0x99), true); return buf; }
|
||||
static u8* l_mat2Light4DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xBBC0}, {GameVersion::GcnPal, 0xBBC0}}, 0x99), true); return buf; }
|
||||
#define l_J_hana01DL (l_J_hana01DL_get())
|
||||
#define l_J_hana01_c_00DL (l_J_hana01_c_00DL_get())
|
||||
#define l_J_hana01_c_01DL (l_J_hana01_c_01DL_get())
|
||||
@@ -586,11 +582,11 @@ dFlower_packet_c::dFlower_packet_c() {
|
||||
|
||||
#if TARGET_PC
|
||||
GXInitTexObj(&mTexObj_l_J_Ohana00_64TEX, l_J_Ohana00_64TEX,
|
||||
l_J_Ohana00_64TEX__width, l_J_Ohana00_64TEX__height, GX_TF_CMPR, GX_MIRROR, GX_MIRROR, GX_FALSE
|
||||
l_J_Ohana00_64TEX__width + 1, l_J_Ohana00_64TEX__height + 1, GX_TF_CMPR, GX_MIRROR, GX_MIRROR, GX_FALSE
|
||||
);
|
||||
|
||||
GXInitTexObj(&mTexObj_l_J_Ohana01_64128_0419TEX, l_J_Ohana01_64128_0419TEX,
|
||||
l_J_Ohana01_64128_0419TEX__width, l_J_Ohana01_64128_0419TEX__height, GX_TF_CMPR, GX_MIRROR, GX_MIRROR, GX_FALSE
|
||||
l_J_Ohana01_64128_0419TEX__width + 1, l_J_Ohana01_64128_0419TEX__height + 1, GX_TF_CMPR, GX_MIRROR, GX_MIRROR, GX_FALSE
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -699,14 +695,14 @@ void dFlower_packet_c::draw() {
|
||||
if (!cLib_checkBit<u8>(sp44->m_state, 4) && !cLib_checkBit<u8>(sp44->m_state, 0x40)) {
|
||||
#ifdef TARGET_PC
|
||||
Mtx flower_mtx;
|
||||
if (dusk::frame_interp::lookup_replacement(reinterpret_cast<const void*>(&sp44->m_modelMtx), flower_mtx)) {
|
||||
if (dusk::frame_interp::lookup_replacement(&sp44->m_modelMtx, flower_mtx)) {
|
||||
cMtx_concat(j3dSys.getViewMtx(), flower_mtx, flower_mtx);
|
||||
GXLoadPosMtxImm(flower_mtx, 0);
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
GXLoadPosMtxImm(sp44->m_modelMtx, 0);
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
#endif
|
||||
GXLoadNrmMtxImm(j3dSys.getViewMtx(), 0);
|
||||
|
||||
#if TARGET_PC
|
||||
@@ -789,6 +785,10 @@ void dFlower_packet_c::draw() {
|
||||
|
||||
GXColor sp28;
|
||||
|
||||
#if AVOID_UB
|
||||
sp28 = {1, 1, 1, 1};
|
||||
#endif
|
||||
|
||||
//u8 sp26, sp25, sp24;
|
||||
GXColor sp24;
|
||||
sp24.r = -0.4f * temp_r29->AmbCol.r * var_f29;
|
||||
@@ -854,20 +854,18 @@ void dFlower_packet_c::draw() {
|
||||
if (!cLib_checkBit<u8>(sp34->m_state, 4) && cLib_checkBit<u8>(sp34->m_state, 0x40)) {
|
||||
#ifdef TARGET_PC
|
||||
Mtx flower_mtx;
|
||||
if (dusk::frame_interp::lookup_replacement(reinterpret_cast<const void*>(&sp34->m_modelMtx), flower_mtx)) {
|
||||
if (dusk::frame_interp::lookup_replacement(&sp34->m_modelMtx, flower_mtx)) {
|
||||
cMtx_concat(j3dSys.getViewMtx(), flower_mtx, flower_mtx);
|
||||
GXLoadPosMtxImm(flower_mtx, 0);
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
GXLoadPosMtxImm(sp34->m_modelMtx, 0);
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
#endif
|
||||
GXLoadNrmMtxImm(j3dSys.getViewMtx(), 0);
|
||||
|
||||
#if TARGET_PC
|
||||
GXLoadTexObj(&mTexObj_l_J_Ohana01_64128_0419TEX, GX_TEXMAP0);
|
||||
#endif
|
||||
|
||||
if (!cLib_checkBit<u8>(sp34->m_state, 8)) {
|
||||
if (!cLib_checkBit<u8>(sp34->m_state, 0x10)) {
|
||||
GXCallDisplayList(mp_Jhana01DL, m_Jhana01DL_size);
|
||||
@@ -994,7 +992,7 @@ void dFlower_packet_c::update() {
|
||||
mDoMtx_stack_c::scaleM(temp_f31, temp_f31, temp_f31);
|
||||
cMtx_concat(j3dSys.getViewMtx(), temp_r28, data_p->m_modelMtx);
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(&data_p->m_modelMtx), data_p->m_modelMtx);
|
||||
dusk::frame_interp::record_final_mtx(temp_r28, data_p->m_modelMtx);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
+21
-20
@@ -20,8 +20,9 @@ const u16 l_M_kusa05_RGBATEX__height = 31;
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/dvd_asset.hpp"
|
||||
static u8* l_M_kusa05_RGBATEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x7680, 0x800), true); return buf; }
|
||||
static u8* l_M_Hijiki00TEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x7E80, 0x800), true); return buf; }
|
||||
using GameVersion = dusk::version::GameVersion;
|
||||
static u8* l_M_kusa05_RGBATEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x7680}, {GameVersion::GcnPal, 0x7680}}, 0x800), true); return buf; }
|
||||
static u8* l_M_Hijiki00TEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x7E80}, {GameVersion::GcnPal, 0x7E80}}, 0x800), true); return buf; }
|
||||
#define l_M_kusa05_RGBATEX (l_M_kusa05_RGBATEX_get())
|
||||
#define l_M_Hijiki00TEX (l_M_Hijiki00TEX_get())
|
||||
#else
|
||||
@@ -113,12 +114,14 @@ static u8 l_texCoord[160] = {
|
||||
};
|
||||
|
||||
#if TARGET_PC
|
||||
static u8* l_M_Kusa_9qDL_get() { static u8 buf[0xCB]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x8B00, 0xCB), true); return buf; }
|
||||
static u8* l_M_Kusa_9q_cDL_get() { static u8 buf[0xCB]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x8BE0, 0xCB), true); return buf; }
|
||||
static u8* l_M_TenGusaDL_get() { static u8 buf[0xD4]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x8CC0, 0xD4), true); return buf; }
|
||||
static u8* l_Tengusa_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x8DA0, 0xA8), true); return buf; }
|
||||
static u8* l_kusa9q_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x8E60, 0xA8), true); return buf; }
|
||||
static u8* l_kusa9q_l4_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x8F20, 0xA8), true); return buf; }
|
||||
using GameVersion = dusk::version::GameVersion;
|
||||
|
||||
static u8* l_M_Kusa_9qDL_get() { static u8 buf[0xCB]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8B00}, {GameVersion::GcnPal, 0x8B00}}, 0xCB), true); return buf; }
|
||||
static u8* l_M_Kusa_9q_cDL_get() { static u8 buf[0xCB]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8BE0}, {GameVersion::GcnPal, 0x8BE0}}, 0xCB), true); return buf; }
|
||||
static u8* l_M_TenGusaDL_get() { static u8 buf[0xD4]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8CC0}, {GameVersion::GcnPal, 0x8CC0}}, 0xD4), true); return buf; }
|
||||
static u8* l_Tengusa_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8DA0}, {GameVersion::GcnPal, 0x8DA0}}, 0xA8), true); return buf; }
|
||||
static u8* l_kusa9q_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8E60}, {GameVersion::GcnPal, 0x8E60}}, 0xA8), true); return buf; }
|
||||
static u8* l_kusa9q_l4_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8F20}, {GameVersion::GcnPal, 0x8F20}}, 0xA8), true); return buf; }
|
||||
#define l_M_Kusa_9qDL (l_M_Kusa_9qDL_get())
|
||||
#define l_M_Kusa_9q_cDL (l_M_Kusa_9q_cDL_get())
|
||||
#define l_M_TenGusaDL (l_M_TenGusaDL_get())
|
||||
@@ -491,11 +494,11 @@ dGrass_packet_c::dGrass_packet_c() {
|
||||
|
||||
#if TARGET_PC
|
||||
GXInitTexObj(&mTexObj_l_M_kusa05_RGBATEX, l_M_kusa05_RGBATEX,
|
||||
l_M_kusa05_RGBATEX__width, l_M_kusa05_RGBATEX__height, GX_TF_RGB5A3, GX_REPEAT, GX_CLAMP, GX_FALSE
|
||||
l_M_kusa05_RGBATEX__width + 1, l_M_kusa05_RGBATEX__height + 1, GX_TF_RGB5A3, GX_REPEAT, GX_CLAMP, GX_FALSE
|
||||
);
|
||||
|
||||
GXInitTexObj(&mTexObj_l_M_Hijiki00TEX, l_M_Hijiki00TEX,
|
||||
l_M_Hijiki00TEX__width, l_M_Hijiki00TEX__height, GX_TF_RGB5A3, GX_REPEAT, GX_CLAMP, GX_FALSE
|
||||
l_M_Hijiki00TEX__width + 1, l_M_Hijiki00TEX__height + 1, GX_TF_RGB5A3, GX_REPEAT, GX_CLAMP, GX_FALSE
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -643,18 +646,14 @@ void dGrass_packet_c::draw() {
|
||||
}
|
||||
|
||||
if (var_r29->field_0x05 <= 3 || var_r29->field_0x05 >= 10) {
|
||||
#if TARGET_PC
|
||||
GXLoadTexObj(&mTexObj_l_M_kusa05_RGBATEX, GX_TEXMAP0);
|
||||
#endif
|
||||
IF_DUSK(GXLoadTexObj(&mTexObj_l_M_kusa05_RGBATEX, GX_TEXMAP0));
|
||||
if (sp48 <= 3) {
|
||||
GXCallDisplayList(mp_kusa9q_14_DL, m_kusa9q_DL_14_size);
|
||||
} else {
|
||||
GXCallDisplayList(mp_kusa9q_DL, m_kusa9q_DL_size);
|
||||
}
|
||||
} else {
|
||||
#if TARGET_PC
|
||||
GXLoadTexObj(&mTexObj_l_M_Hijiki00TEX, GX_TEXMAP0);
|
||||
#endif
|
||||
IF_DUSK(GXLoadTexObj(&mTexObj_l_M_Hijiki00TEX, GX_TEXMAP0));
|
||||
GXCallDisplayList(l_Tengusa_matDL, 0xA0);
|
||||
}
|
||||
|
||||
@@ -680,12 +679,14 @@ void dGrass_packet_c::draw() {
|
||||
|
||||
while (var_r29 != NULL) {
|
||||
if (var_r29->field_0x05 <= 3 || var_r29->field_0x05 >= 10) {
|
||||
IF_DUSK(GXLoadTexObj(&mTexObj_l_M_kusa05_RGBATEX, GX_TEXMAP0));
|
||||
if (sp48 <= 2) {
|
||||
GXCallDisplayList(mp_kusa9q_14_DL, m_kusa9q_DL_14_size);
|
||||
} else {
|
||||
GXCallDisplayList(mp_kusa9q_DL, m_kusa9q_DL_size);
|
||||
}
|
||||
} else {
|
||||
IF_DUSK(GXLoadTexObj(&mTexObj_l_M_Hijiki00TEX, GX_TEXMAP0));
|
||||
GXCallDisplayList(l_Tengusa_matDL, 0xA0);
|
||||
}
|
||||
|
||||
@@ -756,13 +757,13 @@ void dGrass_packet_c::draw() {
|
||||
#ifdef TARGET_PC
|
||||
Mtx grass_mtx;
|
||||
if (dusk::frame_interp::lookup_replacement(reinterpret_cast<const void*>(&var_r29->m_modelMtx), grass_mtx)) {
|
||||
cMtx_concat(j3dSys.getViewMtx(), grass_mtx, grass_mtx);
|
||||
GXLoadPosMtxImm(grass_mtx, 0);
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
GXLoadPosMtxImm(var_r29->m_modelMtx, 0);
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
#endif
|
||||
GXLoadNrmMtxImm(j3dSys.getViewMtx(), 0);
|
||||
if (var_r29->field_0x05 <= 3 || var_r29->field_0x05 >= 10) {
|
||||
if (var_r29->field_0x02 < -1) {
|
||||
@@ -1018,7 +1019,7 @@ void dGrass_packet_c::update() {
|
||||
cMtx_concat(j3dSys.getViewMtx(), mDoMtx_stack_c::get(), data_p->m_modelMtx);
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(&data_p->m_modelMtx), data_p->m_modelMtx);
|
||||
dusk::frame_interp::record_final_mtx(mDoMtx_stack_c::get(), data_p->m_modelMtx);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "JSystem/J2DGraph/J2DScreen.h"
|
||||
#include "JSystem/J2DGraph/J2DTextBox.h"
|
||||
#include "d/d_msg_string.h"
|
||||
#include "dusk/livesplit.h"
|
||||
#include "dusk/imgui/ImGuiConsole.hpp"
|
||||
#include "m_Do/m_Do_controller_pad.h"
|
||||
|
||||
dBrightCheck_c::dBrightCheck_c(JKRArchive* i_archive) {
|
||||
@@ -138,6 +140,17 @@ void dBrightCheck_c::modeWait() {}
|
||||
void dBrightCheck_c::modeMove() {
|
||||
if (mDoCPd_c::getTrigA(PAD_1) || mDoCPd_c::getTrigStart(PAD_1)) {
|
||||
mDoAud_seStart(Z2SE_ENTER_GAME, NULL, 0, 0);
|
||||
#ifdef TARGET_PC
|
||||
dusk::speedrun::start();
|
||||
|
||||
if (dusk::getSettings().game.speedrunMode && !dusk::getSettings().game.hideTvSettingsScreen) {
|
||||
// start a new run if a run isn't already in progress
|
||||
if (!dusk::m_speedrunInfo.m_isRunStarted) {
|
||||
dusk::ImGuiMenuGame::resetForSpeedrunMode();
|
||||
dusk::m_speedrunInfo.startRun();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
mCompleteCheck = true;
|
||||
mMode = MODE_WAIT_e;
|
||||
}
|
||||
@@ -147,7 +160,7 @@ void dBrightCheck_c::modeMove() {
|
||||
void dBrightCheck_c::brightCheckWide() {
|
||||
// Main Canvas
|
||||
mBrightCheck.Scr->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f);
|
||||
mBrightCheck.Scr->translate(mDoGph_gInf_c::getMinXF(), 0.0f);
|
||||
mBrightCheck.Scr->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f);
|
||||
|
||||
// Right Square
|
||||
mBrightCheck.Scr->search(MULTI_CHAR('fuchi_1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
|
||||
+83
-3
@@ -800,6 +800,10 @@ void dCamera_c::updatePad() {
|
||||
}
|
||||
|
||||
mLockLActive = 1;
|
||||
|
||||
#if TARGET_PC
|
||||
mCamParam.mManualMode = 0;
|
||||
#endif
|
||||
} else {
|
||||
mLockLJustActivated = 0;
|
||||
mLockLActive = 0;
|
||||
@@ -833,6 +837,12 @@ void dCamera_c::updatePad() {
|
||||
mHoldB = mDoCPd_c::getHoldB(mPadID) ? true : false;
|
||||
mTrigB = mDoCPd_c::getTrigB(mPadID) ? true : false;
|
||||
|
||||
#if TARGET_PC
|
||||
if (mCamParam.mManualMode) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool sp6B = true;
|
||||
bool sp6C = true;
|
||||
int temp1;
|
||||
@@ -1167,6 +1177,13 @@ bool dCamera_c::Run() {
|
||||
}
|
||||
} else {
|
||||
sp0F = (this->*engine_tbl[mCamParam.Algorythmn(mCamStyle)])(mCamStyle);
|
||||
|
||||
#if TARGET_PC
|
||||
if (mCamParam.Algorythmn(mCamStyle) != 1) {
|
||||
mCamParam.mManualMode = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
field_0x170++;
|
||||
field_0x160++;
|
||||
mCurCamStyleTimer++;
|
||||
@@ -3078,6 +3095,11 @@ bool dCamera_c::bumpCheck(u32 i_flags) {
|
||||
} else {
|
||||
field_0x968 *= mMonitor.field_0xc / 5.0f;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (!dusk::getSettings().game.freeCamera || !mCamParam.mManualMode) {
|
||||
#endif
|
||||
|
||||
f32 tmp = field_0x96c * (mIsWolf == 1 ? 30.0f : 30.0f);
|
||||
center += vec3.norm() * (tmp * globe.V().Sin());
|
||||
cSGlobe globe2(vec2 - center);
|
||||
@@ -3091,6 +3113,10 @@ bool dCamera_c::bumpCheck(u32 i_flags) {
|
||||
vec = lin_chk1.GetCross();
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
}
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
if (mCamSetup.CheckFlag(0x8000)) {
|
||||
dDbVw_Report(20, 235, " U");
|
||||
@@ -4604,6 +4630,11 @@ bool dCamera_c::chaseCamera(s32 param_0) {
|
||||
|
||||
sp110 = mViewCache.mDirection.R();
|
||||
mViewCache.mDirection.R(mViewCache.mDirection.R() + (fVar55 - mViewCache.mDirection.R()) * chase->field_0x74);
|
||||
|
||||
#if TARGET_PC
|
||||
freeCamera();
|
||||
#endif
|
||||
|
||||
chase->field_0x64 = mViewCache.mCenter + mViewCache.mDirection.Xyz();
|
||||
mViewCache.mEye = chase->field_0x64;
|
||||
|
||||
@@ -7063,6 +7094,15 @@ bool dCamera_c::subjectCamera(s32 param_0) {
|
||||
}
|
||||
|
||||
cXyz sp1E0(val0, val2, val1);
|
||||
|
||||
#if TARGET_PC
|
||||
f32 aspect = mDoGph_gInf_c::getAspect();
|
||||
f32 baseAspect = FB_WIDTH / FB_HEIGHT;
|
||||
if (aspect > baseAspect) {
|
||||
sp1E0.z += (aspect - baseAspect) * 4;
|
||||
}
|
||||
#endif
|
||||
|
||||
sp1D4 = dCamMath::xyzRotateX(sp1E0, angle_x);
|
||||
sp1E0 = dCamMath::xyzRotateY(sp1D4, angle_y);
|
||||
f32 sp6C = sp12 ? 40.0f : 0.0f;
|
||||
@@ -7435,6 +7475,40 @@ bool dCamera_c::test2Camera(s32 param_0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
bool dCamera_c::freeCamera() {
|
||||
if (!dusk::getSettings().game.freeCamera) {
|
||||
mCamParam.mManualMode = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
cXyz camMovement = {mPadInfo.mCStick.mLastPosX, mPadInfo.mCStick.mLastPosY, 0.0f};
|
||||
f32 magnitude = sqrt(mPadInfo.mCStick.mLastPosX * mPadInfo.mCStick.mLastPosX + mPadInfo.mCStick.mLastPosY * mPadInfo.mCStick.mLastPosY);
|
||||
|
||||
if (mPadInfo.mCStick.mLastPosX != 0 || mPadInfo.mCStick.mLastPosY != 0) {
|
||||
if (!mCamParam.mManualMode) {
|
||||
mCamParam.mManualMode = 1;
|
||||
mCamParam.freeXAngle = mViewCache.mDirection.mAzimuth.Degree();
|
||||
mCamParam.freeYAngle = mViewCache.mDirection.mInclination.Degree();
|
||||
}
|
||||
|
||||
camMovement = camMovement.normalize();
|
||||
camMovement.y *= dusk::getSettings().game.invertCameraYAxis ? 1.0f : -1.0f;
|
||||
mCamParam.freeXAngle += camMovement.x * magnitude * dusk::getSettings().game.freeCameraSensitivity * 4.0f;
|
||||
mCamParam.freeYAngle += camMovement.y * magnitude * dusk::getSettings().game.freeCameraSensitivity * 4.0f;
|
||||
}
|
||||
|
||||
if (mCamParam.mManualMode) {
|
||||
mCamParam.freeYAngle = std::clamp(mCamParam.freeYAngle, -35.0f, 60.0f);
|
||||
mViewCache.mDirection.mAzimuth = cSAngle(mCamParam.freeXAngle);
|
||||
mViewCache.mDirection.mInclination = cSAngle(mCamParam.freeYAngle);
|
||||
mViewCache.mDirection.mRadius = std::clamp((mCamParam.freeYAngle + 35.0f) * 10.0f, 300.0f, 10000.0f);
|
||||
}
|
||||
|
||||
return mCamParam.mManualMode;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool dCamera_c::towerCamera(s32 param_0) {
|
||||
cSAngle stack_444 = cSAngle(mCamSetup.ChargeLatitude());
|
||||
f32 sp224 = mCamSetup.ChargeBRatio();
|
||||
@@ -11009,6 +11083,15 @@ static int camera_execute(camera_process_class* i_this) {
|
||||
i_this->mCamera.CalcTrimSize();
|
||||
|
||||
store(i_this);
|
||||
|
||||
#ifdef TARGET_PC
|
||||
// record new camera for our sim frame
|
||||
dusk::frame_interp::record_camera(i_this, get_camera_id(i_this));
|
||||
// interpolate the view now so that this sim frame's view matrix matches what
|
||||
// we'll be rendering with later
|
||||
dusk::frame_interp::interp_view(&i_this->view);
|
||||
#endif
|
||||
|
||||
view_setup(i_this);
|
||||
return 1;
|
||||
}
|
||||
@@ -11077,9 +11160,6 @@ static int camera_draw(camera_process_class* i_this) {
|
||||
C_MTXPerspective(process->view.projMtx, process->view.fovy, process->view.aspect, process->view.near_, process->view.far_);
|
||||
mDoMtx_lookAt(process->view.viewMtx, &process->view.lookat.eye, &process->view.lookat.center,
|
||||
&process->view.lookat.up, process->view.bank);
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::record_camera(process, camera_id);
|
||||
#endif
|
||||
|
||||
#if WIDESCREEN_SUPPORT
|
||||
mDoGph_gInf_c::setWideZoomProjection(process->view.projMtx);
|
||||
|
||||
+25
-33
@@ -1096,16 +1096,7 @@ void dDlst_shadowReal_c::draw() {
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
|
||||
GXSetCurrentMtx(GX_PNMTX0);
|
||||
#ifdef TARGET_PC
|
||||
Mtx receiver_proj_mtx;
|
||||
if (dusk::frame_interp::lookup_replacement(&mReceiverProjMtx, receiver_proj_mtx)) {
|
||||
GXLoadTexMtxImm(receiver_proj_mtx, GX_TEXMTX0, GX_MTX3x4);
|
||||
} else {
|
||||
#endif
|
||||
GXLoadTexMtxImm(mReceiverProjMtx, GX_TEXMTX0, GX_MTX3x4);
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
#endif
|
||||
GXLoadTexMtxImm(mReceiverProjMtx, GX_TEXMTX0, GX_MTX3x4);
|
||||
mShadowRealPoly.draw();
|
||||
}
|
||||
|
||||
@@ -1263,14 +1254,9 @@ u8 dDlst_shadowReal_c::setShadowRealMtx(cXyz* param_0, cXyz* param_1, f32 param_
|
||||
C_MTXOrtho(mRenderProjMtx, param_2, -param_2, -param_2, param_2, 1.0f, 10000.0f);
|
||||
C_MTXLightOrtho(mReceiverProjMtx, param_2, -param_2, -param_2, param_2, 0.5f, -0.5f, 0.5f, 0.5f);
|
||||
cMtx_concat(mReceiverProjMtx, mViewMtx, mReceiverProjMtx);
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::record_final_mtx_raw(&mViewMtx, mViewMtx);
|
||||
dusk::frame_interp::record_final_mtx_raw(&mReceiverProjMtx, mReceiverProjMtx);
|
||||
#endif
|
||||
return r29;
|
||||
}
|
||||
|
||||
|
||||
u32 dDlst_shadowReal_c::set(u32 i_key, J3DModel* i_model, cXyz* param_2, f32 param_3, f32 param_4,
|
||||
dKy_tevstr_c* param_5, f32 i_cameraZ, f32 param_7) {
|
||||
dScnKy_env_light_c* env_light = dKy_getEnvlight();
|
||||
@@ -1292,6 +1278,7 @@ u32 dDlst_shadowReal_c::set(u32 i_key, J3DModel* i_model, cXyz* param_2, f32 par
|
||||
}
|
||||
|
||||
field_0x1 = setShadowRealMtx(&sp60, param_2, param_3, param_4, param_7, param_5);
|
||||
|
||||
if (!field_0x1) {
|
||||
return 0;
|
||||
}
|
||||
@@ -1331,14 +1318,14 @@ void dDlst_shadowSimple_c::draw() {
|
||||
GXSetVtxDesc(GX_VA_POS, GX_INDEX8);
|
||||
#ifdef TARGET_PC
|
||||
Mtx volume_mtx;
|
||||
if (dusk::frame_interp::lookup_replacement(&mVolumeMtx, volume_mtx)) {
|
||||
if (dusk::frame_interp::lookup_replacement(mVolumeMtxKey, volume_mtx)) {
|
||||
cMtx_concat(j3dSys.getViewMtx(), volume_mtx, volume_mtx);
|
||||
GXLoadPosMtxImm(volume_mtx, GX_PNMTX0);
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
GXLoadPosMtxImm(mVolumeMtx, GX_PNMTX0);
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
#endif
|
||||
GXSetCurrentMtx(GX_PNMTX0);
|
||||
GXCallDisplayList(l_frontMat, 0x40);
|
||||
GXCallDisplayList(l_shadowVolumeDL, 0x40);
|
||||
@@ -1346,14 +1333,14 @@ void dDlst_shadowSimple_c::draw() {
|
||||
GXCallDisplayList(l_shadowVolumeDL, 0x40);
|
||||
#ifdef TARGET_PC
|
||||
Mtx shadow_mtx;
|
||||
if (dusk::frame_interp::lookup_replacement(&mMtx, shadow_mtx)) {
|
||||
if (dusk::frame_interp::lookup_replacement(mMtxKey, shadow_mtx)) {
|
||||
cMtx_concat(j3dSys.getViewMtx(), shadow_mtx, shadow_mtx);
|
||||
GXLoadPosMtxImm(shadow_mtx, GX_PNMTX1);
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
GXLoadPosMtxImm(mMtx, GX_PNMTX1);
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
#endif
|
||||
GXSetCurrentMtx(GX_PNMTX1);
|
||||
|
||||
if (mpTexObj != NULL) {
|
||||
@@ -1383,6 +1370,12 @@ void dDlst_shadowSimple_c::draw() {
|
||||
GXCallDisplayList(l_shadowVolumeDL, 0x40);
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
static const void* getInterpKey(const void* base, int idx) {
|
||||
return reinterpret_cast<const void*>(reinterpret_cast<uintptr_t>(base) ^ idx);
|
||||
}
|
||||
#endif
|
||||
|
||||
void dDlst_shadowSimple_c::set(cXyz* param_0, f32 param_1, f32 param_2, cXyz* param_3,
|
||||
s16 param_4, f32 param_5, TGXTexObj* param_6) {
|
||||
if (param_5 < 0.0f) {
|
||||
@@ -1406,6 +1399,10 @@ void dDlst_shadowSimple_c::set(cXyz* param_0, f32 param_1, f32 param_2, cXyz* pa
|
||||
mDoMtx_stack_c::transS(param_0->x, param_1 + f30, param_0->z);
|
||||
mDoMtx_stack_c::YrotM(param_4);
|
||||
mDoMtx_stack_c::scaleM(param_2, f30 + f30 + 16.0f, param_2 * param_5);
|
||||
#if TARGET_PC
|
||||
mVolumeMtxKey = getInterpKey(param_0, 0x1);
|
||||
dusk::frame_interp::record_final_mtx(mDoMtx_stack_c::get(), mVolumeMtxKey);
|
||||
#endif
|
||||
cMtx_concat(j3dSys.getViewMtx(), mDoMtx_stack_c::get(), mVolumeMtx);
|
||||
f32 f31 = JMAFastSqrt(1.0f - param_3->x * param_3->x);
|
||||
f32 f29;
|
||||
@@ -1431,17 +1428,11 @@ void dDlst_shadowSimple_c::set(cXyz* param_0, f32 param_1, f32 param_2, cXyz* pa
|
||||
mDoMtx_stack_c::get()[2][3] = param_0->z;
|
||||
mDoMtx_stack_c::YrotM(param_4);
|
||||
mDoMtx_stack_c::scaleM(param_2, 1.0f, param_2 * param_5);
|
||||
cMtx_concat(j3dSys.getViewMtx(), mDoMtx_stack_c::get(), mMtx);
|
||||
#ifdef TARGET_PC
|
||||
const uint64_t shadow_tag_base = dusk::frame_interp::alloc_simple_shadow_pair_base();
|
||||
if (shadow_tag_base != 0) {
|
||||
dusk::frame_interp::record_final_mtx_raw_tagged(&mVolumeMtx, mVolumeMtx, shadow_tag_base);
|
||||
dusk::frame_interp::record_final_mtx_raw_tagged(&mMtx, mMtx, shadow_tag_base + 1u);
|
||||
} else {
|
||||
dusk::frame_interp::record_final_mtx_raw(&mVolumeMtx, mVolumeMtx);
|
||||
dusk::frame_interp::record_final_mtx_raw(&mMtx, mMtx);
|
||||
}
|
||||
mMtxKey = getInterpKey(param_0, 0x2);
|
||||
dusk::frame_interp::record_final_mtx(mDoMtx_stack_c::get(), mMtxKey);
|
||||
#endif
|
||||
cMtx_concat(j3dSys.getViewMtx(), mDoMtx_stack_c::get(), mMtx);
|
||||
mpTexObj = param_6;
|
||||
}
|
||||
|
||||
@@ -1544,9 +1535,10 @@ void dDlst_shadowControl_c::imageDraw(Mtx param_0) {
|
||||
#ifdef TARGET_PC
|
||||
GXCreateFrameBuffer(r26, r26);
|
||||
needsRestore = true;
|
||||
#endif
|
||||
#else
|
||||
GXSetViewport(0.0f, 0.0f, r26, r26, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, r26, r26);
|
||||
#endif
|
||||
}
|
||||
GXSetTevColor(GX_TEVREG0, l_imageDrawColor[chan]);
|
||||
if (chan == 3) {
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "dusk/version.hpp"
|
||||
|
||||
dFile_info_c::dFile_info_c(JKRArchive* i_archive, u8 param_1) {
|
||||
mArchive = i_archive;
|
||||
field_0x22 = param_1;
|
||||
@@ -169,7 +171,18 @@ void dFile_info_c::setSaveDate(dSv_save_c* i_savedata) {
|
||||
OSCalendarTime time;
|
||||
OSTicksToCalendarTime(i_savedata->getPlayer().getPlayerStatusB().getDateIpl(), &time);
|
||||
|
||||
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
|
||||
#if TARGET_PC
|
||||
if (dusk::version::isRegionJpn()) {
|
||||
sprintf(mSaveDate, "%d.%02d.%02d %02d:%02d", time.year, time.mon + 1, time.mday,
|
||||
time.hour, time.min);
|
||||
} else if (dusk::version::isRegionPal() && dComIfGs_getPalLanguage() != dSv_player_config_c::LANGUAGE_ENGLISH) {
|
||||
sprintf(mSaveDate, "%02d/%02d/%d %02d:%02d", time.mday, time.mon + 1, time.year, time.hour,
|
||||
time.min);
|
||||
} else {
|
||||
sprintf(mSaveDate, "%02d/%02d/%d %02d:%02d", time.mon + 1, time.mday, time.year, time.hour,
|
||||
time.min);
|
||||
}
|
||||
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
|
||||
sprintf(mSaveDate, "%d.%02d.%02d %02d:%02d", time.year, time.mon + 1, time.mday,
|
||||
time.hour, time.min);
|
||||
#elif VERSION == VERSION_GCN_PAL
|
||||
|
||||
+33
-38
@@ -70,11 +70,7 @@ dFs_HIO_c::dFs_HIO_c() {
|
||||
select_icon_appear_frames = 5;
|
||||
appear_display_wait_frames = 15;
|
||||
field_0x000d = 15;
|
||||
#if TARGET_PC
|
||||
card_wait_frames = 0;
|
||||
#else
|
||||
card_wait_frames = 90;
|
||||
#endif
|
||||
test_frame_counts[0] = 1.11f;
|
||||
test_frame_counts[1] = 1.11f;
|
||||
test_frame_counts[2] = 1.11f;
|
||||
@@ -2102,11 +2098,7 @@ void dFile_select_c::yesnoCursorShow() {
|
||||
mSelIcon->setPos(pos.x, pos.y, mYnSelPane[field_0x0268]->getPanePtr(), true);
|
||||
mSelIcon->setAlphaRate(1.0f);
|
||||
|
||||
#if TARGET_PC
|
||||
mSelIcon->setParam(0.96f * mDoGph_gInf_c::hudAspectScaleUp, 0.84f, 0.06f, 0.5f, 0.5f);
|
||||
#else
|
||||
mSelIcon->setParam(0.96f, 0.84f, 0.06f, 0.5f, 0.5f);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2259,11 +2251,7 @@ void dFile_select_c::YesNoCancelMove() {
|
||||
m3mSelPane[mSelectMenuNum]->getPanePtr(), true);
|
||||
mSelIcon->setAlphaRate(1.0f);
|
||||
|
||||
#if TARGET_PC
|
||||
mSelIcon->setParam(0.96f * mDoGph_gInf_c::hudAspectScaleUp, 0.84f, 0.06f, 0.5f, 0.5f);
|
||||
#else
|
||||
mSelIcon->setParam(0.96f, 0.84f, 0.06f, 0.5f, 0.5f);
|
||||
#endif
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
field_0x4333 = mSelectMenuNum;
|
||||
@@ -2375,7 +2363,7 @@ void dFile_select_c::CommandExec() {
|
||||
break;
|
||||
}
|
||||
|
||||
mWaitTimer = g_fsHIO.card_wait_frames;
|
||||
mWaitTimer = IF_DUSK(dusk::getSettings().game.instantSaves ? 0 :) g_fsHIO.card_wait_frames;
|
||||
}
|
||||
|
||||
void dFile_select_c::DataEraseWait() {
|
||||
@@ -3147,11 +3135,7 @@ void dFile_select_c::screenSet() {
|
||||
mSelIcon = JKR_NEW dSelect_cursor_c(0, 1.0f, NULL);
|
||||
JUT_ASSERT(5209, mSelIcon != NULL);
|
||||
|
||||
#if TARGET_PC
|
||||
mSelIcon->setParam(0.96f * mDoGph_gInf_c::hudAspectScaleUp, 0.94f, 0.03f, 0.7f, 0.7f);
|
||||
#else
|
||||
mSelIcon->setParam(0.96f, 0.94f, 0.03f, 0.7f, 0.7f);
|
||||
#endif
|
||||
|
||||
Vec vtxCenter;
|
||||
vtxCenter = mSelFilePanes[mSelectNum]->getGlobalVtxCenter(false, 0);
|
||||
@@ -3204,6 +3188,9 @@ void dFile_select_c::screenSet() {
|
||||
timg, NULL);
|
||||
mpFadePict->setBlackWhite(black, white);
|
||||
mpFadePict->setAlpha(0);
|
||||
#ifdef TARGET_PC
|
||||
mFadeDlst.mpPict = mpFadePict;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -3284,11 +3271,7 @@ void dFile_select_c::screenSetCopySel() {
|
||||
mSelIcon2 = JKR_NEW dSelect_cursor_c(0, 1.0f, NULL);
|
||||
JUT_ASSERT(5406, mSelIcon2 != NULL);
|
||||
|
||||
#if TARGET_PC
|
||||
mSelIcon2->setParam(0.96f * mDoGph_gInf_c::hudAspectScaleUp, 0.94f, 0.03f, 0.7f, 0.7f);
|
||||
#else
|
||||
mSelIcon2->setParam(0.96f, 0.94f, 0.03f, 0.7f, 0.7f);
|
||||
#endif
|
||||
|
||||
Vec center = mCpSelPane[0]->getGlobalVtxCenter(false, 0);
|
||||
mSelIcon2->setPos(center.x, center.y, mCpSelPane[0]->getPanePtr(), true);
|
||||
@@ -3680,11 +3663,7 @@ void dFile_select_c::selFileCursorShow() {
|
||||
mSelIcon->setPos(local_1c.x, local_1c.y, mSelFilePanes[mSelectNum]->getPanePtr(), true);
|
||||
mSelIcon->setAlphaRate(1.0f);
|
||||
|
||||
#if TARGET_PC
|
||||
mSelIcon->setParam(0.96f * mDoGph_gInf_c::hudAspectScaleUp, 0.94f, 0.03f, 0.7f, 0.7f);
|
||||
#else
|
||||
mSelIcon->setParam(0.96f, 0.94f, 0.03f, 0.7f, 0.7f);
|
||||
#endif
|
||||
}
|
||||
|
||||
void dFile_select_c::menuWakuAlpahAnmInit(u8 i_idx, u8 param_1, u8 param_2, u8 param_3) {
|
||||
@@ -3727,11 +3706,7 @@ void dFile_select_c::menuCursorShow() {
|
||||
mSelIcon->setPos(local_24.x, local_24.y, m3mSelPane[mSelectMenuNum]->getPanePtr(), true);
|
||||
mSelIcon->setAlphaRate(1.0f);
|
||||
|
||||
#if TARGET_PC
|
||||
mSelIcon->setParam(0.96f * mDoGph_gInf_c::hudAspectScaleUp, 0.84f, 0.06f, 0.5f, 0.5f);
|
||||
#else
|
||||
mSelIcon->setParam(0.96f, 0.84f, 0.06f, 0.5f, 0.5f);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3776,7 +3751,7 @@ bool dFile_select_c::yesnoWakuAlpahAnm(u8 param_1) {
|
||||
#if TARGET_PC
|
||||
void dFile_select_c::fileSelectWide() {
|
||||
mYnSel.ScrYn->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f);
|
||||
mYnSel.ScrYn->translate(mDoGph_gInf_c::getMinXF(), 0.0f);
|
||||
mYnSel.ScrYn->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f);
|
||||
|
||||
mYnSel.ScrYn->search(MULTI_CHAR('w_no_t'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
mYnSel.ScrYn->search(MULTI_CHAR('f_no_t'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
@@ -3784,7 +3759,7 @@ void dFile_select_c::fileSelectWide() {
|
||||
mYnSel.ScrYn->search(MULTI_CHAR('f_yes_t'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
|
||||
m3mSel.Scr3m->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f);
|
||||
m3mSel.Scr3m->translate(mDoGph_gInf_c::getMinXF(), 0.0f);
|
||||
m3mSel.Scr3m->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f);
|
||||
|
||||
m3mSel.Scr3m->search(MULTI_CHAR('w_sta'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
m3mSel.Scr3m->search(MULTI_CHAR('f_sta'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
@@ -3794,7 +3769,7 @@ void dFile_select_c::fileSelectWide() {
|
||||
m3mSel.Scr3m->search(MULTI_CHAR('f_cop_t'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
|
||||
fileSel.Scr->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f);
|
||||
fileSel.Scr->translate(mDoGph_gInf_c::getMinXF(), 0.0f);
|
||||
fileSel.Scr->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f);
|
||||
|
||||
fileSel.Scr->search(MULTI_CHAR('t_for'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
fileSel.Scr->search(MULTI_CHAR('t_for1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
@@ -3833,6 +3808,16 @@ void dFile_select_c::fileSelectWide() {
|
||||
fileSel.Scr->search(MULTI_CHAR('w_uzu07'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
fileSel.Scr->search(MULTI_CHAR('w_uzu08'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
fileSel.Scr->search(MULTI_CHAR('w_uzu09'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
|
||||
#if TARGET_PC
|
||||
if (mSelIcon) {
|
||||
mSelIcon->refreshAspectScale();
|
||||
}
|
||||
|
||||
if (mSelIcon2) {
|
||||
mSelIcon2->refreshAspectScale();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3871,9 +3856,7 @@ void dFile_select_c::_draw() {
|
||||
|
||||
#if PLATFORM_GCN
|
||||
#if TARGET_PC
|
||||
mpFadePict->draw(0, 0,
|
||||
mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), false, false,
|
||||
false);
|
||||
dComIfGd_set2DOpaTop(&mFadeDlst);
|
||||
#else
|
||||
mpFadePict->draw(mDoGph_gInf_c::getMinXF(), mDoGph_gInf_c::getMinYF(),
|
||||
mDoGph_gInf_c::getWidthF(), mDoGph_gInf_c::getHeightF(), false, false,
|
||||
@@ -3923,6 +3906,13 @@ void dDlst_FileSel3m_c::draw() {
|
||||
Scr3m->draw(0.0f, 0.0f, graf);
|
||||
}
|
||||
|
||||
#ifdef TARGET_PC
|
||||
void dDlst_FileSelFade_c::draw() {
|
||||
mpPict->draw(mDoGph_gInf_c::getMinXF(), mDoGph_gInf_c::getMinYF(),
|
||||
mDoGph_gInf_c::getWidthF(), mDoGph_gInf_c::getHeightF(), false, false, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
void dFile_select_c::errorMoveAnmInitSet(int param_1, int param_2) {
|
||||
mErrorMsgPane->setAnimation(field_0x0090);
|
||||
field_0x0130 = param_1;
|
||||
@@ -4765,7 +4755,7 @@ void dFile_select_c::MemCardFormatYesSel2Disp() {
|
||||
bool isErrorTxtChange = errorTxtChangeAnm();
|
||||
bool isYnMenuMove = yesnoMenuMoveAnm();
|
||||
if (isErrorTxtChange == true && isYnMenuMove == true) {
|
||||
mWaitTimer = g_fsHIO.card_wait_frames;
|
||||
mWaitTimer = IF_DUSK(dusk::getSettings().game.instantSaves ? 0 :) g_fsHIO.card_wait_frames;
|
||||
mDoMemCd_Format();
|
||||
mCardCheckProc = MEMCARDCHECKPROC_FORMAT;
|
||||
}
|
||||
@@ -4836,7 +4826,7 @@ void dFile_select_c::MemCardMakeGameFileSelDisp() {
|
||||
|
||||
if (isErrorTxtChange == true && isYnMenuMove == true && isKetteiTxtDisp == true) {
|
||||
if (field_0x0268 != 0) {
|
||||
mWaitTimer = g_fsHIO.card_wait_frames;
|
||||
mWaitTimer = IF_DUSK(dusk::getSettings().game.instantSaves ? 0 :) g_fsHIO.card_wait_frames;
|
||||
setInitSaveData();
|
||||
dataSave();
|
||||
mCardCheckProc = MEMCARDCHECKPROC_MAKE_GAMEFILE;
|
||||
@@ -5584,7 +5574,13 @@ void dFile_select3D_c::createMirrorModel() {
|
||||
void dFile_select3D_c::toItem3Dpos(f32 param_0, f32 param_1, f32 param_2, cXyz* param_3) {
|
||||
Mtx adStack_98;
|
||||
Mtx auStack_c8;
|
||||
#if TARGET_PC
|
||||
param_0 =
|
||||
(2.0f * ((param_0 - mDoGph_gInf_c::getSafeMinXF()) / mDoGph_gInf_c::getSafeWidthF()) -
|
||||
1.0f);
|
||||
#else
|
||||
param_0 = (2.0f * ((param_0 - mDoGph_gInf_c::getMinXF()) / mDoGph_gInf_c::getWidthF()) - 1.0f);
|
||||
#endif
|
||||
param_1 = (2.0f * ((param_1 - -100.0f) / FB_HEIGHT_BASE) - 1.0f);
|
||||
calcViewMtx(adStack_98);
|
||||
cMtx_inverse(adStack_98, auStack_c8);
|
||||
@@ -5601,4 +5597,3 @@ void dFile_select3D_c::calcViewMtx(Mtx param_0) {
|
||||
cXyz pos2(0.0f, 1.0f, 0.0f);
|
||||
cMtx_lookAt(param_0, &pos1, &cXyz::Zero, &pos2, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,11 +37,10 @@ void dDlst_Gameover_CAPTURE_c::draw() {
|
||||
TGXTexObj tex_obj;
|
||||
Mtx44 m;
|
||||
|
||||
#if TARGET_PC
|
||||
GXSetTexCopySrc(0, 0, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
GXSetTexCopyDst(mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), GX_TF_RGB565, GX_TRUE);
|
||||
#else
|
||||
GXSetTexCopySrc(0, 0, FB_WIDTH, FB_HEIGHT);
|
||||
#if TARGET_PC
|
||||
GXSetTexCopyDst(FB_WIDTH, FB_HEIGHT, GX_TF_RGB565, GX_FALSE);
|
||||
#else
|
||||
GXSetTexCopyDst(FB_WIDTH / 2, FB_HEIGHT / 2, GX_TF_RGB565, GX_TRUE);
|
||||
#endif
|
||||
GXCopyTex(mDoGph_gInf_c::mZbufferTex, 0);
|
||||
|
||||
@@ -82,11 +82,7 @@ void dInsect_c::CalcZBuffer(f32 param_0) {
|
||||
pos = current.pos;
|
||||
pos.y += 20.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&pos, &pos_projected, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&pos, &pos_projected);
|
||||
#endif
|
||||
|
||||
if (dComIfGp_getCamera(0)) {
|
||||
camera_trim_height = dComIfGp_getCamera(0)->mCamera.mTrimHeight;
|
||||
|
||||
+5
-4
@@ -35,6 +35,7 @@
|
||||
#if TARGET_PC
|
||||
#include "dusk/imgui/ImGuiBloomWindow.hpp"
|
||||
#include "dusk/settings.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#endif
|
||||
|
||||
static void GxXFog_set();
|
||||
@@ -8251,6 +8252,10 @@ static int dKy_Create(void* i_this) {
|
||||
kankyo_class* kankyo = (kankyo_class*)i_this;
|
||||
BOOL next_time_set = false;
|
||||
|
||||
#if TARGET_PC
|
||||
kankyo->base.draw_interp_frame = true;
|
||||
#endif
|
||||
|
||||
stage_envr_info_class* stage_envr_p = dComIfGp_getStageEnvrInfo();
|
||||
if (stage_envr_p != NULL && dComIfGp_getStartStageRoomNo() != -1) {
|
||||
stage_envr_p += dComIfGp_getStartStageRoomNo();
|
||||
@@ -11004,11 +11009,7 @@ void dKy_depth_dist_set(void* process_p) {
|
||||
|
||||
f32 var_f31 = sp24.abs(camera_p->view.lookat.eye);
|
||||
if (var_f31 < 2000.0f && var_f31 < kankyo->field_0x1268) {
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&actor_p->eyePos, &sp30, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&actor_p->eyePos, &sp30);
|
||||
#endif
|
||||
|
||||
if ((sp30.x >= 0.0f && sp30.x < FB_WIDTH) && (sp30.y >= 0.0f &&
|
||||
#if DEBUG
|
||||
|
||||
@@ -915,12 +915,7 @@ void dKydb_dungeonlight_draw() {
|
||||
rot.y = 0;
|
||||
dDbVw_drawCubeXlu(player->current.pos, size, rot, color);
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&g_env_light.dungeonlight[i].mPosition, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&g_env_light.dungeonlight[i].mPosition, &proj);
|
||||
#endif
|
||||
|
||||
if (proj.x > 30.0f) {
|
||||
proj.x -= 30.0f;
|
||||
}
|
||||
|
||||
+56
-50
@@ -116,12 +116,7 @@ void dKyr_lenzflare_move() {
|
||||
cXyz vect;
|
||||
cXyz proj;
|
||||
cXyz center;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(lenz_packet->mPositions, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(lenz_packet->mPositions, &proj);
|
||||
#endif
|
||||
|
||||
center.x = FB_WIDTH / 2;
|
||||
center.y = FB_HEIGHT / 2;
|
||||
@@ -221,12 +216,7 @@ void dKyr_sun_move() {
|
||||
}
|
||||
|
||||
cXyz proj;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(sun_packet->mPos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(sun_packet->mPos, &proj);
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
cXyz chkpnt = proj;
|
||||
@@ -4127,11 +4117,7 @@ void dKyr_drawStar(Mtx drawMtx, u8** tex) {
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&moon_pos, &moon_proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&moon_pos, &moon_proj);
|
||||
#endif
|
||||
|
||||
// Dusk optimization: we use vertex color rather than GX_TEVREG0 to set star color.
|
||||
// This allows us to merge all the stars into a single draw.
|
||||
@@ -4280,11 +4266,7 @@ void dKyr_drawStar(Mtx drawMtx, u8** tex) {
|
||||
sp68.y = spBC.y + star_pos.y;
|
||||
sp68.z = spBC.z + star_pos.z;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&sp68, &star_proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&sp68, &star_proj);
|
||||
#endif
|
||||
|
||||
moon_proj.z = 0.0f;
|
||||
star_proj.z = 0.0f;
|
||||
@@ -4699,11 +4681,7 @@ void drawVrkumo(Mtx drawMtx, GXColor& color, u8** tex) {
|
||||
}
|
||||
|
||||
if (g_env_light.daytime > 105.0f && g_env_light.daytime < 240.0f && !dComIfGp_event_runCheck() && sun_packet != NULL && sun_packet->mSunAlpha > 0.0f) {
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&sun_packet->mPos[0], &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&sun_packet->mPos[0], &proj);
|
||||
#endif
|
||||
if (proj.x > 0.0f && proj.x < FB_WIDTH && proj.y > spC4 && proj.y < (458.0f - spC4)) {
|
||||
pass = 0;
|
||||
}
|
||||
@@ -4968,12 +4946,7 @@ void drawVrkumo(Mtx drawMtx, GXColor& color, u8** tex) {
|
||||
x = 100.0f;
|
||||
y = 100.0f;
|
||||
z = 100.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&spF0, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&spF0, &proj);
|
||||
#endif
|
||||
|
||||
if (proj.x > -x && proj.x < (FB_WIDTH + x) && proj.y > -y && proj.y < (458.0f + z)) {
|
||||
break;
|
||||
@@ -5023,12 +4996,7 @@ void drawVrkumo(Mtx drawMtx, GXColor& color, u8** tex) {
|
||||
x = 100.0f;
|
||||
y = 100.0f;
|
||||
z = 100.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&spE4, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&spE4, &proj);
|
||||
#endif
|
||||
|
||||
if (proj.x > -x && proj.x < (FB_WIDTH + x) && proj.y > -y && proj.y < (458.0f + z)) {
|
||||
break;
|
||||
@@ -5994,6 +5962,8 @@ static void dKyr_evil_draw2(Mtx drawMtx, u8** tex) {
|
||||
fopAc_ac_c* player = dComIfGp_getPlayer(0);
|
||||
|
||||
if (evil_packet != NULL) {
|
||||
IF_DUSK(GXPushDebugGroup("dKyr_evil_draw2"));
|
||||
|
||||
j3dSys.reinitGX();
|
||||
if (dComIfGd_getView() != NULL) {
|
||||
MTXInverse(dComIfGd_getView()->viewMtxNoTrans, camMtx);
|
||||
@@ -6018,7 +5988,12 @@ static void dKyr_evil_draw2(Mtx drawMtx, u8** tex) {
|
||||
TGXTexObj texobj;
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)tex[1]);
|
||||
|
||||
rot += 0.7f;
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
rot += 0.7f;
|
||||
}
|
||||
MTXRotRad(rotMtx, 'Z', DEG_TO_RAD(rot));
|
||||
MTXConcat(camMtx, rotMtx, camMtx);
|
||||
|
||||
@@ -6068,14 +6043,15 @@ static void dKyr_evil_draw2(Mtx drawMtx, u8** tex) {
|
||||
sp34.x = 80.0f;
|
||||
sp34.y = 80.0f;
|
||||
sp34.z = 80.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&sp7C, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&sp7C, &proj);
|
||||
#endif
|
||||
|
||||
if (!(proj.x > -sp34.x) || !(proj.x < (FB_WIDTH + sp34.x)) ||
|
||||
#if TARGET_PC
|
||||
f32 cullMinX = mDoGph_gInf_c::getSafeMinXF() - sp34.x;
|
||||
f32 cullMaxX = mDoGph_gInf_c::getSafeMinXF() + mDoGph_gInf_c::getSafeWidthF() + sp34.x;
|
||||
#else
|
||||
f32 cullMinX = -sp34.x;
|
||||
f32 cullMaxX = FB_WIDTH + sp34.x;
|
||||
#endif
|
||||
if (!(proj.x > cullMinX) || !(proj.x < cullMaxX) ||
|
||||
!(proj.y > -sp34.y) || !(proj.y < (458.0f + sp34.z)))
|
||||
{
|
||||
continue;
|
||||
@@ -6188,6 +6164,8 @@ static void dKyr_evil_draw2(Mtx drawMtx, u8** tex) {
|
||||
}
|
||||
}
|
||||
|
||||
IF_DUSK(GXPopDebugGroup());
|
||||
|
||||
GXSetClipMode(GX_CLIP_ENABLE);
|
||||
J3DShape::resetVcdVatCache();
|
||||
}
|
||||
@@ -6225,6 +6203,8 @@ void dKyr_evil_draw(Mtx drawMtx, u8** tex) {
|
||||
f32 sp60 = fabsf(cM_ssin(g_Counter.mCounter0 * 215));
|
||||
|
||||
if (evil_packet != NULL) {
|
||||
IF_DUSK(GXPushDebugGroup("dKyr_evil_draw"));
|
||||
|
||||
j3dSys.reinitGX();
|
||||
if (dComIfGd_getView() != NULL) {
|
||||
MTXInverse(dComIfGd_getView()->viewMtxNoTrans, camMtx);
|
||||
@@ -6246,14 +6226,19 @@ void dKyr_evil_draw(Mtx drawMtx, u8** tex) {
|
||||
TGXTexObj texobj;
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)tex[0]);
|
||||
|
||||
rot += 1.0f;
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
rot += 1.0f;
|
||||
}
|
||||
MTXRotRad(rotMtx, 'Z', DEG_TO_RAD(rot));
|
||||
MTXConcat(camMtx, rotMtx, camMtx);
|
||||
|
||||
GXLoadPosMtxImm(drawMtx, GX_PNMTX0);
|
||||
GXSetCurrentMtx(GX_PNMTX0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGBA4, 8);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_RGBA4, 8);
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
||||
@@ -6276,6 +6261,19 @@ void dKyr_evil_draw(Mtx drawMtx, u8** tex) {
|
||||
GXSetClipMode(GX_CLIP_DISABLE);
|
||||
GXSetNumIndStages(0);
|
||||
|
||||
#if TARGET_PC
|
||||
// move color_reg0 to vtx for perf
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
|
||||
GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||
GXSetNumChans(1);
|
||||
GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, 0, GX_DF_NONE, GX_AF_NONE);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_C1, GX_CC_RASC, GX_CC_TEXC, GX_CC_ZERO);
|
||||
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_TEXA, GX_CA_RASA, GX_CA_ZERO);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
#endif
|
||||
|
||||
dComIfG_Ccsp()->PrepareMass();
|
||||
|
||||
for (int i = 0; i < g_env_light.field_0x1054; i++) {
|
||||
@@ -6299,13 +6297,15 @@ void dKyr_evil_draw(Mtx drawMtx, u8** tex) {
|
||||
sp44.y = 80.0f;
|
||||
sp44.z = 80.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&spA4, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&spA4, &proj);
|
||||
#endif
|
||||
|
||||
if (!(proj.x > -sp44.x) || !(proj.x < (FB_WIDTH + sp44.x)) ||
|
||||
#if TARGET_PC
|
||||
f32 cullMinX = mDoGph_gInf_c::getSafeMinXF() - sp44.x;
|
||||
f32 cullMaxX = mDoGph_gInf_c::getSafeMinXF() + mDoGph_gInf_c::getSafeWidthF() + sp44.x;
|
||||
#else
|
||||
f32 cullMinX = -sp44.x;
|
||||
f32 cullMaxX = FB_WIDTH + sp44.x;
|
||||
#endif
|
||||
if (!(proj.x > cullMinX) || !(proj.x < cullMaxX) ||
|
||||
!(proj.y > -sp44.y) || !(proj.y < (458.0f + sp44.z)))
|
||||
{
|
||||
continue;
|
||||
@@ -6392,7 +6392,7 @@ void dKyr_evil_draw(Mtx drawMtx, u8** tex) {
|
||||
color_reg0.b = (115.0f * sp28) + (15.0f * fabsf(sp2C - sp64));
|
||||
}
|
||||
|
||||
GXSetTevColor(GX_TEVREG0, color_reg0);
|
||||
IF_NOT_DUSK(GXSetTevColor(GX_TEVREG0, color_reg0));
|
||||
GXSetTevColor(GX_TEVREG1, color_reg1);
|
||||
|
||||
spC8 = spA4;
|
||||
@@ -6431,12 +6431,16 @@ void dKyr_evil_draw(Mtx drawMtx, u8** tex) {
|
||||
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
GXPosition3f32(pos[0].x, pos[0].y, pos[0].z);
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0, 0);
|
||||
GXPosition3f32(pos[1].x, pos[1].y, pos[1].z);
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0xFF, 0);
|
||||
GXPosition3f32(pos[2].x, pos[2].y, pos[2].z);
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0xFF, 0xFF);
|
||||
GXPosition3f32(pos[3].x, pos[3].y, pos[3].z);
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0, 0xFF);
|
||||
GXEnd();
|
||||
}
|
||||
@@ -6444,6 +6448,8 @@ void dKyr_evil_draw(Mtx drawMtx, u8** tex) {
|
||||
}
|
||||
}
|
||||
|
||||
IF_DUSK(GXPopDebugGroup());
|
||||
|
||||
J3DShape::resetVcdVatCache();
|
||||
GXSetClipMode(GX_CLIP_ENABLE);
|
||||
|
||||
|
||||
+10
-7
@@ -13,6 +13,9 @@
|
||||
#include "SSystem/SComponent/c_math.h"
|
||||
#include "d/actor/d_a_player.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#if TARGET_PC
|
||||
#include <dolphin/gx/GXExtra.h>
|
||||
#endif
|
||||
#include <cstring>
|
||||
|
||||
#if DEBUG
|
||||
@@ -539,17 +542,14 @@ void renderingAmap_c::rendering(dDrawPath_c::poly_class const* i_poly) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Enabling the following definition will modify the following function to
|
||||
* make the map look worse for extra speed in the emulator, especially in large
|
||||
* areas such as hyrule field.
|
||||
*/
|
||||
#define HYRULE_FIELD_SPEEDHACK
|
||||
|
||||
bool renderingAmap_c::isDrawOutSideTrim() {
|
||||
bool rt = false;
|
||||
|
||||
#ifdef HYRULE_FIELD_SPEEDHACK
|
||||
return 0;
|
||||
#if TARGET_PC
|
||||
if (!dusk::getSettings().game.enableMapBackground) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (getDispType() == 0 || getDispType() == 4 || getDispType() == 3 || getDispType() == 2 ||
|
||||
@@ -1218,6 +1218,9 @@ void dMap_c::changeTextureSize(int param_1, int param_2, int param_3) {
|
||||
|
||||
void dMap_c::_remove() {
|
||||
if (mImage_p != NULL) {
|
||||
#if TARGET_PC
|
||||
GXDestroyCopyTex(mImage_p);
|
||||
#endif
|
||||
JKR_DELETE_ARRAY(mImage_p);
|
||||
mImage_p = NULL;
|
||||
}
|
||||
|
||||
+40
-24
@@ -16,10 +16,6 @@
|
||||
|
||||
#ifdef TARGET_PC
|
||||
constexpr u16 kMapResolutionMultiplier = 4;
|
||||
// Line widths are relative to the framebuffer size. Since we're rendering to a separate
|
||||
// framebuffer, we have to scale them accordingly. The original game used about half of the
|
||||
// EFB for the map rendering, so this is a reasonable approximation.
|
||||
constexpr u8 kMapLineWidthMultiplier = 2;
|
||||
#endif
|
||||
|
||||
void dMpath_n::dTexObjAggregate_c::create() {
|
||||
@@ -241,12 +237,15 @@ void dDrawPath_c::rendering(dDrawPath_c::line_class const* p_line) {
|
||||
if (isDrawType(p_line->field_0x0)) {
|
||||
int width = getLineWidth(p_line->field_0x1);
|
||||
|
||||
#if TARGET_PC
|
||||
f32 height = JUTVideo::getManager()->getRenderHeight() / 448.0f;
|
||||
if (height > 1.0f) {
|
||||
width /= 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (width > 0 && p_line->mDataNum >= 2) {
|
||||
#ifdef TARGET_PC
|
||||
GXSetLineWidth(width * kMapLineWidthMultiplier, GX_TO_ZERO);
|
||||
#else
|
||||
GXSetLineWidth(width * 2, GX_TO_ZERO);
|
||||
#endif
|
||||
GXSetLineWidth(width, GX_TO_ZERO);
|
||||
GXSetTevColor(GX_TEVREG0, *getLineColor(p_line->field_0x0 & 0x3F, p_line->field_0x1));
|
||||
GXBegin(GX_LINESTRIP, GX_VTXFMT0, p_line->mDataNum);
|
||||
|
||||
@@ -435,8 +434,12 @@ void dRenderingFDAmap_c::preRenderingMap() {
|
||||
const u16 w = mTexWidth * kMapResolutionMultiplier;
|
||||
const u16 h = mTexHeight * kMapResolutionMultiplier;
|
||||
GXCreateFrameBuffer(w, h);
|
||||
GXSetViewport(0.0f, 0.0f, w, h, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, w, h);
|
||||
// Set logical viewport dimensions
|
||||
GXSetViewport(0.0f, 0.0f, mTexWidth, mTexHeight, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, mTexWidth, mTexHeight);
|
||||
// Set render viewport dimensions
|
||||
GXSetViewportRender(0.0f, 0.0f, w, h, 0.0f, 1.0f);
|
||||
GXSetScissorRender(0, 0, w, h);
|
||||
#else
|
||||
GXSetViewport(0.0f, 0.0f, mTexWidth, mTexHeight, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, mTexWidth, mTexHeight);
|
||||
@@ -494,12 +497,6 @@ void dRenderingFDAmap_c::postRenderingMap() {
|
||||
|
||||
dMpath_n::dTexObjAggregate_c dMpath_n::m_texObjAgg;
|
||||
|
||||
/* Enabling the following definition will modify the following function to
|
||||
* make the map look worse for extra speed in the emulator, especially in large
|
||||
* areas such as hyrule field.
|
||||
*/
|
||||
#define HYRULE_FIELD_SPEEDHACK
|
||||
|
||||
void dRenderingFDAmap_c::renderingDecoration(dDrawPath_c::line_class const* p_line) {
|
||||
s32 width = getDecorationLineWidth(p_line->field_0x1);
|
||||
if (width <= 0) {
|
||||
@@ -517,20 +514,39 @@ void dRenderingFDAmap_c::renderingDecoration(dDrawPath_c::line_class const* p_li
|
||||
|
||||
BE(u16)* data_p = p_line->mpData;
|
||||
s32 data_num = p_line->mDataNum;
|
||||
#ifdef TARGET_PC
|
||||
GXSetLineWidth(width * kMapLineWidthMultiplier, GX_TO_ZERO);
|
||||
GXSetPointSize(width * kMapLineWidthMultiplier, GX_TO_ONE);
|
||||
#else
|
||||
GXSetLineWidth(width, GX_TO_ONE);
|
||||
GXSetPointSize(width, GX_TO_ONE);
|
||||
#endif
|
||||
GXColor lineColor = *getDecoLineColor(p_line->field_0x0 & 0x3f, p_line->field_0x1);
|
||||
GXSetTevColor(GX_TEVREG0, lineColor);
|
||||
lineColor.r = lineColor.r - 4;
|
||||
GXSetTevColor(GX_TEVREG1, lineColor);
|
||||
|
||||
#if TARGET_PC
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_C0);
|
||||
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_KONST);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXBegin(GX_LINESTRIP, GX_VTXFMT0, 2 * (data_num - 1));
|
||||
for (int i = 0; i < data_num - 1; i++) {
|
||||
GXPosition1x16(data_p[i]);
|
||||
GXTexCoord2f32(0, 0);
|
||||
GXPosition1x16(data_p[i + 1]);
|
||||
GXTexCoord2f32(0, 0);
|
||||
}
|
||||
GXEnd();
|
||||
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_KONST, GX_CC_TEXC, GX_CC_C1);
|
||||
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXBegin(GX_POINTS, GX_VTXFMT0, data_num);
|
||||
for (int i = 0; i < data_num; i++) {
|
||||
GXPosition1x16(data_p[i]);
|
||||
GXTexCoord2f32(0, 0);
|
||||
}
|
||||
GXEnd();
|
||||
#else
|
||||
for (int i = 0; i < data_num; i++) {
|
||||
#ifndef HYRULE_FIELD_SPEEDHACK
|
||||
if (i < data_num - 1) {
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_C0);
|
||||
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE,
|
||||
@@ -549,7 +565,6 @@ void dRenderingFDAmap_c::renderingDecoration(dDrawPath_c::line_class const* p_li
|
||||
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
#endif
|
||||
|
||||
GXBegin(GX_POINTS, GX_VTXFMT0, 1);
|
||||
GXPosition1x16(data_p[0]);
|
||||
@@ -557,6 +572,7 @@ void dRenderingFDAmap_c::renderingDecoration(dDrawPath_c::line_class const* p_li
|
||||
GXEnd();
|
||||
data_p++;
|
||||
}
|
||||
#endif
|
||||
|
||||
setTevSettingNonTextureDirectColor();
|
||||
GXClearVtxDesc();
|
||||
|
||||
+26
-19
@@ -99,7 +99,7 @@ dMenu_Collect2D_c::~dMenu_Collect2D_c() {
|
||||
void dMenu_Collect2D_c::menuCollectWide() {
|
||||
// Main Canvas
|
||||
mpScreen->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f);
|
||||
mpScreen->translate(mDoGph_gInf_c::getMinXF(), 0.0f);
|
||||
mpScreen->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f);
|
||||
|
||||
// Pieces of Heart
|
||||
mpScreen->search(MULTI_CHAR('heart_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
@@ -164,11 +164,22 @@ void dMenu_Collect2D_c::menuCollectWide() {
|
||||
|
||||
// Item Description Text
|
||||
mpScreen->search(MULTI_CHAR('infotxtn'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
|
||||
#if TARGET_PC
|
||||
if (mpDrawCursor) {
|
||||
mpDrawCursor->refreshAspectScale();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void dMenu_Collect2D_c::_create() {
|
||||
mpHeap->getTotalFreeSize();
|
||||
|
||||
#if TARGET_PC
|
||||
mpDrawCursor = NULL;
|
||||
#endif
|
||||
|
||||
mpScreen = JKR_NEW J2DScreen();
|
||||
mpScreen->setPriority("zelda_collect_soubi_screen.blo", 0x1020000,
|
||||
dComIfGp_getCollectResArchive());
|
||||
@@ -182,7 +193,7 @@ void dMenu_Collect2D_c::_create() {
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
mpScreenIcon->translate(-mDoGph_gInf_c::getMinXF(), 0.0f);
|
||||
mpScreenIcon->translate(-mDoGph_gInf_c::getSafeMinXF(), 0.0f);
|
||||
#endif
|
||||
|
||||
dPaneClass_showNullPane(mpScreenIcon);
|
||||
@@ -1100,23 +1111,11 @@ void dMenu_Collect2D_c::cursorPosSet() {
|
||||
Vec pos = mpSelPm[mCursorX][mCursorY]->getGlobalVtxCenter(false, 0);
|
||||
mpDrawCursor->setPos(pos.x, pos.y, mpSelPm[mCursorX][mCursorY]->getPanePtr(), false);
|
||||
if (mCursorY == 5) {
|
||||
#if TARGET_PC
|
||||
mpDrawCursor->setParam(1.1f * mDoGph_gInf_c::hudAspectScaleUp, 0.85f, 0.05f, 0.5f, 0.5f);
|
||||
#else
|
||||
mpDrawCursor->setParam(1.1f, 0.85f, 0.05f, 0.5f, 0.5f);
|
||||
#endif
|
||||
} else if (mCursorX == 6 && mCursorY == 0) {
|
||||
#if TARGET_PC
|
||||
mpDrawCursor->setParam(0.6f * mDoGph_gInf_c::hudAspectScaleUp, 0.85f, 0.03f, 0.6f, 0.6f);
|
||||
#else
|
||||
mpDrawCursor->setParam(0.6f, 0.85f, 0.03f, 0.6f, 0.6f);
|
||||
#endif
|
||||
} else {
|
||||
#if TARGET_PC
|
||||
mpDrawCursor->setParam(1.0f * mDoGph_gInf_c::hudAspectScaleUp, 1.0f, 0.1f, 0.7f, 0.7f);
|
||||
#else
|
||||
mpDrawCursor->setParam(1.0f, 1.0f, 0.1f, 0.7f, 0.7f);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2400,6 +2399,13 @@ void dMenu_Collect3D_c::_move(u8 param_0, u8 param_1) {
|
||||
posZ = 550.0f;
|
||||
}
|
||||
toItem3Dpos(linkPos.x, posY, posZ, &itemPos);
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableLinkDollRotation) {
|
||||
const f32 angle = mDoCPd_c::getSubStickX3D(PAD_1) * 2048;
|
||||
ANGLE_ADD(mLinkAngle, angle);
|
||||
} else
|
||||
#endif
|
||||
if (param_0 == 0 && param_1 == 0) {
|
||||
f32 temp = 450.0f;
|
||||
ANGLE_ADD(mLinkAngle, temp);
|
||||
@@ -2688,12 +2694,7 @@ u8 dMenu_Collect3D_c::getMaskMdlVisible() {
|
||||
f32 dMenu_Collect3D_c::mViewOffsetY = -100.0f;
|
||||
|
||||
void dMenu_Collect3D_c::setupItem3D(Mtx param_0) {
|
||||
#if TARGET_PC
|
||||
f32 scaleFactor = mDoGph_gInf_c::getHeight() / FB_HEIGHT;
|
||||
GXSetViewport(0.0f, mViewOffsetY * scaleFactor, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), 0.0f, 1.0f);
|
||||
#else
|
||||
GXSetViewport(0.0f, mViewOffsetY, FB_WIDTH, FB_HEIGHT, 0.0f, 1.0f);
|
||||
#endif
|
||||
mViewOffsetY = -100.0f;
|
||||
Mtx44 projection;
|
||||
C_MTXPerspective(projection, 45.0f, mDoGph_gInf_c::getAspect(), 1.0f, 100000.0f);
|
||||
@@ -2706,8 +2707,14 @@ void dMenu_Collect3D_c::setupItem3D(Mtx param_0) {
|
||||
void dMenu_Collect3D_c::toItem3Dpos(f32 param_0, f32 param_1, f32 param_2, cXyz* param_3) {
|
||||
Mtx adStack_98;
|
||||
Mtx auStack_c8;
|
||||
#if TARGET_PC
|
||||
param_0 =
|
||||
(2.0f * ((param_0 - mDoGph_gInf_c::getSafeMinXF()) / mDoGph_gInf_c::getSafeWidthF()) -
|
||||
1.0f);
|
||||
#else
|
||||
param_0 =
|
||||
(2.0f * ((param_0 - mDoGph_gInf_c::getMinXF()) / mDoGph_gInf_c::getWidthF()) - 1.0f);
|
||||
#endif
|
||||
param_1 = (2.0f * ((param_1 - -100.0f) / FB_HEIGHT_BASE) - 1.0f);
|
||||
calcViewMtx(adStack_98);
|
||||
MTXInverse(adStack_98, auStack_c8);
|
||||
|
||||
+43
-30
@@ -21,6 +21,7 @@
|
||||
#include "d/d_msg_string.h"
|
||||
#include "d/d_meter_haihai.h"
|
||||
#include "d/d_menu_window.h"
|
||||
#include "dusk/settings.h"
|
||||
#include "f_op/f_op_msg_mng.h"
|
||||
#include "m_Do/m_Do_graphic.h"
|
||||
#include <cstring>
|
||||
@@ -864,33 +865,15 @@ void dMenu_DmapBg_c::draw() {
|
||||
J2DOrthoGraph* grafContext = (J2DOrthoGraph*)dComIfGp_getCurrentGrafPort();
|
||||
grafContext->setup2D();
|
||||
|
||||
#if TARGET_PC
|
||||
// GXGetScissor uses 11-bit GC register fields (max 2047) which overflow
|
||||
// at window widths > ~1705px, producing garbage values on restore.
|
||||
scissor_left = 0;
|
||||
scissor_top = 0;
|
||||
scissor_width = (u32)mDoGph_gInf_c::getWidth();
|
||||
scissor_height = (u32)mDoGph_gInf_c::getHeight();
|
||||
#else
|
||||
GXGetScissor(&scissor_left, &scissor_top, &scissor_width, &scissor_height);
|
||||
#endif
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(field_0xd94, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
grafContext->scissor(field_0xd94, 0.0f, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
grafContext->scissor(field_0xd94, 0.0f, FB_WIDTH, FB_HEIGHT);
|
||||
grafContext->setScissor();
|
||||
|
||||
mBaseScreen->draw(field_0xd94, field_0xd98, grafContext);
|
||||
dMenu_Dmap_c::myclass->drawFloorScreenBack(mFloorScreen, field_0xd94, field_0xd98, grafContext);
|
||||
|
||||
#if TARGET_PC
|
||||
f32 dVar21 = mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth();
|
||||
f32 dVar16 = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
#else
|
||||
f32 dVar21 = mDoGph_gInf_c::getWidthF() / FB_WIDTH;
|
||||
f32 dVar16 = mDoGph_gInf_c::getHeightF() / FB_HEIGHT;
|
||||
#endif
|
||||
mMapScreen[0]->draw(field_0xd94, field_0xd98, grafContext);
|
||||
|
||||
if (mpBackTexture != NULL) {
|
||||
@@ -922,15 +905,9 @@ void dMenu_DmapBg_c::draw() {
|
||||
mpBackTexture->draw(local_28c, field_0xd94 + mpBackTexture->getBounds().i.y, mpBackTexture->getWidth(),
|
||||
mpBackTexture->getHeight(), false, false, false);
|
||||
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(field_0xd94,
|
||||
0, mDoGph_gInf_c::getWidth(),
|
||||
scissor_height);
|
||||
#else
|
||||
grafContext->scissor(field_0xd94 + mDoGph_gInf_c::getMinXF(),
|
||||
scissor_top, mDoGph_gInf_c::getWidthF(),
|
||||
scissor_height);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
}
|
||||
|
||||
@@ -957,11 +934,7 @@ void dMenu_DmapBg_c::draw() {
|
||||
|
||||
Vec local_26c = pane.getGlobalVtx(mMapPane, &local_110, 0, false, 0);
|
||||
drawIcon(local_26c.x + field_0xd94, local_26c.y, field_0xda8, 1.0f);
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(field_0xd94, scissor_top, mDoGph_gInf_c::getWidth(), scissor_height);
|
||||
#else
|
||||
grafContext->scissor(field_0xd94 + mDoGph_gInf_c::getMinXF(), scissor_top, mDoGph_gInf_c::getWidthF(), scissor_height);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
grafContext->scissor(scissor_left, scissor_top, scissor_width, scissor_height);
|
||||
grafContext->setScissor();
|
||||
@@ -973,9 +946,15 @@ void dMenu_DmapBg_c::draw() {
|
||||
mpMeterHaihai->drawHaihai(field_0xdda,
|
||||
x1 + (local_224.x + local_218.x) / 2,
|
||||
y1 + (local_224.y + local_218.y) / 2,
|
||||
-35.0f + (local_224.x - local_218.x),
|
||||
-35.0f + (local_224.x - local_218.x),
|
||||
-35.0f + (local_224.y - local_218.y));
|
||||
#if TARGET_PC
|
||||
if (!dusk::getSettings().game.enableFrameInterpolation) {
|
||||
field_0xdda = 0;
|
||||
}
|
||||
#else
|
||||
field_0xdda = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
dMenu_Dmap_c::myclass->drawFloorScreenTop(mFloorScreen, field_0xd94, field_0xd98, grafContext);
|
||||
@@ -1012,7 +991,36 @@ void dMenu_DmapBg_c::update() {
|
||||
JUT_ASSERT(2323, mpBackTexture != NULL);
|
||||
|
||||
void* spec = mpArchive->getResource("spec/spec.dat");
|
||||
#if TARGET_PC
|
||||
struct dmap_spec {
|
||||
/* 0x00 */ BE(f32) field_0x0;
|
||||
/* 0x04 */ BE(f32) field_0x4;
|
||||
/* 0x08 */ BE(f32) field_0x8;
|
||||
/* 0x0C */ u8 field_0xc;
|
||||
/* 0x0D */ u8 field_0xd;
|
||||
/* 0x0E */ u8 field_0xe;
|
||||
/* 0x0F */ u8 field_0xf;
|
||||
/* 0x10 */ u8 field_0x10;
|
||||
/* 0x11 */ u8 field_0x11;
|
||||
/* 0x12 */ u8 field_0x12;
|
||||
/* 0x13 */ u8 field_0x13;
|
||||
};
|
||||
dmap_spec* dspec = (dmap_spec*)spec;
|
||||
|
||||
field_0xd80 = dspec->field_0x0;
|
||||
field_0xd84 = dspec->field_0x4;
|
||||
field_0xd88 = dspec->field_0x8;
|
||||
field_0xd8c = dspec->field_0xc;
|
||||
field_0xd8d = dspec->field_0xd;
|
||||
field_0xd8e = dspec->field_0xe;
|
||||
field_0xd8f = dspec->field_0xf;
|
||||
field_0xd90 = dspec->field_0x10;
|
||||
field_0xd91 = dspec->field_0x11;
|
||||
field_0xd92 = dspec->field_0x12;
|
||||
field_0xd93 = dspec->field_0x13;
|
||||
#else
|
||||
memcpy(&field_0xd80, spec, 20);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2573,6 +2581,11 @@ void dMenu_Dmap_c::zoomIn_proc() {
|
||||
}
|
||||
|
||||
void dMenu_Dmap_c::zoomOut_init_proc() {
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableFrameInterpolation) {
|
||||
mpDrawBg->resetScrollArrowMask();
|
||||
}
|
||||
#endif
|
||||
Z2GetAudioMgr()->seStart(Z2SE_SY_MAP_ZOOMOUT, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
mMapCtrl->initZoomOut(10);
|
||||
mpDrawBg->iconScaleAnmInit(1.0f, 0.0f, 10);
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
#include "d/d_menu_dmap_map.h"
|
||||
#include "f_op/f_op_msg_mng.h"
|
||||
#include "m_Do/m_Do_graphic.h"
|
||||
#if TARGET_PC
|
||||
#include <dolphin/gx/GXExtra.h>
|
||||
#endif
|
||||
|
||||
struct dMdm_HIO_prm_res_dst_s {
|
||||
static void* m_res;
|
||||
@@ -291,6 +294,9 @@ void dMenu_DmapMap_c::_create(u16 param_0, u16 param_1, u16 param_2, u16 param_3
|
||||
void dMenu_DmapMap_c::_delete() {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (mMapImage_p[i] != NULL) {
|
||||
#if TARGET_PC
|
||||
GXDestroyCopyTex(mMapImage_p[i]);
|
||||
#endif
|
||||
JKR_DELETE_ARRAY(mMapImage_p[i]);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "m_Do/m_Do_graphic.h"
|
||||
#include <cstring>
|
||||
|
||||
#include "dusk/version.hpp"
|
||||
|
||||
typedef void (dMenu_Fishing_c::*initFunc)();
|
||||
initFunc map_init_process[] = {
|
||||
&dMenu_Fishing_c::wait_init,
|
||||
@@ -135,9 +137,9 @@ bool dMenu_Fishing_c::isSync() {
|
||||
}
|
||||
|
||||
void dMenu_Fishing_c::init() {
|
||||
#if VERSION == VERSION_GCN_PAL
|
||||
#if TARGET_PC || VERSION == VERSION_GCN_PAL
|
||||
BOOL isEnglish = FALSE;
|
||||
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_ENGLISH) {
|
||||
if (dusk::version::isRegionUsa() || (dusk::version::isRegionPal() && dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_ENGLISH)) {
|
||||
isEnglish = TRUE;
|
||||
}
|
||||
#endif
|
||||
@@ -145,7 +147,7 @@ void dMenu_Fishing_c::init() {
|
||||
for (int i = 0; i < MAX_FINDABLE_FISHES; i++) {
|
||||
if (dComIfGs_getFishNum(i) != 0) {
|
||||
// Fish has been caught once, display it along with it's params
|
||||
#if VERSION == VERSION_GCN_PAL
|
||||
#if TARGET_PC || VERSION == VERSION_GCN_PAL
|
||||
if (isEnglish) {
|
||||
setFishParam(i, dComIfGs_getFishNum(i), dComIfGs_getFishSize(i) / 2.54f);
|
||||
} else {
|
||||
|
||||
+23
-31
@@ -276,18 +276,14 @@ void dMenu_Fmap2DBack_c::draw() {
|
||||
u32 scissorLeft, scissorTop, scissorWidth, scissorHeight;
|
||||
GXGetScissor(&scissorLeft, &scissorTop, &scissorWidth, &scissorHeight);
|
||||
|
||||
#if TARGET_PC
|
||||
grafPort->scissor(mTransX, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
grafPort->scissor(mTransX, 0.0f, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
grafPort->setScissor();
|
||||
|
||||
mpBackTex->setBlackWhite(field_0x1208, field_0x120c);
|
||||
mpBackTex->setAlpha(mAlphaRate * 255.0f * g_fmapHIO.mBackgroundAlpha);
|
||||
mpBackTex->draw(mTransX + mDoGph_gInf_c::getMinXF(),
|
||||
mTransZ + mDoGph_gInf_c::getMinYF(), mDoGph_gInf_c::getWidth(),
|
||||
mDoGph_gInf_c::getHeight(), false, false, false);
|
||||
mTransZ + mDoGph_gInf_c::getMinYF(), mDoGph_gInf_c::getWidthF(),
|
||||
mDoGph_gInf_c::getHeightF(), false, false, false);
|
||||
|
||||
mpBackScreen->draw(mTransX, mTransZ, grafPort);
|
||||
mpBaseScreen->draw(mTransX, mTransZ, grafPort);
|
||||
@@ -297,13 +293,8 @@ void dMenu_Fmap2DBack_c::draw() {
|
||||
|
||||
Vec vec2 = mpMapArea->getGlobalVtx(&mtx, 3, false, 0);
|
||||
|
||||
#if TARGET_PC
|
||||
f32 width = mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth();
|
||||
f32 height = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
#else
|
||||
f32 width = mDoGph_gInf_c::getWidthF() / FB_WIDTH;
|
||||
f32 height = mDoGph_gInf_c::getHeightF() / FB_HEIGHT;
|
||||
#endif
|
||||
|
||||
grafPort->scissor(mTransX + ((vec1.x - mDoGph_gInf_c::getMinXF()) / width),
|
||||
mTransZ + (vec1.y / height), (vec2.x - vec1.x) / width,
|
||||
@@ -351,8 +342,13 @@ void dMenu_Fmap2DBack_c::draw() {
|
||||
scrollAreaDraw();
|
||||
}
|
||||
|
||||
blinkMove(30);
|
||||
moveLightDropAnime();
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
blinkMove(30);
|
||||
moveLightDropAnime();
|
||||
}
|
||||
setCenterPosX(field_0x11dc, 1);
|
||||
drawIcon(mTransX, mTransZ, mAlphaRate, field_0xfa8 * mSpotTextureFadeAlpha);
|
||||
|
||||
@@ -360,11 +356,7 @@ void dMenu_Fmap2DBack_c::draw() {
|
||||
drawDebugRegionArea();
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
grafPort->scissor(scissorLeft, scissorTop, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
grafPort->scissor(scissorLeft, scissorTop, scissorWidth, scissorHeight);
|
||||
#endif
|
||||
grafPort->setScissor();
|
||||
|
||||
if (isArrowDrawFlag()) {
|
||||
@@ -392,16 +384,15 @@ void dMenu_Fmap2DBack_c::draw() {
|
||||
&mArrowPos2DY);
|
||||
|
||||
#ifdef TARGET_PC
|
||||
for (u32 i = 0; i < dusk::frame_interp::get_presentation_ui_advance_ticks(); ++i) {
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
field_0x11e0 -= g_fmapHIO.mCursorSpeed;
|
||||
|
||||
if (field_0x11e0 < 0.0f) {
|
||||
field_0x11e0 += 360.0f;
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
#endif
|
||||
|
||||
mpPointParent->getPanePtr()->rotate(mpPointParent->getSizeX() / 2.0f,
|
||||
mpPointParent->getSizeY() / 2.0f, ROTATE_Z,
|
||||
@@ -1796,14 +1787,19 @@ void dMenu_Fmap2DBack_c::calcBlink() {
|
||||
t * (g_fmapHIO.mMapBlink[i + 1].mUnselectedRegion.mBlinkSpeed -
|
||||
g_fmapHIO.mMapBlink[i].mUnselectedRegion.mBlinkSpeed);
|
||||
|
||||
field_0x1218++;
|
||||
if (field_0x1218 >= selected_blink_speed) {
|
||||
field_0x1218 = 0;
|
||||
}
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
field_0x1218++;
|
||||
if (field_0x1218 >= selected_blink_speed) {
|
||||
field_0x1218 = 0;
|
||||
}
|
||||
|
||||
field_0x121a++;
|
||||
if (field_0x121a >= unselected_blink_speed) {
|
||||
field_0x121a = 0;
|
||||
field_0x121a++;
|
||||
if (field_0x121a >= unselected_blink_speed) {
|
||||
field_0x121a = 0;
|
||||
}
|
||||
}
|
||||
|
||||
f32 t_selected = 0.0f;
|
||||
@@ -2598,11 +2594,7 @@ void dMenu_Fmap2DTop_c::draw() {
|
||||
J2DOrthoGraph* ctx = static_cast<J2DOrthoGraph*>(dComIfGp_getCurrentGrafPort());
|
||||
ctx->setup2D();
|
||||
GXGetScissor(&scissor_left, &scissor_top, &scissor_width, &scissor_height);
|
||||
#if TARGET_PC
|
||||
ctx->scissor(mTransX, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
ctx->scissor(mTransX, 0.0f, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
ctx->setScissor();
|
||||
mpTitleScreen->draw(mTransX, mTransY, ctx);
|
||||
ctx->scissor(scissor_left, scissor_top, scissor_width, scissor_height);
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
#include "d/d_debug_viewer.h"
|
||||
#include "d/d_menu_fmap_map.h"
|
||||
#include "m_Do/m_Do_graphic.h"
|
||||
#if TARGET_PC
|
||||
#include <dolphin/gx/GXExtra.h>
|
||||
#endif
|
||||
#include <cstring>
|
||||
|
||||
static u8 twoValueLineInterpolation(u8 i_value1, u8 i_value2, f32 i_param) {
|
||||
@@ -494,6 +497,9 @@ void dMenu_FmapMap_c::_delete() {
|
||||
mResTIMG = NULL;
|
||||
}
|
||||
if (mMapImage_p != NULL) {
|
||||
#if TARGET_PC
|
||||
GXDestroyCopyTex(mMapImage_p);
|
||||
#endif
|
||||
JKR_DELETE_ARRAY(mMapImage_p);
|
||||
mMapImage_p = NULL;
|
||||
}
|
||||
|
||||
@@ -223,13 +223,8 @@ void dMenu_Letter_c::_draw() {
|
||||
f32 y1 = local_178.y;
|
||||
Vec local_184;
|
||||
local_184 = afStack_138.getGlobalVtx(field_0x1ec, &mtx, 3, false, 0);
|
||||
#if TARGET_PC
|
||||
f32 dVar17 = mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth();
|
||||
f32 dVar16 = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
#else
|
||||
f32 dVar17 = mDoGph_gInf_c::getWidthF() / FB_WIDTH;
|
||||
f32 dVar16 = mDoGph_gInf_c::getHeightF() / FB_HEIGHT;
|
||||
#endif
|
||||
f32 fVar1 = (x1 - mDoGph_gInf_c::getMinXF()) / dVar17;
|
||||
f32 fVar2 = y1 / dVar16;
|
||||
grafContext->scissor(fVar1, fVar2,
|
||||
|
||||
@@ -555,19 +555,23 @@ void dMenu_Option_c::_draw() {
|
||||
#endif
|
||||
|
||||
mpBlackTex->setAlpha(0xff);
|
||||
|
||||
#if TARGET_PC
|
||||
mpBlackTex->draw(mDoGph_gInf_c::getMinXF(), mDoGph_gInf_c::getMinYF(), mDoGph_gInf_c::getWidthF(), mDoGph_gInf_c::getHeightF(), 0, 0, 0);
|
||||
#else
|
||||
mpBlackTex->draw(0.0f, 0.0f, FB_WIDTH, FB_HEIGHT, 0, 0, 0);
|
||||
#endif
|
||||
|
||||
mpBackScreen->draw(0.0f, 0.0f, ctx);
|
||||
f32 alpha = (f32)g_drawHIO.mOptionScreen.mBackgroundAlpha * (f32)field_0x374;
|
||||
mpBlackTex->setAlpha(alpha);
|
||||
|
||||
#if TARGET_PC
|
||||
mpBlackTex->draw(mDoGph_gInf_c::getMinXF(), mDoGph_gInf_c::getMinYF(), mDoGph_gInf_c::getWidthF(), mDoGph_gInf_c::getHeightF(), 0, 0, 0);
|
||||
#else
|
||||
mpBlackTex->draw(0.0f, 0.0f, FB_WIDTH, FB_HEIGHT, 0, 0, 0);
|
||||
#endif
|
||||
|
||||
mpScreen->draw(0.0f, 0.0f, ctx);
|
||||
mpClipScreen->draw(0.0f, 0.0f, ctx);
|
||||
#if TARGET_PC
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/game_clock.h"
|
||||
#endif
|
||||
|
||||
typedef void (dMenu_Ring_c::*initFunc)();
|
||||
static initFunc stick_init[] = {
|
||||
/* STATUS_WAIT */ &dMenu_Ring_c::stick_wait_init,
|
||||
@@ -181,8 +185,22 @@ dMenu_Ring_c::dMenu_Ring_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i
|
||||
field_0x682 = 0xc000;
|
||||
break;
|
||||
}
|
||||
#if TARGET_PC
|
||||
mCursorInterpPrevX = 0.0f;
|
||||
mCursorInterpPrevY = 0.0f;
|
||||
mCursorInterpCurrX = 0.0f;
|
||||
mCursorInterpCurrY = 0.0f;
|
||||
mCursorInterpPrevAngle = 0;
|
||||
mCursorInterpCurrAngle = 0;
|
||||
mCursorInterpPrevAngular = false;
|
||||
mCursorInterpCurrAngular = false;
|
||||
mCursorInterpInit = false;
|
||||
#endif
|
||||
for (int i = 0; i < 4; i++) {
|
||||
field_0x674[i] = 0;
|
||||
#if TARGET_PC
|
||||
mSelectItemSlideElapsed[i] = 0.0f;
|
||||
#endif
|
||||
field_0x518[i] = 0.0f;
|
||||
field_0x528[i] = 0.0f;
|
||||
field_0x538[i] = 0.0f;
|
||||
@@ -624,7 +642,71 @@ void dMenu_Ring_c::_draw() {
|
||||
} else {
|
||||
drawSelectItem();
|
||||
drawItem2();
|
||||
#if TARGET_PC
|
||||
f32 simX = 0.0f;
|
||||
f32 simY = 0.0f;
|
||||
bool restoreSimPos = false;
|
||||
if (dusk::frame_interp::is_enabled() && mAlphaRate >= 1.0f) {
|
||||
simX = mpDrawCursor->getPositionX();
|
||||
simY = mpDrawCursor->getPositionY();
|
||||
|
||||
const bool isAngular = (mStatus == STATUS_MOVE) && !mDirectSelectActive;
|
||||
|
||||
if (dusk::frame_interp::get_ui_tick_pending()) {
|
||||
mCursorInterpPrevX = mCursorInterpCurrX;
|
||||
mCursorInterpPrevY = mCursorInterpCurrY;
|
||||
mCursorInterpPrevAngle = mCursorInterpCurrAngle;
|
||||
mCursorInterpPrevAngular = mCursorInterpCurrAngular;
|
||||
|
||||
mCursorInterpCurrX = simX;
|
||||
mCursorInterpCurrY = simY;
|
||||
mCursorInterpCurrAngle = field_0x66e;
|
||||
mCursorInterpCurrAngular = isAngular;
|
||||
|
||||
// reset prev = curr for first render pass or
|
||||
// when angle modes prev/curr differ
|
||||
// to prevent arrival jitter
|
||||
if (!mCursorInterpInit ||
|
||||
mCursorInterpPrevAngular != mCursorInterpCurrAngular) {
|
||||
mCursorInterpPrevX = mCursorInterpCurrX;
|
||||
mCursorInterpPrevY = mCursorInterpCurrY;
|
||||
mCursorInterpPrevAngle = mCursorInterpCurrAngle;
|
||||
mCursorInterpPrevAngular = mCursorInterpCurrAngular;
|
||||
mCursorInterpInit = true;
|
||||
}
|
||||
}
|
||||
if (mCursorInterpInit) {
|
||||
const f32 step = dusk::frame_interp::get_interpolation_step();
|
||||
if (mCursorInterpPrevAngular && mCursorInterpCurrAngular) {
|
||||
const s16 delta = mCursorInterpCurrAngle - mCursorInterpPrevAngle;
|
||||
const s16 lerpedAngle = mCursorInterpPrevAngle + (s16)(delta * step);
|
||||
|
||||
// yoinked from stick_move_proc()
|
||||
const f32 x = g_ringHIO.mItemRingPosX + FB_WIDTH_BASE / 2 +
|
||||
mRingRadiusH * cM_ssin(lerpedAngle);
|
||||
const f32 y = g_ringHIO.mItemRingPosY + FB_HEIGHT_BASE / 2 +
|
||||
mRingRadiusV * cM_scos(lerpedAngle);
|
||||
mpDrawCursor->setPos(x, y);
|
||||
} else {
|
||||
mpDrawCursor->setPos(
|
||||
mCursorInterpPrevX + (mCursorInterpCurrX - mCursorInterpPrevX) * step,
|
||||
mCursorInterpPrevY + (mCursorInterpCurrY - mCursorInterpPrevY) * step
|
||||
);
|
||||
}
|
||||
restoreSimPos = true;
|
||||
}
|
||||
} else {
|
||||
mCursorInterpInit = false;
|
||||
}
|
||||
#endif
|
||||
mpDrawCursor->draw();
|
||||
#if TARGET_PC
|
||||
// prevents offsetting at destination on the next frame
|
||||
// since stick_wait_proc doesn't call setPos and we clobbered mPositionX/Y
|
||||
if (restoreSimPos) {
|
||||
mpDrawCursor->setPos(simX, simY);
|
||||
}
|
||||
#endif
|
||||
mpItemExplain->trans(mCenterPosX, mCenterPosY);
|
||||
mpItemExplain->draw((J2DOrthoGraph*)grafPort);
|
||||
drawFlag0();
|
||||
@@ -1022,6 +1104,9 @@ void dMenu_Ring_c::setJumpItem(bool i_useVibrationM) {
|
||||
field_0x6b8[0] != dComIfGs_getMixItemIndex(0))
|
||||
{
|
||||
field_0x674[0] = 1;
|
||||
#if TARGET_PC
|
||||
mSelectItemSlideElapsed[0] = 0.0f;
|
||||
#endif
|
||||
}
|
||||
} else if (field_0x6b3 == 1) {
|
||||
field_0x538[0] = g_ringHIO.mUnselectItemScale;
|
||||
@@ -1030,6 +1115,9 @@ void dMenu_Ring_c::setJumpItem(bool i_useVibrationM) {
|
||||
field_0x6b8[1] != dComIfGs_getMixItemIndex(1))
|
||||
{
|
||||
field_0x674[1] = 1;
|
||||
#if TARGET_PC
|
||||
mSelectItemSlideElapsed[1] = 0.0f;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (field_0x674[0] == 1) {
|
||||
@@ -1520,7 +1608,15 @@ void dMenu_Ring_c::setSelectItem(int i_idx, u8 i_itemNo) {
|
||||
void dMenu_Ring_c::drawSelectItem() {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (field_0x674[i] != 0) {
|
||||
#if TARGET_PC
|
||||
mSelectItemSlideElapsed[i] += dusk::game_clock::consume_interval(this);
|
||||
const f32 u = std::min(mSelectItemSlideElapsed[i] / dusk::game_clock::period_for_original_frames(10.0f), 1.0f);
|
||||
if (u >= 1.0f) {
|
||||
setSelectItemForce(i);
|
||||
} else {
|
||||
#else
|
||||
if (field_0x674[i] < 10) {
|
||||
#endif
|
||||
f32 initSizeX = dMeter2Info_getMeterItemPanePtr(i)->getInitSizeX() * 1.7f;
|
||||
f32 initSizeY = dMeter2Info_getMeterItemPanePtr(i)->getInitSizeY() * 1.7f;
|
||||
f32 initScaleX = dMeter2Info_getMeterItemPanePtr(i)->getInitScaleX();
|
||||
@@ -1528,7 +1624,11 @@ void dMenu_Ring_c::drawSelectItem() {
|
||||
Vec pos = dMeter2Info_getMeterItemPanePtr(i)->getGlobalVtxCenter(
|
||||
dMeter2Info_getMeterItemPanePtr(i)->mPane, true, 0);
|
||||
|
||||
#if TARGET_PC
|
||||
f32 fVar14 = 0.1f + 0.8f * u;
|
||||
#else
|
||||
f32 fVar14 = field_0x674[i] / 10.0f;
|
||||
#endif
|
||||
if (field_0x6cd != 0xff) {
|
||||
fVar14 = 1.0f - fVar14;
|
||||
}
|
||||
@@ -1549,9 +1649,11 @@ void dMenu_Ring_c::drawSelectItem() {
|
||||
0);
|
||||
}
|
||||
}
|
||||
#if !TARGET_PC
|
||||
field_0x674[i]++;
|
||||
} else {
|
||||
setSelectItemForce(i);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1562,6 +1664,9 @@ void dMenu_Ring_c::setSelectItemForce(int i_idx) {
|
||||
if (field_0x674[i_idx] != 0) {
|
||||
dComIfGs_setSelectItemIndex(i_idx, field_0x6b4[i_idx]);
|
||||
field_0x674[i_idx] = 0;
|
||||
#if TARGET_PC
|
||||
mSelectItemSlideElapsed[i_idx] = 0.0f;
|
||||
#endif
|
||||
}
|
||||
} else if (field_0x674[i_idx] != 0) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
@@ -1569,6 +1674,9 @@ void dMenu_Ring_c::setSelectItemForce(int i_idx) {
|
||||
dComIfGs_setSelectItemIndex(i, field_0x6b4[i]);
|
||||
}
|
||||
field_0x674[i_idx] = 0;
|
||||
#if TARGET_PC
|
||||
mSelectItemSlideElapsed[i_idx] = 0.0f;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+44
-34
@@ -18,6 +18,7 @@
|
||||
#include "m_Do/m_Do_controller_pad.h"
|
||||
#include "m_Do/m_Do_graphic.h"
|
||||
#include "d/d_msg_scrn_explain.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include "dusk/settings.h"
|
||||
#include "JSystem/J2DGraph/J2DAnmLoader.h"
|
||||
#include "f_op/f_op_msg_mng.h"
|
||||
@@ -386,11 +387,7 @@ void dMenu_save_c::screenSet() {
|
||||
mSelectedFile = dComIfGs_getDataNum();
|
||||
mSelIcon = JKR_NEW dSelect_cursor_c(0, 1.0f, NULL);
|
||||
|
||||
#if TARGET_PC
|
||||
mSelIcon->setParam(0.96f * mDoGph_gInf_c::hudAspectScaleUp, 0.94f, 0.03f, 0.7f, 0.7f);
|
||||
#else
|
||||
mSelIcon->setParam(0.96f, 0.94f, 0.03f, 0.7f, 0.7f);
|
||||
#endif
|
||||
|
||||
Vec pos;
|
||||
pos = mpSelData[mSelectedFile]->getGlobalVtxCenter(false, 0);
|
||||
@@ -719,7 +716,9 @@ void dMenu_save_c::_move() {
|
||||
}
|
||||
|
||||
(this->*MenuSaveProc[mMenuProc])();
|
||||
#if !TARGET_PC
|
||||
saveSelAnm();
|
||||
#endif
|
||||
|
||||
if (mWarning != NULL) {
|
||||
mWarning->_move();
|
||||
@@ -736,36 +735,46 @@ void dMenu_save_c::saveSelAnm() {
|
||||
}
|
||||
|
||||
void dMenu_save_c::selFileWakuAnm() {
|
||||
mFileWakuAnmFrame += 2;
|
||||
if (mFileWakuAnmFrame >= mpFileWakuAnm->getFrameMax()) {
|
||||
mFileWakuAnmFrame -= mpFileWakuAnm->getFrameMax();
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
mFileWakuAnmFrame += 2;
|
||||
if (mFileWakuAnmFrame >= mpFileWakuAnm->getFrameMax()) {
|
||||
mFileWakuAnmFrame -= mpFileWakuAnm->getFrameMax();
|
||||
}
|
||||
|
||||
mFileWakuRotAnmFrame += 2;
|
||||
if (mFileWakuRotAnmFrame >= mpFileWakuRotAnm->getFrameMax()) {
|
||||
mFileWakuRotAnmFrame -= mpFileWakuRotAnm->getFrameMax();
|
||||
}
|
||||
}
|
||||
mpFileWakuAnm->setFrame(mFileWakuAnmFrame);
|
||||
|
||||
mFileWakuRotAnmFrame += 2;
|
||||
if (mFileWakuRotAnmFrame >= mpFileWakuRotAnm->getFrameMax()) {
|
||||
mFileWakuRotAnmFrame -= mpFileWakuRotAnm->getFrameMax();
|
||||
}
|
||||
mpFileWakuRotAnm->setFrame(mFileWakuRotAnmFrame);
|
||||
}
|
||||
|
||||
void dMenu_save_c::bookIconAnm() {
|
||||
field_0x154 += 2;
|
||||
if (field_0x154 >= field_0x150->getFrameMax()) {
|
||||
field_0x154 -= field_0x150->getFrameMax();
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
field_0x154 += 2;
|
||||
if (field_0x154 >= field_0x150->getFrameMax()) {
|
||||
field_0x154 -= field_0x150->getFrameMax();
|
||||
}
|
||||
|
||||
field_0x15c += 2;
|
||||
if (field_0x15c >= field_0x158->getFrameMax()) {
|
||||
field_0x15c -= field_0x158->getFrameMax();
|
||||
}
|
||||
|
||||
field_0x164 += 2;
|
||||
if (field_0x164 >= field_0x160->getFrameMax()) {
|
||||
field_0x164 -= field_0x160->getFrameMax();
|
||||
}
|
||||
}
|
||||
field_0x150->setFrame(field_0x154);
|
||||
|
||||
field_0x15c += 2;
|
||||
if (field_0x15c >= field_0x158->getFrameMax()) {
|
||||
field_0x15c -= field_0x158->getFrameMax();
|
||||
}
|
||||
field_0x158->setFrame(field_0x15c);
|
||||
|
||||
field_0x164 += 2;
|
||||
if (field_0x164 >= field_0x160->getFrameMax()) {
|
||||
field_0x164 -= field_0x160->getFrameMax();
|
||||
}
|
||||
field_0x160->setFrame(field_0x164);
|
||||
}
|
||||
|
||||
@@ -2523,11 +2532,7 @@ void dMenu_save_c::yesnoCursorShow() {
|
||||
mSelIcon->setPos(pos.x, pos.y, mpNoYes[mYesNoCursor]->getPanePtr(), true);
|
||||
mSelIcon->setAlphaRate(1.0f);
|
||||
|
||||
#if TARGET_PC
|
||||
mSelIcon->setParam(0.96f * mDoGph_gInf_c::hudAspectScaleUp, 0.84f, 0.06f, 0.5f, 0.5f);
|
||||
#else
|
||||
mSelIcon->setParam(0.96f, 0.84f, 0.06f, 0.5f, 0.5f);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2676,11 +2681,7 @@ void dMenu_save_c::selFileCursorShow() {
|
||||
mSelIcon->setPos(pos.x, pos.y, mpSelData[mSelectedFile]->getPanePtr(), true);
|
||||
mSelIcon->setAlphaRate(1.0f);
|
||||
|
||||
#if TARGET_PC
|
||||
mSelIcon->setParam(0.96f * mDoGph_gInf_c::hudAspectScaleUp, 0.94f, 0.03f, 0.7f, 0.7f);
|
||||
#else
|
||||
mSelIcon->setParam(0.96f, 0.94f, 0.03f, 0.7f, 0.7f);
|
||||
#endif
|
||||
}
|
||||
|
||||
void dMenu_save_c::yesnoWakuAlpahAnmInit(u8 yesnoIdx, u8 startAlpha, u8 endAlpha, u8 anmTimer) {
|
||||
@@ -2782,7 +2783,7 @@ void dMenu_save_c::_draw() {
|
||||
#if TARGET_PC
|
||||
void dMenu_save_c::menuSaveWide() {
|
||||
mSaveSel.Scr->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f);
|
||||
mSaveSel.Scr->translate(mDoGph_gInf_c::getMinXF(), 0.0f);
|
||||
mSaveSel.Scr->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f);
|
||||
|
||||
mSaveSel.Scr->search(MULTI_CHAR('t_for'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
mSaveSel.Scr->search(MULTI_CHAR('t_for1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
@@ -2813,11 +2814,20 @@ void dMenu_save_c::menuSaveWide() {
|
||||
mSaveSel.Scr->search(MULTI_CHAR('w_uzu07'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
mSaveSel.Scr->search(MULTI_CHAR('w_uzu08'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
mSaveSel.Scr->search(MULTI_CHAR('w_uzu09'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
|
||||
#if TARGET_PC
|
||||
if (mSelIcon) {
|
||||
mSelIcon->refreshAspectScale();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void dMenu_save_c::_draw2() {
|
||||
if (field_0x21a1 == 0) {
|
||||
#if TARGET_PC
|
||||
saveSelAnm();
|
||||
#endif
|
||||
if (mpScrnExplain != NULL) {
|
||||
dComIfGd_set2DOpa(&mMenuSaveExplain);
|
||||
}
|
||||
|
||||
+15
-21
@@ -32,15 +32,9 @@ public:
|
||||
if (getDrawFlag() == 1) {
|
||||
setDrawFlag();
|
||||
dComIfGp_onPauseFlag();
|
||||
|
||||
#if TARGET_PC
|
||||
GXSetTexCopySrc(0, 0, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
GXSetTexCopySrc(0, 0, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
GXSetTexCopyDst(mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_ENABLE);
|
||||
GXSetTexCopyDst(FB_WIDTH, FB_HEIGHT, (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_DISABLE);
|
||||
#else
|
||||
GXSetTexCopyDst(FB_WIDTH / 2, FB_HEIGHT / 2, (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_ENABLE);
|
||||
#endif
|
||||
@@ -48,17 +42,17 @@ public:
|
||||
GXPixModeSync();
|
||||
#if TARGET_PC
|
||||
// init mTexObj at capture time so the gpu ref survives window resizes
|
||||
mCaptureWidth = mDoGph_gInf_c::getWidth();
|
||||
mCaptureHeight = mDoGph_gInf_c::getHeight();
|
||||
GXInitTexObj(&mTexObj, mDoGph_gInf_c::getFrameBufferTex(), mCaptureWidth, mCaptureHeight,
|
||||
mCaptureWidth = JUTVideo::getManager()->getRenderWidth();
|
||||
mCaptureHeight = JUTVideo::getManager()->getRenderHeight();
|
||||
GXInitTexObj(&mTexObj, mDoGph_gInf_c::getFrameBufferTex(), FB_WIDTH / 2, FB_HEIGHT / 2,
|
||||
(GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObjLOD(&mTexObj, GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1);
|
||||
#endif
|
||||
} else {
|
||||
#if TARGET_PC
|
||||
// If the window was resized since capture, force a re-capture at the new size
|
||||
if (mCaptureWidth != (u16)mDoGph_gInf_c::getWidth() ||
|
||||
mCaptureHeight != (u16)mDoGph_gInf_c::getHeight()) {
|
||||
if (mCaptureWidth != JUTVideo::getManager()->getRenderWidth() ||
|
||||
mCaptureHeight != JUTVideo::getManager()->getRenderHeight()) {
|
||||
mFlag = 1;
|
||||
return;
|
||||
}
|
||||
@@ -137,8 +131,8 @@ private:
|
||||
/* 0x5 */ u8 mAlpha;
|
||||
/* 0x6 */ u8 mTopFlag;
|
||||
#if TARGET_PC
|
||||
u16 mCaptureWidth;
|
||||
u16 mCaptureHeight;
|
||||
u32 mCaptureWidth;
|
||||
u32 mCaptureHeight;
|
||||
TGXTexObj mTexObj;
|
||||
#endif
|
||||
};
|
||||
@@ -705,7 +699,7 @@ void dMw_c::collect_open_proc() {
|
||||
dMeter2Info_set2DVibrationM();
|
||||
}
|
||||
|
||||
if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::UNKSTATUS_0) {
|
||||
if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::None) {
|
||||
mMenuProc = COLLECT_MOVE;
|
||||
}
|
||||
}
|
||||
@@ -920,7 +914,7 @@ void dMw_c::collect_letter_move_proc() {
|
||||
}
|
||||
|
||||
void dMw_c::collect_letter_close_proc() {
|
||||
if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::UNKSTATUS_0) {
|
||||
if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::None) {
|
||||
mMenuProc = COLLECT_MOVE;
|
||||
}
|
||||
}
|
||||
@@ -952,7 +946,7 @@ void dMw_c::collect_fishing_move_proc() {
|
||||
}
|
||||
|
||||
void dMw_c::collect_fishing_close_proc() {
|
||||
if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::UNKSTATUS_0) {
|
||||
if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::None) {
|
||||
mMenuProc = COLLECT_MOVE;
|
||||
}
|
||||
}
|
||||
@@ -983,7 +977,7 @@ void dMw_c::collect_skill_move_proc() {
|
||||
}
|
||||
|
||||
void dMw_c::collect_skill_close_proc() {
|
||||
if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::UNKSTATUS_0) {
|
||||
if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::None) {
|
||||
mMenuProc = COLLECT_MOVE;
|
||||
}
|
||||
}
|
||||
@@ -1014,13 +1008,13 @@ void dMw_c::collect_insect_move_proc() {
|
||||
}
|
||||
|
||||
void dMw_c::collect_insect_close_proc() {
|
||||
if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::UNKSTATUS_0) {
|
||||
if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::None) {
|
||||
mMenuProc = COLLECT_MOVE;
|
||||
}
|
||||
}
|
||||
|
||||
void dMw_c::insect_open_proc() {
|
||||
if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::UNKSTATUS_0) {
|
||||
if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::None) {
|
||||
field_0x152 = 0;
|
||||
dComIfGp_setHeapLockFlag(1);
|
||||
dMw_insect_create(1);
|
||||
@@ -1056,7 +1050,7 @@ void dMw_c::insect_move_proc() {
|
||||
}
|
||||
|
||||
void dMw_c::insect_close_proc() {
|
||||
if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::UNKSTATUS_0) {
|
||||
if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::None) {
|
||||
mMenuProc = NO_MENU;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-13
@@ -638,12 +638,11 @@ void dMeter2Draw_c::draw() {
|
||||
var_f29 = g_drawHIO.mLightDrop.mDropPikariAnimSpeed_Completed;
|
||||
int temp_r5_2 = g_drawHIO.mLightDrop.mPikariInterval * 15;
|
||||
#ifdef TARGET_PC
|
||||
// Set even if not advancing
|
||||
// FRAME INTERP NOTE: Set even if not advancing
|
||||
var_f28 = g_drawHIO.mLightDrop.mPikariScaleComplete;
|
||||
|
||||
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
|
||||
for (u32 tick = 0; tick < ui_advance_ticks; ++tick) {
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
if (field_0x756 <= temp_r5_2) {
|
||||
int temp_r4 = (field_0x756 % g_drawHIO.mLightDrop.mPikariInterval);
|
||||
int temp_r3_5 = field_0x756 / g_drawHIO.mLightDrop.mPikariInterval;
|
||||
@@ -669,17 +668,12 @@ void dMeter2Draw_c::draw() {
|
||||
}
|
||||
|
||||
field_0x756 = -1;
|
||||
#ifdef TARGET_PC
|
||||
break;
|
||||
#endif
|
||||
} else {
|
||||
field_0x756++;
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (field_0x66c[i] > 0.0f) {
|
||||
@@ -1349,9 +1343,9 @@ void dMeter2Draw_c::drawPikari(f32 i_posX, f32 i_posY, f32* i_framep, f32 i_scal
|
||||
*i_framep = 0.0f;
|
||||
} else {
|
||||
#ifdef TARGET_PC
|
||||
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
|
||||
for (u32 i = 0; i < ui_advance_ticks; ++i) {
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
*i_framep += param_8;
|
||||
if (*i_framep > var_f31) {
|
||||
if (param_9 == 1 || param_9 == 2 || param_9 == 3) {
|
||||
@@ -1366,9 +1360,7 @@ void dMeter2Draw_c::drawPikari(f32 i_posX, f32 i_posY, f32* i_framep, f32 i_scal
|
||||
} else if (*i_framep == 18.0f && param_9 == 2) {
|
||||
mDoAud_seStart(Z2SE_SY_ITEM_COMBINE_ICON, NULL, 0, 0);
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
#endif
|
||||
|
||||
playPikariBckAnimation(*i_framep);
|
||||
playPikariBpkAnimation(*i_framep);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "d/d_msg_out_font.h"
|
||||
#include "d/d_msg_string.h"
|
||||
#include "d/d_pane_class.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include <cstring>
|
||||
|
||||
#if VERSION == VERSION_GCN_JPN
|
||||
@@ -280,15 +281,20 @@ void dMeterButton_c::draw() {
|
||||
|
||||
s16 temp_r6 = g_drawHIO.mEmpButton.mRepeatHitFrameNum;
|
||||
s16 temp_r6_2 = g_drawHIO.mEmpButton.mRepeatHitFrameNum / 2;
|
||||
field_0x4b8[i]++;
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
field_0x4b8[i]++;
|
||||
|
||||
if (field_0x4b8[i] >= temp_r6) {
|
||||
field_0x4b8[i] = 0;
|
||||
if (field_0x4b8[i] >= temp_r6) {
|
||||
field_0x4b8[i] = 0;
|
||||
|
||||
if (field_0x4bc[i] == 0) {
|
||||
field_0x4bc[i] = 1;
|
||||
} else {
|
||||
field_0x4bc[i] = 0;
|
||||
if (field_0x4bc[i] == 0) {
|
||||
field_0x4bc[i] = 1;
|
||||
} else {
|
||||
field_0x4bc[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,8 +368,22 @@ void dMeterButton_c::draw() {
|
||||
}
|
||||
|
||||
if (var_r3) {
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending()) {
|
||||
mWasListen[i] = var_r22;
|
||||
mWasRepeat[i] = var_r23;
|
||||
} else {
|
||||
var_r22 = mWasListen[i];
|
||||
var_r23 = mWasRepeat[i];
|
||||
}
|
||||
#endif
|
||||
if (var_r22) {
|
||||
if (field_0x2e8[i] == 18.0f) {
|
||||
#ifdef TARGET_PC
|
||||
if (field_0x2e8[i] == 18.0f && dusk::frame_interp::get_ui_tick_pending())
|
||||
#else
|
||||
if (field_0x2e8[i] == 18.0f)
|
||||
#endif
|
||||
{
|
||||
mDoAud_seStart(Z2SE_SY_HINT_BUTTON_BLINK, NULL, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
+37
-21
@@ -11,6 +11,7 @@
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/d_meter_HIO.h"
|
||||
#include "d/d_pane_class.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
|
||||
dMeterHaihai_c::dMeterHaihai_c(u8 i_type) {
|
||||
mType = i_type;
|
||||
@@ -286,14 +287,19 @@ void dMeterHaihai_c::updateHaihai() {
|
||||
void dMeterHaihai_c::playBckAnime(J2DAnmTransformKey* i_bck) {
|
||||
if (checkPlayAnime(1)) {
|
||||
if (i_bck != NULL) {
|
||||
if (mType == 4) {
|
||||
mBckFrame += g_drawHIO.mWiiLockArrowBCKAnimSpeed;
|
||||
} else {
|
||||
mBckFrame += g_drawHIO.mScrollArrowBCKAnimSpeed;
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
if (mType == 4) {
|
||||
mBckFrame += g_drawHIO.mWiiLockArrowBCKAnimSpeed;
|
||||
} else {
|
||||
mBckFrame += g_drawHIO.mScrollArrowBCKAnimSpeed;
|
||||
}
|
||||
|
||||
if (mBckFrame >= i_bck->getFrameMax()) {
|
||||
mBckFrame -= i_bck->getFrameMax();
|
||||
if (mBckFrame >= i_bck->getFrameMax()) {
|
||||
mBckFrame -= i_bck->getFrameMax();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mBtkFrame = 1.0f;
|
||||
@@ -309,14 +315,19 @@ void dMeterHaihai_c::playBckAnime(J2DAnmTransformKey* i_bck) {
|
||||
void dMeterHaihai_c::playBtkAnime(J2DAnmTextureSRTKey* i_btk) {
|
||||
if (checkPlayAnime(2)) {
|
||||
if (i_btk != NULL) {
|
||||
if (mType == 4) {
|
||||
mBtkFrame += g_drawHIO.mWiiLockArrowBTKAnimSpeed;
|
||||
} else {
|
||||
mBtkFrame += g_drawHIO.mScrollArrowBTKAnimSpeed;
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
if (mType == 4) {
|
||||
mBtkFrame += g_drawHIO.mWiiLockArrowBTKAnimSpeed;
|
||||
} else {
|
||||
mBtkFrame += g_drawHIO.mScrollArrowBTKAnimSpeed;
|
||||
}
|
||||
|
||||
if (mBtkFrame >= i_btk->getFrameMax()) {
|
||||
mBtkFrame -= i_btk->getFrameMax();
|
||||
if (mBtkFrame >= i_btk->getFrameMax()) {
|
||||
mBtkFrame -= i_btk->getFrameMax();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mBtkFrame = 1.0f;
|
||||
@@ -331,14 +342,19 @@ void dMeterHaihai_c::playBtkAnime(J2DAnmTextureSRTKey* i_btk) {
|
||||
void dMeterHaihai_c::playBpkAnime(J2DAnmColor* i_bpk) {
|
||||
if (checkPlayAnime(0)) {
|
||||
if (i_bpk != NULL) {
|
||||
if (mType == 4) {
|
||||
mBpkFrame += g_drawHIO.mWiiLockArrowBPKAnimSpeed;
|
||||
} else {
|
||||
mBpkFrame += g_drawHIO.mScrollArrowBPKAnimSpeed;
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
if (mType == 4) {
|
||||
mBpkFrame += g_drawHIO.mWiiLockArrowBPKAnimSpeed;
|
||||
} else {
|
||||
mBpkFrame += g_drawHIO.mScrollArrowBPKAnimSpeed;
|
||||
}
|
||||
|
||||
if (mBpkFrame >= i_bpk->getFrameMax()) {
|
||||
mBpkFrame -= i_bpk->getFrameMax();
|
||||
if (mBpkFrame >= i_bpk->getFrameMax()) {
|
||||
mBpkFrame -= i_bpk->getFrameMax();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mBpkFrame = 1.0f;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "d/d_meter2_info.h"
|
||||
#include "d/d_meter_HIO.h"
|
||||
#include "d/d_pane_class.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include <cstring>
|
||||
|
||||
dMeterString_c::dMeterString_c(int i_stringID) {
|
||||
@@ -105,16 +106,27 @@ void dMeterString_c::draw() {
|
||||
f32 var_f30 = 1.0f;
|
||||
|
||||
if (mAnimFrame < 60.0f) {
|
||||
mAnimFrame += g_drawHIO.mMiniGame.mReadyFightTextAnimSpeed;
|
||||
if (mAnimFrame > 60.0f) {
|
||||
mAnimFrame = 60.0f;
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
mAnimFrame += g_drawHIO.mMiniGame.mReadyFightTextAnimSpeed;
|
||||
if (mAnimFrame > 60.0f) {
|
||||
mAnimFrame = 60.0f;
|
||||
}
|
||||
}
|
||||
|
||||
playBckAnimation(mAnimFrame);
|
||||
} else if (mAnimFrame < (f32)g_drawHIO.mMiniGame.mReadyFightTextWaitFrames + 60.0f) {
|
||||
mAnimFrame += var_f30;
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
mAnimFrame += var_f30;
|
||||
} else if (mAnimFrame < var_f31) {
|
||||
mAnimFrame += var_f30;
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
mAnimFrame += var_f30;
|
||||
var_f30 = acc(g_drawHIO.mMiniGame.field_0x172, var_f31 - mAnimFrame, 0);
|
||||
}
|
||||
|
||||
@@ -128,13 +140,21 @@ void dMeterString_c::draw() {
|
||||
if (mPikariAnimFrame > 0.0f) {
|
||||
drawPikari();
|
||||
} else if (mPikariAnimFrame == -1.0f &&
|
||||
#if TARGET_PC
|
||||
dusk::frame_interp::get_ui_tick_pending() &&
|
||||
#endif
|
||||
mAnimFrame > g_drawHIO.mMiniGame.mReadyFightPikariAppearFrames)
|
||||
{
|
||||
mPikariAnimFrame = 18.0f - g_drawHIO.mMiniGame.mReadyFightPikariAnimSpeed;
|
||||
}
|
||||
|
||||
if (mAnimFrame >= var_f31) {
|
||||
dMeter2Info_resetMeterString();
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
if (mAnimFrame >= var_f31) {
|
||||
dMeter2Info_resetMeterString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+35
-7
@@ -12,6 +12,10 @@
|
||||
#include "d/d_lib.h"
|
||||
#include "JSystem/JUtility/JUTFont.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/scope_guard.hpp"
|
||||
#endif
|
||||
|
||||
#if REGION_JPN
|
||||
#define CHAR_CODE_MALE_ICON 0x8189
|
||||
#define CHAR_CODE_FEMALE_ICON 0x818A
|
||||
@@ -303,7 +307,7 @@ static u8 getOutFontNumberType(int param_0) {
|
||||
}
|
||||
}
|
||||
|
||||
#if VERSION == VERSION_GCN_PAL
|
||||
#if TARGET_PC || VERSION == VERSION_GCN_PAL
|
||||
static void setPlayerName(char* i_player_name, u8 param_2) {
|
||||
if (param_2 != 0) {
|
||||
strcpy(i_player_name, dComIfGs_getPlayerName());
|
||||
@@ -1481,7 +1485,7 @@ bool jmessage_tMeasureProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_siz
|
||||
char buffer[40];
|
||||
switch (i_tag & 0xFF00FFFF) {
|
||||
case MSGTAG_PLAYER_GENITIV:
|
||||
#if VERSION == VERSION_GCN_PAL
|
||||
#if TARGET_PC || VERSION == VERSION_GCN_PAL
|
||||
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_GERMAN) {
|
||||
setPlayerName(buffer, 1);
|
||||
} else {
|
||||
@@ -1491,7 +1495,7 @@ bool jmessage_tMeasureProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_siz
|
||||
push_word(buffer);
|
||||
return true;
|
||||
case MSGTAG_HORSE_GENITIV:
|
||||
#if VERSION == VERSION_GCN_PAL
|
||||
#if TARGET_PC || VERSION == VERSION_GCN_PAL
|
||||
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_GERMAN) {
|
||||
setHorseName(buffer, 1);
|
||||
} else {
|
||||
@@ -1918,6 +1922,11 @@ void jmessage_tSequenceProcessor::do_begin(void const* pEntry, char const* pszTe
|
||||
|
||||
pReference->resetReference();
|
||||
field_0xb5 = 0;
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) {
|
||||
field_0xb2 = 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void jmessage_tSequenceProcessor::do_end() {
|
||||
@@ -1978,6 +1987,13 @@ bool jmessage_tSequenceProcessor::do_isReady() {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) {
|
||||
field_0xb2 = 1;
|
||||
pReference->setSendTimer(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (dComIfGp_checkMesgBgm()) {
|
||||
bool isItemMusicPlaying = true;
|
||||
if (mDoAud_checkPlayingSubBgmFlag() != Z2BGM_ITEM_GET &&
|
||||
@@ -2154,6 +2170,18 @@ void jmessage_tSequenceProcessor::do_character(int iCharacter) {
|
||||
bool jmessage_tSequenceProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_size) {
|
||||
jmessage_tReference* pReference = (jmessage_tReference*)getReference();
|
||||
|
||||
#if TARGET_PC
|
||||
// This class runs the lambda function when it goes out of scope. We want to run
|
||||
// this code after the switch statement and this saves us from having to litter
|
||||
// the switch statement with IF_DUSK before every return.
|
||||
auto instantTextRun = SimpleScopeGuard([&]() {
|
||||
if (dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) {
|
||||
field_0xb2 = 1;
|
||||
pReference->setSendTimer(0);
|
||||
}
|
||||
});
|
||||
#endif
|
||||
|
||||
switch (i_tag & 0xFF0000) {
|
||||
case MSGTAG_GROUP(1): {
|
||||
cXyz pos = pReference->getActorPos();
|
||||
@@ -4242,7 +4270,7 @@ bool jmessage_string_tMeasureProcessor::do_tag(u32 i_tag, void const* i_data, u3
|
||||
char buffer[40];
|
||||
switch (i_tag & 0xFF00FFFF) {
|
||||
case MSGTAG_PLAYER_GENITIV:
|
||||
#if VERSION == VERSION_GCN_PAL
|
||||
#if TARGET_PC || VERSION == VERSION_GCN_PAL
|
||||
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_GERMAN) {
|
||||
setPlayerName(buffer, 1);
|
||||
} else {
|
||||
@@ -4253,7 +4281,7 @@ bool jmessage_string_tMeasureProcessor::do_tag(u32 i_tag, void const* i_data, u3
|
||||
stack_pushCurrent(buffer);
|
||||
break;
|
||||
case MSGTAG_HORSE_GENITIV:
|
||||
#if VERSION == VERSION_GCN_PAL
|
||||
#if TARGET_PC || VERSION == VERSION_GCN_PAL
|
||||
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_GERMAN) {
|
||||
setHorseName(buffer, 1);
|
||||
} else {
|
||||
@@ -4850,7 +4878,7 @@ bool jmessage_string_tRenderingProcessor::do_tag(u32 i_tag, void const* i_data,
|
||||
char buffer[40];
|
||||
switch (i_tag & 0xFF00FFFF) {
|
||||
case MSGTAG_PLAYER_GENITIV:
|
||||
#if VERSION == VERSION_GCN_PAL
|
||||
#if TARGET_PC || VERSION == VERSION_GCN_PAL
|
||||
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_GERMAN) {
|
||||
setPlayerName(buffer, 1);
|
||||
} else {
|
||||
@@ -4861,7 +4889,7 @@ bool jmessage_string_tRenderingProcessor::do_tag(u32 i_tag, void const* i_data,
|
||||
push_word(buffer);
|
||||
break;
|
||||
case MSGTAG_HORSE_GENITIV:
|
||||
#if VERSION == VERSION_GCN_PAL
|
||||
#if TARGET_PC || VERSION == VERSION_GCN_PAL
|
||||
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_GERMAN) {
|
||||
setHorseName(buffer, 1);
|
||||
} else {
|
||||
|
||||
+37
-17
@@ -24,9 +24,15 @@
|
||||
#include "f_op/f_op_msg_mng.h"
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "dusk/version.hpp"
|
||||
#include "m_Do/m_Do_controller_pad.h"
|
||||
#include "m_Do/m_Do_lib.h"
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/settings.h"
|
||||
#endif
|
||||
|
||||
static void dMsgObject_addFundRaising(s16 param_0);
|
||||
static void dMsgObject_addTotalPayment(s16 param_0);
|
||||
@@ -1464,24 +1470,12 @@ void dMsgObject_c::fukiPosCalc(bool param_1) {
|
||||
fopAc_ac_c* player = dComIfGp_getPlayer(0);
|
||||
cXyz local_3c;
|
||||
cXyz cStack_48;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&player->eyePos, &cStack_48, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&player->eyePos, &cStack_48);
|
||||
#endif
|
||||
|
||||
f32 temp;
|
||||
if ((field_0x100->pos == cXyz(0.0f, 0.0f, 0.0f))) {
|
||||
temp = cStack_48.y;
|
||||
} else {
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&field_0x100->pos, &local_3c, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&field_0x100->pos, &local_3c);
|
||||
#endif
|
||||
|
||||
if (local_3c.x >= 0.0f && local_3c.x <= FB_WIDTH && local_3c.y >= 0.0f &&
|
||||
local_3c.y <= FB_HEIGHT)
|
||||
{
|
||||
@@ -1566,7 +1560,8 @@ u8 dMsgObject_c::isSend() {
|
||||
if (pRef->getSendFlag() == 5) {
|
||||
if (getStatusLocal() == 21) {
|
||||
setButtonStatusLocal();
|
||||
if (mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
|
||||
if (IF_DUSK((dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) ||)
|
||||
mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
@@ -1585,7 +1580,8 @@ u8 dMsgObject_c::isSend() {
|
||||
}
|
||||
if (pRef->getSendFlag() == 2) {
|
||||
setButtonStatusLocal();
|
||||
if (mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
|
||||
if (IF_DUSK((dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) ||)
|
||||
mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
@@ -1598,7 +1594,8 @@ u8 dMsgObject_c::isSend() {
|
||||
return 2;
|
||||
}
|
||||
} else {
|
||||
if (mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
|
||||
if (IF_DUSK((dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) ||)
|
||||
mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
|
||||
return 2;
|
||||
}
|
||||
if (mesgCancelButton) {
|
||||
@@ -1648,7 +1645,30 @@ void dMsgObject_c::readMessageGroupLocal(mDoDvdThd_mountXArchive_c** p_arcMount)
|
||||
#else
|
||||
#if TARGET_PC
|
||||
// Original game UB
|
||||
snprintf(arcName, sizeof(arcName), "/res/Msgus/bmgres%d.arc", msgGroup);
|
||||
|
||||
if (dusk::version::isRegionPal()) {
|
||||
switch (dComIfGs_getPalLanguage()) {
|
||||
case dSv_player_config_c::LANGUAGE_GERMAN:
|
||||
snprintf(arcName, sizeof(arcName), "/res/Msgde/bmgres%d.arc", msgGroup);
|
||||
break;
|
||||
case dSv_player_config_c::LANGUAGE_FRENCH:
|
||||
snprintf(arcName, sizeof(arcName), "/res/Msgfr/bmgres%d.arc", msgGroup);
|
||||
break;
|
||||
case dSv_player_config_c::LANGUAGE_SPANISH:
|
||||
snprintf(arcName, sizeof(arcName), "/res/Msgsp/bmgres%d.arc", msgGroup);
|
||||
break;
|
||||
case dSv_player_config_c::LANGUAGE_ITALIAN:
|
||||
snprintf(arcName, sizeof(arcName), "/res/Msgit/bmgres%d.arc", msgGroup);
|
||||
break;
|
||||
default:
|
||||
snprintf(arcName, sizeof(arcName), "/res/Msguk/bmgres%d.arc", msgGroup);
|
||||
}
|
||||
} else if (dusk::version::isRegionJpn()) {
|
||||
snprintf(arcName, sizeof(arcName), "/res/Msgjp/bmgres%d.arc", msgGroup);
|
||||
} else {
|
||||
snprintf(arcName, sizeof(arcName), "/res/Msgus/bmgres%d.arc", msgGroup);
|
||||
}
|
||||
|
||||
#else
|
||||
sprintf(arcName, "/res/Msgus/bmgres%d.arc", msgGroup);
|
||||
#endif
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "JSystem/JUtility/JUTTexture.h"
|
||||
#include "d/d_meter2_info.h"
|
||||
#include "d/d_msg_object.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include "f_op/f_op_msg_mng.h"
|
||||
|
||||
COutFontSet_c::COutFontSet_c() {
|
||||
@@ -311,6 +312,15 @@ void COutFont_c::draw(J2DTextBox* i_textbox, f32 param_1, f32 param_2, f32 param
|
||||
sp256[i] = field_0x1b4[i];
|
||||
}
|
||||
|
||||
#ifdef TARGET_PC
|
||||
bool uiTickPending = dusk::frame_interp::get_ui_tick_pending();
|
||||
if (!uiTickPending) {
|
||||
for (int i = 0; i < 70; i++) {
|
||||
sp256[i] = -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < 35; i++) {
|
||||
u8 type = mpOfs[i]->getType();
|
||||
J2DTextBox* tbox = mpOfs[i]->getTextBoxPtr();
|
||||
@@ -505,9 +515,14 @@ void COutFont_c::draw(J2DTextBox* i_textbox, f32 param_1, f32 param_2, f32 param
|
||||
case 20:
|
||||
case 21:
|
||||
case 22:
|
||||
field_0x1b4[type]++;
|
||||
if (field_0x1b4[type] >= 28) {
|
||||
field_0x1b4[type] = 0;
|
||||
#ifdef TARGET_PC
|
||||
if (uiTickPending)
|
||||
#endif
|
||||
{
|
||||
field_0x1b4[type]++;
|
||||
if (field_0x1b4[type] >= 28) {
|
||||
field_0x1b4[type] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
mpPane[type]->rotate(0.5f * sizeX, 0.5f * sizeY, ROTATE_Z,
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "Z2AudioLib/Z2WolfHowlMgr.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include "dusk/settings.h"
|
||||
#endif
|
||||
|
||||
@@ -580,9 +581,14 @@ void dMsgScrnHowl_c::drawWave() {
|
||||
f17 = local_60;
|
||||
f18 = local_64;
|
||||
} else {
|
||||
field_0x2134++;
|
||||
if (field_0x2134 > 30) {
|
||||
field_0x2134 = 0;
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
field_0x2134++;
|
||||
if (field_0x2134 > 30) {
|
||||
field_0x2134 = 0;
|
||||
}
|
||||
}
|
||||
if (field_0x2134 < 15) {
|
||||
local_dc = field_0x2134 / 15.0f;
|
||||
@@ -607,17 +613,10 @@ void dMsgScrnHowl_c::drawGuide() {
|
||||
J2DGrafContext* grafContext = dComIfGp_getCurrentGrafPort();
|
||||
Vec local_b0 = field_0x128;
|
||||
Vec local_bc = field_0x140;
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(
|
||||
(local_b0.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
|
||||
field_0x2118, (local_bc.x - local_b0.x) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
|
||||
field_0x2120);
|
||||
#else
|
||||
grafContext->scissor(
|
||||
(local_b0.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
|
||||
field_0x2118, (local_bc.x - local_b0.x) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
|
||||
field_0x2120);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
f32 local_cc = mpLineH[0]->getGlobalPosX();
|
||||
s16 sVar12 = 0;
|
||||
@@ -745,19 +744,11 @@ void dMsgScrnHowl_c::drawGuide2() {
|
||||
}
|
||||
Vec local_58 = field_0x128;
|
||||
Vec local_64 = field_0x140;
|
||||
#if TARGET_PC
|
||||
f32 local_70 = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
grafContext->scissor(
|
||||
(local_58.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
|
||||
field_0x2118, (local_64.x - local_58.x) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
|
||||
field_0x2120);
|
||||
#else
|
||||
f32 local_70 = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
grafContext->scissor(
|
||||
(local_58.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
|
||||
field_0x2118, (local_64.x - local_58.x) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
|
||||
field_0x2120);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
f32 local_74 = mpLineH[0]->getGlobalPosX();
|
||||
s16 local_134 = 0;
|
||||
@@ -859,15 +850,9 @@ void dMsgScrnHowl_c::drawEffect() {
|
||||
Vec vec1 = field_0x128;
|
||||
Vec vec2 = field_0x140;
|
||||
mDoGph_gInf_c::getHeightF();
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(
|
||||
(vec1.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()), field_0x2118,
|
||||
12.0f + ((vec2.x - vec1.x) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth())), field_0x2120);
|
||||
#else
|
||||
grafContext->scissor(
|
||||
(vec1.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH), field_0x2118,
|
||||
12.0f + ((vec2.x - vec1.x) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH)), field_0x2120);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
u8 timer = daAlink_getAlinkActorClass()->getWolfHowlMgrP()->getReleaseTimer();
|
||||
u8 screenAlpha = mpScreen->search(MULTI_CHAR('line00'))->getAlpha();
|
||||
|
||||
@@ -557,22 +557,11 @@ void dMsgScrnItem_c::fukiPosCalc(u8 param_1) {
|
||||
cXyz local_70;
|
||||
cXyz cStack_7c;
|
||||
f32 f3;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&player->eyePos, &cStack_7c, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&player->eyePos, &cStack_7c);
|
||||
#endif
|
||||
|
||||
if (iVar6->pos == cXyz(0.0f, 0.0f, 0.0f)) {
|
||||
f3 = cStack_7c.y;
|
||||
} else {
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&iVar6->pos, &local_70, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&iVar6->pos, &local_70);
|
||||
#endif
|
||||
|
||||
if (local_70.x >= 0.0f && local_70.x <= FB_WIDTH && local_70.y >= 0.0f &&
|
||||
local_70.y <= FB_HEIGHT)
|
||||
{
|
||||
|
||||
@@ -204,16 +204,14 @@ void dMsgScrnLight_c::draw(f32* i_anmFrame, f32 i_posX, f32 i_posY, f32 i_scaleX
|
||||
|
||||
if (mPlayAnim) {
|
||||
#ifdef TARGET_PC
|
||||
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
|
||||
for (u32 i = 0; i < ui_advance_ticks; ++i) {
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
*i_anmFrame += 1.0f;
|
||||
if (*i_anmFrame >= mpBck->getFrameMax()) {
|
||||
*i_anmFrame = 0.0f;
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
#endif
|
||||
|
||||
mBckFrame = *i_anmFrame;
|
||||
mBpkFrame = *i_anmFrame;
|
||||
@@ -229,17 +227,15 @@ void dMsgScrnLight_c::draw(f32* i_anmFrame, f32 i_posX, f32 i_posY, f32 i_scaleX
|
||||
|
||||
if (mPlayAnim) {
|
||||
#ifdef TARGET_PC
|
||||
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
|
||||
for (u32 i = 0; i < ui_advance_ticks; ++i) {
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
*i_anmFrame += i_anmRate;
|
||||
|
||||
if (*i_anmFrame >= mpBck->getFrameMax()) {
|
||||
*i_anmFrame = 0.0f;
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
#endif
|
||||
|
||||
mBckFrame = *i_anmFrame;
|
||||
mBpkFrame = *i_anmFrame;
|
||||
|
||||
@@ -441,22 +441,11 @@ void dMsgScrnTalk_c::fukiPosCalc(u8 param_1) {
|
||||
cXyz local_70;
|
||||
cXyz cStack_7c;
|
||||
f32 f3y;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&player->eyePos, &cStack_7c, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&player->eyePos, &cStack_7c);
|
||||
#endif
|
||||
|
||||
if (msgActor->pos == cXyz(0.0f, 0.0f, 0.0f)) {
|
||||
f3y = cStack_7c.y;
|
||||
} else {
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&msgActor->pos, &local_70, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&msgActor->pos, &local_70);
|
||||
#endif
|
||||
|
||||
if (local_70.x >= 0.0f && local_70.x <= FB_WIDTH_BASE && local_70.y >= 0.0f &&
|
||||
local_70.y <= FB_HEIGHT_BASE)
|
||||
{
|
||||
|
||||
+27
-2
@@ -271,6 +271,30 @@ void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) {
|
||||
u32 filesize = pHeader->size;
|
||||
u8* pSection = ((u8*)pHeader) + filepos;
|
||||
|
||||
#if TARGET_PC
|
||||
// patch bug in the original game where filepos would be incremented by the next section's size rather than the current section size.
|
||||
// in certain scenarios this would read past the end of the file, incrementing filepos by 0 in an infinite loop
|
||||
while (filepos < filesize) {
|
||||
switch (((bmg_section_t*)pSection)->magic) {
|
||||
case 'FLW1':
|
||||
break;
|
||||
case 'FLI1':
|
||||
break;
|
||||
case 'INF1':
|
||||
pInfoBlock = (bmg_section_t*)pSection;
|
||||
break;
|
||||
case 'DAT1':
|
||||
pMsgDataBlock = pSection;
|
||||
break;
|
||||
case 'STR1':
|
||||
pStrAttributeBlock = (str1_section_t*)pSection;
|
||||
break;
|
||||
}
|
||||
|
||||
filepos += ((bmg_section_t*)pSection)->size;
|
||||
pSection += ((bmg_section_t*)pSection)->size;
|
||||
}
|
||||
#else
|
||||
for (; filepos < filesize; filepos += ((bmg_section_t*)pSection)->size) {
|
||||
switch (((bmg_section_t*)pSection)->magic) {
|
||||
case 'FLW1':
|
||||
@@ -289,6 +313,7 @@ void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) {
|
||||
}
|
||||
pSection += ((bmg_section_t*)pSection)->size;
|
||||
}
|
||||
#endif
|
||||
|
||||
// This section is weird. The debug seems like entriesStr is outside the condition
|
||||
// but the normal build doesn't really work with that. Same for pInfoBlock->entries.
|
||||
@@ -309,11 +334,11 @@ void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) {
|
||||
vals[1] = ((dMsgUnit_inf1_section_t*)pInfoBlock)->entries[i_type].endFrame;
|
||||
#endif
|
||||
|
||||
#if REGION_PAL
|
||||
#if TARGET_PC || REGION_PAL
|
||||
if (i_value == 1 ||
|
||||
(dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_FRENCH &&
|
||||
i_value == 0)) {
|
||||
#elif !REGION_USA
|
||||
#elif !REGION_USA // Dusk TODO: What? This checks for Spanish when *not* PAL or USA?
|
||||
if (i_value == 1 ||
|
||||
(dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_SPANISH &&
|
||||
i_value == 0)) {
|
||||
|
||||
+305
-104
@@ -8,9 +8,15 @@
|
||||
#include "m_Do/m_Do_controller_pad.h"
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "JSystem/J2DGraph/J2DAnmLoader.h"
|
||||
#include "dusk/version.hpp"
|
||||
#include "f_op/f_op_msg_mng.h"
|
||||
|
||||
static bool isPalOrJpn() {
|
||||
return dusk::version::isRegionPal() || dusk::version::isRegionJpn();
|
||||
}
|
||||
|
||||
static const char* l_mojiHira[65] = {
|
||||
"あ", "い", "う", "え", "お", "か", "き", "く", "け", "こ", "さ", "し", "す",
|
||||
"せ", "そ", "た", "ち", "つ", "て", "と", "な", "に", "ぬ", "ね", "の", "は",
|
||||
@@ -66,15 +72,31 @@ static const char* l_mojiEisu[65] = {
|
||||
"X", "k", "x", ",", "L", "Y", "l", "y", ".", "M", "Z", "m", "z", " ",
|
||||
};
|
||||
|
||||
#if REGION_PAL
|
||||
static char* l_mojiEisuPal_1[65] = {
|
||||
#if TARGET_PC
|
||||
// The game normally mutates this string list to fill in the real character codes.
|
||||
// That can't work on a modern platform, so instead I've filled them out ahead of time.
|
||||
static const char* l_mojiEisuPal_1[65] = {
|
||||
"A", "N", "\xC0", "\xCF", "1", "B", "O", "\xC1", "\xD0", "2", "C", "P", "\xC2", "\xD1", "3", "D", "Q",
|
||||
"\xC3", "\xD2", "4", "E", "R", "\xC4", "\xD3", "5", "F", "S", "\xC5", "\xD4", "6", "G", "T", "\xC6", "\xD5",
|
||||
"7", "H", "U", "\xC7", "\xD6", "8", "I", "V", "\xC8", "\xD7", "9", "J", "W", "\xC9", "\xD8", "0", "K",
|
||||
"X", "\xCA", "\xD9", ",", "L", "Y", "\xCB", "\xDA", ".", "M", "Z", "\xCC", "\xDB", " ",
|
||||
};
|
||||
|
||||
static const char* l_mojiEisuPal_2[65] = {
|
||||
"a", "n", "\xE0", "\xEF", "1", "b", "o", "\xE1", "\xF0", "2", "c", "p", "\xE2", "\xF1", "3", "d", "q",
|
||||
"\xE3", "\xF2", "4", "e", "r", "\xE4", "\xF3", "5", "f", "s", "\xE5", "\xF4", "6", "g", "t", "\xE6",
|
||||
"\xF5", "7", "h", "u", "\xE7", "\xF6", "8", "i", "v", "\xE8", "\xF7", "9", "j", "w", "\xE9", "\xF8", "0",
|
||||
"k", "x", "\xEA", "\xF9", ",", "l", "y", "\xEB", "\xFA", ".", "m", "z", "\xEC", "\xFB", " ",
|
||||
};
|
||||
#elif REGION_PAL
|
||||
static const char* l_mojiEisuPal_1[65] = {
|
||||
"A", "N", "AA", "BB", "1", "B", "O", "CC", "DD", "2", "C", "P", "EE", "FF", "3", "D", "Q",
|
||||
"GG", "HH", "4", "E", "R", "II", "JJ", "5", "F", "S", "KK", "LL", "6", "G", "T", "MM", "NN",
|
||||
"7", "H", "U", "OO", "PP", "8", "I", "V", "QQ", "RR", "9", "J", "W", "SS", "TT", "0", "K",
|
||||
"X", "UU", "VV", ",", "L", "Y", "WW", "XX", ".", "M", "Z", "YY", "ZZ", " ",
|
||||
};
|
||||
|
||||
static char* l_mojiEisuPal_2[65] = {
|
||||
static const char* l_mojiEisuPal_2[65] = {
|
||||
"a", "n", "aa", "bb", "1", "b", "o", "cc", "dd", "2", "c", "p", "ee", "ff", "3", "d", "q",
|
||||
"gg", "hh", "4", "e", "r", "ii", "jj", "5", "f", "s", "kk", "ll", "6", "g", "t", "mm",
|
||||
"nn", "7", "h", "u", "oo", "pp", "8", "i", "v", "qq", "rr", "9", "j", "w", "ss", "tt", "0",
|
||||
@@ -82,6 +104,16 @@ static char* l_mojiEisuPal_2[65] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
// ' ' (full-width space)
|
||||
#define SPACE_MAYBE_FULL (dusk::version::isRegionJpn() ? '\x81\x40' : ' ')
|
||||
#elif REGION_JPN
|
||||
// ' ' (full-width space)
|
||||
#define SPACE_MAYBE_FULL '\x81\x40'
|
||||
#else
|
||||
#define SPACE_MAYBE_FULL ' '
|
||||
#endif
|
||||
|
||||
static dNm_HIO_c g_nmHIO;
|
||||
|
||||
typedef void (dName_c::*selProcFunc)(void);
|
||||
@@ -163,13 +195,18 @@ void dName_c::init() {
|
||||
field_0x2ac = mSelProc;
|
||||
field_0x2ad = mSelProc;
|
||||
field_0x2ae = field_0x2ac;
|
||||
#if REGION_PAL || REGION_JPN
|
||||
#if TARGET_PC
|
||||
mMojiSet = isPalOrJpn() ? MOJI_HIRA : MOJI_EIGO;
|
||||
#elif REGION_PAL || REGION_JPN
|
||||
mMojiSet = MOJI_HIRA;
|
||||
#else
|
||||
mMojiSet = MOJI_EIGO;
|
||||
#endif
|
||||
mPrevMojiSet = 255;
|
||||
#if REGION_PAL || REGION_JPN
|
||||
#if TARGET_PC
|
||||
mSelMenu = isPalOrJpn() ? MENU_HIRA : MENU_END;
|
||||
mPrevSelMenu = isPalOrJpn() ? MENU_HIRA : MENU_END;
|
||||
#elif REGION_PAL || REGION_JPN
|
||||
mSelMenu = MENU_HIRA;
|
||||
mPrevSelMenu = MENU_HIRA;
|
||||
#else
|
||||
@@ -187,7 +224,8 @@ void dName_c::initial() {
|
||||
mNextNameStr[0] = 0;
|
||||
}
|
||||
|
||||
#if REGION_PAL || REGION_JPN
|
||||
#if TARGET_PC || REGION_PAL || REGION_JPN
|
||||
IF_DUSK_BLOCK(isPalOrJpn())
|
||||
if (mSelProc == PROC_MOJI_SELECT) {
|
||||
mMenuIcon[mMojiSet]->scale(g_nmHIO.mMenuScale, g_nmHIO.mMenuScale);
|
||||
mMenuText[mMojiSet]->setWhite(JUtility::TColor(0xC8, 0xC8, 0xC8, 0xFF));
|
||||
@@ -196,6 +234,7 @@ void dName_c::initial() {
|
||||
mMenuText[mPrevMojiSet]->setWhite(JUtility::TColor(0x96, 0x96, 0x96, 0xFF));
|
||||
}
|
||||
}
|
||||
IF_DUSK_BLOCK_END
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -230,8 +269,8 @@ void dName_c::_move() {
|
||||
stick->checkTrigger();
|
||||
(this->*SelProc[mSelProc])();
|
||||
|
||||
#if REGION_PAL || REGION_JPN
|
||||
if (mDoCPd_c::getTrigY(PAD_1)) {
|
||||
#if TARGET_PC || REGION_PAL || REGION_JPN
|
||||
if (IF_DUSK(isPalOrJpn() &&) mDoCPd_c::getTrigY(PAD_1)) {
|
||||
mDoAud_seStart(Z2SE_SY_DUMMY, 0, 0, 0);
|
||||
mPrevMojiSet = mMojiSet;
|
||||
mMojiSet++;
|
||||
@@ -245,8 +284,8 @@ void dName_c::_move() {
|
||||
mojiListChange();
|
||||
} else {
|
||||
#endif
|
||||
#if REGION_JPN
|
||||
if (mDoCPd_c::getTrigX(PAD_1)) {
|
||||
#if TARGET_PC || REGION_JPN
|
||||
if (IF_DUSK(dusk::version::isRegionJpn() &&) mDoCPd_c::getTrigX(PAD_1)) {
|
||||
if (mCurPos != 0) {
|
||||
if (mojiChange(mCurPos - 1) == 1) {
|
||||
mDoAud_seStart(Z2SE_SY_DUMMY, 0, 0, 0);
|
||||
@@ -283,12 +322,14 @@ void dName_c::_move() {
|
||||
backSpace();
|
||||
}
|
||||
} else if (mDoCPd_c::getTrigStart(PAD_1)) {
|
||||
#define EIGO_OR_END DUSK_IF_ELSE((dusk::version::isRegionPal() ? MENU_EIGO : MENU_END), MENU_END)
|
||||
|
||||
#if REGION_PAL
|
||||
if ((mSelProc != PROC_MENU_SELECT || mSelMenu != MENU_EIGO) &&
|
||||
(mSelProc == PROC_MENU_SELECT || mSelProc == PROC_MOJI_SELECT))
|
||||
{
|
||||
#else
|
||||
if ((mSelProc != PROC_MENU_SELECT || mSelMenu != MENU_END) &&
|
||||
if ((mSelProc != PROC_MENU_SELECT || mSelMenu != EIGO_OR_END) &&
|
||||
(mSelProc == PROC_MENU_SELECT || mSelProc == PROC_MOJI_SELECT))
|
||||
{
|
||||
#endif
|
||||
@@ -297,7 +338,7 @@ void dName_c::_move() {
|
||||
#if REGION_PAL
|
||||
mSelMenu = MENU_EIGO;
|
||||
#else
|
||||
mSelMenu = MENU_END;
|
||||
mSelMenu = EIGO_OR_END;
|
||||
#endif
|
||||
|
||||
switch (mSelProc) {
|
||||
@@ -314,10 +355,10 @@ void dName_c::_move() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if REGION_JPN
|
||||
#if TARGET_PC || REGION_JPN
|
||||
}
|
||||
#endif
|
||||
#if REGION_PAL || REGION_JPN
|
||||
#if TARGET_PC || REGION_PAL || REGION_JPN
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -327,10 +368,9 @@ void dName_c::_move() {
|
||||
int dName_c::nameCheck() {
|
||||
for (int i = 8, len = 7; i > 0; i--) {
|
||||
#if REGION_JPN
|
||||
// ' ' (full-width space)
|
||||
if (mChrInfo[len].mCharacter != ' ' && mChrInfo[len].mCharacter != '\x81\x40') {
|
||||
#else
|
||||
if (mChrInfo[len].mCharacter != ' ') {
|
||||
if (mChrInfo[len].mCharacter != ' ' IF_DUSK(&& (!dusk::version::isRegionJpn() || mChrInfo[len].mCharacter != '\x81\x40'))) {
|
||||
#endif
|
||||
return len + 1;
|
||||
}
|
||||
@@ -344,8 +384,8 @@ void dName_c::playNameSet(int nameLength) {
|
||||
char* str = mInputStr;
|
||||
|
||||
for (int i = 0; i < nameLength; i++) {
|
||||
#if REGION_JPN
|
||||
if (mChrInfo[i].mMojiSet == 2) {
|
||||
#if TARGET_PC || REGION_JPN
|
||||
if (!dusk::version::isRegionJpn() || mChrInfo[i].mMojiSet == 2) {
|
||||
*str = mChrInfo[i].mCharacter;
|
||||
str += 1;
|
||||
} else {
|
||||
@@ -727,7 +767,34 @@ int dName_c::getMoji() {
|
||||
int result = -1;
|
||||
const char* moji;
|
||||
|
||||
#if REGION_PAL
|
||||
#if TARGET_PC
|
||||
if (dusk::version::isRegionPal()) {
|
||||
switch (mMojiSet) {
|
||||
case MOJI_HIRA:
|
||||
moji = l_mojiEisuPal_1[mCharRow + mCharColumn * 5];
|
||||
break;
|
||||
case MOJI_KATA:
|
||||
moji = l_mojiEisuPal_2[mCharRow + mCharColumn * 5];
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
} else {
|
||||
switch (mMojiSet) {
|
||||
case MOJI_HIRA:
|
||||
moji = l_mojiHira[mCharRow + mCharColumn * 5];
|
||||
break;
|
||||
case MOJI_KATA:
|
||||
moji = l_mojikata[mCharRow + mCharColumn * 5];
|
||||
break;
|
||||
case MOJI_EIGO:
|
||||
moji = l_mojiEisu[mCharRow + mCharColumn * 5];
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
}
|
||||
#elif REGION_PAL
|
||||
switch (mMojiSet) {
|
||||
case MOJI_HIRA:
|
||||
moji = l_mojiEisuPal_1[mCharRow + mCharColumn * 5];
|
||||
@@ -750,7 +817,17 @@ int dName_c::getMoji() {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if REGION_JPN
|
||||
#if TARGET_PC
|
||||
if (dusk::version::isRegionJpn()) {
|
||||
if (*(u8*)moji >> 4 == 0x8 || *(u8*)moji >> 4 == 0x9) {
|
||||
result = *(u16*)moji;
|
||||
} else {
|
||||
result = *moji;
|
||||
}
|
||||
} else {
|
||||
result = *moji;
|
||||
}
|
||||
#elif REGION_JPN
|
||||
if (*(u8*)moji >> 4 == 0x8 || *(u8*)moji >> 4 == 0x9) {
|
||||
result = *(u16*)moji;
|
||||
} else {
|
||||
@@ -763,6 +840,14 @@ int dName_c::getMoji() {
|
||||
return result;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
#define CHAR_TRUNC(val) (dusk::version::isRegionPal() ? val & 0xFF : val)
|
||||
#elif REGION_PAL
|
||||
#define CHAR_TRUNC(val) (val & 0xFF)
|
||||
#else
|
||||
#define CHAR_TRUNC(val) val
|
||||
#endif
|
||||
|
||||
void dName_c::setMoji(int moji) {
|
||||
if (mCurPos == 8 || nameCheck() == 8) {
|
||||
mDoAud_seStart(Z2SE_SYS_ERROR, NULL, 0, 0);
|
||||
@@ -771,24 +856,14 @@ void dName_c::setMoji(int moji) {
|
||||
|
||||
s32 notEmpty = false;
|
||||
for (int i = mCurPos; i < 8; i++) {
|
||||
#if REGION_JPN
|
||||
// ' ' (full-width space)
|
||||
if (mChrInfo[i].mCharacter != '\x81\x40') {
|
||||
#else
|
||||
if (mChrInfo[i].mCharacter != ' ') {
|
||||
#endif
|
||||
if (mChrInfo[i].mCharacter != SPACE_MAYBE_FULL) {
|
||||
notEmpty = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (notEmpty) {
|
||||
#if REGION_JPN
|
||||
// ' ' (full-width space)
|
||||
if (mChrInfo[7].mCharacter == '\x81\x40') {
|
||||
#else
|
||||
if (mChrInfo[7].mCharacter == ' ') {
|
||||
#endif
|
||||
if (mChrInfo[7].mCharacter == SPACE_MAYBE_FULL) {
|
||||
for (int i = 6; i >= mCurPos; i--) {
|
||||
mChrInfo[i + 1] = mChrInfo[i];
|
||||
}
|
||||
@@ -797,11 +872,7 @@ void dName_c::setMoji(int moji) {
|
||||
mChrInfo[mCurPos].mRow = mCharRow;
|
||||
mChrInfo[mCurPos].mMojiSet = mMojiSet;
|
||||
mChrInfo[mCurPos].field_0x3 = 1;
|
||||
#if REGION_PAL
|
||||
mChrInfo[mCurPos].mCharacter = moji & 0xFF;
|
||||
#else
|
||||
mChrInfo[mCurPos].mCharacter = moji;
|
||||
#endif
|
||||
mChrInfo[mCurPos].mCharacter = CHAR_TRUNC(moji);
|
||||
|
||||
if (mCurPos != 8) {
|
||||
mLastCurPos = mCurPos;
|
||||
@@ -814,11 +885,7 @@ void dName_c::setMoji(int moji) {
|
||||
mChrInfo[mCurPos].mRow = mCharRow;
|
||||
mChrInfo[mCurPos].mMojiSet = mMojiSet;
|
||||
mChrInfo[mCurPos].field_0x3 = 1;
|
||||
#if REGION_PAL
|
||||
mChrInfo[mCurPos].mCharacter = moji & 0xFF;
|
||||
#else
|
||||
mChrInfo[mCurPos].mCharacter = moji;
|
||||
#endif
|
||||
mChrInfo[mCurPos].mCharacter = CHAR_TRUNC(moji);
|
||||
|
||||
if (mCurPos != 8) {
|
||||
mLastCurPos = mCurPos;
|
||||
@@ -844,13 +911,8 @@ void dName_c::setNameText() {
|
||||
"CR\x1b"
|
||||
"CC[000000]\x1bGM[0]%c\x1bHM\x1b"
|
||||
"CC[ffffff]\x1bGM[0]%c",
|
||||
#if REGION_PAL
|
||||
(u8)mChrInfo[i].mCharacter & 0xFF,
|
||||
(u8)mChrInfo[i].mCharacter & 0xFF
|
||||
#else
|
||||
(u8)mChrInfo[i].mCharacter,
|
||||
(u8)mChrInfo[i].mCharacter
|
||||
#endif
|
||||
CHAR_TRUNC((u8)mChrInfo[i].mCharacter),
|
||||
CHAR_TRUNC((u8)mChrInfo[i].mCharacter)
|
||||
);
|
||||
#if REGION_JPN
|
||||
} else {
|
||||
@@ -889,7 +951,29 @@ void dName_c::nameCursorMove() {
|
||||
|
||||
void dName_c::selectCursorMove() {
|
||||
int idx;
|
||||
#if REGION_PAL
|
||||
#if TARGET_PC
|
||||
if (dusk::version::isRegionPal()) {
|
||||
if (mCharColumn < 3) {
|
||||
idx = 0;
|
||||
} else if (mCharColumn < 6) {
|
||||
idx = 1;
|
||||
} else if (mCharColumn >= 6) {
|
||||
idx = 2;
|
||||
}
|
||||
} else if (dusk::version::isRegionJpn()) {
|
||||
if (mCharColumn < 3) {
|
||||
idx = 0;
|
||||
} else if (mCharColumn < 6) {
|
||||
idx = 1;
|
||||
} else if (mCharColumn < 8) {
|
||||
idx = 2;
|
||||
} else if (mCharColumn >= 8) {
|
||||
idx = 3;
|
||||
}
|
||||
} else {
|
||||
idx = 3;
|
||||
}
|
||||
#elif REGION_PAL
|
||||
if (mCharColumn < 3) {
|
||||
idx = 0;
|
||||
} else if (mCharColumn < 6) {
|
||||
@@ -930,7 +1014,36 @@ void dName_c::selectCursorMove() {
|
||||
|
||||
void dName_c::menuCursorPosSet() {
|
||||
mPrevSelMenu = mSelMenu;
|
||||
#if REGION_PAL
|
||||
#if TARGET_PC
|
||||
if (dusk::version::isRegionPal()) {
|
||||
if (mCharColumn < 3) {
|
||||
mSelMenu = MENU_HIRA;
|
||||
} else if (mCharColumn < 6) {
|
||||
mSelMenu = MENU_KATA;
|
||||
} else if (mCharColumn >= 6) {
|
||||
mSelMenu = MENU_EIGO;
|
||||
}
|
||||
} else if (dusk::version::isRegionJpn()) {
|
||||
if (mCharColumn < 3) {
|
||||
mSelMenu = MENU_HIRA;
|
||||
return;
|
||||
}
|
||||
if (mCharColumn < 6) {
|
||||
mSelMenu = MENU_KATA;
|
||||
return;
|
||||
}
|
||||
if (mCharColumn < 8) {
|
||||
mSelMenu = MENU_EIGO;
|
||||
return;
|
||||
}
|
||||
if (mCharColumn >= 8) {
|
||||
mSelMenu = MENU_END;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
mSelMenu = MENU_END;
|
||||
}
|
||||
#elif REGION_PAL
|
||||
if (mCharColumn < 3) {
|
||||
mSelMenu = MENU_HIRA;
|
||||
} else if (mCharColumn < 6) {
|
||||
@@ -961,28 +1074,28 @@ void dName_c::menuCursorPosSet() {
|
||||
}
|
||||
|
||||
void dName_c::MenuSelect() {
|
||||
#if REGION_PAL || REGION_JPN
|
||||
if (stick->checkRightTrigger()) {
|
||||
#if TARGET_PC || REGION_PAL || REGION_JPN
|
||||
if (isPalOrJpn() && stick->checkRightTrigger()) {
|
||||
mDoAud_seStart(Z2SE_SY_CURSOR_OPTION, NULL, 0, 0);
|
||||
mPrevSelMenu = mSelMenu;
|
||||
mSelMenu++;
|
||||
#if REGION_PAL
|
||||
if (mSelMenu > MENU_EIGO) {
|
||||
#else
|
||||
if (mSelMenu > MENU_END) {
|
||||
if (mSelMenu > EIGO_OR_END) {
|
||||
#endif
|
||||
mSelMenu = MENU_HIRA;
|
||||
}
|
||||
MenuSelectAnmInit();
|
||||
mSelProc = PROC_MENU_SEL_ANM;
|
||||
} else if (stick->checkLeftTrigger()) {
|
||||
} else if (isPalOrJpn() && stick->checkLeftTrigger()) {
|
||||
mDoAud_seStart(Z2SE_SY_CURSOR_OPTION, NULL, 0, 0);
|
||||
mPrevSelMenu = mSelMenu;
|
||||
if (mSelMenu == MENU_HIRA) {
|
||||
#if REGION_JPN
|
||||
mSelMenu = MENU_END;
|
||||
#else
|
||||
mSelMenu = MENU_EIGO;
|
||||
mSelMenu = dusk::version::isRegionJpn() ? MENU_END : MENU_EIGO;
|
||||
#endif
|
||||
} else {
|
||||
mSelMenu--;
|
||||
@@ -1009,7 +1122,7 @@ void dName_c::MenuSelect() {
|
||||
#if REGION_PAL
|
||||
if (mSelMenu == MENU_EIGO) {
|
||||
#else
|
||||
if (mSelMenu == MENU_END) {
|
||||
if (mSelMenu == EIGO_OR_END) {
|
||||
#endif
|
||||
if (nameCheck() != 0) {
|
||||
mDoAud_seStart(Z2SE_SY_NAME_OK, NULL, 0, 0);
|
||||
@@ -1024,7 +1137,7 @@ void dName_c::MenuSelect() {
|
||||
#if REGION_PAL
|
||||
if (mSelMenu == MENU_EIGO) {
|
||||
#else
|
||||
if (mSelMenu == MENU_END) {
|
||||
if (mSelMenu == EIGO_OR_END) {
|
||||
#endif
|
||||
if (nameCheck() != 0) {
|
||||
mDoAud_seStart(Z2SE_SY_NAME_OK, NULL, 0, 0);
|
||||
@@ -1067,9 +1180,11 @@ void dName_c::MenuSelectAnm2() {
|
||||
if (canMove == true) {
|
||||
if (prevMenu_i != mojiSet_i) {
|
||||
mMenuText[prevMenu_i]->setWhite(JUtility::TColor(0x96, 0x96, 0x96, 0xFF));
|
||||
#if REGION_PAL || REGION_JPN
|
||||
#if TARGET_PC || REGION_PAL || REGION_JPN
|
||||
IF_DUSK_BLOCK(isPalOrJpn())
|
||||
mMenuIcon[mojiSet_i]->scale(g_nmHIO.mMenuScale, g_nmHIO.mMenuScale);
|
||||
mMenuText[mojiSet_i]->setWhite(JUtility::TColor(0xC8, 0xC8, 0xC8, 0xFF));
|
||||
IF_DUSK_BLOCK_END
|
||||
#endif
|
||||
}
|
||||
selectCursorMove();
|
||||
@@ -1081,6 +1196,11 @@ void dName_c::MenuSelectAnm2() {
|
||||
void dName_c::MenuSelectAnm3() {}
|
||||
|
||||
void dName_c::menuAbtnSelect() {
|
||||
#if TARGET_PC
|
||||
if (dusk::version::isRegionPal() && mSelMenu == MENU_EIGO) {
|
||||
goto pal_eigo;
|
||||
}
|
||||
#endif
|
||||
switch (mSelMenu) {
|
||||
case MENU_HIRA:
|
||||
case MENU_KATA:
|
||||
@@ -1098,6 +1218,7 @@ void dName_c::menuAbtnSelect() {
|
||||
#else
|
||||
case MENU_END:
|
||||
#endif
|
||||
IF_DUSK(pal_eigo:)
|
||||
int nameNum = nameCheck();
|
||||
if (nameNum != 0) {
|
||||
playNameSet(nameNum);
|
||||
@@ -1116,44 +1237,33 @@ void dName_c::backSpace() {
|
||||
if (mCurPos != 0) {
|
||||
mDoAud_seStart(Z2SE_SY_NAME_DELETE, NULL, 0, 0);
|
||||
|
||||
#if REGION_JPN
|
||||
// ' ' (full-width space)
|
||||
if (mCurPos == 8 && mChrInfo[7].mCharacter != '\x81\x40') {
|
||||
#else
|
||||
if (mCurPos == 8 && mChrInfo[7].mCharacter != ' ') {
|
||||
#endif
|
||||
if (mCurPos == 8 && mChrInfo[7].mCharacter != SPACE_MAYBE_FULL) {
|
||||
mChrInfo[7].mColumn = 7;
|
||||
mChrInfo[7].mRow = 1;
|
||||
#if REGION_PAL || REGION_JPN
|
||||
#if TARGET_PC
|
||||
mChrInfo[7].mMojiSet = isPalOrJpn() ? MOJI_HIRA : MOJI_EIGO;
|
||||
#elif REGION_PAL || REGION_JPN
|
||||
mChrInfo[7].mMojiSet = MOJI_HIRA;
|
||||
#else
|
||||
mChrInfo[7].mMojiSet = MOJI_EIGO;
|
||||
#endif
|
||||
mChrInfo[7].field_0x3 = 1;
|
||||
#if REGION_JPN
|
||||
// ' ' (full-width space)
|
||||
mChrInfo[7].mCharacter = '\x81\x40';
|
||||
#else
|
||||
mChrInfo[7].mCharacter = ' ';
|
||||
#endif
|
||||
mChrInfo[7].mCharacter = SPACE_MAYBE_FULL;
|
||||
} else {
|
||||
for (int i = mCurPos - 1; i < 7; i++) {
|
||||
mChrInfo[i] = mChrInfo[i + 1];
|
||||
}
|
||||
mChrInfo[7].mColumn = 7;
|
||||
mChrInfo[7].mRow = 1;
|
||||
#if REGION_PAL || REGION_JPN
|
||||
#if TARGET_PC
|
||||
mChrInfo[7].mMojiSet = isPalOrJpn() ? MOJI_HIRA : MOJI_EIGO;
|
||||
#elif REGION_PAL || REGION_JPN
|
||||
mChrInfo[7].mMojiSet = MOJI_HIRA;
|
||||
#else
|
||||
mChrInfo[7].mMojiSet = MOJI_EIGO;
|
||||
#endif
|
||||
mChrInfo[7].field_0x3 = 1;
|
||||
#if REGION_JPN
|
||||
// ' ' (full-width space)
|
||||
mChrInfo[7].mCharacter = '\x81\x40';
|
||||
#else
|
||||
mChrInfo[7].mCharacter = ' ';
|
||||
#endif
|
||||
mChrInfo[7].mCharacter = SPACE_MAYBE_FULL;
|
||||
}
|
||||
|
||||
setNameText();
|
||||
@@ -1164,7 +1274,31 @@ void dName_c::backSpace() {
|
||||
}
|
||||
|
||||
void dName_c::mojiListChange() {
|
||||
#if REGION_PAL
|
||||
#if TARGET_PC
|
||||
const char** mojiSet;
|
||||
if (dusk::version::isRegionPal()) {
|
||||
switch (mMojiSet) {
|
||||
case MOJI_HIRA:
|
||||
mojiSet = l_mojiEisuPal_1;
|
||||
break;
|
||||
case MOJI_KATA:
|
||||
mojiSet = l_mojiEisuPal_2;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (mMojiSet) {
|
||||
case MOJI_HIRA:
|
||||
mojiSet = l_mojiHira;
|
||||
break;
|
||||
case MOJI_KATA:
|
||||
mojiSet = l_mojikata;
|
||||
break;
|
||||
case MOJI_EIGO:
|
||||
mojiSet = l_mojiEisu;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#elif REGION_PAL
|
||||
char** mojiSet;
|
||||
|
||||
switch (mMojiSet) {
|
||||
@@ -1212,7 +1346,8 @@ void dName_c::mojiListChange() {
|
||||
strcpy(mMojiText[i], buf);
|
||||
}
|
||||
|
||||
#if REGION_PAL || REGION_JPN
|
||||
#if TARGET_PC || REGION_PAL || REGION_JPN
|
||||
IF_DUSK_BLOCK(isPalOrJpn())
|
||||
if (mSelProc == PROC_MOJI_SELECT) {
|
||||
mMenuIcon[mMojiSet]->scale(g_nmHIO.mMenuScale, g_nmHIO.mMenuScale);
|
||||
mMenuText[mMojiSet]->setWhite(JUtility::TColor(0xC8, 0xC8, 0xC8, 0xFF));
|
||||
@@ -1221,6 +1356,7 @@ void dName_c::mojiListChange() {
|
||||
mMenuText[mPrevMojiSet]->setWhite(JUtility::TColor(0x96, 0x96, 0x96, 0xFF));
|
||||
}
|
||||
}
|
||||
IF_DUSK_BLOCK_END
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1241,9 +1377,11 @@ void dName_c::menuCursorMove2() {
|
||||
if (menu_i != mojiSet_i) {
|
||||
mMenuIcon[menu_i]->scale(g_nmHIO.mMenuScale, g_nmHIO.mMenuScale);
|
||||
mMenuText[menu_i]->setWhite(JUtility::TColor(0xC8, 0xC8, 0xC8, 0xFF));
|
||||
#if REGION_PAL || REGION_JPN
|
||||
#if TARGET_PC || REGION_PAL || REGION_JPN
|
||||
IF_DUSK_BLOCK(isPalOrJpn())
|
||||
mMenuIcon[mojiSet_i]->scale(1.0f, 1.0f);
|
||||
mMenuText[mojiSet_i]->setWhite(JUtility::TColor(0x96, 0x96, 0x96, 0xFF));
|
||||
IF_DUSK_BLOCK_END
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1265,7 +1403,9 @@ void dName_c::selectCursorPosSet(int row) {
|
||||
mCharColumn = 3;
|
||||
break;
|
||||
case MENU_EIGO:
|
||||
#if REGION_PAL
|
||||
#if TARGET_PC
|
||||
mCharColumn = dusk::version::isRegionPal() ? 8 : 6;
|
||||
#elif REGION_PAL
|
||||
mCharColumn = 8;
|
||||
#else
|
||||
mCharColumn = 6;
|
||||
@@ -1288,7 +1428,11 @@ void dName_c::selectCursorPosSet(int row) {
|
||||
#if TARGET_PC
|
||||
void dName_c::nameWide() {
|
||||
//Resize Select Icon
|
||||
mSelIcon->setParam(0.82f * mDoGph_gInf_c::hudAspectScaleUp, 0.77f, 0.05f, 0.4f, 0.4f);
|
||||
#if TARGET_PC
|
||||
if (mSelIcon) {
|
||||
mSelIcon->refreshAspectScale();
|
||||
}
|
||||
#endif
|
||||
|
||||
// List of Characters Box
|
||||
static u64 l_tagName[65] = {
|
||||
@@ -1477,9 +1621,11 @@ void dName_c::screenSet() {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !(REGION_PAL || REGION_JPN)
|
||||
#if TARGET_PC || !(REGION_PAL || REGION_JPN)
|
||||
IF_DUSK_BLOCK(!isPalOrJpn())
|
||||
mMenuIcon[0]->hide();
|
||||
mMenuIcon[1]->hide();
|
||||
IF_DUSK_BLOCK_END
|
||||
#endif
|
||||
mMojiPane = nameIn.NameInScr->search(MULTI_CHAR('moji_n'));
|
||||
|
||||
@@ -1497,25 +1643,28 @@ void dName_c::screenSet() {
|
||||
((J2DTextBox*)nameTagPane[i])->setFont(nameIn.font);
|
||||
((J2DTextBox*)nameTagPane[i])->setString(72, "");
|
||||
((J2DTextBox*)nameTagPane[i])->setWhite(JUtility::TColor(0xC8, 0xC8, 0xC8, 0xFF));
|
||||
#if REGION_PAL
|
||||
#if TARGET_PC || REGION_PAL
|
||||
IF_DUSK_BLOCK(dusk::version::isRegionPal())
|
||||
((J2DTextBox*)nameTagPane[i])->resize(24.0f, 23.0f);
|
||||
IF_DUSK_BLOCK_END
|
||||
#endif
|
||||
mNameText[i] = ((J2DTextBox*)nameTagPane[i])->getStringPtr();
|
||||
}
|
||||
|
||||
#if REGION_PAL
|
||||
#if REGION_PAL // DUSK version note: this code mutates strings. We just edit the table.
|
||||
IF_DUSK_BLOCK(dusk::version::isRegionPal())
|
||||
int idx = 2;
|
||||
|
||||
static u8 palMoji00[13] = {
|
||||
static const u8 palMoji00[13] = {
|
||||
0xC0, 0xC1, 0xC2, 0xC4, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE,
|
||||
};
|
||||
static u8 palMoji01[13] = {
|
||||
static const u8 palMoji01[13] = {
|
||||
0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD6, 0x8C, 0xD9, 0xDA, 0xDB, 0xDC, 0x2D,
|
||||
};
|
||||
static u8 palMoji10[13] = {
|
||||
static const u8 palMoji10[13] = {
|
||||
0xE0, 0xE1, 0xE2, 0xE4, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE,
|
||||
};
|
||||
static u8 palMoji11[13] = {
|
||||
static const u8 palMoji11[13] = {
|
||||
0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF6, 0x9C, 0xF9, 0xFA, 0xFB, 0xFC, 0xDF,
|
||||
};
|
||||
|
||||
@@ -1532,6 +1681,7 @@ void dName_c::screenSet() {
|
||||
l_mojiEisuPal_2[idx + 1][0] = palMoji11[i];
|
||||
l_mojiEisuPal_2[idx + 1][1] = 0;
|
||||
}
|
||||
IF_DUSK_BLOCK_END
|
||||
#endif
|
||||
|
||||
mCharColumn = 0;
|
||||
@@ -1540,11 +1690,7 @@ void dName_c::screenSet() {
|
||||
mSelIcon = JKR_NEW dSelect_cursor_c(0, 1.0f, NULL);
|
||||
JUT_ASSERT(0, mSelIcon != NULL);
|
||||
|
||||
#if TARGET_PC
|
||||
mSelIcon->setParam(0.82f * mDoGph_gInf_c::hudAspectScaleUp, 0.77f, 0.05f, 0.4f, 0.4f);
|
||||
#else
|
||||
mSelIcon->setParam(0.82f, 0.77f, 0.05f, 0.4f, 0.4f);
|
||||
#endif
|
||||
|
||||
Vec pos = mMojiIcon[mCharRow + mCharColumn * 5]->getGlobalVtxCenter(false, 0);
|
||||
mSelIcon->setPos(pos.x, pos.y, mMojiIcon[mCharRow + mCharColumn * 5]->getPanePtr(), true);
|
||||
@@ -1574,18 +1720,15 @@ void dName_c::displayInit() {
|
||||
mNameCursor[i]->hide();
|
||||
mChrInfo[i].mColumn = 7;
|
||||
mChrInfo[i].mRow = 1;
|
||||
#if REGION_PAL || REGION_JPN
|
||||
#if TARGET_PC
|
||||
mChrInfo[i].mMojiSet = isPalOrJpn() ? MOJI_HIRA : MOJI_EIGO;
|
||||
#elif REGION_PAL || REGION_JPN
|
||||
mChrInfo[i].mMojiSet = MOJI_HIRA;
|
||||
#else
|
||||
mChrInfo[i].mMojiSet = MOJI_EIGO;
|
||||
#endif
|
||||
mChrInfo[i].field_0x3 = 1;
|
||||
#if REGION_JPN
|
||||
// ' ' (full-width space)
|
||||
mChrInfo[i].mCharacter = '\x81\x40';
|
||||
#else
|
||||
mChrInfo[i].mCharacter = ' ';
|
||||
#endif
|
||||
mChrInfo[i].mCharacter = SPACE_MAYBE_FULL;
|
||||
}
|
||||
|
||||
mIsInputEnd = false;
|
||||
@@ -1596,7 +1739,63 @@ void dName_c::NameStrSet() {
|
||||
|
||||
int i = 0;
|
||||
while (*moji != 0) {
|
||||
#if REGION_PAL
|
||||
#if TARGET_PC
|
||||
if (dusk::version::isRegionPal()) {
|
||||
mChrInfo[i].mCharacter = static_cast<u8>(*moji);
|
||||
|
||||
for (int j = 0; j < 65; j++) {
|
||||
if (mChrInfo[i].mCharacter == *(u8*)l_mojiEisuPal_1[j] ||
|
||||
mChrInfo[i].mCharacter == *(u16*)l_mojiEisuPal_2[j])
|
||||
{
|
||||
mChrInfo[i].mColumn = j / 5;
|
||||
mChrInfo[i].mRow = j % 5;
|
||||
mChrInfo[i].mMojiSet = MOJI_HIRA;
|
||||
break;
|
||||
}
|
||||
}
|
||||
moji++;
|
||||
i++;
|
||||
} else {
|
||||
if (*(u8*)moji >> 4 == 8 || *(u8*)moji >> 4 == 9) {
|
||||
mChrInfo[i].mCharacter = *(u16*)moji;
|
||||
|
||||
for (int j = 0; j < 65; j++) {
|
||||
if (mChrInfo[i].mCharacter == *(u16*)l_mojiHira[j] ||
|
||||
mChrInfo[i].mCharacter == *(u16*)l_mojiHira2[j] ||
|
||||
mChrInfo[i].mCharacter == *(u16*)l_mojiHira3[j])
|
||||
{
|
||||
mChrInfo[i].mColumn = j / 5;
|
||||
mChrInfo[i].mRow = j % 5;
|
||||
mChrInfo[i].mMojiSet = MOJI_HIRA;
|
||||
break;
|
||||
} else if (mChrInfo[i].mCharacter == *(u16*)l_mojikata[j] ||
|
||||
mChrInfo[i].mCharacter == *(u16*)l_mojikata2[j] ||
|
||||
mChrInfo[i].mCharacter == *(u16*)l_mojikata3[j])
|
||||
{
|
||||
mChrInfo[i].mColumn = j / 5;
|
||||
mChrInfo[i].mRow = j % 5;
|
||||
mChrInfo[i].mMojiSet = MOJI_KATA;
|
||||
break;
|
||||
}
|
||||
}
|
||||
moji += 2;
|
||||
i++;
|
||||
} else {
|
||||
mChrInfo[i].mCharacter = *moji;
|
||||
|
||||
for (int j = 0; j < 65; j++) {
|
||||
if (mChrInfo[i].mCharacter == *(u8*)l_mojiEisu[j]) {
|
||||
mChrInfo[i].mColumn = j / 5;
|
||||
mChrInfo[i].mRow = j % 5;
|
||||
mChrInfo[i].mMojiSet = MOJI_EIGO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
moji++;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
#elif REGION_PAL
|
||||
mChrInfo[i].mCharacter = static_cast<u8>(*moji);
|
||||
|
||||
for (int j = 0; j < 65; j++) {
|
||||
@@ -1669,7 +1868,9 @@ s32 dName_c::getMenuPosIdx(u8 selPos) {
|
||||
result = 1;
|
||||
break;
|
||||
case 2:
|
||||
#if REGION_PAL
|
||||
#if TARGET_PC
|
||||
result = dusk::version::isRegionPal() ? 3 : 2;
|
||||
#elif REGION_PAL
|
||||
result = 3;
|
||||
#else
|
||||
result = 2;
|
||||
|
||||
@@ -26,8 +26,8 @@ static void dOvlpFd_startFadeIn(int param_0) {
|
||||
JUTFader* fader = JFWDisplay::getManager()->getFader();
|
||||
JUT_ASSERT(0, fader != NULL);
|
||||
|
||||
fader->setStatus(JUTFader::UNKSTATUS_0, 0);
|
||||
fader->setStatus(JUTFader::UNKSTATUS_0, -1);
|
||||
fader->setStatus(JUTFader::None, 0);
|
||||
fader->setStatus(JUTFader::None, -1);
|
||||
fader->startFadeIn(param_0);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,13 +12,8 @@
|
||||
#include "m_Do/m_Do_graphic.h"
|
||||
|
||||
void dOvlpFd2_dlst_c::draw() {
|
||||
#if TARGET_PC
|
||||
GXSetViewport(0.0f, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
GXSetViewport(0.0f, 0.0f, FB_WIDTH, FB_HEIGHT, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGB, GX_RGBA4, 0);
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user