comparison Outdoor.cpp @ 2132:49de109bbab5

SavePCXScreenshot() continue
author Ritor1
date Sun, 29 Dec 2013 01:26:15 +0600
parents de5cdcb03fda
children 4c0c475917dd
comparison
equal deleted inserted replaced
2131:651b24553ae9 2132:49de109bbab5
999 int OutdoorLocationTerrain::_47CB57(int a1, int a2, int a3) 999 int OutdoorLocationTerrain::_47CB57(int a1, int a2, int a3)
1000 { 1000 {
1001 signed int result; // eax@2 1001 signed int result; // eax@2
1002 unsigned __int16 *v5; // edx@3 1002 unsigned __int16 *v5; // edx@3
1003 double v6; // st7@3 1003 double v6; // st7@3
1004 char v7; // bl@3
1005 int v8; // eax@3 1004 int v8; // eax@3
1006 int v9; // eax@4 1005 int v9; // eax@4
1007 int v10; // eax@5 1006 int v10; // eax@5
1008 double v11; // st6@7 1007 double v11; // st6@7
1009 signed int v12; // edi@7 1008 signed int v12; // edi@7
1010 int v13; // esi@9 1009 int v13; // esi@9
1011 char *v14; // esi@10 1010 char *v14; // esi@10
1012 signed int v15; // ecx@10 1011 signed int v15; // ecx@10
1013 char v16[256]; // [sp+4h] [bp-124h]@9 1012 char v16[256]; // [sp+4h] [bp-124h]@9
1014 unsigned __int16 *v17; // [sp+104h] [bp-24h]@3 1013 unsigned __int16 *v17; // [sp+104h] [bp-24h]@3
1015 unsigned int v18; // [sp+108h] [bp-20h]@3
1016 unsigned int v19; // [sp+10Ch] [bp-1Ch]@3
1017 unsigned int v20; // [sp+110h] [bp-18h]@3
1018 unsigned int v21; // [sp+114h] [bp-14h]@3
1019 float v22; // [sp+118h] [bp-10h]@3 1014 float v22; // [sp+118h] [bp-10h]@3
1020 float v23; // [sp+11Ch] [bp-Ch]@3 1015 float v23; // [sp+11Ch] [bp-Ch]@3
1021 int i; // [sp+120h] [bp-8h]@3 1016 int i; // [sp+120h] [bp-8h]@3
1022 unsigned int v25; // [sp+124h] [bp-4h]@5 1017 unsigned int v25; // [sp+124h] [bp-4h]@5
1023 signed int a2a; // [sp+134h] [bp+Ch]@3 1018 signed int a2a; // [sp+134h] [bp+Ch]@3
1024 unsigned int a2b; // [sp+134h] [bp+Ch]@7 1019 unsigned int a2b; // [sp+134h] [bp+Ch]@7
1025 float a3a; // [sp+138h] [bp+10h]@7 1020 float a3a; // [sp+138h] [bp+10h]@7
1026 int a3b; // [sp+138h] [bp+10h]@9 1021 int a3b; // [sp+138h] [bp+10h]@9
1027 1022
1023 int num_r_bits = 5;
1024 int num_g_bits = 6;
1025 int num_b_bits = 5;
1026
1027 int r_mask = 0xF800;
1028 int g_mask = 0x7E0;
1029 int b_mask = 0x1F;
1030
1028 if ( pRenderer->pRenderD3D ) 1031 if ( pRenderer->pRenderD3D )
1029 {
1030 result = 0; 1032 result = 0;
1031 }
1032 else 1033 else
1033 { 1034 {
1035 __debugbreak();
1034 v5 = PaletteManager::Get_Dark_or_Red_LUT(a2, 0, 1); 1036 v5 = PaletteManager::Get_Dark_or_Red_LUT(a2, 0, 1);
1035 v6 = 0.0; 1037 v6 = 0.0;
1036 v7 = LOBYTE(pRenderer->uTargetBBits);
1037 v19 = pRenderer->uTargetRMask;
1038 v21 = pRenderer->uTargetGMask;
1039 v22 = 0.0; 1038 v22 = 0.0;
1040 v20 = pRenderer->uTargetBMask;
1041 v8 = 0; 1039 v8 = 0;
1042 v17 = v5; 1040 v17 = v5;
1043 v23 = 0.0; 1041 v23 = 0.0;
1044 v18 = pRenderer->uTargetBBits;
1045 a2a = 0; 1042 a2a = 0;
1046 for ( i = 0; i < a3; ++i ) 1043 for ( i = 0; i < a3; ++i )
1047 { 1044 {
1048 v9 = *(char *)(v8 + a1); 1045 v9 = *(char *)(v8 + a1);
1049 if ( v9 ) 1046 if ( v9 )
1050 { 1047 {
1051 v10 = v5[v9]; 1048 v10 = v5[v9];
1052 v6 = v6 + (double)((signed int)(v19 & v10) >> (LOBYTE(pRenderer->uTargetBBits) + LOBYTE(pRenderer->uTargetGBits))); 1049 v6 = v6 + (double)((signed int)(r_mask & v10) >> (num_b_bits + num_g_bits));
1053 ++a2a; 1050 ++a2a;
1054 v25 = v20 & v10; 1051 v25 = b_mask & v10;
1055 v22 = (double)((signed int)(v21 & v10) >> SLOBYTE(pRenderer->uTargetBBits)) + v22; 1052 v22 = (double)((signed int)(g_mask & v10) >> num_b_bits) + v22;
1056 v23 = (double)(signed int)(v20 & v10) + v23; 1053 v23 = (double)(signed int)(b_mask & v10) + v23;
1057 } 1054 }
1058 v8 = i + 1; 1055 v8 = i + 1;
1059 } 1056 }
1060 v11 = 1.0 / (double)a2a; 1057 v11 = 1.0 / (double)a2a;
1061 a3a = v11; 1058 a3a = v11;
1062 v25 = (signed __int64)(a3a * v22); 1059 v25 = (signed __int64)(a3a * v22);
1063 i = (signed __int64)(a3a * v23); 1060 i = (signed __int64)(a3a * v23);
1064 v12 = 0; 1061 v12 = 0;
1065 a2b = pRenderer->uTargetBBits + pRenderer->uTargetGBits; 1062 a2b = num_b_bits + num_g_bits;
1066 while ( 1 ) 1063 while ( 1 )
1067 { 1064 {
1068 v13 = v17[v12]; 1065 v13 = v17[v12];
1069 a3b = abs((__int64)(signed __int64)(v11 * v6) - ((signed int)(v19 & v17[v12]) >> a2b)); 1066 a3b = abs((__int64)(signed __int64)(v11 * v6) - ((signed int)(r_mask & v17[v12]) >> a2b));
1070 BYTE3(a3b) = abs((signed)v25 - ((signed int)(v21 & v13) >> v7)) + a3b; 1067 BYTE3(a3b) = abs((signed)v25 - ((signed int)(g_mask & v13) >> num_b_bits)) + a3b;
1071 v16[v12++] = abs((signed)i - (signed)(v20 & v13)) + BYTE3(a3b); 1068 v16[v12++] = abs((signed)i - (signed)(b_mask & v13)) + BYTE3(a3b);
1072 if ( v12 >= 256 ) 1069 if ( v12 >= 256 )
1073 break; 1070 break;
1074 v7 = v18;
1075 } 1071 }
1076 result = 0; 1072 result = 0;
1077 v14 = (char *)&pPaletteManager->field_D1600[42][23][116]; 1073 v14 = (char *)&pPaletteManager->field_D1600[42][23][116];
1078 v15 = 0; 1074 v15 = 0;
1079 do 1075 do