2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-19 04:45:23 +00:00

Input handling for CGuiFrame

This commit is contained in:
Jack Andersen
2016-03-14 13:32:44 -10:00
parent aa207d3e5f
commit 66247cfe79
18 changed files with 501 additions and 93 deletions

View File

@@ -0,0 +1,30 @@
#include "CGuiAutoRepeatData.hpp"
namespace urde
{
void CGuiAutoRepeatData::AddAutoEvent(int cIdx, CGuiPhysicalMsg::PhysicalMap& events, float eTime)
{
if (x28_pressed[cIdx])
{
if (x2c_defer[cIdx])
{
x2c_defer[cIdx] = false;
return;
}
if (eTime >= x8_nextDue[cIdx])
{
CGuiPhysicalMsg::AddControllerID(events, x0_instEvent, true);
x8_nextDue[cIdx] = x18_remainder[cIdx] + eTime;
x18_remainder[cIdx] -= 0.05;
if (x18_remainder[cIdx] < 0.05)
x18_remainder[cIdx] = 0.05;
}
if (CGuiPhysicalMsg::FindControllerID(events, x4_contEvent) ==
CGuiPhysicalMsg::EControllerState::NotPressed)
x28_pressed[cIdx] = false;
}
}
}