mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Merge pull request #22389 from hrydgard/savedata-icon-black-background
Savedata dialog: Draw icons over black, with alpha blending
This commit is contained in:
3 files changed
+4
-10
No files matched your search
@@ -412,7 +412,6 @@ void PSPSaveDialog::DisplaySaveList(bool canMove) {
|
||||
|
||||
for (int displayCount = 0; displayCount < param.GetFilenameCount(); displayCount++) {
|
||||
PPGeImageStyle imageStyle = FadedImageStyle();
|
||||
imageStyle.alphaBlend = false;
|
||||
auto fileInfo = param.GetFileInfo(displayCount);
|
||||
|
||||
if (fileInfo.size == 0 && fileInfo.texture && fileInfo.texture->IsValid())
|
||||
@@ -449,6 +448,8 @@ void PSPSaveDialog::DisplaySaveList(bool canMove) {
|
||||
pad = (w - scaledW) / 2;
|
||||
w = scaledW;
|
||||
|
||||
// The PSP draws save icons over black, so their transparent parts come out black (#22280).
|
||||
PPGeDrawRect(x + pad, y, x + pad + w, y + h, CalcFadedColor(0xFF000000));
|
||||
PPGeDrawImage(x + pad, y, w, h, 0, 0, 1, 1, tw, th, imageStyle);
|
||||
} else {
|
||||
PPGeDrawRect(x, y, x + w, y + h, 0x88666666);
|
||||
@@ -476,8 +477,6 @@ void PSPSaveDialog::DisplaySaveList(bool canMove) {
|
||||
void PSPSaveDialog::DisplaySaveIcon(bool checkExists) {
|
||||
std::lock_guard<std::mutex> guard(paramLock);
|
||||
PPGeImageStyle imageStyle = FadedImageStyle();
|
||||
imageStyle.alphaBlend = false;
|
||||
|
||||
auto curSave = param.GetFileInfo(currentSelectedSave);
|
||||
|
||||
if (curSave.size == 0 && checkExists)
|
||||
@@ -499,6 +498,8 @@ void PSPSaveDialog::DisplaySaveIcon(bool checkExists) {
|
||||
int scaledW = (int)(tw * scale);
|
||||
x += (w - scaledW) / 2;
|
||||
w = scaledW;
|
||||
// Over black, as in DisplaySaveList.
|
||||
PPGeDrawRect(x, y, x + w, y + h, CalcFadedColor(0xFF000000));
|
||||
} else {
|
||||
PPGeDisableTexture();
|
||||
}
|
||||
|
||||
@@ -1299,16 +1299,10 @@ void PPGeDrawImage(ImageID atlasImage, float x, float y, float w, float h, const
|
||||
void PPGeDrawImage(float x, float y, float w, float h, float u1, float v1, float u2, float v2, int tw, int th, const PPGeImageStyle &style) {
|
||||
if (!dlPtr)
|
||||
return;
|
||||
if (!style.alphaBlend) {
|
||||
WriteCmd(GE_CMD_ALPHABLENDENABLE, 0);
|
||||
}
|
||||
BeginVertexData();
|
||||
Vertex(x, y, u1, v1, tw, th, style.color);
|
||||
Vertex(x + w, y + h, u2, v2, tw, th, style.color);
|
||||
EndVertexDataAndDraw(GE_PRIM_RECTANGLES);
|
||||
if (!style.alphaBlend) {
|
||||
WriteCmd(GE_CMD_ALPHABLENDENABLE, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void PPGeSetDefaultTexture()
|
||||
|
||||
@@ -85,7 +85,6 @@ struct PPGeStyle {
|
||||
|
||||
struct PPGeImageStyle {
|
||||
uint32_t color = 0xFFFFFFFF;
|
||||
bool alphaBlend = true;
|
||||
};
|
||||
|
||||
// Get the metrics of the bounding box of the text without changing the buffer or state.
|
||||
|
||||
Reference in new issue
Block a user