annotate Viewport.cpp @ 692:066e2b29b30f

viewport.cpp added
author Gloval
date Sat, 16 Mar 2013 21:57:32 +0400
parents
children e0a1fccc89b1
rev   line source
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
1 #include "Viewport.h"
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
2
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
3 #include "Party.h"
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
4 #include "VectorTypes.h"
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
5 #include "Indoor.h"
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
6 #include "Render.h"
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
7 #include "mm7_data.h"
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
8
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
9
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
10 //----- (004C0262) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
11 void Viewport::SetScreen( signed int sTL_X, signed int sTL_Y, signed int sBR_X, signed int sBR_Y )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
12 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
13 unsigned int tl_x; // edx@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
14 unsigned int br_x; // esi@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
15 unsigned int tl_y; // edi@3
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
16 unsigned int br_y; // eax@3
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
17 int v10; // eax@7
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
18
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
19 tl_x = sTL_X;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
20 br_x = sBR_X;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
21 if ( sTL_X > sBR_X )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
22 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
23 br_x = sBR_X ^ sTL_X ^ sBR_X; // swap x's
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
24 tl_x = br_x ^ sBR_X ^ sTL_X;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
25 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
26 tl_y = sTL_Y;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
27 br_y = sBR_Y;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
28 if ( (signed int)sTL_Y > (signed int)sBR_Y )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
29 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
30 br_y = sBR_Y ^ sTL_Y ^ sBR_Y; // swap y's
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
31 tl_y = br_y ^ sBR_Y ^ sTL_Y;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
32 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
33 this->uScreen_TL_X = tl_x;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
34 this->uScreen_TL_Y = tl_y;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
35 this->uScreen_BR_X = br_x;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
36 this->uScreen_BR_Y = br_y;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
37 this->uScreenWidth = br_x - tl_x + 1;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
38 this->uScreenCenterX = (signed int)(br_x + tl_x) >> 1;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
39 if ( pRenderer->pRenderD3D == 0 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
40 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
41 this->uScreenHeight = br_y - tl_y + 1;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
42 this->uScreenCenterY = this->uScreen_BR_Y - ((unsigned __int64)(this->field_30 * (signed __int64)(br_y - tl_y + 1)) >> 16);
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
43 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
44 else
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
45 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
46 this->uScreenHeight = br_y - tl_y + 1;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
47 this->uScreenCenterY = (signed int)(br_y + tl_y) >> 1;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
48 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
49 SetViewport(this->uScreen_TL_X, this->uScreen_TL_Y, this->uScreen_BR_X, this->uScreen_BR_Y);
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
50 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
51
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
52 //----- (004C02F8) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
53 void Viewport::_4C02F8(int a2)
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
54 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
55 this->field_30 = a2;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
56 SetScreen(this->uScreen_TL_X, this->uScreen_TL_Y, this->uScreen_BR_X, this->uScreen_BR_Y);
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
57 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
58
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
59 //----- (004C0312) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
60 void Viewport::SetViewport( signed int uX, signed int uY, signed int uZ, signed int uW )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
61 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
62 unsigned int x; // ebx@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
63 unsigned int y; // edi@3
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
64 unsigned int z; // edx@5
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
65 unsigned int w; // eax@7
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
66
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
67 x = uX;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
68 if ( uX < this->uScreen_TL_X )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
69 x = this->uScreen_TL_X;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
70 y = uY;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
71 if ( uY < this->uScreen_TL_Y )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
72 y = this->uScreen_TL_Y;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
73 z = uZ;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
74 if ( uZ > this->uScreen_BR_X )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
75 z = this->uScreen_BR_X;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
76 w = uW;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
77 if ( uW > this->uScreen_BR_Y )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
78 w = this->uScreen_BR_Y;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
79 this->uViewportY = y;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
80 this->uViewportX = x;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
81 this->uViewportZ = z;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
82 this->uViewportW = w;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
83 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
84
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
85 //----- (00443219) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
86 void ViewingParams::_443219()
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
87 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
88 this->sPartyPosZ += 512;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
89 _4432E7();
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
90 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
91
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
92 //----- (00443225) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
93 void ViewingParams::_443225()
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
94 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
95 this->sPartyPosX -= 512;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
96 _4432E7();
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
97 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
98
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
99 //----- (00443231) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
100 void ViewingParams::_443231()
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
101 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
102 this->sPartyPosZ -= 512;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
103 _4432E7();
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
104 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
105
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
106 //----- (0044323D) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
107 void ViewingParams::_44323D()
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
108 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
109 this->sPartyPosX += 512;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
110 _4432E7();
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
111 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
112
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
113 //----- (00443249) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
114 void ViewingParams::_443249()
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
115 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
116 int v1; // edx@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
117
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
118 v1 = (unsigned __int64)((signed __int64)this->field_2C << 15) >> 16;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
119 this->field_2C = v1;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
120 if ( v1 < 384 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
121 this->field_2C = 384;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
122 this->sPartyPosX = pParty->vPosition.x;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
123 this->sPartyPosZ = pParty->vPosition.y;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
124 _4432E7();
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
125 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
126
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
127 //----- (00443291) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
128 void ViewingParams::_443291()
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
129 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
130 int v1; // edx@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
131 int v2; // eax@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
132
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
133 v1 = 2 * this->field_2C;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
134 v2 = 1536;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
135 this->field_2C = v1;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
136 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
137 v2 = 3072;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
138 if ( v1 > v2 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
139 this->field_2C = v2;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
140 this->sPartyPosX = pParty->vPosition.x;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
141 this->sPartyPosZ = pParty->vPosition.y;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
142 _4432E7();
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
143 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
144
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
145 //----- (004432E7) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
146 void ViewingParams::_4432E7()
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
147 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
148 ViewingParams *v1; // esi@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
149 int v2; // ebx@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
150 signed int v3; // edx@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
151 int v4; // ecx@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
152 int v5; // edi@3
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
153 int v6; // eax@3
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
154 int v7; // eax@5
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
155 int result; // eax@7
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
156
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
157 v1 = this;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
158 v2 = this->field_3A;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
159 v3 = 88 >> this->field_2C / 384;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
160 v4 = (44 - v3) << 9;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
161 if ( v1->sPartyPosZ > v2 + v4 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
162 v1->sPartyPosZ = v2 + v4;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
163
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
164 v5 = v1->field_38;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
165 v6 = (v3 - 44) << 9;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
166 if ( v1->sPartyPosX < v5 + v6 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
167 v1->sPartyPosX = v5 + v6;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
168
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
169 v7 = v2 + v6;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
170 if ( v1->sPartyPosZ < v7 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
171 v1->sPartyPosZ = v7;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
172
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
173 result = v5 + v4;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
174 if ( v1->sPartyPosX > v5 + v4 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
175 v1->sPartyPosX = result;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
176 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
177
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
178 //----- (00443343) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
179 void ViewingParams::InitGrayPalette()
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
180 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
181 for (unsigned short i=0; i<256; ++i)
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
182 pPalette[i]=GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(i, i, i);
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
183 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
184
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
185 //----- (00443365) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
186 void ViewingParams::_443365()
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
187 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
188 ViewingParams *v1; // esi@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
189 __int16 *v2; // edi@3
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
190 Vec3_short_ *v3; // eax@4
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
191 unsigned int v4; // edx@4
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
192 signed int v5; // eax@8
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
193 Vec3_short_ *v6; // eax@12
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
194 signed int v7; // edi@12
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
195 signed int v8; // eax@16
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
196 char v9; // zf@20
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
197 int result; // eax@21
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
198 unsigned int v11; // [sp+4h] [bp-1Ch]@3
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
199 unsigned int *v12; // [sp+8h] [bp-18h]@3
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
200 unsigned int v13; // [sp+Ch] [bp-14h]@8
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
201 unsigned int v14; // [sp+10h] [bp-10h]@2
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
202 unsigned int v15; // [sp+14h] [bp-Ch]@2
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
203 unsigned int v16; // [sp+18h] [bp-8h]@2
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
204 unsigned int v17; // [sp+1Ch] [bp-4h]@2
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
205
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
206 v1 = this;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
207 InitGrayPalette();
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
208 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
209 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
210 v16 = 0x40000000u;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
211 v14 = 0x40000000u;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
212 v17 = 0xC0000000u;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
213 v15 = 0xC0000000u;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
214 if ( (signed int)pIndoor->pMapOutlines->uNumOutlines > 0 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
215 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
216 v2 = (__int16 *)(pIndoor->pMapOutlines->pOutlines);
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
217 v11 = pIndoor->pMapOutlines->uNumOutlines;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
218 v12 = (uint *)pIndoor->pMapOutlines->pOutlines;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
219 do
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
220 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
221 v3 = &pIndoor->pVertices[*v2];
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
222 v4 = v3->x;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
223 if ( (signed int)v4 < (signed int)v16 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
224 v16 = v3->x;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
225 if ( (signed int)v4 > (signed int)v17 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
226 v17 = v3->x;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
227 v5 = v3->y;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
228 v13 = v5;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
229 if ( v5 < (signed int)v14 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
230 v14 = v4;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
231 if ( v5 > (signed int)v15 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
232 v15 = v4;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
233 v6 = &pIndoor->pVertices[v2[1]];
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
234 v7 = v6->x;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
235 if ( v7 < (signed int)v16 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
236 v16 = v4;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
237 if ( v7 > (signed int)v17 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
238 v17 = v4;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
239 v8 = v6->y;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
240 if ( v8 < (signed int)v14 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
241 v14 = v13;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
242 if ( v8 > (signed int)v15 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
243 v15 = v13;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
244 v2 = (__int16 *)(v12 + 3);
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
245 v9 = v11-- == 1;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
246 v12 += 3;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
247 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
248 while ( !v9 );
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
249 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
250 v1->uMinimapZoom = 1024;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
251 v1->field_38 = (signed int)(v16 + v17) / 2;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
252 v1->field_28 = 10;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
253 result = (signed int)(v14 + v15) / 2;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
254 v1->field_3A = result;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
255 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
256 else
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
257 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
258 v1->field_38 = 0;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
259 v1->field_3A = 0;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
260 v1->uMinimapZoom = dword_576E2C;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
261 v1->field_28 = dword_576E28;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
262 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
263 v1->field_2C = 384;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
264 }