Skip to content

Commit

Permalink
DSi-based themes: Fix progress bar length sometimes being longer than…
Browse files Browse the repository at this point in the history
… 192px
  • Loading branch information
RocketRobz committed Jan 28, 2025
1 parent f900e7c commit 2c5f3ae
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions quickmenu/arm9/source/graphics/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ void vBlankHandler()
if (whiteScreen) {
glBoxFilled(0, 0, 256, 192, RGB15(31, 31, 31));
if (showProgressBar) {
if (progressBarLength > 192) progressBarLength = 192;
int barXpos = 31;
int barYpos = 169;
glBoxFilled(barXpos, barYpos, barXpos+192, barYpos+5, RGB15(23, 23, 23));
Expand Down
2 changes: 0 additions & 2 deletions quickmenu/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2958,7 +2958,6 @@ int dsClassicMenu(void) {
for (u32 address=0;address<romSize&&address<0x2000000;address+=0x40000) {
expansion().Block_Erase(address);
progressBarLength = (address+0x40000)/(romSize/192);
if (progressBarLength > 192) progressBarLength = 192;
}
nor = true;
} else if (*(u16*)(0x020000C0) == 0x4353 && romSize > 0x1FFFFFE) {
Expand All @@ -2980,7 +2979,6 @@ int dsClassicMenu(void) {
s2RamAccess(false);
curPtr += 0x8000;
progressBarLength = ((curPtr-ptr)+0x8000)/(romSize/192);
if (progressBarLength > 192) progressBarLength = 192;
} else {
break;
}
Expand Down
3 changes: 2 additions & 1 deletion romsel_dsimenutheme/arm9/source/graphics/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1195,14 +1195,15 @@ void vBlankHandler() {
glSprite(ms().rtl() ? 16 : 224, 152, GL_FLIP_NONE, &tex().progressImage()[progressAnimNum]);
}
if (showProgressBar) {
if (progressBarLength > 192) progressBarLength = 192;
int barXpos = ms().rtl() ? 256 - 19 : 19;
int barYpos = 157;
if (ms().theme == TWLSettings::EThemeSaturn) {
barXpos += ms().rtl() ? -12 : 12;
barYpos += 12;
}
extern int getFavoriteColor(void);
int fillColor = tc().progressBarUserPalette() ? progressBarColors[getFavoriteColor()] : tc().progressBarColor();
const int fillColor = tc().progressBarUserPalette() ? progressBarColors[getFavoriteColor()] : tc().progressBarColor();
if (colorTable) fillColor = colorTable[fillColor];
if (ms().rtl()) {
glBoxFilled(barXpos, barYpos, barXpos-192, barYpos+5, tc().darkLoading() ? RGB15(6, 6, 6) : RGB15(23, 23, 23));
Expand Down
2 changes: 0 additions & 2 deletions romsel_dsimenutheme/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2073,7 +2073,6 @@ int dsiMenuTheme(void) {
for (u32 address=0;address<romSize&&address<0x2000000;address+=0x40000) {
expansion().Block_Erase(address);
progressBarLength = (address+0x40000)/(romSize/192);
if (progressBarLength > 192) progressBarLength = 192;
}
nor = true;
} else if (*(u16*)(0x020000C0) == 0x4353 && romSize > 0x1FFFFFE) {
Expand All @@ -2095,7 +2094,6 @@ int dsiMenuTheme(void) {
s2RamAccess(false);
curPtr += 0x8000;
progressBarLength = ((curPtr-ptr)+0x8000)/(romSize/192);
if (progressBarLength > 192) progressBarLength = 192;
} else {
break;
}
Expand Down

0 comments on commit 2c5f3ae

Please sign in to comment.