mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
More tweaking of gamelist icons
This commit is contained in:
@@ -2472,6 +2472,10 @@ int sceKernelWakeupThread(SceUID uid) {
|
||||
return hleLogVerbose(Log::sceKernel, 0, "woke thread at %i", t->nt.wakeupCount);
|
||||
}
|
||||
} else {
|
||||
if (uid == (SceUID)-1) {
|
||||
// Common error (for example in Power Stone). Let's log at debug level.
|
||||
return hleLogDebug(Log::sceKernel, error, "bad thread id");
|
||||
}
|
||||
return hleLogError(Log::sceKernel, error, "bad thread id");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,11 +332,12 @@ bool TextureReplacer::LoadIniValues(IniFile &ini, VFSBackend *dir, bool isOverri
|
||||
}
|
||||
|
||||
std::string badFilenames;
|
||||
constexpr int MaxBadFilenameCount = 5; // How many to list in the popup
|
||||
|
||||
if (ini.HasSection("hashes")) {
|
||||
const Section *hashesSection = ini.GetOrCreateSection("hashes");
|
||||
// Format: hashname = filename.png
|
||||
bool checkFilenames = saveEnabled_ && !g_Config.bIgnoreTextureFilenames && !vfsIsZip_;
|
||||
const bool checkFilenames = saveEnabled_ && !g_Config.bIgnoreTextureFilenames && !vfsIsZip_;
|
||||
|
||||
for (const auto &line : hashesSection->Lines()) {
|
||||
if (line.Key().empty())
|
||||
@@ -362,9 +363,9 @@ bool TextureReplacer::LoadIniValues(IniFile &ini, VFSBackend *dir, bool isOverri
|
||||
#endif
|
||||
if (bad) {
|
||||
badFileNameCount++;
|
||||
if (badFileNameCount == 10) {
|
||||
if (badFileNameCount == MaxBadFilenameCount) {
|
||||
badFilenames.append("...");
|
||||
} else if (badFileNameCount < 10) {
|
||||
} else if (badFileNameCount < MaxBadFilenameCount) {
|
||||
badFilenames.append(v);
|
||||
badFilenames.push_back('\n');
|
||||
}
|
||||
|
||||
+18
-18
@@ -294,8 +294,8 @@ void GameButton::Draw(UIContext &dc) {
|
||||
ImageID imageIcon = ImageID::invalid();
|
||||
bool drawBackground = true;
|
||||
switch (ginfo->fileType) {
|
||||
case IdentifiedFileType::PSP_ELF: imageIcon = ImageID("I_DEBUGGER"); drawBackground = false; break;
|
||||
case IdentifiedFileType::UNKNOWN_ELF: imageIcon = ImageID("I_CROSS"); drawBackground = false; break;
|
||||
case IdentifiedFileType::PSP_ELF: imageIcon = ImageID("I_APP"); drawBackground = false; break;
|
||||
case IdentifiedFileType::UNKNOWN_ELF: imageIcon = ImageID("I_APP"); drawBackground = false; break;
|
||||
case IdentifiedFileType::PPSSPP_GE_DUMP: imageIcon = ImageID("I_DISPLAY"); break;
|
||||
case IdentifiedFileType::PSX_ISO:
|
||||
case IdentifiedFileType::PSP_PS1_PBP: imageIcon = ImageID("I_PSX_ISO"); break;
|
||||
@@ -309,6 +309,15 @@ void GameButton::Draw(UIContext &dc) {
|
||||
default: break;
|
||||
}
|
||||
|
||||
if (ginfo->Ready(GameInfoFlags::ICON)) {
|
||||
if (ginfo->icon.texture && drawBackground) {
|
||||
texture = ginfo->icon.texture;
|
||||
} else if (drawBackground) {
|
||||
// No icon, but drawBackground is set. Let's show a plain icon depending on type.
|
||||
imageIcon = (ginfo->fileType == IdentifiedFileType::PSP_ISO || ginfo->fileType == IdentifiedFileType::PSP_ISO_NP) ? ImageID("I_UMD") : ImageID("I_APP");
|
||||
}
|
||||
}
|
||||
|
||||
Bounds overlayBounds = bounds_;
|
||||
u32 overlayColor = 0;
|
||||
if (holdEnabled_ && holdStart_ != 0.0) {
|
||||
@@ -325,15 +334,6 @@ void GameButton::Draw(UIContext &dc) {
|
||||
}
|
||||
}
|
||||
|
||||
if (ginfo->Ready(GameInfoFlags::ICON)) {
|
||||
if (ginfo->icon.texture && drawBackground) {
|
||||
texture = ginfo->icon.texture;
|
||||
} else if (drawBackground) {
|
||||
// No icon, but drawBackground is set. Let's show a plain icon.
|
||||
imageIcon = ImageID("I_APP");
|
||||
}
|
||||
}
|
||||
|
||||
int x = bounds_.x;
|
||||
int y = bounds_.y;
|
||||
int w = gridStyle_ ? bounds_.w : 144;
|
||||
@@ -397,6 +397,13 @@ void GameButton::Draw(UIContext &dc) {
|
||||
dc.Draw()->Flush();
|
||||
}
|
||||
|
||||
if (gridStyle_ && g_Config.bShowIDOnGameIcon && ginfo->fileType != IdentifiedFileType::PSP_ELF && !ginfo->id_version.empty()) {
|
||||
dc.SetFontScale(0.5f * g_Config.fGameGridScale, 0.5f * g_Config.fGameGridScale);
|
||||
dc.DrawText(ginfo->id_version, bounds_.x + 5, y + 1, 0xFF000000, ALIGN_TOPLEFT);
|
||||
dc.DrawText(ginfo->id_version, bounds_.x + 4, y, dc.GetTheme().infoStyle.fgColor, ALIGN_TOPLEFT);
|
||||
dc.SetFontScale(1.0f, 1.0f);
|
||||
}
|
||||
|
||||
if (imageIcon.isValid()) {
|
||||
Style style = dc.GetTheme().itemStyle;
|
||||
|
||||
@@ -509,13 +516,6 @@ void GameButton::Draw(UIContext &dc) {
|
||||
}
|
||||
}
|
||||
|
||||
if (gridStyle_ && g_Config.bShowIDOnGameIcon) {
|
||||
dc.SetFontScale(0.5f*g_Config.fGameGridScale, 0.5f*g_Config.fGameGridScale);
|
||||
dc.DrawText(ginfo->id_version, bounds_.x+5, y+1, 0xFF000000, ALIGN_TOPLEFT);
|
||||
dc.DrawText(ginfo->id_version, bounds_.x+4, y, dc.GetTheme().infoStyle.fgColor, ALIGN_TOPLEFT);
|
||||
dc.SetFontScale(1.0f, 1.0f);
|
||||
}
|
||||
|
||||
if (overlayColor) {
|
||||
dc.FillRect(Drawable(overlayColor), overlayBounds);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user