# HG changeset patch # User Ritor1 # Date 1383794338 -21600 # Node ID bb1e7b0780d818b0d165c31a53e5b6ccbb194f10 # Parent 079f2abf54e42c2d54f72c106d0bc395df279030 DrawIndoorSky diff -r 079f2abf54e4 -r bb1e7b0780d8 Render.cpp --- a/Render.cpp Tue Nov 05 12:58:19 2013 +0600 +++ b/Render.cpp Thu Nov 07 09:18:58 2013 +0600 @@ -5044,7 +5044,6 @@ unsigned int v63; // [sp+120h] [bp-54h]@7 unsigned int v65; // [sp+128h] [bp-4Ch]@1 unsigned int v66; // [sp+12Ch] [bp-48h]@7 - //float v67; // [sp+130h] [bp-44h]@7 __int64 v69; // [sp+13Ch] [bp-38h]@3 int v70; // [sp+144h] [bp-30h]@3 int X; // [sp+148h] [bp-2Ch]@9 @@ -5061,7 +5060,7 @@ const void *v81; // [sp+170h] [bp-4h]@7 pFace = &pIndoor->pFaces[uFaceID]; - //for floor and wall(for example Selesta)------------------- + //for floor and wall(for example Celesta)------------------- if (pFace->uPolygonType == POLYGON_InBetweenFloorAndWall || pFace->uPolygonType == POLYGON_Floor) { int v69 = (GetTickCount() / 32) - pGame->pIndoorCameraD3D->vPartyPos.x; @@ -5105,16 +5104,12 @@ pSkyPolygon.field_24 = 0x2000000; extern float _calc_fov(int viewport_width, int angle_degree); - //v64 = (double)(signed int)(pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX) * 0.5; - //v72 = 65536 / (signed int)(signed __int64)(v64 / tan(0.6457717418670654) + 0.5); v72 = 65536.0f / _calc_fov(pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX, 74); v12 = pSkyPolygon.pTexture->uWidthMinus1; v13 = pSkyPolygon.pTexture->uHeightMinus1; - //v67 = 1.0 / (double)pSkyPolygon.pTexture->uTextureWidth; v63 = 224 * pMiscTimer->uTotalGameTimeElapsed & v13; v66 = 224 * pMiscTimer->uTotalGameTimeElapsed & v12; v78 = 0; - //v81 = 0; float v68 = 1.0 / (double)pSkyPolygon.pTexture->uTextureHeight; if ( (signed int)pSkyPolygon.uNumVertices <= 0 ) return; @@ -5122,7 +5117,6 @@ int _507D30_idx = 0; for ( _507D30_idx; _507D30_idx < pSkyPolygon.uNumVertices; _507D30_idx++ ) { - //v15 = (void *)(v72 * (v70 - (int)array_507D30[_507D30_idx].vWorldViewProjY)); v77 = (unsigned __int64)(pSkyPolygon.ptr_38->viewing_angle_from_west_east * (signed __int64)(v72 * (v70 - array_507D30[_507D30_idx].vWorldViewProjY))) >> 16; v74 = v77 + pSkyPolygon.ptr_38->angle_from_north; @@ -5174,13 +5168,6 @@ v77 = (unsigned __int64)(SLODWORD(s) * (v23 / X)) >> 16; LODWORD(v73) = (unsigned __int64)(SLODWORD(s2) * (v23 / X)) >> 16; array_507D30[_507D30_idx]._rhw = 65536.0 / (double)(signed int)v79; - - //if ( (int)v81 >= pSkyPolygon.uNumVertices ) - //{ - // pRenderer->DrawIndoorSkyPolygon(pSkyPolygon.uNumVertices, &pSkyPolygon, - // pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPolygon.uTileBitmapID]); - // return; - //} continue; } break; @@ -5228,21 +5215,17 @@ } if ( SLODWORD(v73) <= 0 ) goto LABEL_40; - //v34 = (char *)&array_50AC10[0].vWorldViewProjY; uint j = 0; v65 = v77 >> 14; - //HIDWORD(v69) = LODWORD(v73); for ( int t = (int)LODWORD(v73); t > 1; t-- ) { v35 = (const void *)(v72 * (v70 - (unsigned __int64)(signed __int64)array_50AC10[j].vWorldViewProjY)); - //v78 = pSkyPolygon.ptr_38->viewing_angle_from_west_east; v81 = (const void *)((unsigned __int64)(pSkyPolygon.ptr_38->viewing_angle_from_west_east * (signed __int64)(signed int)v35) >> 16); v36 = (int)((char *)v81 + pSkyPolygon.ptr_38->angle_from_north); v81 = v35; v74 = v36; - //v78 = pSkyPolygon.ptr_38->viewing_angle_from_north_south; v81 = (const void *)((unsigned __int64)(pSkyPolygon.ptr_38->viewing_angle_from_north_south * (signed __int64)(signed int)v35) >> 16); v78 = (int)v35; v75 = (RenderVertexSoft *)((char *)v81 + pSkyPolygon.ptr_38->angle_from_east); @@ -5289,30 +5272,24 @@ v79 = (void *)(v42 / X); v81 = v37; - //v78 = pSkyPolygon.ptr_38->angle_from_west; v81 = (const void *)((unsigned __int64)(pSkyPolygon.ptr_38->angle_from_west * (signed __int64)(signed int)v37) >> 16); v43 = v74 + ((unsigned __int64)(pSkyPolygon.ptr_38->angle_from_west * (signed __int64)(signed int)v37) >> 16); v74 = (unsigned int)v37; LODWORD(v76) = v43; - //v78 = pSkyPolygon.ptr_38->angle_from_south; v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(pSkyPolygon.ptr_38->angle_from_south * (signed __int64)(signed int)v37) >> 16)); v74 = (unsigned __int64)(v43 * v42 / X) >> 16; v81 = (const void *)((unsigned __int64)((signed int)v75 * v42 / X) >> 16); - //v34 += 48; v78 = v66 + ((signed int)v74 >> 4); - //v44 = HIDWORD(v69)-- == 1; v45 = (double)v78 * 0.000015259022; v78 = v63 + ((signed int)((unsigned __int64)((signed int)v75 * v42 / X) >> 16) >> 4); array_50AC10[j].u = v45 * (1.0 / (double)pSkyPolygon.pTexture->uTextureWidth); array_50AC10[j].v = (double)v78 * 0.000015259022 * v68; - //v46 = (double)(signed int)v79; array_50AC10[j].vWorldViewPosition.x = 0.000015258789 * (double)(signed int)v79; array_50AC10[j]._rhw = 65536.0 / (double)(signed int)v79; ++j; } - //while ( !v44 ); LABEL_40: uint i = 0; if ( SLODWORD(v73) > 0 ) @@ -5345,7 +5322,6 @@ pRenderer->DrawIndoorSkyPolygon(pNumVertices, &pSkyPolygon, pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPolygon.uTileBitmapID]); } - //----- (004A2FC0) -------------------------------------------------------- void Render::DrawIndoorPolygon(unsigned int uNumVertices, BLVFace *pFace, IDirect3DTexture2 *pHwTex, Texture *pTex, int uPackedID, unsigned int uColor, int a8) {