comparison Render.cpp @ 1922:e60d9df73428

DrawIndoorPolygonSky
author Ritor1
date Wed, 23 Oct 2013 17:13:23 +0600
parents ab1c03cc2219
children f92e0bab7c78
comparison
equal deleted inserted replaced
1921:f04c2f93dacb 1922:e60d9df73428
5005 } 5005 }
5006 } 5006 }
5007 5007
5008 5008
5009 //----- (00479A53) -------------------------------------------------------- 5009 //----- (00479A53) --------------------------------------------------------
5010 void Render::DrawIndoorPolygonNoLight(unsigned int uNumVertices, unsigned int uFaceID) 5010 void Render::DrawIndoorPolygonSky(unsigned int uNumVertices, unsigned int uFaceID)
5011 { 5011 {
5012 BLVFace *pFace; // esi@1 5012 BLVFace *pFace; // esi@1
5013 //unsigned int v3; // edi@1 5013 //unsigned int v3; // edi@1
5014 //PolygonType v4; // al@1 5014 //PolygonType v4; // al@1
5015 double v5; // st7@3 5015 double v5; // st7@3
5032 int v22; // eax@14 5032 int v22; // eax@14
5033 signed __int64 v23; // qtt@16 5033 signed __int64 v23; // qtt@16
5034 double v24; // st7@16 5034 double v24; // st7@16
5035 unsigned __int8 v25; // sf@16 5035 unsigned __int8 v25; // sf@16
5036 unsigned __int8 v26; // of@16 5036 unsigned __int8 v26; // of@16
5037 Render *v27; // ecx@17 5037 //Render *v27; // ecx@17
5038 double v28; // st7@20 5038 double v28; // st7@20
5039 char *v29; // ebx@20 5039 char *v29; // ebx@20
5040 char *v30; // edx@20 5040 char *v30; // edx@20
5041 unsigned __int8 v31; // c0@21 5041 unsigned __int8 v31; // c0@21
5042 unsigned __int8 v32; // c3@21 5042 unsigned __int8 v32; // c3@21
5067 //int v57; // ST10_4@55 5067 //int v57; // ST10_4@55
5068 //Texture *v58; // eax@55 5068 //Texture *v58; // eax@55
5069 signed int v59; // [sp-4h] [bp-178h]@17 5069 signed int v59; // [sp-4h] [bp-178h]@17
5070 struct Polygon *v60; // [sp+0h] [bp-174h]@17 5070 struct Polygon *v60; // [sp+0h] [bp-174h]@17
5071 IDirect3DTexture2 *v61; // [sp+4h] [bp-170h]@17 5071 IDirect3DTexture2 *v61; // [sp+4h] [bp-170h]@17
5072 struct Polygon v62; // [sp+14h] [bp-160h]@6 5072 struct Polygon pSkyPoligon; // [sp+14h] [bp-160h]@6
5073 unsigned int v63; // [sp+120h] [bp-54h]@7 5073 unsigned int v63; // [sp+120h] [bp-54h]@7
5074 //double v64; // [sp+124h] [bp-50h]@7 5074 //double v64; // [sp+124h] [bp-50h]@7
5075 unsigned int v65; // [sp+128h] [bp-4Ch]@1 5075 unsigned int v65; // [sp+128h] [bp-4Ch]@1
5076 unsigned int v66; // [sp+12Ch] [bp-48h]@7 5076 unsigned int v66; // [sp+12Ch] [bp-48h]@7
5077 float v67; // [sp+130h] [bp-44h]@7 5077 float v67; // [sp+130h] [bp-44h]@7
5102 } 5102 }
5103 pRenderer->DrawIndoorPolygon(uNumVertices, pFace, pBitmaps_LOD->pHardwareTextures[pFace->uBitmapID], pFace->GetTexture(), PID(OBJECT_BModel, uFaceID), -1, 0); 5103 pRenderer->DrawIndoorPolygon(uNumVertices, pFace, pBitmaps_LOD->pHardwareTextures[pFace->uBitmapID], pFace->GetTexture(), PID(OBJECT_BModel, uFaceID), -1, 0);
5104 return; 5104 return;
5105 } 5105 }
5106 5106
5107 *(float *)&v74 = (double)pBLVRenderParams->uViewportCenterY; 5107 //*(float *)&v74 = (double)pBLVRenderParams->uViewportCenterY;
5108 v70 = (signed __int64)((double)(pBLVRenderParams->fov_rad_fixpoint * pGame->pIndoorCameraD3D->vPartyPos.z) 5108 v70 = (signed __int64)((double)(pBLVRenderParams->fov_rad_fixpoint * pGame->pIndoorCameraD3D->vPartyPos.z)
5109 / (((double)pBLVRenderParams->fov_rad_fixpoint + 16192.0) 5109 / (((double)pBLVRenderParams->fov_rad_fixpoint + 16192.0)
5110 * 65536.0) 5110 * 65536.0)
5111 + *(float *)&v74); 5111 + (double)pBLVRenderParams->uViewportCenterY);
5112 v5 = (double)pGame->pIndoorCameraD3D->sRotationX * 0.0030664064; 5112 v5 = (double)pGame->pIndoorCameraD3D->sRotationX * 0.0030664064;
5113 *(float *)&v75 = v5; 5113 //*(float *)&v75 = v5;
5114 v6 = (signed __int64)(*(float *)&v74 5114 v6 = (signed __int64)((double)pBLVRenderParams->uViewportCenterY
5115 - (double)pBLVRenderParams->fov_rad_fixpoint 5115 - (double)pBLVRenderParams->fov_rad_fixpoint
5116 / ((cos(v5) * 16192.0 + 0.0000001) 5116 / ((cos(v5) * 16192.0 + 0.0000001)
5117 * 65535.0) 5117 * 65535.0)
5118 * (sin(*(float *)&v75) * -16192.0 - (double)pGame->pIndoorCameraD3D->vPartyPos.z)); 5118 * (sin(v5) * -16192.0 - (double)pGame->pIndoorCameraD3D->vPartyPos.z));
5119 5119
5120 5120
5121 stru_8019C8._48653D_frustum_blv(65536, 0, 0, 0, 65536, 0); 5121 stru_8019C8._48653D_frustum_blv(65536, 0, 0, 0, 65536, 0);
5122 v62.Create_48607B(&stru_8019C8); 5122 pSkyPoligon.Create_48607B(&stru_8019C8);
5123 v62.uTileBitmapID = pFace->uBitmapID; 5123 pSkyPoligon.uTileBitmapID = pFace->uBitmapID;
5124 5124
5125 v62.pTexture = pBitmaps_LOD->GetTexture(v62.uTileBitmapID); 5125 pSkyPoligon.pTexture = pBitmaps_LOD->GetTexture(pSkyPoligon.uTileBitmapID);
5126 if ( !v62.pTexture ) 5126 if ( !pSkyPoligon.pTexture )
5127 return; 5127 return;
5128 5128
5129 v62.dimming_level = 0; 5129 pSkyPoligon.dimming_level = 0;
5130 v62.uNumVertices = uNumVertices; 5130 pSkyPoligon.uNumVertices = uNumVertices;
5131 v62.v_18.y = 0; 5131 pSkyPoligon.v_18.y = 0;
5132 v62.v_18.x = -stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationX + 16); 5132 pSkyPoligon.v_18.x = -stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationX + 16);
5133 v62.v_18.z = -stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationX + 16); 5133 pSkyPoligon.v_18.z = -stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationX + 16);
5134 memcpy(&array_507D30[uNumVertices], array_507D30, sizeof(array_507D30[uNumVertices])); 5134 memcpy(&array_507D30[uNumVertices], array_507D30, sizeof(array_507D30[uNumVertices]));
5135 v62.field_24 = 0x2000000; 5135 pSkyPoligon.field_24 = 0x2000000;
5136 5136
5137 extern float _calc_fov(int viewport_width, int angle_degree); 5137 extern float _calc_fov(int viewport_width, int angle_degree);
5138 //v64 = (double)(signed int)(pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX) * 0.5; 5138 //v64 = (double)(signed int)(pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX) * 0.5;
5139 //v72 = 65536 / (signed int)(signed __int64)(v64 / tan(0.6457717418670654) + 0.5); 5139 //v72 = 65536 / (signed int)(signed __int64)(v64 / tan(0.6457717418670654) + 0.5);
5140 v72 = 65536.0f / _calc_fov(pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX, 74); 5140 v72 = 65536.0f / _calc_fov(pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX, 74);
5141 v12 = v62.pTexture->uWidthMinus1; 5141 v12 = pSkyPoligon.pTexture->uWidthMinus1;
5142 v13 = v62.pTexture->uHeightMinus1; 5142 v13 = pSkyPoligon.pTexture->uHeightMinus1;
5143 v67 = 1.0 / (double)v62.pTexture->uTextureWidth; 5143 v67 = 1.0 / (double)pSkyPoligon.pTexture->uTextureWidth;
5144 v63 = 224 * pMiscTimer->uTotalGameTimeElapsed & v13; 5144 v63 = 224 * pMiscTimer->uTotalGameTimeElapsed & v13;
5145 v66 = 224 * pMiscTimer->uTotalGameTimeElapsed & v12; 5145 v66 = 224 * pMiscTimer->uTotalGameTimeElapsed & v12;
5146 v78 = 0; 5146 v78 = 0;
5147 v81 = 0; 5147 v81 = 0;
5148 float v68 = 1.0 / (double)v62.pTexture->uTextureHeight; 5148 float v68 = 1.0 / (double)pSkyPoligon.pTexture->uTextureHeight;
5149 if ( (signed int)v62.uNumVertices <= 0 ) 5149 if ( (signed int)pSkyPoligon.uNumVertices <= 0 )
5150 { 5150 {
5151 LABEL_17: 5151 LABEL_17:
5152 v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID]; 5152 v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPoligon.uTileBitmapID];
5153 v27 = pRenderer; 5153 //v27 = pRenderer;
5154 v60 = &v62; 5154 v60 = &pSkyPoligon;
5155 v59 = v62.uNumVertices; 5155 v59 = pSkyPoligon.uNumVertices;
5156 goto LABEL_18; 5156 goto LABEL_18;
5157 } 5157 }
5158 5158
5159 //v14 = (char *)&array_507D30[0].vWorldViewProjY; 5159 //v14 = (char *)&array_507D30[0].vWorldViewProjY;
5160 int _507D30_idx = 0; 5160 int _507D30_idx = 0;
5161 while ( 2 ) 5161 while ( 2 )
5162 { 5162 {
5163 v15 = (void *)(v72 * (v70 - (int)array_507D30[_507D30_idx].vWorldViewProjY)); 5163 v15 = (void *)(v72 * (v70 - (int)array_507D30[_507D30_idx].vWorldViewProjY));
5164 v77 = (unsigned __int64)(v62.ptr_38->viewing_angle_from_west_east * (signed __int64)(signed int)v15) >> 16; 5164 v77 = (unsigned __int64)(pSkyPoligon.ptr_38->viewing_angle_from_west_east * (signed __int64)(signed int)v15) >> 16;
5165 v74 = v77 + v62.ptr_38->angle_from_north; 5165 v74 = v77 + pSkyPoligon.ptr_38->angle_from_north;
5166 v77 = (int)v15; 5166 v77 = (int)v15;
5167 v77 = (unsigned __int64)(v62.ptr_38->viewing_angle_from_north_south * (signed __int64)(signed int)v15) >> 16; 5167 v77 = (unsigned __int64)(pSkyPoligon.ptr_38->viewing_angle_from_north_south * (signed __int64)(signed int)v15) >> 16;
5168 v79 = v15; 5168 v79 = v15;
5169 v75 = (RenderVertexSoft *)(v77 + v62.ptr_38->angle_from_east); 5169 v75 = (RenderVertexSoft *)(v77 + pSkyPoligon.ptr_38->angle_from_east);
5170 v79 = (void *)((unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v15) >> 16); 5170 v79 = (void *)((unsigned __int64)(pSkyPoligon.v_18.z * (signed __int64)(signed int)v15) >> 16);
5171 v17 = v72 * (pBLVRenderParams->uViewportCenterX - (int)array_507D30[_507D30_idx].vWorldViewProjX); 5171 v17 = v72 * (pBLVRenderParams->uViewportCenterX - (int)array_507D30[_507D30_idx].vWorldViewProjX);
5172 v18 = array_507D30[_507D30_idx].vWorldViewProjY - 1.0; 5172 v18 = array_507D30[_507D30_idx].vWorldViewProjY - 1.0;
5173 v19 = -v62.field_24; 5173 v19 = -pSkyPoligon.field_24;
5174 v77 = -v62.field_24; 5174 v77 = -pSkyPoligon.field_24;
5175 X = (int)((char *)v79 + v62.v_18.x); 5175 X = (int)((char *)v79 + pSkyPoligon.v_18.x);
5176 LODWORD(v76) = (signed __int64)v18; 5176 LODWORD(v76) = (signed __int64)v18;
5177 v20 = (void *)(v72 * (v70 - LODWORD(v76))); 5177 v20 = (void *)(v72 * (v70 - LODWORD(v76)));
5178 while ( 1 ) 5178 while ( 1 )
5179 { 5179 {
5180 v79 = v20; 5180 v79 = v20;
5186 if ( SLODWORD(v76) <= (signed int)pViewport->uViewportTL_Y ) 5186 if ( SLODWORD(v76) <= (signed int)pViewport->uViewportTL_Y )
5187 break; 5187 break;
5188 v19 = v77; 5188 v19 = v77;
5189 v20 = v79; 5189 v20 = v79;
5190 LABEL_14: 5190 LABEL_14:
5191 v79 = (void *)((unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v20) >> 16); 5191 v79 = (void *)((unsigned __int64)(pSkyPoligon.v_18.z * (signed __int64)(signed int)v20) >> 16);
5192 v22 = (unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v20) >> 16; 5192 v22 = (unsigned __int64)(pSkyPoligon.v_18.z * (signed __int64)(signed int)v20) >> 16;
5193 --LODWORD(v76); 5193 --LODWORD(v76);
5194 v20 = (char *)v20 + v72; 5194 v20 = (char *)v20 + v72;
5195 X = v22 + v62.v_18.x; 5195 X = v22 + pSkyPoligon.v_18.x;
5196 v78 = 1; 5196 v78 = 1;
5197 } 5197 }
5198 if ( !v78 ) 5198 if ( !v78 )
5199 { 5199 {
5200 LODWORD(v23) = v77 << 16; 5200 LODWORD(v23) = v77 << 16;
5201 HIDWORD(v23) = v77 >> 16; 5201 HIDWORD(v23) = v77 >> 16;
5202 v79 = (void *)(v23 / X); 5202 v79 = (void *)(v23 / X);
5203 v77 = v17; 5203 v77 = v17;
5204 v77 = v17; 5204 v77 = v17;
5205 LODWORD(v76) = v74 + ((unsigned __int64)(v62.ptr_38->angle_from_west * (signed __int64)v17) >> 16); 5205 LODWORD(v76) = v74 + ((unsigned __int64)(pSkyPoligon.ptr_38->angle_from_west * (signed __int64)v17) >> 16);
5206 v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(v62.ptr_38->angle_from_south * (signed __int64)v17) >> 16)); 5206 v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(pSkyPoligon.ptr_38->angle_from_south * (signed __int64)v17) >> 16));
5207 v77 = (unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16; 5207 v77 = (unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16;
5208 LODWORD(v73) = (unsigned __int64)((signed int)v75 * v23 / X) >> 16; 5208 LODWORD(v73) = (unsigned __int64)((signed int)v75 * v23 / X) >> 16;
5209 //v14 += 48; 5209 //v14 += 48;
5210 LODWORD(v80) = v66 + ((signed int)((unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16) >> 4); 5210 LODWORD(v80) = v66 + ((signed int)((unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16) >> 4);
5211 v81 = (char *)v81 + 1; 5211 v81 = (char *)v81 + 1;
5212 v24 = (double)SLODWORD(v80) * 0.000015259022; 5212 v24 = (double)SLODWORD(v80) * 0.000015259022;
5213 LODWORD(v80) = v63 + ((signed int)((unsigned __int64)((signed int)v75 * v23 / X) >> 16) >> 4); 5213 LODWORD(v80) = v63 + ((signed int)((unsigned __int64)((signed int)v75 * v23 / X) >> 16) >> 4);
5214 v26 = __OFSUB__((int)v81, v62.uNumVertices); 5214 v26 = __OFSUB__((int)v81, pSkyPoligon.uNumVertices);
5215 v25 = (signed int)((char *)v81 - v62.uNumVertices) < 0; 5215 v25 = (signed int)((char *)v81 - pSkyPoligon.uNumVertices) < 0;
5216 array_507D30[_507D30_idx].u = v24 * v67; 5216 array_507D30[_507D30_idx].u = v24 * v67;
5217 array_507D30[_507D30_idx].v = (double)SLODWORD(v80) * 0.000015259022 * v68; 5217 array_507D30[_507D30_idx].v = (double)SLODWORD(v80) * 0.000015259022 * v68;
5218 array_507D30[_507D30_idx]._rhw = 65536.0 / (double)(signed int)v79; 5218 array_507D30[_507D30_idx]._rhw = 65536.0 / (double)(signed int)v79;
5219 _507D30_idx++; 5219 _507D30_idx++;
5220 if ( !(v25 ^ v26) ) 5220 if ( !(v25 ^ v26) )
5223 } 5223 }
5224 break; 5224 break;
5225 } 5225 }
5226 LODWORD(v73) = 0; 5226 LODWORD(v73) = 0;
5227 v80 = v76; 5227 v80 = v76;
5228 if ( (signed int)v62.uNumVertices > 0 ) 5228 if ( (signed int)pSkyPoligon.uNumVertices > 0 )
5229 { 5229 {
5230 v28 = (double)SLODWORD(v76); 5230 v28 = (double)SLODWORD(v76);
5231 LODWORD(v76) = (int)(char *)array_50AC10 + 28; 5231 LODWORD(v76) = (int)(char *)array_50AC10 + 28;
5232 v29 = (char *)&array_50AC10[0].vWorldViewProjX; 5232 v29 = (char *)&array_50AC10[0].vWorldViewProjX;
5233 v30 = (char *)&array_507D30[1].vWorldViewProjY; 5233 v30 = (char *)&array_507D30[1].vWorldViewProjY;
5234 v79 = array_50AC10; 5234 v79 = array_50AC10;
5235 v81 = array_507D30; 5235 v81 = array_507D30;
5236 v78 = v62.uNumVertices; 5236 v78 = pSkyPoligon.uNumVertices;
5237 do 5237 do
5238 { 5238 {
5239 v31 = v28 < *((float *)v30 - 12); 5239 v31 = v28 < *((float *)v30 - 12);
5240 v32 = v28 == *((float *)v30 - 12); 5240 v32 = v28 == *((float *)v30 - 12);
5241 ++LODWORD(v73); 5241 ++LODWORD(v73);
5274 v65 = v77 >> 14; 5274 v65 = v77 >> 14;
5275 HIDWORD(v69) = LODWORD(v73); 5275 HIDWORD(v69) = LODWORD(v73);
5276 do 5276 do
5277 { 5277 {
5278 v35 = (const void *)(v72 * (v70 - (unsigned __int64)(signed __int64)*(float *)v34)); 5278 v35 = (const void *)(v72 * (v70 - (unsigned __int64)(signed __int64)*(float *)v34));
5279 v78 = v62.ptr_38->viewing_angle_from_west_east; 5279 v78 = pSkyPoligon.ptr_38->viewing_angle_from_west_east;
5280 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16); 5280 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16);
5281 v36 = (int)((char *)v81 + v62.ptr_38->angle_from_north); 5281 v36 = (int)((char *)v81 + pSkyPoligon.ptr_38->angle_from_north);
5282 v81 = v35; 5282 v81 = v35;
5283 v74 = v36; 5283 v74 = v36;
5284 v78 = v62.ptr_38->viewing_angle_from_north_south; 5284 v78 = pSkyPoligon.ptr_38->viewing_angle_from_north_south;
5285 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16); 5285 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16);
5286 v78 = (int)v35; 5286 v78 = (int)v35;
5287 v75 = (RenderVertexSoft *)((char *)v81 + v62.ptr_38->angle_from_east); 5287 v75 = (RenderVertexSoft *)((char *)v81 + pSkyPoligon.ptr_38->angle_from_east);
5288 v81 = (const void *)v62.v_18.z; 5288 v81 = (const void *)pSkyPoligon.v_18.z;
5289 v78 = (unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v35) >> 16; 5289 v78 = (unsigned __int64)(pSkyPoligon.v_18.z * (signed __int64)(signed int)v35) >> 16;
5290 v37 = (const void *)(v72 5290 v37 = (const void *)(v72
5291 * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)*((float *)v34 - 1))); 5291 * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)*((float *)v34 - 1)));
5292 v38 = (signed __int64)(*(float *)v34 - 1.0); 5292 v38 = (signed __int64)(*(float *)v34 - 1.0);
5293 v81 = 0; 5293 v81 = 0;
5294 LODWORD(v76) = v38; 5294 LODWORD(v76) = v38;
5303 break; 5303 break;
5304 if ( SLODWORD(v76) <= (signed int)pViewport->uViewportTL_Y ) 5304 if ( SLODWORD(v76) <= (signed int)pViewport->uViewportTL_Y )
5305 break; 5305 break;
5306 v39 = v78; 5306 v39 = v78;
5307 LABEL_36: 5307 LABEL_36:
5308 v78 = v62.v_18.z; 5308 v78 = pSkyPoligon.v_18.z;
5309 v41 = (unsigned __int64)(v62.v_18.z * (signed __int64)v39) >> 16; 5309 v41 = (unsigned __int64)(pSkyPoligon.v_18.z * (signed __int64)v39) >> 16;
5310 --LODWORD(v76); 5310 --LODWORD(v76);
5311 v39 += v72; 5311 v39 += v72;
5312 X = v41 + v62.v_18.x; 5312 X = v41 + pSkyPoligon.v_18.x;
5313 v81 = (const void *)1; 5313 v81 = (const void *)1;
5314 } 5314 }
5315 if ( v81 ) 5315 if ( v81 )
5316 { 5316 {
5317 v79 = (void *)v62.v_18.z; 5317 v79 = (void *)pSkyPoligon.v_18.z;
5318 v78 = 2 * LODWORD(v76); 5318 v78 = 2 * LODWORD(v76);
5319 v81 = (const void *)((unsigned __int64)(v62.v_18.z 5319 v81 = (const void *)((unsigned __int64)(pSkyPoligon.v_18.z
5320 * (signed __int64)(signed int)(signed __int64)(((double)v70 5320 * (signed __int64)(signed int)(signed __int64)(((double)v70
5321 - ((double)(2 * LODWORD(v76)) 5321 - ((double)(2 * LODWORD(v76))
5322 - *(float *)v34)) 5322 - *(float *)v34))
5323 * (double)v72)) >> 16); 5323 * (double)v72)) >> 16);
5324 X = (int)((char *)v81 + v62.v_18.x); 5324 X = (int)((char *)v81 + pSkyPoligon.v_18.x);
5325 } 5325 }
5326 LODWORD(v42) = v77 << 16; 5326 LODWORD(v42) = v77 << 16;
5327 HIDWORD(v42) = v77 >> 16; 5327 HIDWORD(v42) = v77 >> 16;
5328 v79 = (void *)(v42 / X); 5328 v79 = (void *)(v42 / X);
5329 v81 = v37; 5329 v81 = v37;
5330 v78 = v62.ptr_38->angle_from_west; 5330 v78 = pSkyPoligon.ptr_38->angle_from_west;
5331 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16); 5331 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16);
5332 v43 = v74 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16); 5332 v43 = v74 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16);
5333 v74 = (unsigned int)v37; 5333 v74 = (unsigned int)v37;
5334 LODWORD(v76) = v43; 5334 LODWORD(v76) = v43;
5335 v78 = v62.ptr_38->angle_from_south; 5335 v78 = pSkyPoligon.ptr_38->angle_from_south;
5336 v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16)); 5336 v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16));
5337 v74 = (unsigned __int64)(v43 * v42 / X) >> 16; 5337 v74 = (unsigned __int64)(v43 * v42 / X) >> 16;
5338 v81 = (const void *)((unsigned __int64)((signed int)v75 * v42 / X) >> 16); 5338 v81 = (const void *)((unsigned __int64)((signed int)v75 * v42 / X) >> 16);
5339 v34 += 48; 5339 v34 += 48;
5340 v78 = v66 + ((signed int)v74 >> 4); 5340 v78 = v66 + ((signed int)v74 >> 4);
5368 ++v49; 5368 ++v49;
5369 --HIDWORD(v69); 5369 --HIDWORD(v69);
5370 } 5370 }
5371 while ( HIDWORD(v69) ); 5371 while ( HIDWORD(v69) );
5372 } 5372 }
5373 v62.uNumVertices = v47; 5373 pSkyPoligon.uNumVertices = v47;
5374 pRenderer->_4A2ED5(v47, &v62, pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID]); 5374 pRenderer->_4A2ED5(v47, &pSkyPoligon, pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPoligon.uTileBitmapID]);
5375 *(float *)&v74 = 0.0; 5375 *(float *)&v74 = 0.0;
5376 if ( SLODWORD(v73) > 0 ) 5376 if ( SLODWORD(v73) > 0 )
5377 { 5377 {
5378 v51 = (double)SLODWORD(v80); 5378 v51 = (double)SLODWORD(v80);
5379 v75 = array_507D30; 5379 v75 = array_507D30;
5391 ++v52; 5391 ++v52;
5392 --LODWORD(v80); 5392 --LODWORD(v80);
5393 } 5393 }
5394 while ( v80 != 0.0 ); 5394 while ( v80 != 0.0 );
5395 } 5395 }
5396 v62.uNumVertices = v74; 5396 pSkyPoligon.uNumVertices = v74;
5397 v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID]; 5397 v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPoligon.uTileBitmapID];
5398 v60 = &v62; 5398 v60 = &pSkyPoligon;
5399 v59 = v74; 5399 v59 = v74;
5400 v27 = pRenderer; 5400 //v27 = pRenderer;
5401 LABEL_18: 5401 LABEL_18:
5402 v27->_4A2ED5(v59, v60, v61); 5402 pRenderer->_4A2ED5(v59, v60, v61);
5403 } 5403 }
5404 5404
5405 5405
5406 //----- (004A2FC0) -------------------------------------------------------- 5406 //----- (004A2FC0) --------------------------------------------------------
5407 void Render::DrawIndoorPolygon(unsigned int uNumVertices, BLVFace *pFace, IDirect3DTexture2 *pHwTex, Texture *pTex, int uPackedID, unsigned int uColor, int a8) 5407 void Render::DrawIndoorPolygon(unsigned int uNumVertices, BLVFace *pFace, IDirect3DTexture2 *pHwTex, Texture *pTex, int uPackedID, unsigned int uColor, int a8)
8883 v9 = pTextureFrameTable->GetFrameTexture(v9, pEventTimer->uTotalGameTimeElapsed); 8883 v9 = pTextureFrameTable->GetFrameTexture(v9, pEventTimer->uTotalGameTimeElapsed);
8884 pFaceTexture = pBitmaps_LOD->GetTexture(v9); 8884 pFaceTexture = pBitmaps_LOD->GetTexture(v9);
8885 array_77EC08[pODMRenderParams->uNumPolygons].pTexture = pFaceTexture; 8885 array_77EC08[pODMRenderParams->uNumPolygons].pTexture = pFaceTexture;
8886 if (pOutdoor->pBModels[model_id].pFaces[face_id].uAttributes & FACE_FLUID) 8886 if (pOutdoor->pBModels[model_id].pFaces[face_id].uAttributes & FACE_FLUID)
8887 array_77EC08[pODMRenderParams->uNumPolygons].flags |= 2; 8887 array_77EC08[pODMRenderParams->uNumPolygons].flags |= 2;
8888 if (pOutdoor->pBModels[model_id].pFaces[face_id].uAttributes & FACE_DO_NOT_LIGHT ) 8888 if (pOutdoor->pBModels[model_id].pFaces[face_id].uAttributes & FACE_INDOOR_SKY )
8889 HIBYTE(array_77EC08[pODMRenderParams->uNumPolygons].flags) |= 4; 8889 HIBYTE(array_77EC08[pODMRenderParams->uNumPolygons].flags) |= 4;
8890 if ( pOutdoor->pBModels[model_id].pFaces[face_id].uAttributes & 4 ) 8890 if ( pOutdoor->pBModels[model_id].pFaces[face_id].uAttributes & 4 )
8891 HIBYTE(array_77EC08[pODMRenderParams->uNumPolygons].flags) |= 4; 8891 HIBYTE(array_77EC08[pODMRenderParams->uNumPolygons].flags) |= 4;
8892 else 8892 else
8893 { 8893 {