mirror of
https://github.com/BernardoGiordano/Checkpoint
synced 2024-11-25 02:00:17 +00:00
Make it impossible to exit before the title thread is finished
This commit is contained in:
parent
53235c622c
commit
718fc2cdee
3 changed files with 11 additions and 5 deletions
|
@ -38,5 +38,6 @@ inline bool g_bottomScrollEnabled = false;
|
|||
inline float g_timer = 0;
|
||||
inline std::string g_selectedCheatKey;
|
||||
inline std::vector<std::string> g_selectedCheatCodes;
|
||||
inline volatile bool g_isLoadingTitles = false;
|
||||
|
||||
#endif
|
|
@ -40,11 +40,17 @@ int main()
|
|||
Threads::create((ThreadFunc)Threads::titles);
|
||||
ATEXIT(Threads::destroy);
|
||||
|
||||
while (aptMainLoop() && !(hidKeysDown() & KEY_START)) {
|
||||
while (aptMainLoop()) {
|
||||
touchPosition touch;
|
||||
hidScanInput();
|
||||
hidTouchRead(&touch);
|
||||
|
||||
if (hidKeysDown() & KEY_START) {
|
||||
if (!g_isLoadingTitles) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Configuration::getInstance().shouldScanCard()) {
|
||||
updateCard();
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
static std::vector<Thread> threads;
|
||||
|
||||
static bool forceRefresh = false;
|
||||
static volatile bool isLoadingTitles = false;
|
||||
|
||||
void Threads::create(ThreadFunc entrypoint)
|
||||
{
|
||||
|
@ -50,12 +49,12 @@ void Threads::destroy(void)
|
|||
void Threads::titles(void)
|
||||
{
|
||||
// don't load titles while they're loading
|
||||
if (isLoadingTitles) {
|
||||
if (g_isLoadingTitles) {
|
||||
return;
|
||||
}
|
||||
|
||||
isLoadingTitles = true;
|
||||
g_isLoadingTitles = true;
|
||||
loadTitles(forceRefresh);
|
||||
forceRefresh = true;
|
||||
isLoadingTitles = false;
|
||||
g_isLoadingTitles = false;
|
||||
}
|
Loading…
Reference in a new issue