comparison _deleted.cpp @ 1638:ccde94f02b75

class IndoorCamera split into BLVRenderParams and ODMRenderParams
author Nomad
date Tue, 17 Sep 2013 15:40:09 +0200
parents 2c71fa8913d2
children 8971dc85b8fb
comparison
equal deleted inserted replaced
1637:2c71fa8913d2 1638:ccde94f02b75
12985 } 12985 }
12986 return result; 12986 return result;
12987 } 12987 }
12988 12988
12989 12989
12990 /*
12991 // 143 12990 // 143
12992 #pragma pack(push, 1) 12991 #pragma pack(push, 1)
12993 struct Span 12992 struct Span
12994 { 12993 {
12995 Span *pNext; 12994 Span *pNext;
13047 #pragma pack(pop) 13046 #pragma pack(pop)
13048 extern Edge defaultEdge; // weak 13047 extern Edge defaultEdge; // weak
13049 13048
13050 extern Edge stru_80C9A4; 13049 extern Edge stru_80C9A4;
13051 extern Edge stru_80C9D8; 13050 extern Edge stru_80C9D8;
13052 */ 13051
13052
13053
13054 #define INDOOR_CAMERA_DRAW_SW_OUTLINES 1
13055 #define INDOOR_CAMERA_DRAW_D3D_OUTLINES 2
13056 #define INDOOR_CAMERA_DRAW_TERRAIN_OUTLINES 4
13057 // 157
13058 #pragma pack(push, 1)
13059 struct IndoorCamera
13060 {
13061 //----- (0042391F) --------------------------------------------------------
13062 IndoorCamera()
13063 {
13064 sRotationX = 0;
13065 sRotationY = 0;
13066 fov_rad = 2000.0f;
13067 fov_rad_inv = 32.768002f;
13068
13069 flags = 0;
13070 }
13071 void Initialize(int degFov, unsigned int uViewportWidth, unsigned int uViewportHeight);
13072 void Initialize2();
13073 float ViewTransform_ODM(struct RenderVertexSoft *a1);
13074
13075
13076 Vec3_int_ pos;
13077 unsigned int uMapGridCellX;
13078 unsigned int uMapGridCellZ;
13079 int sRotationX;
13080 int sRotationY;
13081 float fov_rad;
13082 float fov_rad_inv;
13083 int field_24;
13084 int field_28;
13085 float fRotationYSine;
13086 float fRotationYCosine;
13087 float fRotationXSine;
13088 float fRotationXCosine;
13089 int _int_sine;
13090 int _int_cosine;
13091 int _int_sine_2;
13092 int _int_cosine_2;
13093 int flags; // & INDOOR_CAMERA_DRAW_D3D_OUTLINES: render terrain outlines in d3d
13094 };
13095 #pragma pack(pop)
13096
13097
13098
13099 extern IndoorCamera *pIndoorCamera; // idb
13100
13101
13102 IndoorCamera *pIndoorCamera; // idb
13103
13104
13105
13106
13107
13108 //----- (00481CCE) --------------------------------------------------------
13109 float IndoorCamera::ViewTransform_ODM(RenderVertexSoft *a1)
13110 {
13111 float result; // eax@1
13112 double vCamToVertexZ; // st7@1
13113 double v3; // st6@1
13114 double v4; // st5@1
13115 double v5; // st4@1
13116 float v6; // ST04_4@3
13117 float v7; // [sp+0h] [bp-14h]@1
13118 float v8; // [sp+8h] [bp-Ch]@1
13119 float vCamToVertexX; // [sp+Ch] [bp-8h]@1
13120 float vCamToVertexY; // [sp+10h] [bp-4h]@1
13121
13122 v8 = fRotationXCosine;
13123 result = fRotationXSine;
13124 v7 = fRotationXSine;
13125 vCamToVertexX = a1->vWorldPosition.x - (double)pos.x;
13126 vCamToVertexY = a1->vWorldPosition.y - (double)pos.y;
13127 vCamToVertexZ = a1->vWorldPosition.z - (double)pos.z;
13128 v3 = fRotationYCosine;
13129 v4 = fRotationYSine;
13130 v5 = vCamToVertexY * fRotationYSine + fRotationYCosine * vCamToVertexX;
13131 if ( sRotationX )
13132 {
13133 v6 = vCamToVertexY * fRotationYSine + fRotationYCosine * vCamToVertexX;
13134 a1->vWorldViewPosition.x = v5 * fRotationXCosine + fRotationXSine * vCamToVertexZ;
13135 a1->vWorldViewPosition.y = v3 * vCamToVertexY - v4 * vCamToVertexX;
13136 a1->vWorldViewPosition.z = v8 * vCamToVertexZ - v6 * v7;
13137 }
13138 else
13139 {
13140 a1->vWorldViewPosition.x = vCamToVertexY * fRotationYSine + fRotationYCosine * vCamToVertexX;
13141 a1->vWorldViewPosition.y = v3 * vCamToVertexY - v4 * vCamToVertexX;
13142 a1->vWorldViewPosition.z = vCamToVertexZ;
13143 }
13144 return result;
13145 }
13146
13147
13148
13149 //----- (0042394D) --------------------------------------------------------
13150 void IndoorCamera::Initialize(int degFov, unsigned int uViewportWidth, unsigned int uViewportHeight)
13151 {
13152 IndoorCamera *v4; // esi@1
13153 double v5; // st7@1
13154
13155 v4 = this;
13156 v5 = (double)(signed int)(signed __int64)((double)(signed int)uViewportWidth
13157 * 0.5
13158 / tan((double)(degFov >> 1) * 0.01745329)
13159 + 0.5);
13160 v4->fov_rad = v5;
13161 v4->fov_rad_inv = 65536.0 / v5;
13162 }
13163
13164 //----- (004239A7) --------------------------------------------------------
13165 void IndoorCamera::Initialize2()
13166 {
13167 //IndoorCamera *v1; // esi@1
13168 double v2; // st7@4
13169 //double v3; // st7@6
13170 //int v4; // eax@6
13171 //int v5; // eax@6
13172 //int v6; // ST04_4@6
13173 //int v7; // eax@6
13174 //int v8; // ST04_4@6
13175
13176 //v1 = this;
13177 fRotationYSine = sin((3.141592653589793 + 3.141592653589793) * (double)sRotationY * 0.00048828125);
13178 fRotationYCosine = cos((3.141592653589793 + 3.141592653589793) * (double)sRotationY * 0.00048828125);
13179 if ( byte_4D864C && pGame->uFlags & 0x80 || uCurrentlyLoadedLevelType == LEVEL_Indoor)
13180 {
13181 fRotationXSine = sin((3.141592653589793 + 3.141592653589793) * (double)-sRotationX * 0.00048828125);
13182 v2 = (3.141592653589793 + 3.141592653589793) * (double)-sRotationX;
13183 }
13184 else
13185 {
13186 fRotationXSine = sin((3.141592653589793 + 3.141592653589793) * (double)sRotationX * 0.00048828125);
13187 v2 = (3.141592653589793 + 3.141592653589793) * (double)sRotationX;
13188 }
13189 //v3 = cos(v2 * 0.00048828125);
13190 //v4 = sRotationY;
13191 fRotationXCosine = cos(v2 * 0.00048828125);
13192 //v5 = stru_5C6E00->SinCos(sRotationY - stru_5C6E00->uIntegerHalfPi);
13193 //v6 = sRotationY;
13194 _int_sine = stru_5C6E00->Sin(sRotationY);
13195 _int_cosine = stru_5C6E00->Cos(sRotationY);
13196 //v7 = stru_5C6E00->SinCos(sRotationX - stru_5C6E00->uIntegerHalfPi);
13197 //v8 = sRotationX;
13198 _int_sine_2 = stru_5C6E00->Sin(sRotationX);
13199 _int_cosine_2 = stru_5C6E00->Cos(sRotationX);
13200 }
13201 // 4D864C: using guessed type char byte_4D864C;
13053 13202
13054 13203
13055 13204
13056 13205
13057 13206