Mercurial > mm7
comparison mm7_2.cpp @ 2314:8e9be4fa33a8
for Bloodsplat
author | Ritor1 |
---|---|
date | Tue, 18 Mar 2014 23:50:35 +0600 |
parents | ca13c630ee2b |
children | 9551756f46c4 |
comparison
equal
deleted
inserted
replaced
2313:b75a8f15568d | 2314:8e9be4fa33a8 |
---|---|
879 unsigned int heightRatio; // [sp+14h] [bp-74h]@12 | 879 unsigned int heightRatio; // [sp+14h] [bp-74h]@12 |
880 unsigned int widthRatioPlusOne; // [sp+14h] [bp-74h]@218 | 880 unsigned int widthRatioPlusOne; // [sp+14h] [bp-74h]@218 |
881 int v160; // [sp+3Ch] [bp-4Ch]@13 | 881 int v160; // [sp+3Ch] [bp-4Ch]@13 |
882 unsigned __int16 *v175; // [sp+4Ch] [bp-3Ch]@13 | 882 unsigned __int16 *v175; // [sp+4Ch] [bp-3Ch]@13 |
883 unsigned __int16 *v193; // [sp+5Ch] [bp-2Ch]@7 | 883 unsigned __int16 *v193; // [sp+5Ch] [bp-2Ch]@7 |
884 signed int v231; // [sp+78h] [bp-10h]@7 | 884 //signed int v231; // [sp+78h] [bp-10h]@7 |
885 __int64 v240; // [sp+7Ch] [bp-Ch]@12 | 885 __int64 v240; // [sp+7Ch] [bp-Ch]@12 |
886 unsigned int v251; // [sp+80h] [bp-8h]@218 | 886 unsigned int v251; // [sp+80h] [bp-8h]@218 |
887 unsigned int v252; // [sp+84h] [bp-4h]@218 | 887 unsigned int v252; // [sp+84h] [bp-4h]@218 |
888 float a6s; // [sp+A0h] [bp+18h]@218 | 888 float a6s; // [sp+A0h] [bp+18h]@218 |
889 float a6t; // [sp+A0h] [bp+18h]@218 | 889 float a6t; // [sp+A0h] [bp+18h]@218 |
920 v193 = pDst; | 920 v193 = pDst; |
921 if ( dstHeight <= 0 ) | 921 if ( dstHeight <= 0 ) |
922 return result; | 922 return result; |
923 | 923 |
924 //do | 924 //do |
925 for ( v231 = 0; v231 < dstHeight; v231++ ) | 925 for ( int height = 0; height < dstHeight; height++ ) |
926 { | 926 { |
927 for (int counter = 0; counter < dstWidth; counter++) | 927 for (int width = 0; width < dstWidth; width++) |
928 { | 928 { |
929 a6s = (double)counter / (double)dstWidth * (double)srcWidth; | 929 a6s = (double)width / (double)dstWidth * (double)srcWidth; |
930 widthRatio = bankersRounding(a6s); | 930 widthRatio = bankersRounding(a6s); |
931 a6t = (double)(counter + 1) / (double)dstWidth * (double)srcWidth; | 931 a6t = (double)(width + 1) / (double)dstWidth * (double)srcWidth; |
932 widthRatioPlusOne = bankersRounding(a6t); | 932 widthRatioPlusOne = bankersRounding(a6t); |
933 v17 = (double)v231 / (double)dstHeight * (double)srcHeight; | 933 |
934 v17 = (double)height / (double)dstHeight * (double)srcHeight; | |
934 heightRatio = bankersRounding(v17); | 935 heightRatio = bankersRounding(v17); |
935 v18 = (double)(v231 + 1) / (double)dstHeight * (double)srcHeight; | 936 v18 = (double)(height + 1) / (double)dstHeight * (double)srcHeight; |
936 heightRatioPlusOne = bankersRounding(v18); | 937 heightRatioPlusOne = bankersRounding(v18); |
938 | |
937 v251 = 0; | 939 v251 = 0; |
938 v19 = (heightRatioPlusOne - heightRatio) * (widthRatioPlusOne - widthRatio); | 940 v19 = (heightRatioPlusOne - heightRatio) * (widthRatioPlusOne - widthRatio); |
939 v252 = 0; | 941 v252 = 0; |
940 a6b = 0; | 942 a6b = 0; |
941 v240 = 0i64; | 943 v240 = 0i64; |
942 | 944 |
943 v175 = (unsigned short*)((char *)pSrc + field_0_bits * (widthRatio + srcPitch * heightRatio)); | 945 v175 = (unsigned short*)((char *)pSrc + field_0_bits * (widthRatio + srcPitch * heightRatio)); |
944 for (int heightDiff = 0; heightDiff < heightRatioPlusOne - heightRatio; heightDiff++) | 946 for (int heightDiff = 0; heightDiff < heightRatioPlusOne - heightRatio; heightDiff++) |
945 { | 947 { |
946 int ratioDiff = widthRatioPlusOne - widthRatio; | 948 //int ratioDiff = widthRatioPlusOne - widthRatio; |
947 for(int i = 0; i < ratioDiff; i++) | 949 for(int ratioDiff = 0; ratioDiff < widthRatioPlusOne - widthRatio; ratioDiff++) |
948 { | 950 { |
949 if(field0value == 32) | 951 if(field0value == 32) |
950 v21 = _450FB1(((int*)v175)[i]); | 952 v21 = _450FB1(((int*)v175)[ratioDiff]); |
951 else if(field0value == 16) | 953 else if(field0value == 16) |
952 v21 = _450FB1(((_WORD*)v175)[i]); | 954 v21 = _450FB1(((_WORD*)v175)[ratioDiff]); |
953 else if (field0value == 8) | 955 else if (field0value == 8) |
954 v21 = _450FB1(((unsigned __int8*)v175)[i]); | 956 v21 = _450FB1(((unsigned __int8*)v175)[ratioDiff]); |
955 v240 += ((unsigned int)v21 >> 24); | 957 v240 += ((unsigned int)v21 >> 24); |
956 a6b += BYTE2(v21); | 958 a6b += BYTE2(v21); |
957 v252 += BYTE1(v21); | 959 v252 += BYTE1(v21); |
958 v251 += (unsigned __int8)v21; | 960 v251 += (unsigned __int8)v21; |
959 } | 961 } |
960 if (field0value == 32) | 962 if (field0value == 32) |
961 v175 += 2 * srcPitch; | 963 v175 += 2 * srcPitch; |
962 else if (field0value == 16) | 964 else if (field0value == 16) |
963 v175 += srcPitch; | 965 v175 += srcPitch; |
964 else if (field0value == 8) | 966 else if (field0value == 8) |
965 v175 = (unsigned short*)((char *)v175 + 2 * srcPitch); | 967 v175 = (unsigned short*)((char *)v175 + 2 * srcPitch); |
966 } | 968 } |
969 | |
967 v22 = (unsigned int)v240 / ((heightRatioPlusOne - heightRatio) * (widthRatioPlusOne - widthRatio)); | 970 v22 = (unsigned int)v240 / ((heightRatioPlusOne - heightRatio) * (widthRatioPlusOne - widthRatio)); |
968 if ( v19 ) | 971 if ( v19 ) |
969 { | 972 { |
970 a6b /= v19; | 973 a6b /= v19; |
971 v252 /= v19; | 974 v252 /= v19; |
977 *(_DWORD *)v193 = v23; | 980 *(_DWORD *)v193 = v23; |
978 v193 = (unsigned __int16 *)((char *)v193 + field_20_bits); | 981 v193 = (unsigned __int16 *)((char *)v193 + field_20_bits); |
979 } | 982 } |
980 v193 = (unsigned __int16 *)((char *)v193 + field_20_bits * (dstPitch - dstWidth)); | 983 v193 = (unsigned __int16 *)((char *)v193 + field_20_bits * (dstPitch - dstWidth)); |
981 //++v231; | 984 //++v231; |
982 result = v231; | 985 result = height; |
983 } | 986 } |
984 //while(v231 < dstHeight); | 987 //while(v231 < dstHeight); |
985 return result; | 988 return result; |
986 } | 989 } |
987 | 990 |