Fix bug in blue-to-alpha - alpha blending could be on when it shouldn't be.

Fixes #15732. (Split/Second environment mapping problem in the menu).
This commit is contained in:
Henrik Rydgård 2022-07-27 10:58:33 +02:00
parent fc70d21d04
commit a44bee6f85
3 changed files with 12 additions and 1 deletions

View File

@ -77,6 +77,12 @@ std::string TextDrawerAndroid::NormalizeString(std::string str) {
}
void TextDrawerAndroid::MeasureString(const char *str, size_t len, float *w, float *h) {
if (!str) {
*w = 0.0;
*h = 0.0;
return;
}
CacheKey key{ std::string(str, len), fontHash_ };
TextMeasureEntry *entry;
auto iter = sizeCache_.find(key);

View File

@ -1089,9 +1089,12 @@ void ConvertBlendState(GenericBlendState &blendState, bool allowFramebufferRead,
case REPLACE_BLEND_BLUE_TO_ALPHA:
blueToAlpha = true;
blendState.enabled = gstate.isAlphaBlendEnabled();
// We'll later convert the color blend to blend in the alpha channel.
break;
case REPLACE_BLEND_COPY_FBO:
blendState.enabled = true;
blendState.applyFramebufferRead = true;
blendState.resetFramebufferRead = false;
blendState.replaceAlphaWithStencil = replaceAlphaWithStencil;
@ -1099,16 +1102,17 @@ void ConvertBlendState(GenericBlendState &blendState, bool allowFramebufferRead,
case REPLACE_BLEND_PRE_SRC:
case REPLACE_BLEND_PRE_SRC_2X_ALPHA:
blendState.enabled = true;
usePreSrc = true;
break;
case REPLACE_BLEND_STANDARD:
case REPLACE_BLEND_2X_ALPHA:
case REPLACE_BLEND_2X_SRC:
blendState.enabled = true;
break;
}
blendState.enabled = true;
blendState.resetFramebufferRead = true;
const GEBlendMode blendFuncEq = gstate.getBlendEq();

View File

@ -1102,6 +1102,7 @@ NPEH00029 = true
ULUS10455 = true
[BlueToAlpha]
# Split/Second
ULES01402 = true
ULUS10513 = true
ULJM05812 = true