mirror of https://github.com/AxioDL/metaforce.git
animation timing fix
This commit is contained in:
parent
5951beaf9e
commit
fda85c2f6f
|
@ -350,6 +350,7 @@ void ModalWindow::think()
|
||||||
case Phase::BuildIn:
|
case Phase::BuildIn:
|
||||||
{
|
{
|
||||||
bool loadVerts = false;
|
bool loadVerts = false;
|
||||||
|
int doneCount = 0;
|
||||||
if (m_frame > WIRE_START)
|
if (m_frame > WIRE_START)
|
||||||
{
|
{
|
||||||
float wt = (m_frame-WIRE_START) / float(WIRE_FRAMES);
|
float wt = (m_frame-WIRE_START) / float(WIRE_FRAMES);
|
||||||
|
@ -357,6 +358,8 @@ void ModalWindow::think()
|
||||||
m_lineTime = CubicEase(wt);
|
m_lineTime = CubicEase(wt);
|
||||||
setLineVerts(m_width, m_height, pf, m_lineTime);
|
setLineVerts(m_width, m_height, pf, m_lineTime);
|
||||||
setLineColors(wt);
|
setLineColors(wt);
|
||||||
|
if (wt == 2.f)
|
||||||
|
++doneCount;
|
||||||
loadVerts = true;
|
loadVerts = true;
|
||||||
}
|
}
|
||||||
if (m_frame > SOLID_START)
|
if (m_frame > SOLID_START)
|
||||||
|
@ -364,6 +367,8 @@ void ModalWindow::think()
|
||||||
float ft = (m_frame-SOLID_START) / float(SOLID_FRAMES);
|
float ft = (m_frame-SOLID_START) / float(SOLID_FRAMES);
|
||||||
ft = Zeus::Math::clamp(0.f, ft, 2.f);
|
ft = Zeus::Math::clamp(0.f, ft, 2.f);
|
||||||
setFillColors(ft);
|
setFillColors(ft);
|
||||||
|
if (ft == 2.f)
|
||||||
|
++doneCount;
|
||||||
loadVerts = true;
|
loadVerts = true;
|
||||||
}
|
}
|
||||||
if (res.fontCacheReady() && m_frame > CONTENT_START)
|
if (res.fontCacheReady() && m_frame > CONTENT_START)
|
||||||
|
@ -374,8 +379,10 @@ void ModalWindow::think()
|
||||||
tt = Zeus::Math::clamp(0.f, tt, 1.f);
|
tt = Zeus::Math::clamp(0.f, tt, 1.f);
|
||||||
updateContentOpacity(tt);
|
updateContentOpacity(tt);
|
||||||
if (tt == 1.f)
|
if (tt == 1.f)
|
||||||
m_phase = Phase::Showing;
|
++doneCount;
|
||||||
}
|
}
|
||||||
|
if (doneCount == 3)
|
||||||
|
m_phase = Phase::Showing;
|
||||||
if (loadVerts)
|
if (loadVerts)
|
||||||
m_vertsBuf->load(&m_verts, sizeof(m_verts));
|
m_vertsBuf->load(&m_verts, sizeof(m_verts));
|
||||||
++m_frame;
|
++m_frame;
|
||||||
|
|
Loading…
Reference in New Issue