Skip to content

Commit 6dad976

Browse files
committed
Press Left to stop the video without exiting it
1 parent 28b74a9 commit 6dad976

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

arm9/source/main.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ void renderFrames(void) {
223223
}
224224

225225
int playRvid(const char* filename) {
226+
bool confirmReturn = false;
226227
bool confirmStop = false;
227228

228229
if (rvidHeader.ver > 1) {
@@ -355,6 +356,10 @@ int playRvid(const char* filename) {
355356
}
356357
if (keysDown() & KEY_B
357358
|| ((keysDown() & KEY_TOUCH) && touch.px >= 2 && touch.px <= 159 && touch.py >= 162 && touch.py <= 191)) {
359+
confirmReturn = true;
360+
break;
361+
}
362+
if (keysDown() & KEY_LEFT) {
358363
confirmStop = true;
359364
break;
360365
}
@@ -388,6 +393,10 @@ int playRvid(const char* filename) {
388393
}
389394
if (keysDown() & KEY_B
390395
|| ((keysDown() & KEY_TOUCH) && touch.px >= 2 && touch.px <= 159 && touch.py >= 162 && touch.py <= 191)) {
396+
confirmReturn = true;
397+
break;
398+
}
399+
if (keysDown() & KEY_LEFT) {
391400
confirmStop = true;
392401
break;
393402
}
@@ -410,7 +419,10 @@ int playRvid(const char* filename) {
410419
snd().beginStream();
411420
}
412421
}
413-
if (currentFrame > (int)rvidHeader.frames) {
422+
if (keysDown() & KEY_LEFT) {
423+
confirmStop = true;
424+
}
425+
if ((videoPlaying && confirmStop) || currentFrame > (int)rvidHeader.frames) {
414426
videoPlaying = false;
415427
snd().stopStream();
416428

@@ -442,8 +454,9 @@ int playRvid(const char* filename) {
442454
}
443455

444456
snd().resetStream();
457+
confirmStop = false;
445458
}
446-
if (confirmStop || keysDown() & KEY_B
459+
if (confirmReturn || keysDown() & KEY_B
447460
|| ((keysDown() & KEY_TOUCH) && touch.px >= 2 && touch.px <= 159 && touch.py >= 162 && touch.py <= 191)) {
448461
break;
449462
}

0 commit comments

Comments
 (0)