Mercurial > mm7
changeset 1125:f87e7d1aa9ec
sub_451007_scale_image_bicubic cleanup - removing duplicate code from end of function differing only in one variable value
author | Grumpy7 |
---|---|
date | Fri, 31 May 2013 00:49:13 +0200 |
parents | dd1cb6a2dba6 |
children | 5f59f1cba5f5 05247ad19710 |
files | mm7_2.cpp |
diffstat | 1 files changed, 14 insertions(+), 202 deletions(-) [+] |
line wrap: on
line diff
--- a/mm7_2.cpp Fri May 31 00:41:13 2013 +0200 +++ b/mm7_2.cpp Fri May 31 00:49:13 2013 +0200 @@ -2463,6 +2463,7 @@ int a9d; // [sp+ACh] [bp+24h]@111 int a9e; // [sp+ACh] [bp+24h]@164 int a9f; // [sp+ACh] [bp+24h]@189 + int vxx; v11 = 0; result = this->field_0.field_C; @@ -3096,7 +3097,19 @@ HIDWORD(v245) += (unsigned __int8)v81; goto LABEL_151; } + result = this->field_20.field_C; + switch(result) + { + case 8: vxx = dstPitch - dstWidth; + break; + case 16: vxx = 2 * (dstPitch - dstWidth); + break; + case 32: vxx = 4 * (dstPitch - dstWidth); + break; + default: + return result; + } if ( result == 8 ) { result = (int)pDst; @@ -3189,7 +3202,7 @@ } while ( v211 < dstWidth ); LABEL_236: - v201 = (unsigned __int16 *)((char *)v201 + dstPitch - dstWidth); + v201 = (unsigned __int16 *)((char *)v201 + vxx); ++v239; result = v239; if ( v239 >= dstHeight ) @@ -3197,207 +3210,6 @@ v11 = 0; } } - if ( result == 16 ) - { - result = (int)pDst; - v200 = pDst; - v238 = 0; - if ( dstHeight <= 0 ) - return result; - v98 = dstWidth; - a9f = 2 * (dstPitch - dstWidth); - while ( 1 ) - { - v99 = 0; - a6o = 0; - if ( dstWidth <= v11 ) - goto LABEL_211; - v228 = (double)dstWidth; - v219 = (double)srcWidth; - v100 = (double)dstHeight; - v101 = (double)srcHeight; - do - { - a6bg = (double)a6o / v228 * v219; - v131 = a6bg + 6.7553994e15; - v210 = v99 + 1; - a6bh = (double)(v99 + 1) / v228 * v219; - v140 = a6bh + 6.7553994e15; - v102 = (double)v238 / v100 * v101; - v149 = v102 + 6.7553994e15; - v103 = (double)(v238 + 1) / v100 * v101; - v158 = v103 + 6.7553994e15; - v250 = 0; - v104 = (LODWORD(v158) - LODWORD(v149)) * (LODWORD(v140) - LODWORD(v131)); - v259 = 0; - a6p = 0; - v247 = 0; - if ( SLODWORD(v149) >= SLODWORD(v158) ) - goto LABEL_206; - v168 = LODWORD(v158) - LODWORD(v149); - v183 = (char *)pSrc + srcPitch * LODWORD(v149); - do - { - v105 = LODWORD(v131); - while ( v105 < SLODWORD(v140) ) - { - v106 = (unsigned __int8)v183[v105]; - if ( a10 ) - { - v230 = 1; - v98 = v106 != a11 ? 0xFF : 0; - } - v107 = _450FB1(v106); - if ( v230 ) - { - v247 += v98; - v230 = 0; - if ( !v98 ) - { - --v104; - goto LABEL_203; - } - } - else - { - v247 += (unsigned int)v107 >> 24; - } - a6p += BYTE2(v107); - v259 += BYTE1(v107); - v250 += (unsigned __int8)v107; -LABEL_203: - ++v105; - } - v183 += srcPitch; - --v168; - } - while ( v168 ); -LABEL_206: - v108 = v247 / ((LODWORD(v158) - LODWORD(v149)) * (LODWORD(v140) - LODWORD(v131))); - if ( v104 ) - { - a6p /= v104; - v259 /= v104; - v250 /= v104; - } - if ( v108 != 255 ) - v108 &= 0x7FFFFFFFu; - v109 = _450F55(v250 | ((v259 | ((a6p | (v108 << 8)) << 8)) << 8)); - v110 = v200; - ++v200; - *v110 = v109; - v99 = v210; - a6o = v210; - } - while ( v210 < dstWidth ); -LABEL_211: - v200 = (unsigned __int16 *)((char *)v200 + a9f); - ++v238; - result = v238; - if ( v238 >= dstHeight ) - return result; - v11 = 0; - } - } - if ( result != 32 || (result = (int)pDst, v199 = pDst, v237 = 0, dstHeight <= 0) ) - return result; - v85 = dstWidth; - a9e = 4 * (dstPitch - dstWidth); - while ( 2 ) - { - v86 = 0; - a6m = 0; - if ( dstWidth <= v11 ) - goto LABEL_186; - v227 = (double)dstWidth; - v218 = (double)srcWidth; - v87 = (double)dstHeight; - v88 = (double)srcHeight; - do - { - a6be = (double)a6m / v227 * v218; - v130 = a6be + 6.7553994e15; - v209 = v86 + 1; - a6bf = (double)(v86 + 1) / v227 * v218; - v139 = a6bf + 6.7553994e15; - v89 = (double)v237 / v87 * v88; - v148 = v89 + 6.7553994e15; - v90 = (double)(v237 + 1) / v87 * v88; - v157 = v90 + 6.7553994e15; - v249 = 0; - v91 = (LODWORD(v157) - LODWORD(v148)) * (LODWORD(v139) - LODWORD(v130)); - v258 = 0; - a6n = 0; - v246 = 0; - if ( SLODWORD(v148) >= SLODWORD(v157) ) - goto LABEL_181; - v167 = LODWORD(v157) - LODWORD(v148); - v182 = (char *)pSrc + srcPitch * LODWORD(v148); - do - { - v92 = LODWORD(v130); - while ( v92 < SLODWORD(v139) ) - { - v93 = (unsigned __int8)v182[v92]; - if ( a10 ) - { - v230 = 1; - v85 = v93 != a11 ? 0xFF : 0; - } - v94 = _450FB1(v93); - if ( v230 ) - { - v246 += v85; - v230 = 0; - if ( !v85 ) - { - --v91; - goto LABEL_178; - } - } - else - { - v246 += (unsigned int)v94 >> 24; - } - a6n += BYTE2(v94); - v258 += BYTE1(v94); - v249 += (unsigned __int8)v94; -LABEL_178: - ++v92; - } - v182 += srcPitch; - --v167; - } - while ( v167 ); -LABEL_181: - v95 = v246 / ((LODWORD(v157) - LODWORD(v148)) * (LODWORD(v139) - LODWORD(v130))); - if ( v91 ) - { - a6n /= v91; - v258 /= v91; - v249 /= v91; - } - if ( v95 != 255 ) - v95 &= 0x7FFFFFFFu; - v96 = _450F55(v249 | ((v258 | ((a6n | (v95 << 8)) << 8)) << 8)); - v97 = v199; - v199 += 2; - *(_DWORD *)v97 = v96; - v86 = v209; - a6m = v209; - } - while ( v209 < dstWidth ); -LABEL_186: - v199 = (unsigned __int16 *)((char *)v199 + a9e); - ++v237; - result = v237; - if ( v237 < dstHeight ) - { - v11 = 0; - continue; - } - return result; - } } //----- (0044E1EC) --------------------------------------------------------