Fix Earth Saver Plus font

This commit is contained in:
sum2012 committed 2022-08-14 20:31:45 +08:00
1 parent a35d261908
commit 112951e6bd
4 files changed
+18

No files matched your search

+1
View File
@@ -97,6 +97,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "ZZT3SelectHack", &flags_.ZZT3SelectHack);
CheckSetting(iniFile, gameID, "AllowLargeFBTextureOffsets", &flags_.AllowLargeFBTextureOffsets);
CheckSetting(iniFile, gameID, "AtracLoopHack", &flags_.AtracLoopHack);
CheckSetting(iniFile, gameID, "Fontltn12Hack", &flags_.Fontltn12Hack);
}
void Compatibility::CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag) {
+1
View File
@@ -87,6 +87,7 @@ struct CompatFlags {
bool ZZT3SelectHack;
bool AllowLargeFBTextureOffsets;
bool AtracLoopHack;
bool Fontltn12Hack;
};
class IniFile;
+13
View File
@@ -1171,6 +1171,19 @@ static int sceFontFindOptimumFont(u32 libHandle, u32 fontStylePtr, u32 errorCode
Font *optimumFont = 0;
Font *nearestFont = 0;
float nearestDist = std::numeric_limits<float>::infinity();
if (PSP_CoreParameter().compat.flags().Fontltn12Hack && requestedStyle->fontLanguage == 2) {
for (size_t j = 0; j < internalFonts.size(); j++) {
const auto tempmatchStyle = internalFonts[j]->GetFontStyle();
const std::string str(tempmatchStyle.fontFileName);
if (str == "ltn12.pgf") {
optimumFont = internalFonts[j];
*errorCode = 0;
return GetInternalFontIndex(optimumFont);
}
}
}
for (size_t i = 0; i < internalFonts.size(); i++) {
MatchQuality q = internalFonts[i]->MatchesStyle(*requestedStyle);
if (q != MATCH_NONE) {
+3
View File
@@ -1263,3 +1263,6 @@ ULES00897 = true
ULUS10194 = true
ULES00618 = true
[Fontltn12Hack]
#optimumFont do not return ltn12.pgf see #11055
NPJH00052 = true