diff Render.cpp @ 327:a7f15da53e82

Слияние
author Ritor1
date Wed, 20 Feb 2013 11:27:06 +0600
parents d720a13e2273
children 672b83584b0f
line wrap: on
line diff
--- a/Render.cpp	Wed Feb 20 11:26:54 2013 +0600
+++ b/Render.cpp	Wed Feb 20 11:27:06 2013 +0600
@@ -610,10 +610,10 @@
   array_77EC08[1999].field_58 = 23 - (-20 * pOutdoor->vSunlight.z >> 16);
   if ( array_77EC08[1999].field_58 > 20 )
     array_77EC08[1999].field_58 = 20;
-  v10 = stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi);
+  v10 = stru_5C6E00->Sin(pIndoorCamera->sRotationX);
   array_77EC08[1999].v_18.y = 0;
   array_77EC08[1999].v_18.x = v10;
-  array_77EC08[1999].v_18.z = stru_5C6E00->SinCos(pIndoorCamera->sRotationX);
+  array_77EC08[1999].v_18.z = stru_5C6E00->Cos(pIndoorCamera->sRotationX);
   array_77EC08[1999].field_24 = 2048 - (pIndoorCamera->pos.z << 16);
   a1a = (signed __int64)((double)(pIndoorCamera->pos.z * pOutdoorCamera->int_fov_rad)
                        / ((double)pOutdoorCamera->int_fov_rad + 8192.0)
@@ -627,10 +627,10 @@
   if ( !(pOutdoor->uSky_TextureID != -1 ? (int)v2 : 0) )
     return (signed __int16)v2;
   array_77EC08[1999].field_58 = 0;
-  v11 = stru_5C6E00->SinCos(pIndoorCamera->sRotationX + 16 - stru_5C6E00->uIntegerHalfPi);
+  v11 = stru_5C6E00->Sin(pIndoorCamera->sRotationX + 16);
   array_77EC08[1999].v_18.y = 0;
   array_77EC08[1999].v_18.x = -v11;
-  array_77EC08[1999].v_18.z = -stru_5C6E00->SinCos(pIndoorCamera->sRotationX + 16);
+  array_77EC08[1999].v_18.z = -stru_5C6E00->Cos(pIndoorCamera->sRotationX + 16);
   LOWORD(v2) = 224 * LOWORD(pMiscTimer->uTotalGameTimeElapsed);
   array_77EC08[1999].field_24 = 0x2000000u;
   array_77EC08[1999].sTextureDeltaU = 224 * pMiscTimer->uTotalGameTimeElapsed;
@@ -729,13 +729,6 @@
   }
   return (signed __int16)v2;
 }
-// 6BE030: using guessed type int day_attrib;
-// 6BE3C4: using guessed type char bUnderwater;
-// 80AA10: using guessed type char byte_80AA10;
-// 80AA14: using guessed type int dword_80AA14;
-// 80AA18: using guessed type int dword_80AA18;
-// 80AA1C: using guessed type int dword_80AA1C;
-// 80AA20: using guessed type int dword_80AA20;
 
 //----- (00485044) --------------------------------------------------------
 int Render::DrawSkySW(Span *a1, stru148 *a2, int a3)
@@ -1034,8 +1027,8 @@
   v105 = pIndoorCamera->sRotationY / ((signed int)stru_5C6E00->uIntegerHalfPi / 2);//2
   pDirectionIndicator1 = stru_5C6E00->uDoublePiMask & (stru_5C6E00->uIntegerDoublePi - pIndoorCamera->sRotationY);//1536
   pDirectionIndicator2 = stru_5C6E00->uDoublePiMask & (stru_5C6E00->uIntegerPi + pDirectionIndicator1);//512
-  v124 = ((pIndoorCamera->uMapGridCellX << 16) + 3 * stru_5C6E00->SinCos(stru_5C6E00->uDoublePiMask & (stru_5C6E00->uIntegerPi + pDirectionIndicator1))) >> 16;
-  v123 = ((pIndoorCamera->uMapGridCellZ << 16) + 3 * stru_5C6E00->SinCos(pDirectionIndicator2 - stru_5C6E00->uIntegerHalfPi)) >> 16;
+  v124 = ((pIndoorCamera->uMapGridCellX << 16) + 3 * stru_5C6E00->Cos(stru_5C6E00->uDoublePiMask & (stru_5C6E00->uIntegerPi + pDirectionIndicator1))) >> 16;
+  v123 = ((pIndoorCamera->uMapGridCellZ << 16) + 3 * stru_5C6E00->Sin(pDirectionIndicator2)) >> 16;
   v120 = pOutdoorCamera->outdoor_grid_band_3 + v124;//+- range X
   v119 = pOutdoorCamera->outdoor_grid_band_3 + v123;
   v2 = pOutdoorCamera->uCameraFovInDegrees + 15;
@@ -1047,10 +1040,10 @@
   v3 = (v2 << 11) / 720;
   v4 = stru_5C6E00->uDoublePiMask & (pDirectionIndicator1 - v3);
   v5 = stru_5C6E00->uDoublePiMask & (v3 + pDirectionIndicator1);
-  v106 = stru_5C6E00->SinCos(v4);
-  uEndZ = stru_5C6E00->SinCos(v4 - stru_5C6E00->uIntegerHalfPi);
-  v111 = stru_5C6E00->SinCos(v5);
-  v6 = stru_5C6E00->SinCos(v5 - stru_5C6E00->uIntegerHalfPi);
+  v106 = stru_5C6E00->Cos(v4);
+  uEndZ = stru_5C6E00->Sin(v4);
+  v111 = stru_5C6E00->Cos(v5);
+  v6 = stru_5C6E00->Sin(v5);
   v7 = v4 & stru_5C6E00->uPiMask;
 
   if ( (v4 & stru_5C6E00->uPiMask) >= stru_5C6E00->uIntegerHalfPi )
@@ -3042,7 +3035,7 @@
             billboard.pPalette = pPaletteManager->field_261600[*((short *)v1 - 7)];
           if ( !(billboard.uFlags & 0x40) && billboard.uFlags & 0x80 )
           {
-            v12 = stru_5C6E00->SinCos(i * 5 + GetTickCount());
+            v12 = stru_5C6E00->Cos(i * 5 + GetTickCount());
             v15 = abs(v12);
             v18 = (unsigned __int64)(15i64 * v15) >> 16;
             billboard.pPalette2 = PaletteManager::Get_Dark_or_Red_LUT(*((short *)v1 - 7), 15 - v18, 1);
@@ -4437,7 +4430,7 @@
     {
       if ( !v54 || byte_4D864C && pGame->uFlags & 2 )
       {
-        ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP));//   
+        ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP));
         ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_CW));
         if (bUsingSpecular)
         {
@@ -4479,6 +4472,18 @@
           }
           while ( !v18 );
         }
+
+        if (a4->uAttributes & FACE_OUTLINED)
+        {
+          int color;
+          if (GetTickCount() % 300 >= 150)
+            color = 0xFFFF2020;
+          else color = 0xFF901010;
+
+          for (uint i = 0; i < uNumVertices; ++i)
+            d3d_vertex_buffer[i].diffuse = color;
+        }
+
         pRenderD3D->pDevice->SetTexture(0, pTexture);
         pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN,
                                            D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1,
@@ -8171,10 +8176,10 @@
       v15 = v14;
       v16 = (double)(v9 - 12) - v12;
       v17 = (double)(v10 - 25) - v14;
-      v18 = stru_5C6E00->SinCos(angle);
-      v19 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
-      v20 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
-      v21 = stru_5C6E00->SinCos(angle);
+      v18 = stru_5C6E00->Cos(angle);
+      v19 = stru_5C6E00->Sin(angle);
+      v20 = stru_5C6E00->Sin(angle);
+      v21 = stru_5C6E00->Cos(angle);
       pBillboardRenderListD3D[v8].pQuards[0].pos.x = (((double)(unsigned __int16)v18 * 0.000015259022
                                                        + (double)(v18 >> 16))
                                                        * v16
@@ -8196,10 +8201,10 @@
       pBillboardRenderListD3D[v8].pQuards[0].texcoord.y = 0.0;
       v31 = (double)(a2->uScreenSpaceX + 12) - v13;
       v32 = (double)a2->uScreenSpaceY - v15;
-      v25 = stru_5C6E00->SinCos(angle);
-      v26 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
-      v27 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
-      v28 = stru_5C6E00->SinCos(angle);
+      v25 = stru_5C6E00->Cos(angle);
+      v26 = stru_5C6E00->Sin(angle);
+      v27 = stru_5C6E00->Sin(angle);
+      v28 = stru_5C6E00->Cos(angle);
       pBillboardRenderListD3D[v8].pQuards[1].pos.x = (((double)(unsigned __int16)v25 * 0.000015259022
                                                        + (double)(v25 >> 16))
                                                        * v23
@@ -8222,10 +8227,10 @@
       pBillboardRenderListD3D[v8].pQuards[1].texcoord.y = 1.0;
       v23 = (double)(a2->uScreenSpaceX - 12) - v13;
       v24 = (double)a2->uScreenSpaceY - v15;
-      v33 = stru_5C6E00->SinCos(angle);
-      v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
-      v35 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
-      v36 = stru_5C6E00->SinCos(angle);
+      v33 = stru_5C6E00->Cos(angle);
+      v34 = stru_5C6E00->Sin(angle);
+      v35 = stru_5C6E00->Sin(angle);
+      v36 = stru_5C6E00->Cos(angle);
       pBillboardRenderListD3D[v8].pQuards[2].pos.x = (((double)(unsigned __int16)v33 * 0.000015259022
                                                         + (double)(v33 >> 16))
                                                         * v31
@@ -8248,10 +8253,10 @@
       pBillboardRenderListD3D[v8].pQuards[2].texcoord.y = 1.0;
       v39 = (double)(a2->uScreenSpaceX + 12) - v13;
       v40 = (double)(a2->uScreenSpaceY - 25) - v15;
-      v41 = stru_5C6E00->SinCos(angle);
-      v42 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
-      v43 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
-      v44 = stru_5C6E00->SinCos(angle);
+      v41 = stru_5C6E00->Cos(angle);
+      v42 = stru_5C6E00->Sin(angle);
+      v43 = stru_5C6E00->Sin(angle);
+      v44 = stru_5C6E00->Cos(angle);
       pBillboardRenderListD3D[v8].pQuards[3].pos.x = (((double)(unsigned __int16)v41 * 0.000015259022
                                                         + (double)(v41 >> 16))
                                                         * v39
@@ -8345,11 +8350,11 @@
     v15 = v14;
     v16 = (double)(v9 - 12) - v12;
     v17 = (double)(v10 - 25) - v14;
-    v18 = stru_5C6E00->SinCos(angle);
+    v18 = stru_5C6E00->Cos(angle);
     v19 = angle - stru_5C6E00->uIntegerHalfPi;
-    v20 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
-    v21 = stru_5C6E00->SinCos(v19);
-    v22 = stru_5C6E00->SinCos(angle);
+    v20 = stru_5C6E00->Sin(angle);
+    v21 = stru_5C6E00->Sin(angle);
+    v22 = stru_5C6E00->Cos(angle);
     pBillboardRenderListD3D[v8].pQuards[0].pos.x = (((double)(unsigned __int16)v18 * 0.000015259022
                                                     + (double)(v18 >> 16))
                                                     * v16
@@ -8373,10 +8378,10 @@
     pBillboardRenderListD3D[v8].pQuards[0].texcoord.y = 0.0;
     v26 = (double)(a2->uScreenSpaceX - 12) - v13;
     v27 = (double)a2->uScreenSpaceY - v15;
-    v28 = stru_5C6E00->SinCos(angle);
-    v29 = stru_5C6E00->SinCos(v19);
-    v30 = stru_5C6E00->SinCos(v19);
-    v31 = stru_5C6E00->SinCos(angle);
+    v28 = stru_5C6E00->Cos(angle);
+    v29 = stru_5C6E00->Sin(v19 + stru_5C6E00->uIntegerHalfPi);
+    v30 = stru_5C6E00->Sin(v19 + stru_5C6E00->uIntegerHalfPi);
+    v31 = stru_5C6E00->Cos(angle);
     pBillboardRenderListD3D[v8].pQuards[1].pos.x = (((double)(unsigned __int16)v28 * 0.000015259022
                                                      + (double)(v28 >> 16))
                                                      * v26
@@ -8398,10 +8403,10 @@
     pBillboardRenderListD3D[v8].pQuards[1].texcoord.y = 1.0;
     v33 = (double)(a2->uScreenSpaceX + 12) - v13;
     v34 = (double)a2->uScreenSpaceY - v15;
-    v35 = stru_5C6E00->SinCos(angle);
-    v36 = stru_5C6E00->SinCos(v19);
-    v37 = stru_5C6E00->SinCos(v19);
-    v38 = stru_5C6E00->SinCos(angle);
+    v35 = stru_5C6E00->Cos(angle);
+    v36 = stru_5C6E00->Sin(v19 + stru_5C6E00->uIntegerHalfPi);
+    v37 = stru_5C6E00->Sin(v19 + stru_5C6E00->uIntegerHalfPi);
+    v38 = stru_5C6E00->Cos(angle);
     pBillboardRenderListD3D[v8].pQuards[2].pos.x = (((double)(unsigned __int16)v35 * 0.000015259022
                                                      + (double)(v35 >> 16))
                                                      * v33
@@ -8423,10 +8428,10 @@
     pBillboardRenderListD3D[v8].pQuards[2].texcoord.y = 1.0;
     v40 = (double)(a2->uScreenSpaceX + 12) - v13;
     v41 = (double)(a2->uScreenSpaceY - 25) - v15;
-    v42 = stru_5C6E00->SinCos(angle);
-    v43 = stru_5C6E00->SinCos(v19);
-    v44 = stru_5C6E00->SinCos(v19);
-    v45 = stru_5C6E00->SinCos(angle);
+    v42 = stru_5C6E00->Cos(angle);
+    v43 = stru_5C6E00->Sin(v19 + stru_5C6E00->uIntegerHalfPi);
+    v44 = stru_5C6E00->Sin(v19 + stru_5C6E00->uIntegerHalfPi);
+    v45 = stru_5C6E00->Cos(angle);
     pBillboardRenderListD3D[v8].pQuards[3].pos.x = (((double)(unsigned __int16)v42 * 0.000015259022
                                                      + (double)(v42 >> 16))
                                                      * v40