annotate Viewport.cpp @ 693:e0a1fccc89b1

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