2019-12-22 20:04:07 +00:00
|
|
|
#include "Runtime/Input/CInputGenerator.hpp"
|
|
|
|
|
|
|
|
#include "Runtime/CArchitectureMessage.hpp"
|
|
|
|
#include "Runtime/CArchitectureQueue.hpp"
|
2015-08-28 00:11:31 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2015-08-28 00:11:31 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CInputGenerator::Update(float dt, CArchitectureQueue& queue) {
|
|
|
|
if (m_firstFrame) {
|
|
|
|
m_firstFrame = false;
|
|
|
|
return;
|
|
|
|
}
|
2016-02-21 06:34:42 +00:00
|
|
|
|
2022-02-08 01:48:08 +00:00
|
|
|
const CFinalInput& kbInput = getFinalInput(0, dt);
|
|
|
|
queue.Push(MakeMsg::CreateUserInput(EArchMsgTarget::Game, kbInput));
|
2015-08-29 01:30:47 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
/* Dolphin controllers next */
|
2022-02-08 01:48:08 +00:00
|
|
|
// for (int i = 0; i < 4; ++i) {
|
|
|
|
// bool connected;
|
|
|
|
// EStatusChange change = m_dolphinCb.getStatusChange(i, connected);
|
|
|
|
// if (change != EStatusChange::NoChange)
|
|
|
|
// queue.Push(MakeMsg::CreateControllerStatus(EArchMsgTarget::Game, i, connected));
|
|
|
|
// if (connected) {
|
|
|
|
// CFinalInput input = m_dolphinCb.getFinalInput(i, dt, m_leftDiv, m_rightDiv);
|
|
|
|
// if (i == 0) /* Merge KB input with first controller */
|
|
|
|
// {
|
|
|
|
// input |= kbInput;
|
|
|
|
// kbUsed = true;
|
|
|
|
// }
|
|
|
|
// m_lastUpdate = input;
|
|
|
|
// queue.Push(MakeMsg::CreateUserInput(EArchMsgTarget::Game, input));
|
|
|
|
// }
|
|
|
|
// }
|
2015-08-28 00:11:31 +00:00
|
|
|
|
2022-02-08 01:48:08 +00:00
|
|
|
// /* Send straight keyboard input if no first controller present */
|
|
|
|
// if (!kbUsed) {
|
|
|
|
// m_lastUpdate = kbInput;
|
|
|
|
// }
|
2015-08-29 01:30:47 +00:00
|
|
|
}
|
2015-08-28 00:11:31 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|