comparison Render.cpp @ 203:dacc9207809a

Слияние
author Ritor1
date Thu, 03 Jan 2013 16:03:54 +0600
parents c04d432611e1
children
comparison
equal deleted inserted replaced
202:b78cf60aaa8e 203:dacc9207809a
905 905
906 //----- (0047F5C6) -------------------------------------------------------- 906 //----- (0047F5C6) --------------------------------------------------------
907 float Render::DrawBezierTerrain() 907 float Render::DrawBezierTerrain()
908 { 908 {
909 //__debugbreak();Ritor1: it's temporarily 909 //__debugbreak();Ritor1: it's temporarily
910 return 0; 910 //return 0;
911 /* 911
912 unsigned int v0; // ebx@1 912 unsigned int v0; // ebx@1
913 unsigned int v1; // edi@1 913 unsigned int v1; // edi@1
914 unsigned int v2; // eax@1 914 unsigned int v2; // eax@1
915 int v3; // eax@3 915 int v3; // eax@3
916 int v4; // edi@3 916 int v4; // edi@3
1692 Render::DrawTerrainSW(v111, 1, (int)&v102); 1692 Render::DrawTerrainSW(v111, 1, (int)&v102);
1693 } 1693 }
1694 } 1694 }
1695 result = v126; 1695 result = v126;
1696 pOutdoorCamera->field_40 = v126; 1696 pOutdoorCamera->field_40 = v126;
1697 return result;*/ 1697 return result;
1698 } 1698 }
1699 // 47FFC4: inconsistent fpu stack 1699 // 47FFC4: inconsistent fpu stack
1700 // 4D864C: using guessed type char byte_4D864C; 1700 // 4D864C: using guessed type char byte_4D864C;
1701 1701
1702 1702
1822 char this_3a; // [sp+DBh] [bp+Bh]@82 1822 char this_3a; // [sp+DBh] [bp+Bh]@82
1823 char this_3b; // [sp+DBh] [bp+Bh]@131 1823 char this_3b; // [sp+DBh] [bp+Bh]@131
1824 1824
1825 v3 = a1; 1825 v3 = a1;
1826 v82 = edx0; 1826 v82 = edx0;
1827 v83 = *(short *)(a3 + 4); 1827 v83 = *(/*short **/_WORD *)(a3 + 4);
1828 X = abs(*(short *)(a3 + 6)); 1828 X = abs(*(/*short **/_WORD *)(a3 + 6));
1829 v4 = 0; 1829 v4 = 0;
1830 v88 = 0; 1830 v88 = 0;
1831 v84 = v3 - 1; 1831 v84 = v3 - 1;
1832 v90 = (double)pOutdoor->vSunlight.x * 0.000015258789; 1832 v90 = (double)pOutdoor->vSunlight.x * 0.000015258789;
1833 v91 = (double)pOutdoor->vSunlight.y * 0.000015258789; 1833 v91 = (double)pOutdoor->vSunlight.y * 0.000015258789;
1834 v92 = (double)pOutdoor->vSunlight.z * 0.000015258789; 1834 v92 = (double)pOutdoor->vSunlight.z * 0.000015258789;
1835 if ( v3 - 1 > 0 ) 1835 if ( v3 - 1 > 0 )
1836 { 1836 {
1837 while ( 1 ) 1837 while ( 1 )
1838 { 1838 {
1839 v5 = abs(X); 1839 v5 = abs(X);//v5 = 13108
1840 v6 = abs(v83); 1840 v6 = abs(v83);//v6 = 13108
1841 --X; 1841 --X;
1842 v93 = &stru_76E5C8[(v5 << 7) + v6]; 1842 v93 = &stru_76E5C8[(v5 << 7) + v6];
1843 if ( !v93->field_0 || ((v7 = 48 * v4, v8 = &pVerticesSR_806210[v4], a2 = v8, !v82) ? (v9 = (RenderVertexSoft *)((char *)&pVerticesSR_801A10 + v7), 1843 if ( !v93->field_0 || ((v7 = 48 * v4, v8 = &pVerticesSR_806210[v4], a2 = v8, !v82) ? (v9 = (RenderVertexSoft *)((char *)&pVerticesSR_801A10 + v7),
1844 v10 = &pVerticesSR_806210[1] + v7) : (v9 = &pVerticesSR_806210[1] + v7, v10 = (RenderVertexSoft *)((char *)&pVerticesSR_801A10 + v7)), 1844 v10 = &pVerticesSR_806210[1] + v7) : (v9 = &pVerticesSR_806210[1] + v7, v10 = (RenderVertexSoft *)((char *)&pVerticesSR_801A10 + v7)),
1845 ((a8 = v9, 1845 ((a8 = v9,
2417 Vec3_float_ *pNormal; // [sp+C0h] [bp+8h]@17 2417 Vec3_float_ *pNormal; // [sp+C0h] [bp+8h]@17
2418 Vec3_float_ *pNormala; // [sp+C0h] [bp+8h]@48 2418 Vec3_float_ *pNormala; // [sp+C0h] [bp+8h]@48
2419 Vec3_float_ *pNormalb; // [sp+C0h] [bp+8h]@77 2419 Vec3_float_ *pNormalb; // [sp+C0h] [bp+8h]@77
2420 2420
2421 v3 = a1; 2421 v3 = a1;
2422 v4 = *(short *)(a3 + 4); 2422 //v4 = *(short *)(a3 + 4);
2423 v5 = *(short *)(a3 + 6); 2423 //v5 = *(short *)(a3 + 6);
2424 v85 = a2; 2424 v85 = a2;
2425 v86 = v4; 2425 v86 = *(_WORD *)(a3 + 4); //v4;
2426 X = abs(v5); 2426 X = abs(*(_WORD *)(a3 + 6)); //v5
2427 v6 = 0; 2427 v6 = 0;
2428 v90 = 0; 2428 v90 = 0;
2429 v81 = v3 - 1; 2429 v81 = v3 - 1;
2430 v95 = (double)pOutdoor->vSunlight.x * 0.000015258789; 2430 v95 = (double)pOutdoor->vSunlight.x * 0.000015258789;
2431 v96 = (double)pOutdoor->vSunlight.y * 0.000015258789; 2431 v96 = (double)pOutdoor->vSunlight.y * 0.000015258789;
9203 } 9203 }
9204 } 9204 }
9205 9205
9206 9206
9207 //----- (004A5D33) -------------------------------------------------------- 9207 //----- (004A5D33) --------------------------------------------------------
9208 void Render::_4A5D33(unsigned int a2, unsigned int a3, int a4, int a5, RGBTexture *pTexture) 9208 void Render::_4A5D33(unsigned int pX, unsigned int pY, int a4, int a5, RGBTexture *pTexture)
9209 { 9209 {
9210 Render *v6; // esi@1 9210 Render *v6; // esi@1
9211 unsigned __int16 *v7; // ebx@3 9211 unsigned __int16 *v7; // ebx@3
9212 int v8; // ecx@3 9212 int v8; // ecx@3
9213 int v9; // edx@3 9213 int v9; // edx@3
9225 unsigned int v21; // ecx@17 9225 unsigned int v21; // ecx@17
9226 int v22; // eax@21 9226 int v22; // eax@21
9227 int v23; // edi@23 9227 int v23; // edi@23
9228 int v24; // [sp+Ch] [bp-4h]@3 9228 int v24; // [sp+Ch] [bp-4h]@3
9229 int a2a; // [sp+18h] [bp+8h]@21 9229 int a2a; // [sp+18h] [bp+8h]@21
9230 unsigned int a3a; // [sp+1Ch] [bp+Ch]@20 9230 unsigned int teal; // [sp+1Ch] [bp+Ch]@20
9231 int a4a; // [sp+20h] [bp+10h]@3 9231 int a4a; // [sp+20h] [bp+10h]@3
9232 int a4b; // [sp+20h] [bp+10h]@21 9232 int a4b; // [sp+20h] [bp+10h]@21
9233 unsigned __int16 *pTexturea; // [sp+28h] [bp+18h]@3 9233 unsigned __int16 *pTexturea; // [sp+28h] [bp+18h]@3
9234 9234
9235 v6 = this; 9235 v6 = this;
9236 if ( this->uNumSceneBegins && pTexture ) 9236 if ( this->uNumSceneBegins && pTexture )
9237 { 9237 {
9238 v7 = &this->pTargetSurface[a2 + a3 * this->uTargetSurfacePitch]; 9238 v7 = &this->pTargetSurface[pX + pY * this->uTargetSurfacePitch];
9239 v8 = pTexture->uWidth; 9239 v8 = pTexture->uWidth;
9240 v24 = pTexture->uWidth; 9240 v24 = pTexture->uWidth;
9241 v9 = a4 + a5 * v8; 9241 v9 = a4 + a5 * v8;
9242 v10 = v8 - a4; 9242 v10 = v8 - a4;
9243 a4a = v10; 9243 a4a = v10;
9244 v11 = pTexture->uHeight - a5; 9244 v11 = pTexture->uHeight - a5;
9245 pTexturea = &pTexture->pPixels[v9]; 9245 pTexturea = &pTexture->pPixels[v9];
9246 if ( v6->bClip ) 9246 if ( v6->bClip )
9247 { 9247 {
9248 v12 = v6->uClipX; 9248 v12 = v6->uClipX;
9249 if ( (signed int)a2 < v12 ) 9249 if ( (signed int)pX < v12 )
9250 { 9250 {
9251 v13 = 2 * (v12 - a2); 9251 v13 = 2 * (v12 - pX);
9252 pTexturea = (unsigned __int16 *)((char *)pTexturea + v13); 9252 pTexturea = (unsigned __int16 *)((char *)pTexturea + v13);
9253 v10 += a2 - v6->uClipX; 9253 v10 += pX - v6->uClipX;
9254 v7 = (unsigned __int16 *)((char *)v7 + v13); 9254 v7 = (unsigned __int16 *)((char *)v7 + v13);
9255 a4a = v10; 9255 a4a = v10;
9256 } 9256 }
9257 v14 = v6->uClipY; 9257 v14 = v6->uClipY;
9258 if ( (signed int)a3 < v14 ) 9258 if ( (signed int)pY < v14 )
9259 { 9259 {
9260 v15 = v14 - a3; 9260 v15 = v14 - pY;
9261 pTexturea += v24 * v15; 9261 pTexturea += v24 * v15;
9262 v11 += a3 - v6->uClipY; 9262 v11 += pY - v6->uClipY;
9263 v10 = a4a; 9263 v10 = a4a;
9264 v7 += v6->uTargetSurfacePitch * v15; 9264 v7 += v6->uTargetSurfacePitch * v15;
9265 } 9265 }
9266 v16 = v6->uClipX; 9266 v16 = v6->uClipX;
9267 if ( (signed int)v16 < (signed int)a2 ) 9267 if ( (signed int)v16 < (signed int)pX )
9268 v16 = a2; 9268 v16 = pX;
9269 v17 = v6->uClipZ; 9269 v17 = v6->uClipZ;
9270 if ( (signed int)(v10 + v16) > v17 ) 9270 if ( (signed int)(v10 + v16) > v17 )
9271 { 9271 {
9272 v18 = v6->uClipX; 9272 v18 = v6->uClipX;
9273 if ( (signed int)v18 < (signed int)a2 ) 9273 if ( (signed int)v18 < (signed int)pX )
9274 v18 = a2; 9274 v18 = pX;
9275 a4a = v17 - v18; 9275 a4a = v17 - v18;
9276 } 9276 }
9277 v19 = v6->uClipY; 9277 v19 = v6->uClipY;
9278 if ( (signed int)v19 < (signed int)a3 ) 9278 if ( (signed int)v19 < (signed int)pY )
9279 v19 = a3; 9279 v19 = pY;
9280 v20 = v6->uClipW; 9280 v20 = v6->uClipW;
9281 if ( (signed int)(v11 + v19) > v20 ) 9281 if ( (signed int)(v11 + v19) > v20 )
9282 { 9282 {
9283 v21 = v6->uClipY; 9283 v21 = v6->uClipY;
9284 if ( (signed int)v21 < (signed int)a3 ) 9284 if ( (signed int)v21 < (signed int)pY )
9285 v21 = a3; 9285 v21 = pY;
9286 v11 = v20 - v21; 9286 v11 = v20 - v21;
9287 } 9287 }
9288 } 9288 }
9289 a3a = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu); 9289 teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu);
9290 if ( v11 > 0 ) 9290 if ( v11 > 0 )
9291 { 9291 {
9292 v22 = a4a; 9292 v22 = a4a;
9293 a2a = v11; 9293 a2a = v11;
9294 a4b = 2 * (v24 - a4a); 9294 a4b = 2 * (v24 - a4a);
9297 if ( v22 > 0 ) 9297 if ( v22 > 0 )
9298 { 9298 {
9299 v23 = v22; 9299 v23 = v22;
9300 do 9300 do
9301 { 9301 {
9302 if ( *pTexturea != a3a ) 9302 if ( *pTexturea != teal )
9303 *v7 = *pTexturea; 9303 *v7 = *pTexturea;
9304 ++pTexturea; 9304 ++pTexturea;
9305 ++v7; 9305 ++v7;
9306 --v23; 9306 --v23;
9307 } 9307 }
10339 } 10339 }
10340 } 10340 }
10341 } 10341 }
10342 10342
10343 10343
10344
10345 //----- (004A612A) -------------------------------------------------------- 10344 //----- (004A612A) --------------------------------------------------------
10346 void Render::_4A612A(signed int uOutX, unsigned int uOutY, Texture *pTexture, int zVal) 10345 void Render::_4A612A(signed int uOutX, unsigned int uOutY, Texture *pTexture, int zVal)
10347 { 10346 {
10348 Texture *v5; // eax@2 10347 Texture *v5; // eax@2
10349 unsigned int v6; // edx@3 10348 unsigned int v6; // edx@3