ppsspp-git/ppsspp-gcc5.1.patch
2015-06-08 11:11:15 +02:00

41 lines
1.8 KiB
Diff

diff -rupN ppsspp.orig/ext/xbrz/xbrz.cpp ppsspp/ext/xbrz/xbrz.cpp
--- ppsspp.orig/ext/xbrz/xbrz.cpp 2015-06-01 14:16:20.005738417 +0200
+++ ppsspp/ext/xbrz/xbrz.cpp 2015-06-01 14:21:30.365765974 +0200
@@ -648,23 +648,21 @@ void scalePixel(const Kernel_3x3& ker,
auto eq = [&](uint32_t pix1, uint32_t pix2) { return ColorDistance::dist(pix1, pix2, cfg.luminanceWeight_) < cfg.equalColorTolerance_; };
auto dist = [&](uint32_t pix1, uint32_t pix2) { return ColorDistance::dist(pix1, pix2, cfg.luminanceWeight_); };
- const bool doLineBlend = [&]() -> bool
- {
- if (getBottomR(blend) >= BLEND_DOMINANT)
- return true;
+ bool doLineBlend;
- //make sure there is no second blending in an adjacent rotation for this pixel: handles insular pixels, mario eyes
- if (getTopR(blend) != BLEND_NONE && !eq(e, g)) //but support double-blending for 90° corners
- return false;
- if (getBottomL(blend) != BLEND_NONE && !eq(e, c))
- return false;
+ if (getBottomR(blend) >= BLEND_DOMINANT)
+ doLineBlend = true;
- //no full blending for L-shapes; blend corner only (handles "mario mushroom eyes")
- if (!eq(e, i) && eq(g, h) && eq(h , i) && eq(i, f) && eq(f, c))
- return false;
-
- return true;
- }();
+ //make sure there is no second blending in an adjacent rotation for this pixel: handles insular pixels, mario eyes
+ else if (getTopR(blend) != BLEND_NONE && !eq(e, g)) //but support double-blending for 90° corners
+ doLineBlend = false;
+ else if (getBottomL(blend) != BLEND_NONE && !eq(e, c))
+ doLineBlend = false;
+ //no full blending for L-shapes; blend corner only (handles "mario mushroom eyes")
+ else if (!eq(e, i) && eq(g, h) && eq(h , i) && eq(i, f) && eq(f, c))
+ doLineBlend = false;
+ else
+ doLineBlend = true;
const uint32_t px = dist(e, f) <= dist(e, h) ? f : h; //choose most similar color