Skip to content

Commit f52bec0

Browse files
committed
Fix trying to read custom icons from DSi/3DS SD when detected, regardless of where TWLMenu++ is run from
1 parent 188db01 commit f52bec0

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

quickmenu/arm9/source/iconTitle.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <gl2d.h>
2929
#include "common/tonccpy.h"
3030
#include "common/twlmenusettings.h"
31-
#include "common/flashcard.h"
31+
#include "common/systemdetails.h"
3232
#include "graphics/graphics.h"
3333
#include "graphics/fontHandler.h"
3434
#include "common/lodepng.h"
@@ -315,7 +315,7 @@ void getGameInfo(int num, bool isDir, const char* name, bool fromArgv)
315315
bool customIconGood = false;
316316

317317
// First try banner bin
318-
snprintf(customIconPath, sizeof(customIconPath), "%s:/_nds/TWiLightMenu/icons/%s.bin", sdFound() ? "sd" : "fat", name);
318+
snprintf(customIconPath, sizeof(customIconPath), "%s:/_nds/TWiLightMenu/icons/%s.bin", sys().isRunFromSD() ? "sd" : "fat", name);
319319
customIcon[num] = (access(customIconPath, F_OK) == 0);
320320
if (customIcon[num]) {
321321
customIcon[num] = 2; // custom icon is a banner bin
@@ -342,7 +342,7 @@ void getGameInfo(int num, bool isDir, const char* name, bool fromArgv)
342342
}
343343
} else {
344344
// If no banner bin, try png
345-
snprintf(customIconPath, sizeof(customIconPath), "%s:/_nds/TWiLightMenu/icons/%s.png", sdFound() ? "sd" : "fat", name);
345+
snprintf(customIconPath, sizeof(customIconPath), "%s:/_nds/TWiLightMenu/icons/%s.png", sys().isRunFromSD() ? "sd" : "fat", name);
346346
customIcon[num] = (access(customIconPath, F_OK) == 0);
347347
if (customIcon[num]) {
348348
std::vector<unsigned char> image;

romsel_aktheme/arm9/source/iconTitle.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <sys/stat.h>
2929
#include <gl2d.h>
3030
#include "common/bootstrapsettings.h"
31-
#include "common/flashcard.h"
3231
#include "common/systemdetails.h"
3332
#include "common/tonccpy.h"
3433
#include "common/twlmenusettings.h"
@@ -958,7 +957,7 @@ void getGameInfo(int num, bool isDir, const char* name, bool fromArgv)
958957
bool customIconGood = false;
959958

960959
// First try banner bin
961-
snprintf(customIconPath, sizeof(customIconPath), "%s:/_nds/TWiLightMenu/icons/%s.bin", sdFound() ? "sd" : "fat", name);
960+
snprintf(customIconPath, sizeof(customIconPath), "%s:/_nds/TWiLightMenu/icons/%s.bin", sys().isRunFromSD() ? "sd" : "fat", name);
962961
if (access(customIconPath, F_OK) == 0) {
963962
customIcon[num] = 2; // custom icon is a banner bin
964963
FILE *file = fopen(customIconPath, "rb");
@@ -1000,7 +999,7 @@ void getGameInfo(int num, bool isDir, const char* name, bool fromArgv)
1000999
}
10011000
} else if (customIcon[num] == 0) {
10021001
// If no banner bin, try png
1003-
snprintf(customIconPath, sizeof(customIconPath), "%s:/_nds/TWiLightMenu/icons/%s.png", sdFound() ? "sd" : "fat", name);
1002+
snprintf(customIconPath, sizeof(customIconPath), "%s:/_nds/TWiLightMenu/icons/%s.png", sys().isRunFromSD() ? "sd" : "fat", name);
10041003
customIcon[num] = (access(customIconPath, F_OK) == 0);
10051004
if (customIcon[num]) {
10061005
std::vector<unsigned char> image;

romsel_dsimenutheme/arm9/source/iconTitle.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "common/twlmenusettings.h"
2626
#include "common/bootstrapsettings.h"
2727
#include "common/systemdetails.h"
28-
#include "common/flashcard.h"
2928
#include <gl2d.h>
3029
#include "common/tonccpy.h"
3130
#include "fileBrowse.h"
@@ -216,7 +215,7 @@ void getGameInfo(bool isDir, const char *name, int num, bool fromArgv) {
216215
bool customIconGood = false;
217216

218217
// First try banner bin
219-
snprintf(customIconPath, sizeof(customIconPath), "%s:/_nds/TWiLightMenu/icons/%s.bin", sdFound() ? "sd" : "fat", name);
218+
snprintf(customIconPath, sizeof(customIconPath), "%s:/_nds/TWiLightMenu/icons/%s.bin", sys().isRunFromSD() ? "sd" : "fat", name);
220219
if (access(customIconPath, F_OK) == 0) {
221220
customIcon[num] = 2; // custom icon is a banner bin
222221
FILE *file = fopen(customIconPath, "rb");
@@ -258,7 +257,7 @@ void getGameInfo(bool isDir, const char *name, int num, bool fromArgv) {
258257
}
259258
} else if (customIcon[num] == 0) {
260259
// If no banner bin, try png
261-
snprintf(customIconPath, sizeof(customIconPath), "%s:/_nds/TWiLightMenu/icons/%s.png", sdFound() ? "sd" : "fat", name);
260+
snprintf(customIconPath, sizeof(customIconPath), "%s:/_nds/TWiLightMenu/icons/%s.png", sys().isRunFromSD() ? "sd" : "fat", name);
262261
customIcon[num] = (access(customIconPath, F_OK) == 0);
263262
if (customIcon[num]) {
264263
std::vector<unsigned char> image;

romsel_r4theme/arm9/source/iconTitle.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <sys/stat.h>
2929
#include <gl2d.h>
3030
#include "common/bootstrapsettings.h"
31-
#include "common/flashcard.h"
3231
#include "common/systemdetails.h"
3332
#include "common/tonccpy.h"
3433
#include "common/twlmenusettings.h"
@@ -924,7 +923,7 @@ void getGameInfo(bool isDir, const char* name, bool fromArgv)
924923
bool customIconGood = false;
925924

926925
// First try banner bin
927-
snprintf(customIconPath, sizeof(customIconPath), "%s:/_nds/TWiLightMenu/icons/%s.bin", sdFound() ? "sd" : "fat", name);
926+
snprintf(customIconPath, sizeof(customIconPath), "%s:/_nds/TWiLightMenu/icons/%s.bin", sys().isRunFromSD() ? "sd" : "fat", name);
928927
customIcon = (access(customIconPath, F_OK) == 0);
929928
if (customIcon) {
930929
customIcon = 2; // custom icon is a banner bin
@@ -951,7 +950,7 @@ void getGameInfo(bool isDir, const char* name, bool fromArgv)
951950
}
952951
} else {
953952
// If no banner bin, try png
954-
snprintf(customIconPath, sizeof(customIconPath), "%s:/_nds/TWiLightMenu/icons/%s.png", sdFound() ? "sd" : "fat", name);
953+
snprintf(customIconPath, sizeof(customIconPath), "%s:/_nds/TWiLightMenu/icons/%s.png", sys().isRunFromSD() ? "sd" : "fat", name);
955954
customIcon = (access(customIconPath, F_OK) == 0);
956955
if (customIcon) {
957956
std::vector<unsigned char> image;

0 commit comments

Comments
 (0)