Mercurial > mm7
annotate OutdoorCamera.cpp @ 1616:de6e646822a6
mul <> sub0 difference
author | zipi |
---|---|
date | Sat, 14 Sep 2013 22:43:45 +0100 |
parents | 75fafd8ced59 |
children |
rev | line source |
---|---|
1295 | 1 #include "OutdoorCamera.h" |
2 #include "IndoorCamera.h" | |
3 #include "Outdoor_stuff.h" | |
4 #include "Game.h" | |
5 #include "LightmapBuilder.h" | |
6 #include "Viewport.h" | |
7 #include "Math.h" | |
8 #include "mm7_data.h" | |
9 | |
10 //----- (00481E55) -------------------------------------------------------- | |
11 void OutdoorCamera::Project(unsigned int uNumVertices) | |
12 { | |
13 double v1; // st7@2 | |
14 double v2; // st6@2 | |
15 double v3; // st5@2 | |
16 int v4; // eax@2 | |
17 unsigned int v5; // edx@2 | |
18 double v6; // st4@3 | |
19 double v7; // st3@3 | |
20 | |
21 if ( (signed int)uNumVertices > 0 ) | |
22 { | |
23 v1 = (double)pOutdoorCamera->int_fov_rad; | |
24 v2 = (double)pViewport->uScreenCenterX; | |
25 v3 = (double)pViewport->uScreenCenterY; | |
26 v4 = 0; | |
27 v5 = uNumVertices; | |
28 do | |
29 { | |
30 v6 = v1 * array_507D30[v4]._rhw; | |
31 v7 = v6 * array_507D30[v4].vWorldViewPosition.y; | |
32 memcpy(&array_50AC10[v4], &array_507D30[v4], sizeof(array_50AC10[v4])); | |
33 array_50AC10[v4].vWorldViewProjX = v2 - v7; | |
34 array_50AC10[v4].vWorldViewProjY = v3 - v6 * array_507D30[v4].vWorldViewPosition.z; | |
35 ++v4; | |
36 --v5; | |
37 } | |
38 while ( v5 ); | |
39 } | |
40 } | |
41 //----- (00485F64) -------------------------------------------------------- | |
42 void OutdoorCamera::_485F64() | |
43 { | |
44 int v1; // eax@1 | |
45 int v2; // eax@2 | |
46 signed __int64 v3; // qtt@4 | |
47 int v4; // eax@4 | |
48 | |
49 this->uCameraFovInDegrees = 75; | |
50 v1 = stru_5C6E00->uPiMask & 0xD5; | |
51 if ( v1 >= (signed int)stru_5C6E00->uIntegerHalfPi ) | |
52 v2 = -stru_5C6E00->pTanTable[stru_5C6E00->uIntegerPi - v1]; | |
53 else | |
54 v2 = stru_5C6E00->pTanTable[v1]; | |
55 LODWORD(v3) = (viewparams->uSomeZ - viewparams->uSomeX) << 31; | |
56 HIDWORD(v3) = (viewparams->uSomeZ - viewparams->uSomeX) << 15 >> 16; | |
57 v4 = (signed int)(v3 / v2) >> 16; | |
58 this->int_fov_rad = v4; | |
59 this->field_4C = 360000; | |
60 this->int_fov_rad_inv = 65536 / v4; | |
61 this->field_50 = 115; | |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1295
diff
changeset
|
62 //sr_6BE060[1] = 1; |
1295 | 63 RotationToInts(); |
64 } | |
65 | |
66 //----- (0048600E) -------------------------------------------------------- | |
67 void OutdoorCamera::RotationToInts() | |
68 { | |
69 camera_rotation_y_int_sine = stru_5C6E00->Sin(pIndoorCamera->sRotationY); | |
70 camera_rotation_y_int_cosine = stru_5C6E00->Cos(pIndoorCamera->sRotationY); | |
71 camera_rotation_x_int_sine = stru_5C6E00->Sin(pIndoorCamera->sRotationX); | |
72 camera_rotation_x_int_cosine = stru_5C6E00->Cos(pIndoorCamera->sRotationX); | |
73 } |