Skip to content

Commit d45ab12

Browse files
committed
Bug fix
1 parent c065120 commit d45ab12

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

romsel_dsimenutheme/arm9/source/graphics/graphics.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,9 +1252,9 @@ static int currentBootstrapPhoto = 0;
12521252
void loadPhoto(const std::string &path, const bool bufferOnly);
12531253
void loadBootstrapScreenshot(FILE *file, const bool bufferOnly);
12541254

1255-
void loadPhotoList() {
1255+
bool loadPhotoList() {
12561256
if (!tex().photoBuffer()) {
1257-
return;
1257+
return false;
12581258
}
12591259

12601260
DIR *dir;
@@ -1284,7 +1284,7 @@ void loadPhotoList() {
12841284
currentPhotoPath = photoList[rand() / ((RAND_MAX + 1u) / photoList.size())];
12851285
loadPhoto(currentPhotoPath, false);
12861286
currentPhotoIsBootstrap = false;
1287-
return;
1287+
return true;
12881288
}
12891289
}
12901290

@@ -1307,7 +1307,7 @@ void loadPhotoList() {
13071307
fseek(file, 0x200 + 0x18400 * currentBootstrapPhoto, SEEK_SET);
13081308
loadBootstrapScreenshot(file, false);
13091309
currentPhotoIsBootstrap = true;
1310-
return;
1310+
return true;
13111311
}
13121312
}
13131313

@@ -1317,6 +1317,7 @@ void loadPhotoList() {
13171317
currentPhotoPath = path;
13181318
loadPhoto(path, false);
13191319
currentPhotoIsBootstrap = false;
1320+
return true;
13201321
}
13211322

13221323
void reloadPhoto() {

romsel_dsimenutheme/arm9/source/graphics/graphics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void SetBrightness(u8 screen, s8 bright);
2929
void drawCurrentDate();
3030
void drawCurrentTime();
3131

32-
void loadPhotoList();
32+
bool loadPhotoList();
3333
void reloadPhoto();
3434
void clearBoxArt();
3535
void graphicsInit();

romsel_dsimenutheme/arm9/source/main.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -907,18 +907,18 @@ void customSleep() {
907907
powerOn(PM_BACKLIGHT_BOTTOM);
908908
if (!ms().macroMode && ms().showPhoto && tc().renderPhoto()) {
909909
srand(time(NULL));
910-
loadPhotoList();
911-
912-
extern bool boxArtLoaded;
913-
extern bool showLshoulder;
914-
extern bool showRshoulder;
915-
extern int file_count;
916-
917-
boxArtLoaded = false;
918-
showLshoulder = (PAGENUM != 0);
919-
showRshoulder = (file_count > 40 + PAGENUM * 40);
920-
if (ms().theme != TWLSettings::EThemeHBL) {
921-
tex().drawShoulders(showLshoulder, showRshoulder);
910+
if (loadPhotoList()) {
911+
extern bool boxArtLoaded;
912+
extern bool showLshoulder;
913+
extern bool showRshoulder;
914+
extern int file_count;
915+
916+
boxArtLoaded = false;
917+
showLshoulder = (PAGENUM != 0);
918+
showRshoulder = (file_count > 40 + PAGENUM * 40);
919+
if (ms().theme != TWLSettings::EThemeHBL) {
920+
tex().drawShoulders(showLshoulder, showRshoulder);
921+
}
922922
}
923923
}
924924
fadeType = true;

0 commit comments

Comments
 (0)