comparison mm7_3.cpp @ 1438:bc99e1a48bea

m
author Ritor1
date Mon, 22 Jul 2013 18:00:34 +0600
parents 47975067d6a8
children 468f434a8d8a
comparison
equal deleted inserted replaced
1437:47975067d6a8 1438:bc99e1a48bea
5956 //----- (00479543) -------------------------------------------------------- 5956 //----- (00479543) --------------------------------------------------------
5957 void Render::DrawSkyD3D() 5957 void Render::DrawSkyD3D()
5958 { 5958 {
5959 int v0; // esi@2 5959 int v0; // esi@2
5960 int v1; // eax@2 5960 int v1; // eax@2
5961 //double v2; // st7@2
5962 //double v3; // st6@2
5963 //double v4; // st5@2
5964 //double v5; // st4@2
5965 //double v6; // st7@2
5966 //char *v7; // esi@3
5967 int v8; // eax@4 5961 int v8; // eax@4
5968 int v9; // eax@4 5962 int v9; // eax@4
5969 int v10; // ebx@4 5963 int v10; // ebx@4
5970 signed __int64 v11; // qax@6 5964 signed __int64 v11; // qax@6
5971 double v12; // st7@6 5965 //double v12; // st7@6
5972 int v13; // edi@6 5966 int v13; // edi@6
5973 int v14; // ecx@6 5967 int v14; // ecx@6
5974 int v15; // eax@8 5968 //int v15; // eax@8
5975 int v16; // eax@12 5969 int v16; // eax@12
5976 signed __int64 v17; // qtt@13 5970 signed __int64 v17; // qtt@13
5977 signed int v18; // ecx@13 5971 signed int pShading; // ecx@13
5978 //Texture *v19; // eax@15
5979 //double v20; // st6@15
5980 //double v21; // st7@15
5981 //double v22; // st6@15
5982 //unsigned __int8 v23; // sf@15
5983 //unsigned __int8 v24; // of@15
5984 stru148 pSky; // [sp+14h] [bp-150h]@1 5972 stru148 pSky; // [sp+14h] [bp-150h]@1
5985 //double v26; // [sp+120h] [bp-44h]@4
5986 //float v27; // [sp+128h] [bp-3Ch]@4
5987 float v28; // [sp+12Ch] [bp-38h]@2 5973 float v28; // [sp+12Ch] [bp-38h]@2
5988 int v29; // [sp+130h] [bp-34h]@4 5974 int v29; // [sp+130h] [bp-34h]@4
5989 int v30; // [sp+134h] [bp-30h]@1 5975 int v30; // [sp+134h] [bp-30h]@1
5990 //int v31; // [sp+138h] [bp-2Ch]@2
5991 int v32; // [sp+13Ch] [bp-28h]@6 5976 int v32; // [sp+13Ch] [bp-28h]@6
5992 int v33; // [sp+140h] [bp-24h]@2 5977 int v33; // [sp+140h] [bp-24h]@2
5993 int v34; // [sp+144h] [bp-20h]@1 5978 int v34; // [sp+144h] [bp-20h]@1
5994 int v35; // [sp+148h] [bp-1Ch]@4 5979 int v35; // [sp+148h] [bp-1Ch]@4
5995 int v36; // [sp+14Ch] [bp-18h]@2 5980 int v36; // [sp+14Ch] [bp-18h]@2
6019 return; 6004 return;
6020 6005
6021 pSky.dimming_level = 0;//затемнение 6006 pSky.dimming_level = 0;//затемнение
6022 pSky.uNumVertices = 4;//количество вершин 6007 pSky.uNumVertices = 4;//количество вершин
6023 6008
6024 //tilt(наклон)--------------------------------------------------------------- 6009 //centering(центруем)---------------------------------------------------------------
6025 pSky.v_18.x = -stru_5C6E00->Sin(pIndoorCamera->sRotationX + 16); 6010 pSky.v_18.x = -stru_5C6E00->Sin(pIndoorCamera->sRotationX + 16);//-3216
6026 pSky.v_18.y = 0; 6011 pSky.v_18.y = 0;
6027 pSky.v_18.z = -stru_5C6E00->Cos(pIndoorCamera->sRotationX + 16); 6012 pSky.v_18.z = -stru_5C6E00->Cos(pIndoorCamera->sRotationX + 16);//-65457
6028 //--------------------------------------------------------------------------- 6013 //---------------------------------------------------------------------------
6029 6014
6030 pSky.field_24 = 0x2000000; 6015 pSky.field_24 = 0x2000000;
6031 6016
6032 pSky.sTextureDeltaU = 224 * pMiscTimer->uTotalGameTimeElapsed; 6017 pSky.sTextureDeltaU = 224 * pMiscTimer->uTotalGameTimeElapsed;
6045 array_50AC10[3].vWorldViewProjX = pViewport->uViewportBR_X; 6030 array_50AC10[3].vWorldViewProjX = pViewport->uViewportBR_X;
6046 array_50AC10[3].vWorldViewProjY = pViewport->uViewportTL_Y; 6031 array_50AC10[3].vWorldViewProjY = pViewport->uViewportTL_Y;
6047 //-------------------------------------------------------------------------- 6032 //--------------------------------------------------------------------------
6048 6033
6049 //pParty->sRotationY / 2048.0f 6034 //pParty->sRotationY / 2048.0f
6050 // move sky(двидение неба)--------------include----------------------------- 6035 // move sky(движение неба)--------------include-----------------------------
6051 float t = (GetTickCount() % 96000) / 96000.0f; 6036 float t = (GetTickCount() % 96000) / 96000.0f;
6052 array_50AC10[0].u = t - pParty->sRotationY / 1024.0f; 6037 array_50AC10[0].u = t - pParty->sRotationY / 1024.0f;
6053 array_50AC10[0].v = t - pParty->sRotationX / 512.0f; 6038 array_50AC10[0].v = t - pParty->sRotationX / 512.0f;
6054 6039
6055 array_50AC10[1].u = t - pParty->sRotationY / 1024.0f; 6040 array_50AC10[1].u = t - pParty->sRotationY / 1024.0f;
6061 array_50AC10[3].u = 1 + t - pParty->sRotationY / 1024.0f; 6046 array_50AC10[3].u = 1 + t - pParty->sRotationY / 1024.0f;
6062 array_50AC10[3].v = t - pParty->sRotationX / 512.0f; 6047 array_50AC10[3].v = t - pParty->sRotationX / 512.0f;
6063 //-------------------------------------------------------------------------- 6048 //--------------------------------------------------------------------------
6064 6049
6065 //rotate skydome(вращение купола неба)-------------------------------------- 6050 //rotate skydome(вращение купола неба)--------------------------------------
6066 v36 = (pViewport->uViewportBR_X - pViewport->uViewportTL_X) * 0.5;//центр экрана 6051 v36 = (pViewport->uViewportBR_X - pViewport->uViewportTL_X) * 0.5;//центр экрана 230
6067 v33 = 65536 / (signed int)(v36 / tan(0.6457717418670654) + 0.5); 6052 v33 = 65536 / (signed int)(v36 / tan(0.6457717418670654) + 0.5);//214
6068 6053
6069 for (uint i = 0; i < pSky.uNumVertices; ++i) 6054 for (uint i = 0; i < pSky.uNumVertices; ++i)
6070 { 6055 {
6071 v29 = floorf(array_50AC10[i].vWorldViewProjY + 0.5f); 6056 v29 = floorf(array_50AC10[i].vWorldViewProjY + 0.5f);//8
6072 v39 = (unsigned __int64)(pSky.ptr_38->field_14 * v33 * (v30 - v29)) / 65536; 6057 v39 = (unsigned __int64)(pSky.ptr_38->field_14 * v33 * (v30 - v29)) / 65536;//0
6073 v8 = v39 + pSky.ptr_38->field_C; 6058 v8 = v39 + pSky.ptr_38->field_C;//0
6074 6059
6075 v39 = (unsigned __int64)(pSky.ptr_38->field_20 * v33 * (v30 - v29)) / 65536; 6060 v39 = (unsigned __int64)(pSky.ptr_38->field_20 * v33 * (v30 - v29)) / 65536;//0
6076 v36 = v39 + pSky.ptr_38->field_18; 6061 v36 = v39 + pSky.ptr_38->field_18;//65536
6077 6062
6078 v9 = (unsigned __int64)(pSky.v_18.z * v33 * (v30 - v29)) / 65536; 6063 v9 = (unsigned __int64)(pSky.v_18.z * v33 * (v30 - v29)) / 65536;//27917
6079 v10 = pSky.v_18.x + v9; 6064 v10 = pSky.v_18.x + v9;//24701
6080 v39 = pSky.v_18.x + v9; 6065 v39 = pSky.v_18.x + v9;//24701
6081 if ( pSky.v_18.x + v9 > 0 ) 6066 if ( pSky.v_18.x + v9 > 0 )
6082 { 6067 {
6083 v10 = 0; 6068 v10 = 0;
6084 v39 = 0; 6069 v39 = 0;
6085 } 6070 }
6086 //v11 = (signed __int64)array_50AC10[i].vWorldViewProjX; 6071 //v11 = (signed __int64)array_50AC10[i].vWorldViewProjX;
6087 v38 = v10; 6072 v38 = v10;
6088 v12 = array_50AC10[i].vWorldViewProjY - 1.0; 6073 //v12 = array_50AC10[i].vWorldViewProjY - 1.0;
6089 v13 = v33 * (pViewport->uScreenCenterX - (signed __int64)array_50AC10[i].vWorldViewProjX); 6074 v13 = v33 * (pViewport->uScreenCenterX - (signed __int64)array_50AC10[i].vWorldViewProjX);
6090 v34 = -pSky.field_24; 6075 v34 = -pSky.field_24;
6091 v32 = (signed __int64)v12; 6076 v32 = (signed __int64)array_50AC10[i].vWorldViewProjY - 1.0;
6092 v14 = v33 * (v30 - v32); 6077 v14 = v33 * (v30 - v32);
6078
6093 while ( 1 ) 6079 while ( 1 )
6094 { 6080 {
6095 //v40 = v14; 6081 v40 = v14;
6096 if ( !v10 ) 6082 if ( !v10 )
6097 { 6083 {
6098 v37 = pSky.v_18.z; 6084 v37 = pSky.v_18.z;
6099 v16 = (unsigned __int64)(pSky.v_18.z * (signed __int64)v14) >> 16; 6085 v16 = (unsigned __int64)(pSky.v_18.z * (signed __int64)v14) >> 16;
6100 --v32; 6086 --v32;
6103 v39 = pSky.v_18.x + v16; 6089 v39 = pSky.v_18.x + v16;
6104 v38 = pSky.v_18.x + v16; 6090 v38 = pSky.v_18.x + v16;
6105 break; 6091 break;
6106 } 6092 }
6107 v37 = abs(v34 >> 14); 6093 v37 = abs(v34 >> 14);
6108 v15 = abs(v10); 6094 if ( abs(v34 >> 14) <= abs(v10) || v32 <= pViewport->uViewportTL_Y )
6109 if ( v37 <= v15 || v32 <= pViewport->uViewportTL_Y )
6110 { 6095 {
6111 if ( v39 <= 0 ) 6096 if ( v39 <= 0 )
6112 break; 6097 break;
6113 } 6098 }
6114 //v14 = v40; 6099 v14 = v40;
6115 v37 = pSky.v_18.z; 6100 v37 = pSky.v_18.z;
6116 v16 = (unsigned __int64)(pSky.v_18.z * v14) >> 16; 6101 v16 = (unsigned __int64)(pSky.v_18.z * v14) >> 16;
6117 --v32; 6102 --v32;
6118 v14 += v33; 6103 v14 += v33;
6119 v10 = pSky.v_18.x + v16; 6104 v10 = pSky.v_18.x + v16;
6120 v39 = pSky.v_18.x + v16; 6105 v39 = pSky.v_18.x + v16;
6121 v38 = pSky.v_18.x + v16; 6106 v38 = pSky.v_18.x + v16;
6122 break; 6107 break;
6123 } 6108 }
6109
6124 LODWORD(v17) = v34 << 16; 6110 LODWORD(v17) = v34 << 16;
6125 HIDWORD(v17) = v34 >> 16; 6111 HIDWORD(v17) = v34 >> 16;
6126 v18 = v17 / v38; 6112 pShading = v17 / v38;
6127 if ( v18 < 0 ) 6113 if ( pShading < 0 )
6128 v18 = pOutdoorCamera->shading_dist_mist; 6114 pShading = pOutdoorCamera->shading_dist_mist;
6129 6115
6130 v37 += ((unsigned __int64)(pSky.ptr_38->field_10 * v13) >> 16); 6116 v37 += ((unsigned __int64)(pSky.ptr_38->field_10 * v13) >> 16);
6131 v36 += ((unsigned __int64)(pSky.ptr_38->field_1C * v13) >> 16); 6117 v36 += ((unsigned __int64)(pSky.ptr_38->field_1C * v13) >> 16);
6132 v35 = 224 * pMiscTimer->uTotalGameTimeElapsed + fixpoint_sub0(v37, v18) / 8; 6118 v35 = 224 * pMiscTimer->uTotalGameTimeElapsed + fixpoint_sub0(v37, pShading) / 8;
6133 v36 = 224 * pMiscTimer->uTotalGameTimeElapsed + fixpoint_sub0(v36, v18) / 8; 6119 v36 = 224 * pMiscTimer->uTotalGameTimeElapsed + fixpoint_sub0(v36, pShading) / 8;
6134 6120
6135 //array_50AC10[i].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist; 6121 //array_50AC10[i].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist;
6136 //array_50AC10[i].vWorldPosition.x = v36 / (_this.pTexture->uTextureHeight * 65536.0); 6122 //array_50AC10[i].vWorldPosition.x = v36 / (pSky.pTexture->uTextureHeight * 65536.0);
6137 //array_50AC10[i].vWorldPosition.y = 1.0 / (pOutdoorCamera->shading_dist_mist >> 16); 6123 //array_50AC10[i].vWorldPosition.y = 1.0 / (pOutdoorCamera->shading_dist_mist >> 16);
6138 //array_50AC10[i].vWorldPosition.z = v35 / (_this.pTexture->uTextureWidth * 65536.0); 6124 //array_50AC10[i].vWorldPosition.z = v35 / (pSky.pTexture->uTextureWidth * 65536.0);
6139 //array_50AC10[i]._rhw = 1.0f / (v18 >> 16); 6125 //array_50AC10[i]._rhw = 1.0f / (v18 >> 16);
6140 //array_50AC10[i].u = (double)v35 / (65536.0 * _this.pTexture->uTextureWidth); 6126 //array_50AC10[i].u = (double)v35 / (65536.0 * pSky.pTexture->uTextureWidth);
6141 //array_50AC10[i].v = (double)v36 / (65536.0 * _this.pTexture->uTextureHeight); 6127 //array_50AC10[i].v = (double)v36 / (65536.0 * pSky.pTexture->uTextureHeight);
6142 //----------------------------------------------------------------------------------------- 6128 //-----------------------------------------------------------------------------------------
6143 6129
6144 array_50AC10[i]._rhw = 1.0f; 6130 array_50AC10[i]._rhw = 1.0f;
6145 } 6131 }
6146 //if ( i == _this.uNumVertices - 1 ) 6132 //if ( i == _this.uNumVertices - 1 )