diff Render.cpp @ 1642:8971dc85b8fb

More camera unifications.
author Nomad
date Tue, 17 Sep 2013 20:15:56 +0200
parents 466c5e15f524
children dbd6f940f26c
line wrap: on
line diff
--- a/Render.cpp	Tue Sep 17 18:39:32 2013 +0200
+++ b/Render.cpp	Tue Sep 17 20:15:56 2013 +0200
@@ -546,36 +546,36 @@
             if (pGame->pIndoorCameraD3D->sRotationX)
             {
               v13 = (y - pGame->pIndoorCameraD3D->vPartyPos.y) << 16;
-              v30 = ((unsigned __int64)(v12 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16)
-                  + ((unsigned __int64)(v13 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16);
-              v37 = (unsigned __int64)(v12 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16;
-              a6a = (unsigned __int64)(v13 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16;
+              v30 = ((unsigned __int64)(v12 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16)
+                  + ((unsigned __int64)(v13 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16);
+              v37 = (unsigned __int64)(v12 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16;
+              a6a = (unsigned __int64)(v13 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16;
               v33 = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16;
-              v14 = (unsigned __int64)(v30 * (signed __int64)pODMRenderParams->camera_rotation_x_int_cosine) >> 16;
-              v15 = (unsigned __int64)(v33 * (signed __int64)pODMRenderParams->camera_rotation_x_int_sine) >> 16;
+              v14 = (unsigned __int64)(v30 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16;
+              v15 = (unsigned __int64)(v33 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16;
               v16 = v15 + v14;
               v42 = v15 + v14;
               if ( v15 + v14 >= 262144 && v16 <= pODMRenderParams->shading_dist_mist << 16 )
               {
                 v17 = a6a - v37;
                 v40 = a6a - v37;
-                v18 = ((unsigned __int64)(v33 * (signed __int64)pODMRenderParams->camera_rotation_x_int_cosine) >> 16)
-                    - ((unsigned __int64)(v30 * (signed __int64)pODMRenderParams->camera_rotation_x_int_sine) >> 16);
+                v18 = ((unsigned __int64)(v33 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16)
+                    - ((unsigned __int64)(v30 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16);
                 goto LABEL_29;
               }
             }
             else
             {
               v34 = (y - pGame->pIndoorCameraD3D->vPartyPos.y) << 16;
-              v19 = (unsigned __int64)(v12 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16;
-              v20 = (unsigned __int64)(v34 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16;
+              v19 = (unsigned __int64)(v12 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16;
+              v20 = (unsigned __int64)(v34 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16;
               v16 = v20 + v19;
               v42 = v20 + v19;
               if ( v20 + v19 >= 262144 && v16 <= pODMRenderParams->shading_dist_mist << 16 )
               {
-                v21 = (unsigned __int64)(((x - pGame->pIndoorCameraD3D->vPartyPos.x) << 16) * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16;
-                v17 = ((unsigned __int64)(v34 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16) - v21;
-                v40 = ((unsigned __int64)(v34 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16) - v21;
+                v21 = (unsigned __int64)(((x - pGame->pIndoorCameraD3D->vPartyPos.x) << 16) * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16;
+                v17 = ((unsigned __int64)(v34 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - v21;
+                v40 = ((unsigned __int64)(v34 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - v21;
                 v18 = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16;
 LABEL_29:
                 v31 = v18;
@@ -1044,23 +1044,23 @@
           if (pGame->pIndoorCameraD3D->sRotationX)
           {
             v40 = (decor->vPosition.y - pGame->pIndoorCameraD3D->vPartyPos.y) << 16;
-            v18 = ((unsigned __int64)(v17 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16)
-                + ((unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16);
+            v18 = ((unsigned __int64)(v17 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16)
+                + ((unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16);
             v42 = v18;
-            b = (unsigned __int64)(v17 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16;
-            a5 = (unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16;
+            b = (unsigned __int64)(v17 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16;
+            a5 = (unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16;
             v40 = (decor->vPosition.z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16;
-            v41 = (unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_x_int_sine) >> 16;
-            v19 = (unsigned __int64)(v18 * (signed __int64)pODMRenderParams->camera_rotation_x_int_cosine) >> 16;
-            v20 = v19 + ((unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_x_int_sine) >> 16);
-            v39 = v19 + ((unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_x_int_sine) >> 16);
+            v41 = (unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16;
+            v19 = (unsigned __int64)(v18 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16;
+            v20 = v19 + ((unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16);
+            v39 = v19 + ((unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16);
             if ( v20 >= 262144 && v20 <= pODMRenderParams->shading_dist_mist << 16 )
             {
               v21 = a5 - b;
               v41 = a5 - b;
-              a5 = (unsigned __int64)(v42 * (signed __int64)pODMRenderParams->camera_rotation_x_int_sine) >> 16;
-              b = (unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_x_int_cosine) >> 16;
-              v22 = ((unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_x_int_cosine) >> 16) - a5;
+              a5 = (unsigned __int64)(v42 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16;
+              b = (unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16;
+              v22 = ((unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) - a5;
 LABEL_30:
               v42 = v22;
               v40 = 2 * abs(v20);
@@ -1127,16 +1127,16 @@
           {
             v42 = (decor->vPosition.x - pGame->pIndoorCameraD3D->vPartyPos.x) << 16;
             v40 = (decor->vPosition.y - pGame->pIndoorCameraD3D->vPartyPos.y) << 16;
-            b = (unsigned __int64)(v17 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16;
-            a5 = (unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16;
-            v20 = b + ((unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16);
-            v39 = b + ((unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16);
+            b = (unsigned __int64)(v17 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16;
+            a5 = (unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16;
+            v20 = b + ((unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16);
+            v39 = b + ((unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16);
             if ( v20 >= 262144 && v20 <= pODMRenderParams->shading_dist_mist << 16 )
             {
-              a5 = (unsigned __int64)(v42 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16;
-              b = (unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16;
-              v21 = ((unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16) - a5;
-              v41 = ((unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16) - a5;
+              a5 = (unsigned __int64)(v42 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16;
+              b = (unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16;
+              v21 = ((unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - a5;
+              v41 = ((unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - a5;
               v22 = (decor->vPosition.z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16;
               goto LABEL_30;
             }
@@ -4916,7 +4916,7 @@
     }
 
     //if (pIndoorCamera->flags & INDOOR_CAMERA_DRAW_TERRAIN_OUTLINES || pBLVRenderParams->uFlags & INDOOR_CAMERA_DRAW_TERRAIN_OUTLINES)
-    if (pODMRenderParams->flags & ODM_RENDER_DRAW_TERRAIN_OUTLINES)
+    if (pGame->pIndoorCameraD3D->debug_flags & ODM_RENDER_DRAW_TERRAIN_OUTLINES)
       pGame->pIndoorCameraD3D->debug_outline_d3d(d3d_vertex_buffer, uNumVertices, 0x00FFFFFF, 0.0);
   }
 // 4A26BC: could not find valid save-restore pair for esi