comparison mm7_2.cpp @ 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
comparison
equal deleted inserted replaced
1124:dd1cb6a2dba6 1125:f87e7d1aa9ec
2461 int a9b; // [sp+ACh] [bp+24h]@33 2461 int a9b; // [sp+ACh] [bp+24h]@33
2462 int a9c; // [sp+ACh] [bp+24h]@86 2462 int a9c; // [sp+ACh] [bp+24h]@86
2463 int a9d; // [sp+ACh] [bp+24h]@111 2463 int a9d; // [sp+ACh] [bp+24h]@111
2464 int a9e; // [sp+ACh] [bp+24h]@164 2464 int a9e; // [sp+ACh] [bp+24h]@164
2465 int a9f; // [sp+ACh] [bp+24h]@189 2465 int a9f; // [sp+ACh] [bp+24h]@189
2466 int vxx;
2466 2467
2467 v11 = 0; 2468 v11 = 0;
2468 result = this->field_0.field_C; 2469 result = this->field_0.field_C;
2469 //v202 = this; 2470 //v202 = this;
2470 v230 = 0; 2471 v230 = 0;
3094 a6l += BYTE2(v81); 3095 a6l += BYTE2(v81);
3095 v257 += BYTE1(v81); 3096 v257 += BYTE1(v81);
3096 HIDWORD(v245) += (unsigned __int8)v81; 3097 HIDWORD(v245) += (unsigned __int8)v81;
3097 goto LABEL_151; 3098 goto LABEL_151;
3098 } 3099 }
3100
3099 result = this->field_20.field_C; 3101 result = this->field_20.field_C;
3102 switch(result)
3103 {
3104 case 8: vxx = dstPitch - dstWidth;
3105 break;
3106 case 16: vxx = 2 * (dstPitch - dstWidth);
3107 break;
3108 case 32: vxx = 4 * (dstPitch - dstWidth);
3109 break;
3110 default:
3111 return result;
3112 }
3100 if ( result == 8 ) 3113 if ( result == 8 )
3101 { 3114 {
3102 result = (int)pDst; 3115 result = (int)pDst;
3103 v201 = pDst; 3116 v201 = pDst;
3104 v239 = 0; 3117 v239 = 0;
3187 v112 = v211; 3200 v112 = v211;
3188 a6q = v211; 3201 a6q = v211;
3189 } 3202 }
3190 while ( v211 < dstWidth ); 3203 while ( v211 < dstWidth );
3191 LABEL_236: 3204 LABEL_236:
3192 v201 = (unsigned __int16 *)((char *)v201 + dstPitch - dstWidth); 3205 v201 = (unsigned __int16 *)((char *)v201 + vxx);
3193 ++v239; 3206 ++v239;
3194 result = v239; 3207 result = v239;
3195 if ( v239 >= dstHeight ) 3208 if ( v239 >= dstHeight )
3196 return result; 3209 return result;
3197 v11 = 0; 3210 v11 = 0;
3198 } 3211 }
3199 }
3200 if ( result == 16 )
3201 {
3202 result = (int)pDst;
3203 v200 = pDst;
3204 v238 = 0;
3205 if ( dstHeight <= 0 )
3206 return result;
3207 v98 = dstWidth;
3208 a9f = 2 * (dstPitch - dstWidth);
3209 while ( 1 )
3210 {
3211 v99 = 0;
3212 a6o = 0;
3213 if ( dstWidth <= v11 )
3214 goto LABEL_211;
3215 v228 = (double)dstWidth;
3216 v219 = (double)srcWidth;
3217 v100 = (double)dstHeight;
3218 v101 = (double)srcHeight;
3219 do
3220 {
3221 a6bg = (double)a6o / v228 * v219;
3222 v131 = a6bg + 6.7553994e15;
3223 v210 = v99 + 1;
3224 a6bh = (double)(v99 + 1) / v228 * v219;
3225 v140 = a6bh + 6.7553994e15;
3226 v102 = (double)v238 / v100 * v101;
3227 v149 = v102 + 6.7553994e15;
3228 v103 = (double)(v238 + 1) / v100 * v101;
3229 v158 = v103 + 6.7553994e15;
3230 v250 = 0;
3231 v104 = (LODWORD(v158) - LODWORD(v149)) * (LODWORD(v140) - LODWORD(v131));
3232 v259 = 0;
3233 a6p = 0;
3234 v247 = 0;
3235 if ( SLODWORD(v149) >= SLODWORD(v158) )
3236 goto LABEL_206;
3237 v168 = LODWORD(v158) - LODWORD(v149);
3238 v183 = (char *)pSrc + srcPitch * LODWORD(v149);
3239 do
3240 {
3241 v105 = LODWORD(v131);
3242 while ( v105 < SLODWORD(v140) )
3243 {
3244 v106 = (unsigned __int8)v183[v105];
3245 if ( a10 )
3246 {
3247 v230 = 1;
3248 v98 = v106 != a11 ? 0xFF : 0;
3249 }
3250 v107 = _450FB1(v106);
3251 if ( v230 )
3252 {
3253 v247 += v98;
3254 v230 = 0;
3255 if ( !v98 )
3256 {
3257 --v104;
3258 goto LABEL_203;
3259 }
3260 }
3261 else
3262 {
3263 v247 += (unsigned int)v107 >> 24;
3264 }
3265 a6p += BYTE2(v107);
3266 v259 += BYTE1(v107);
3267 v250 += (unsigned __int8)v107;
3268 LABEL_203:
3269 ++v105;
3270 }
3271 v183 += srcPitch;
3272 --v168;
3273 }
3274 while ( v168 );
3275 LABEL_206:
3276 v108 = v247 / ((LODWORD(v158) - LODWORD(v149)) * (LODWORD(v140) - LODWORD(v131)));
3277 if ( v104 )
3278 {
3279 a6p /= v104;
3280 v259 /= v104;
3281 v250 /= v104;
3282 }
3283 if ( v108 != 255 )
3284 v108 &= 0x7FFFFFFFu;
3285 v109 = _450F55(v250 | ((v259 | ((a6p | (v108 << 8)) << 8)) << 8));
3286 v110 = v200;
3287 ++v200;
3288 *v110 = v109;
3289 v99 = v210;
3290 a6o = v210;
3291 }
3292 while ( v210 < dstWidth );
3293 LABEL_211:
3294 v200 = (unsigned __int16 *)((char *)v200 + a9f);
3295 ++v238;
3296 result = v238;
3297 if ( v238 >= dstHeight )
3298 return result;
3299 v11 = 0;
3300 }
3301 }
3302 if ( result != 32 || (result = (int)pDst, v199 = pDst, v237 = 0, dstHeight <= 0) )
3303 return result;
3304 v85 = dstWidth;
3305 a9e = 4 * (dstPitch - dstWidth);
3306 while ( 2 )
3307 {
3308 v86 = 0;
3309 a6m = 0;
3310 if ( dstWidth <= v11 )
3311 goto LABEL_186;
3312 v227 = (double)dstWidth;
3313 v218 = (double)srcWidth;
3314 v87 = (double)dstHeight;
3315 v88 = (double)srcHeight;
3316 do
3317 {
3318 a6be = (double)a6m / v227 * v218;
3319 v130 = a6be + 6.7553994e15;
3320 v209 = v86 + 1;
3321 a6bf = (double)(v86 + 1) / v227 * v218;
3322 v139 = a6bf + 6.7553994e15;
3323 v89 = (double)v237 / v87 * v88;
3324 v148 = v89 + 6.7553994e15;
3325 v90 = (double)(v237 + 1) / v87 * v88;
3326 v157 = v90 + 6.7553994e15;
3327 v249 = 0;
3328 v91 = (LODWORD(v157) - LODWORD(v148)) * (LODWORD(v139) - LODWORD(v130));
3329 v258 = 0;
3330 a6n = 0;
3331 v246 = 0;
3332 if ( SLODWORD(v148) >= SLODWORD(v157) )
3333 goto LABEL_181;
3334 v167 = LODWORD(v157) - LODWORD(v148);
3335 v182 = (char *)pSrc + srcPitch * LODWORD(v148);
3336 do
3337 {
3338 v92 = LODWORD(v130);
3339 while ( v92 < SLODWORD(v139) )
3340 {
3341 v93 = (unsigned __int8)v182[v92];
3342 if ( a10 )
3343 {
3344 v230 = 1;
3345 v85 = v93 != a11 ? 0xFF : 0;
3346 }
3347 v94 = _450FB1(v93);
3348 if ( v230 )
3349 {
3350 v246 += v85;
3351 v230 = 0;
3352 if ( !v85 )
3353 {
3354 --v91;
3355 goto LABEL_178;
3356 }
3357 }
3358 else
3359 {
3360 v246 += (unsigned int)v94 >> 24;
3361 }
3362 a6n += BYTE2(v94);
3363 v258 += BYTE1(v94);
3364 v249 += (unsigned __int8)v94;
3365 LABEL_178:
3366 ++v92;
3367 }
3368 v182 += srcPitch;
3369 --v167;
3370 }
3371 while ( v167 );
3372 LABEL_181:
3373 v95 = v246 / ((LODWORD(v157) - LODWORD(v148)) * (LODWORD(v139) - LODWORD(v130)));
3374 if ( v91 )
3375 {
3376 a6n /= v91;
3377 v258 /= v91;
3378 v249 /= v91;
3379 }
3380 if ( v95 != 255 )
3381 v95 &= 0x7FFFFFFFu;
3382 v96 = _450F55(v249 | ((v258 | ((a6n | (v95 << 8)) << 8)) << 8));
3383 v97 = v199;
3384 v199 += 2;
3385 *(_DWORD *)v97 = v96;
3386 v86 = v209;
3387 a6m = v209;
3388 }
3389 while ( v209 < dstWidth );
3390 LABEL_186:
3391 v199 = (unsigned __int16 *)((char *)v199 + a9e);
3392 ++v237;
3393 result = v237;
3394 if ( v237 < dstHeight )
3395 {
3396 v11 = 0;
3397 continue;
3398 }
3399 return result;
3400 } 3212 }
3401 } 3213 }
3402 3214
3403 //----- (0044E1EC) -------------------------------------------------------- 3215 //----- (0044E1EC) --------------------------------------------------------
3404 int TextureFrameTable::FromFileTxt(const char *Args) 3216 int TextureFrameTable::FromFileTxt(const char *Args)