summarylogtreecommitdiffstats
path: root/ppsspp-gcc5.1.patch
blob: e046206b19639859acf75f73697d201ddad8a8ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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