comparison mm7_4.cpp @ 737:225d92620998

004A19D8 refactored
author Nomad
date Fri, 22 Mar 2013 20:40:23 +0200
parents 6daaa2f18d0d
children 852ec78d9548
comparison
equal deleted inserted replaced
736:9cc972ebd3cf 737:225d92620998
4930 4930
4931 4931
4932 4932
4933 4933
4934 //----- (004A19D8) -------------------------------------------------------- 4934 //----- (004A19D8) --------------------------------------------------------
4935 int __fastcall sub_4A19D8(unsigned int a1, unsigned int a2) 4935 unsigned int BlendColors(unsigned int a1, unsigned int a2)
4936 { 4936 {
4937 signed __int64 v2; // ST10_8@1 4937 /*signed __int64 v2; // ST10_8@1
4938 double v3; // st7@1 4938 double v3; // st7@1
4939 float v4; // ST24_4@1 4939 float v4; // ST24_4@1
4940 double v5; // ST10_8@1 4940 double v5; // ST10_8@1
4941 int v6; // ST1C_4@1 4941 int v6; // ST1C_4@1
4942 float v7; // ST24_4@1 4942 float v7; // ST24_4@1
4943 double v8; // ST10_8@1 4943 double v8; // ST10_8@1
4944 unsigned __int8 v9; // ST20_1@1 4944 unsigned __int8 v9; // ST20_1@1
4945 float v10; // ST24_4@1 4945 float v10; // ST24_4@1
4946 double v11; // ST10_8@1 4946 double v11; // ST10_8@1
4947 float v12; // ST24_4@1 4947 float v12; // ST24_4@1
4948 double v13; // ST08_8@1 4948 double v13; // ST08_8@1*/
4949 4949
4950 v2 = a1 >> 24; 4950 uint alpha = (uint)floorf(0.5f + (a1 >> 24) / 255.0f *
4951 v3 = (double)v2 * 0.0039215689; 4951 (a2 >> 24) / 255.0f * 255.0f),
4952 red = (uint)floorf(0.5f + ((a1 >> 16) & 0xFF) / 255.0f *
4953 ((a2 >> 16) & 0xFF) / 255.0f * 255.0f),
4954 green = (uint)floorf(0.5f + ((a1 >> 8) & 0xFF) / 255.0f *
4955 ((a2 >> 8) & 0xFF) / 255.0f * 255.0f),
4956 blue = (uint)floorf(0.5f + ((a1 >> 0) & 0xFF) / 255.0f *
4957 ((a2 >> 0) & 0xFF) / 255.0f * 255.0f);
4958 return (alpha << 24) | (red << 16) | (green << 8) | blue;
4959 /*v2 = a1 >> 24;
4960 v3 = (double)v2 / 255.0f;
4961 HIDWORD(v2) = 0;
4952 LODWORD(v2) = a2 >> 24; 4962 LODWORD(v2) = a2 >> 24;
4953 v4 = v3 * (double)v2 * 0.0039215689 * 255.0; 4963 v4 = v3 * (double)v2 / 255.0f * 255.0;
4954 v5 = v4 + 6.7553994e15; 4964 v5 = v4 + 6.7553994e15;
4955 v6 = LODWORD(v5); 4965 v6 = LODWORD(v5);
4956 v7 = (double)((a1 >> 16) & 0xFFi64) * 0.0039215689 * (double)((a2 >> 16) & 0xFF) * 0.0039215689 * 255.0; 4966 v7 = (double)((a1 >> 16) & 0xFFi64) / 255.0f * (double)((a2 >> 16) & 0xFF) * 0.0039215689 * 255.0;
4957 v8 = v7 + 6.7553994e15; 4967 v8 = v7 + 6.7553994e15;
4958 v9 = LOBYTE(v8); 4968 v9 = LOBYTE(v8);
4959 v10 = (double)((unsigned __int16)a1 >> 8) * 0.0039215689 * (double)((unsigned __int16)a2 >> 8) * 0.0039215689 * 255.0; 4969 v10 = (double)((unsigned __int16)a1 >> 8) / 255.0f * (double)((unsigned __int16)a2 >> 8) / 255.0f * 255.0;
4960 v11 = v10 + 6.7553994e15; 4970 v11 = v10 + 6.7553994e15;
4961 v12 = (double)(a1 & 0xFFi64) * 0.0039215689 * (double)(unsigned __int8)a2 * 0.0039215689 * 255.0; 4971 v12 = (double)(a1 & 0xFFi64) / 255.0f * (double)(unsigned __int8)a2 / 255.0f * 255.0;
4962 v13 = v12 + 6.7553994e15; 4972 v13 = v12 + 6.7553994e15;
4963 return LOBYTE(v13) | ((LOBYTE(v11) | (((v6 << 8) | v9) << 8)) << 8); 4973 return LOBYTE(v13) | ((LOBYTE(v11) | (((v6 << 8) | v9) << 8)) << 8);*/
4964 } 4974 }
4965 4975
4966 4976
4967 4977
4968 //----- (004A46E6) -------------------------------------------------------- 4978 //----- (004A46E6) --------------------------------------------------------