MCPcopy Create free account
hub / github.com/Cpasjuste/pplay / onUpdate

Method onUpdate

src/main.cpp:178–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176}
177
178void Main::onUpdate() {
179 unsigned int keys = getInput()->getKeys(0);
180 if (keys != Input::Key::Delay) {
181 bool changed = (oldKeys ^ keys) != 0;
182 oldKeys = keys;
183 if (!changed) {
184 if (timer->getElapsedTime().asSeconds() > 5) {
185 getInput()->setRepeatDelay(INPUT_DELAY / 20);
186 } else if (timer->getElapsedTime().asSeconds() > 3) {
187 getInput()->setRepeatDelay(INPUT_DELAY / 8);
188 } else if (timer->getElapsedTime().asSeconds() > 1) {
189 getInput()->setRepeatDelay(INPUT_DELAY / 4);
190 }
191 } else {
192 getInput()->setRepeatDelay(INPUT_DELAY);
193 timer->restart();
194 }
195 }
196
197 C2DRenderer::onUpdate();
198}
199
200void Main::show(MenuType type) {
201 if (player->getMpv()->isStopped() && player->isFullscreen()) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected