mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-05 20:24:01 +01:00
Use the latch in dialogs throughout.
This makes it so that rapid fire works for them as well.
This commit is contained in:
1 parent
c9c179d233
commit
77acd0729f
6 files changed
+18
-15
No files matched your search
@@ -18,6 +18,7 @@
|
||||
#include "i18n/i18n.h"
|
||||
|
||||
#include "Common/ChunkFile.h"
|
||||
#include "Core/HLE/sceCtrl.h"
|
||||
#include "Core/Util/PPGeDraw.h"
|
||||
#include "Core/Dialog/PSPDialog.h"
|
||||
|
||||
@@ -124,14 +125,20 @@ pspUtilityDialogCommon *PSPDialog::GetCommonParam()
|
||||
return 0;
|
||||
}
|
||||
|
||||
void PSPDialog::UpdateButtons()
|
||||
{
|
||||
lastButtons = __CtrlPeekButtons();
|
||||
buttons = __CtrlReadLatch();
|
||||
}
|
||||
|
||||
bool PSPDialog::IsButtonPressed(int checkButton)
|
||||
{
|
||||
return !isFading && !(lastButtons & checkButton) && (buttons & checkButton);
|
||||
return !isFading && (buttons & checkButton);
|
||||
}
|
||||
|
||||
bool PSPDialog::IsButtonHeld(int checkButton, int &framesHeld, int framesHeldThreshold, int framesHeldRepeatRate)
|
||||
{
|
||||
bool btnWasHeldLastFrame = (lastButtons & checkButton) && (buttons & checkButton);
|
||||
bool btnWasHeldLastFrame = (lastButtons & checkButton) && (__CtrlPeekButtons() & checkButton);
|
||||
if (!isFading && btnWasHeldLastFrame) {
|
||||
framesHeld++;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user