mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-31 00:45:24 -04:00
Merge pull request #426 from TwilitRealm/fix/cat_cs
More interpolation fixes
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+42
-39
@@ -23,9 +23,7 @@
|
||||
#include "m_Do/m_Do_lib.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#endif
|
||||
|
||||
static int dTimer_createStart2D(s32 param_0, u16 param_1);
|
||||
|
||||
@@ -1340,11 +1338,11 @@ void dDlst_TimerScrnDraw_c::draw() {
|
||||
f32 temp = (f32)g_drawHIO.mMiniGame.mGetInTextAlphaFrames +
|
||||
((f32)g_drawHIO.mMiniGame.mGetInTextWaitFrames + 60.0f);
|
||||
|
||||
for (int i = 0; i < 51; i++) {
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
for (int i = 0; i < 51; i++) {
|
||||
{
|
||||
if (m_getin_info[i].bck_frame > 0.0f && m_getin_info[i].bck_frame < temp) {
|
||||
if (m_getin_info[i].bck_frame < 60.0f) {
|
||||
m_getin_info[i].bck_frame += g_drawHIO.mMiniGame.mGetInTextAnimSpeed;
|
||||
@@ -1357,45 +1355,50 @@ void dDlst_TimerScrnDraw_c::draw() {
|
||||
m_getin_info[i].bck_frame++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_getin_info[i].bck_frame > 0.0f && m_getin_info[i].bck_frame < temp) {
|
||||
f32 var_f29 = 1.0f;
|
||||
if (m_getin_info[i].bck_frame >= g_drawHIO.mMiniGame.mGetInTextWaitFrames + 60.0f &&
|
||||
m_getin_info[i].bck_frame < temp) {
|
||||
var_f29 = acc(g_drawHIO.mMiniGame.mGetInTextAlphaFrames,
|
||||
temp - m_getin_info[i].bck_frame, 0);
|
||||
if (m_getin_info[i].bck_frame > 0.0f && m_getin_info[i].bck_frame < temp) {
|
||||
f32 var_f29 = 1.0f;
|
||||
if (m_getin_info[i].bck_frame >= g_drawHIO.mMiniGame.mGetInTextWaitFrames + 60.0f &&
|
||||
m_getin_info[i].bck_frame < temp) {
|
||||
var_f29 = acc(g_drawHIO.mMiniGame.mGetInTextAlphaFrames,
|
||||
temp - m_getin_info[i].bck_frame, 0);
|
||||
}
|
||||
|
||||
if (m_getin_info[i].bck_frame < 60.0f) {
|
||||
playBckAnimation(m_getin_info[i].bck_frame);
|
||||
} else {
|
||||
playBckAnimation(60.0f);
|
||||
}
|
||||
|
||||
mpGetInParent->setAlphaRate(var_f29);
|
||||
|
||||
if (g_drawHIO.mMiniGame.mGetInTextLocation == 1) {
|
||||
mpGetInRoot->translate(m_getin_info[i].pos_x + g_drawHIO.mMiniGame.mGetInTextPosX,
|
||||
m_getin_info[i].pos_y + g_drawHIO.mMiniGame.mGetInTextPosY);
|
||||
} else {
|
||||
f32 temp_f2 = m_getin_info[i].bck_frame - 40.0f;
|
||||
f32 var_f3 = ((temp_f2 * 0.5f) * temp_f2) * 0.15f;
|
||||
if (i == 0) {
|
||||
var_f3 = 0.0f;
|
||||
}
|
||||
|
||||
if (m_getin_info[i].bck_frame < 60.0f) {
|
||||
playBckAnimation(m_getin_info[i].bck_frame);
|
||||
} else {
|
||||
playBckAnimation(60.0f);
|
||||
}
|
||||
mpGetInRoot->paneTrans(
|
||||
m_getin_info[i].pos_x + g_drawHIO.mMiniGame.mGetInTextPosX,
|
||||
(m_getin_info[i].pos_y + g_drawHIO.mMiniGame.mGetInTextPosY) - var_f3);
|
||||
}
|
||||
|
||||
mpGetInParent->setAlphaRate(var_f29);
|
||||
mpGetInRoot->scale(g_drawHIO.mMiniGame.mGetInTextSizeX,
|
||||
g_drawHIO.mMiniGame.mGetInTextSizeY);
|
||||
mpGetInScreen->draw(0.0f, 0.0f, graf_ctx);
|
||||
|
||||
if (g_drawHIO.mMiniGame.mGetInTextLocation == 1) {
|
||||
mpGetInRoot->translate(m_getin_info[i].pos_x + g_drawHIO.mMiniGame.mGetInTextPosX,
|
||||
m_getin_info[i].pos_y + g_drawHIO.mMiniGame.mGetInTextPosY);
|
||||
} else {
|
||||
f32 temp_f2 = m_getin_info[i].bck_frame - 40.0f;
|
||||
f32 var_f3 = ((temp_f2 * 0.5f) * temp_f2) * 0.15f;
|
||||
if (i == 0) {
|
||||
var_f3 = 0.0f;
|
||||
}
|
||||
|
||||
mpGetInRoot->paneTrans(
|
||||
m_getin_info[i].pos_x + g_drawHIO.mMiniGame.mGetInTextPosX,
|
||||
(m_getin_info[i].pos_y + g_drawHIO.mMiniGame.mGetInTextPosY) - var_f3);
|
||||
}
|
||||
|
||||
mpGetInRoot->scale(g_drawHIO.mMiniGame.mGetInTextSizeX,
|
||||
g_drawHIO.mMiniGame.mGetInTextSizeY);
|
||||
mpGetInScreen->draw(0.0f, 0.0f, graf_ctx);
|
||||
|
||||
if (m_getin_info[i].pikari_frame > 0.0f) {
|
||||
drawPikari(i);
|
||||
} else if (m_getin_info[i].pikari_frame == -1.0f) {
|
||||
if (m_getin_info[i].pikari_frame > 0.0f) {
|
||||
drawPikari(i);
|
||||
} else if (m_getin_info[i].pikari_frame == -1.0f) {
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
if (m_getin_info[i].field_0xc == 0) {
|
||||
if (m_getin_info[i].bck_frame > g_drawHIO.mMiniGame.mGetInPikariAppearFrames) {
|
||||
m_getin_info[i].pikari_frame =
|
||||
|
||||
Reference in New Issue
Block a user