Skip to content

Commit 2c5f3ae

Browse files
committed
DSi-based themes: Fix progress bar length sometimes being longer than 192px
1 parent f900e7c commit 2c5f3ae

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

quickmenu/arm9/source/graphics/graphics.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,7 @@ void vBlankHandler()
706706
if (whiteScreen) {
707707
glBoxFilled(0, 0, 256, 192, RGB15(31, 31, 31));
708708
if (showProgressBar) {
709+
if (progressBarLength > 192) progressBarLength = 192;
709710
int barXpos = 31;
710711
int barYpos = 169;
711712
glBoxFilled(barXpos, barYpos, barXpos+192, barYpos+5, RGB15(23, 23, 23));

quickmenu/arm9/source/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2958,7 +2958,6 @@ int dsClassicMenu(void) {
29582958
for (u32 address=0;address<romSize&&address<0x2000000;address+=0x40000) {
29592959
expansion().Block_Erase(address);
29602960
progressBarLength = (address+0x40000)/(romSize/192);
2961-
if (progressBarLength > 192) progressBarLength = 192;
29622961
}
29632962
nor = true;
29642963
} else if (*(u16*)(0x020000C0) == 0x4353 && romSize > 0x1FFFFFE) {
@@ -2980,7 +2979,6 @@ int dsClassicMenu(void) {
29802979
s2RamAccess(false);
29812980
curPtr += 0x8000;
29822981
progressBarLength = ((curPtr-ptr)+0x8000)/(romSize/192);
2983-
if (progressBarLength > 192) progressBarLength = 192;
29842982
} else {
29852983
break;
29862984
}

romsel_dsimenutheme/arm9/source/graphics/graphics.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,14 +1195,15 @@ void vBlankHandler() {
11951195
glSprite(ms().rtl() ? 16 : 224, 152, GL_FLIP_NONE, &tex().progressImage()[progressAnimNum]);
11961196
}
11971197
if (showProgressBar) {
1198+
if (progressBarLength > 192) progressBarLength = 192;
11981199
int barXpos = ms().rtl() ? 256 - 19 : 19;
11991200
int barYpos = 157;
12001201
if (ms().theme == TWLSettings::EThemeSaturn) {
12011202
barXpos += ms().rtl() ? -12 : 12;
12021203
barYpos += 12;
12031204
}
12041205
extern int getFavoriteColor(void);
1205-
int fillColor = tc().progressBarUserPalette() ? progressBarColors[getFavoriteColor()] : tc().progressBarColor();
1206+
const int fillColor = tc().progressBarUserPalette() ? progressBarColors[getFavoriteColor()] : tc().progressBarColor();
12061207
if (colorTable) fillColor = colorTable[fillColor];
12071208
if (ms().rtl()) {
12081209
glBoxFilled(barXpos, barYpos, barXpos-192, barYpos+5, tc().darkLoading() ? RGB15(6, 6, 6) : RGB15(23, 23, 23));

romsel_dsimenutheme/arm9/source/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,7 +2073,6 @@ int dsiMenuTheme(void) {
20732073
for (u32 address=0;address<romSize&&address<0x2000000;address+=0x40000) {
20742074
expansion().Block_Erase(address);
20752075
progressBarLength = (address+0x40000)/(romSize/192);
2076-
if (progressBarLength > 192) progressBarLength = 192;
20772076
}
20782077
nor = true;
20792078
} else if (*(u16*)(0x020000C0) == 0x4353 && romSize > 0x1FFFFFE) {
@@ -2095,7 +2094,6 @@ int dsiMenuTheme(void) {
20952094
s2RamAccess(false);
20962095
curPtr += 0x8000;
20972096
progressBarLength = ((curPtr-ptr)+0x8000)/(romSize/192);
2098-
if (progressBarLength > 192) progressBarLength = 192;
20992097
} else {
21002098
break;
21012099
}

0 commit comments

Comments
 (0)