annotate Viewport.cpp @ 1093:c59ac5ea63f5

* stru154::GetFacePlane mistake fixed * messing with memory leaks
author zipi
date Sun, 26 May 2013 13:59:49 +0100
parents 05c62d166182
children b89a20cd8a54
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"
1051
05c62d166182 004C1D2B cleaned
Nomad
parents: 1027
diff changeset
7 #include "Math.h"
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
8 #include "mm7_data.h"
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
9
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
10
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
11 //----- (004C0262) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
12 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
13 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
14 unsigned int tl_x; // edx@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
15 unsigned int br_x; // esi@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
16 unsigned int tl_y; // edi@3
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
17 unsigned int br_y; // eax@3
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 {
1027
Nomad
parents: 949
diff changeset
23 __debugbreak(); // check this code
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
24 br_x = sBR_X ^ sTL_X ^ sBR_X; // swap x's
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
25 tl_x = br_x ^ sBR_X ^ sTL_X;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
26 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
27 tl_y = sTL_Y;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
28 br_y = sBR_Y;
711
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
29 if ( sTL_Y > sBR_Y )
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
30 {
1027
Nomad
parents: 949
diff changeset
31 __debugbreak(); // check this code
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
32 br_y = sBR_Y ^ sTL_Y ^ sBR_Y; // swap y's
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
33 tl_y = br_y ^ sBR_Y ^ sTL_Y;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
34 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
35 this->uScreen_TL_X = tl_x;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
36 this->uScreen_TL_Y = tl_y;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
37 this->uScreen_BR_X = br_x;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
38 this->uScreen_BR_Y = br_y;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
39 this->uScreenWidth = br_x - tl_x + 1;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
40 this->uScreenHeight = br_y - tl_y + 1;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
41 this->uScreenCenterX = (signed int)(br_x + tl_x) /2;
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
42 if ( pRenderer->pRenderD3D == 0 )
871
710cf848ad24 Particle engine made working.
Nomad
parents: 762
diff changeset
43 this->uScreenCenterY = this->uScreen_BR_Y - fixpoint_sub0(field_30, uScreenHeight);
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
44 else
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
45 this->uScreenCenterY = uScreenHeight/2;
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
46 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
47 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
48
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
49 //----- (004C02F8) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
50 void Viewport::_4C02F8(int a2)
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
51 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
52 this->field_30 = a2;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
53 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
54 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
55
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
56 //----- (004C0312) --------------------------------------------------------
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
57 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
58 {
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
59 signed int tl_x; // ebx@1
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
60 signed int tl_y; // edi@3
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
61 signed int br_x; // edx@5
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
62 signed int br_y; // eax@7
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
63
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
64 tl_x = sTL_X;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
65 if ( sTL_X < this->uScreen_TL_X )
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
66 tl_x = this->uScreen_TL_X;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
67 tl_y = sTL_Y;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
68 if ( sTL_Y < this->uScreen_TL_Y )
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
69 tl_y = this->uScreen_TL_Y;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
70 br_x = sBR_X;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
71 if ( sBR_X > this->uScreen_BR_X )
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
72 br_x = this->uScreen_BR_X;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
73 br_y = sBR_Y;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
74 if ( sBR_Y > this->uScreen_BR_Y )
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
75 br_y = this->uScreen_BR_Y;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
76 this->uViewportTL_Y = tl_y;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
77 this->uViewportTL_X = tl_x;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
78 this->uViewportBR_X = br_x;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
79 this->uViewportBR_Y = br_y;
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
80 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
81
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
82 //----- (00443219) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
83 void ViewingParams::_443219()
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
84 {
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
85 this->sViewCenterY += 512;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
86 AdjustPosition();
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
87 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
88
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
89 //----- (00443225) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
90 void ViewingParams::_443225()
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
91 {
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
92 this->sViewCenterX -= 512;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
93 AdjustPosition();
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
94 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
95
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
96 //----- (00443231) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
97 void ViewingParams::_443231()
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
98 {
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
99 this->sViewCenterY -= 512;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
100 AdjustPosition();
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
101 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
102
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
103 //----- (0044323D) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
104 void ViewingParams::_44323D()
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
105 {
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
106 this->sViewCenterX += 512;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
107 AdjustPosition();
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
108 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
109
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
110 //----- (00443249) --------------------------------------------------------
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
111 void ViewingParams::CenterOnParty()
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
112 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
113 int v1; // edx@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
114
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
115 v1 = (unsigned __int64)((signed __int64)this->field_2C << 15) >> 16;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
116 this->field_2C = v1;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
117 if ( v1 < 384 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
118 this->field_2C = 384;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
119 this->sViewCenterX = pParty->vPosition.x;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
120 this->sViewCenterY = pParty->vPosition.y;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
121 AdjustPosition();
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
122 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
123
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
124 //----- (00443291) --------------------------------------------------------
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
125 void ViewingParams::CenterOnParty2()
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
126 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
127 int v1; // edx@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
128 int v2; // eax@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
129
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
130 v1 = 2 * this->field_2C;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
131 v2 = 1536;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
132 this->field_2C = v1;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
133 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
134 v2 = 3072;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
135 if ( v1 > v2 )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
136 this->field_2C = v2;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
137 this->sViewCenterX = pParty->vPosition.x;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
138 this->sViewCenterY = pParty->vPosition.y;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
139 AdjustPosition();
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
140 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
141
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
142 //----- (004432E7) --------------------------------------------------------
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
143 void ViewingParams::AdjustPosition()
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
144 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
145 ViewingParams *v1; // esi@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
146 int v2; // ebx@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
147 signed int v3; // edx@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
148 int v4; // ecx@1
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
149 int v5; // edi@3
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
150 int v6; // eax@3
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
151 int v7; // eax@5
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
152
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
153
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
154 v1 = this;
711
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
155 v2 = this->indoor_center_y;
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
156 v3 = 88 >> this->field_2C / 384;
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
157 v4 = (44 - v3) << 9;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
158 if ( v1->sViewCenterY > v2 + v4 )
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
159 v1->sViewCenterY = v2 + v4;
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
160
711
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
161 v5 = v1->indoor_center_x;
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
162 v6 = (v3 - 44) << 9;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
163 if ( v1->sViewCenterX < v5 + v6 )
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
164 v1->sViewCenterX = v5 + v6;
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
165
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
166 v7 = v2 + v6;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
167 if ( v1->sViewCenterY < v7 )
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
168 v1->sViewCenterY = v7;
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
169
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
170 if ( v1->sViewCenterX > v5 + v4 )
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
171 v1->sViewCenterX = v5 + v4;
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
172 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
173
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
174 //----- (00443343) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
175 void ViewingParams::InitGrayPalette()
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
176 {
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
177 for (unsigned short i=0; i<256; ++i)
949
Nomad
parents: 871
diff changeset
178 pPalette[i]=TargetColor(i, i, i);
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
179 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
180
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
181 //----- (00443365) --------------------------------------------------------
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
182 void ViewingParams::_443365()
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
183 {
711
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
184
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
185 Vec3_short_ *v3; // eax@4
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
186 Vec3_short_ *v6; // eax@12
711
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
187 int minimum_y; // [sp+10h] [bp-10h]@2
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
188 int maximum_y; // [sp+14h] [bp-Ch]@2
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
189 int minimum_x; // [sp+18h] [bp-8h]@2
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
190 int maximum_x; // [sp+1Ch] [bp-4h]@2
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
191
711
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
192
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
193 InitGrayPalette();
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
194 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
195 {
711
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
196 minimum_x = 0x40000000;
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
197 minimum_y = 0x40000000;
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
198
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
199 maximum_x = -0x40000000;
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
200 maximum_y = -0x40000000;
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
201 for (int i=0; i<pIndoor->pMapOutlines->uNumOutlines; ++i)
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
202 {
711
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
203 v3 = &pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uFace1ID];
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
204
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
205 if ( v3->x < minimum_x )
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
206 minimum_x = v3->x;
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
207 if ( v3->x > maximum_x )
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
208 maximum_x = v3->x;
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
209 if ( v3->y < minimum_y )
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
210 minimum_y = v3->x;
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
211 if ( v3->y > maximum_y )
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
212 maximum_y = v3->x;
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
213
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
214 v6 = &pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uFace2ID];
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
215
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
216 if ( v6->x < minimum_x )
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
217 minimum_x = v3->x;
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
218 if ( v6->x > maximum_x )
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
219 maximum_x = v3->x;
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
220
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
221 if ( v6->y < minimum_y )
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
222 minimum_y = v3->y;
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
223 if ( v6->y > maximum_y )
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
224 maximum_y = v3->y;
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
225 }
711
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
226
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
227 uMinimapZoom = 1024;
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
228 indoor_center_x = (signed int)(minimum_x + maximum_x) / 2;
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
229 field_28 = 10;
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
230 indoor_center_y = (signed int)(minimum_y + maximum_y) / 2;
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
231 }
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
232 else
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
233 {
711
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
234 indoor_center_x = 0;
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
235 indoor_center_y = 0;
1051
05c62d166182 004C1D2B cleaned
Nomad
parents: 1027
diff changeset
236 uMinimapZoom = _576E2C_current_minimap_zoom;
711
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
237 field_28 = dword_576E28;
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
238 }
711
a5e587c8e30e some cleaning
Gloval
parents: 693
diff changeset
239 field_2C = 384;
692
066e2b29b30f viewport.cpp added
Gloval
parents:
diff changeset
240 }