Updated to match scale2x 2.0

svn-id: r13563
This commit is contained in:
Max Horn 2004-04-12 21:16:32 +00:00
parent 8d6a1c1245
commit 0a0a0c7b06

View File

@ -176,10 +176,18 @@ void AdvMame2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPi
A = B; B = C; C = *(p - nextlineSrc);
D = E; E = F; F = *(p);
G = H; H = I; I = *(p + nextlineSrc);
*(q + 0) = D == B && B != F && D != H ? D : E;
*(q + 1) = B == F && B != D && F != H ? F : E;
*(q + nextlineDst + 0) = D == H && D != B && H != F ? D : E;
*(q + nextlineDst + 1) = H == F && D != H && B != F ? F : E;
if (B != H && D != F) {
*(q + 0) = D == B ? D : E;
*(q + 1) = B == F ? F : E;
*(q + nextlineDst + 0) = D == H ? D : E;
*(q + nextlineDst + 1) = H == F ? F : E;
} else {
*(q + 0) = E;
*(q + 1) = E;
*(q + nextlineDst + 0) = E;
*(q + nextlineDst + 1) = E;
}
q += 2;
}
p += nextlineSrc - width;
@ -216,16 +224,29 @@ void AdvMame3x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPi
A = B; B = C; C = *(p - nextlineSrc);
D = E; E = F; F = *(p);
G = H; H = I; I = *(p + nextlineSrc);
if (B != H && D != F) {
*(q + 0) = D == B ? D : E;
*(q + 1) = (D == B && E != C) || (B == F && E != A) ? B : E;
*(q + 2) = B == F ? F : E;
*(q + nextlineDst + 0) = (D == B && E != G) || (D == B && E != A) ? D : E;
*(q + nextlineDst + 1) = E;
*(q + nextlineDst + 2) = (B == F && E != I) || (H == F && E != C) ? F : E;
*(q + 2 * nextlineDst + 0) = D == H ? D : E;
*(q + 2 * nextlineDst + 1) = (D == H && E != I) || (H == F && E != G) ? H : E;
*(q + 2 * nextlineDst + 2) = H == F ? F : E;
} else {
*(q + 0) = E;
*(q + 1) = E;
*(q + 2) = E;
*(q + nextlineDst + 0) = E;
*(q + nextlineDst + 1) = E;
*(q + nextlineDst + 2) = E;
*(q + 2 * nextlineDst + 0) = E;
*(q + 2 * nextlineDst + 1) = E;
*(q + 2 * nextlineDst + 2) = E;
}
*(q) = D == B && B != F && D != H ? D : E;
*(q + 1) = E;
*(q + 2) = B == F && B != D && F != H ? F : E;
*(q + nextlineDst) = E;
*(q + nextlineDst + 1) = E;
*(q + nextlineDst + 2) = E;
*(q + 2 * nextlineDst) = D == H && D != B && H != F ? D : E;
*(q + 2 * nextlineDst + 1) = E;
*(q + 2 * nextlineDst + 2) = H == F && D != H && B != F ? F : E;
q += 3;
}
p += nextlineSrc - width;