annotate stru9.cpp @ 67:476145dc3441

Слияние
author Ritor1
date Fri, 26 Oct 2012 23:22:41 +0600
parents 5159d2e6f559
children fdacbc653945
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include "stru9.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2 #include "IndoorCameraD3D.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 #include "mm7_data.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 //----- (00498377) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9 bool stru9::_498377(struct RenderVertexSoft *a1, unsigned int uNumVertices, struct IndoorCameraD3D_Vec4 *a3, struct RenderVertexSoft *pVertices, unsigned int *pOutNumVertices)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11 bool result; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12 unsigned int *v7; // ebx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13 char *v8; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14 RenderVertexSoft *v9; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15 double v10; // st7@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 double v11; // st6@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17 RenderVertexSoft *v12; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18 int v13; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 VertexBuffer *v14; // edx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 char *v15; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21 unsigned int i; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22 bool v17; // [sp+0h] [bp-28h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23 char *v18; // [sp+10h] [bp-18h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24 RenderVertexSoft *v19; // [sp+14h] [bp-14h]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25 RenderVertexSoft *v20; // [sp+18h] [bp-10h]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26 signed int v21; // [sp+1Ch] [bp-Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 RenderVertexSoft *a2; // [sp+20h] [bp-8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 stru9 *thisa; // [sp+24h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 signed int a3a; // [sp+38h] [bp+10h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 int a3b; // [sp+38h] [bp+10h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 thisa = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 static RenderVertexSoft static_AE3FB4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 static bool __init_flag1 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 if (!__init_flag1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 __init_flag1 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40 static_AE3FB4.flt_2C = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 static stru312 static_AE3FA4; // idb
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44 static bool __init_flag2 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45 if (!__init_flag2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47 __init_flag2 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49 //stru312::stru312(&static_AE3FA4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
52 static VertexBuffer static_AE33A0; // idb
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53 static bool __init_flag3 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 if (!__init_flag3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56 __init_flag3 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 //VertexBuffer::VertexBuffer(&static_AE33A0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 v7 = pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 if ( (signed int)uNumVertices <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 a2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 v8 = (char *)&a3->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 v18 = (char *)&a3->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 v17 = result + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 v9 = &a1[(result + 1) % (signed int)uNumVertices];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 if ( a2->vWorldPosition.x != v9->vWorldPosition.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74 || a2->vWorldPosition.y != v9->vWorldPosition.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75 || a2->vWorldPosition.z != v9->vWorldPosition.z )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77 v10 = *((float *)v8 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78 v11 = *(float *)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
79 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
80 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
81 static_AE3FA4.flt_0 = *((float *)v8 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
82 static_AE33A0.uNumVertices = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 a3a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84 static_AE3FA4.flt_4 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
85 static_AE3FA4.flt_8 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
86 if ( (signed int)*v7 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
87 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
88 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
89 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
90 v12 = &pVertices[result];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
91 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93 if ( _4989E1(v20, &pVertices[result], a2, &static_AE3FA4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94 && _498774(v20, v12, a2, &static_AE3FA4, &static_AE3FB4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95 AddVertex(&static_AE33A0, &static_AE3FB4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 v19 = &pVertices[result];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 v20 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
102 if ( _49895A(v12, a2, &static_AE3FA4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103 AddVertex(&static_AE33A0, v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
104 v7 = pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
105 result = a3a++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107 while ( a3a < (signed int)*pOutNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108 if ( !static_AE33A0.uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110 if ( _4989E1(v12, v19, a2, &static_AE3FA4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111 && _498774(v12, v19, a2, &static_AE3FA4, &static_AE3FB4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112 AddVertex(&static_AE33A0, &static_AE3FB4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 v13 = static_AE33A0.uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 a3b = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 if ( static_AE33A0.uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117 v14 = &static_AE33A0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118 v15 = (char *)&pVertices->vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119 for ( i = (char *)&static_AE33A0.pVertices[0].vWorldPosition.y - (char *)pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 i = (char *)&static_AE33A0.pVertices[0].vWorldPosition.y - (char *)pVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 ++a3b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124 *((int *)v15 - 1) = *(unsigned int *)(&v14->pVertices[0].vWorldPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125 v14 = (VertexBuffer *)((char *)v14 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 *(float *)v15 = *(float *)&v15[(char *)&static_AE33A0 - (char *)pVertices];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 *((float *)v15 + 1) = *(float *)&v15[i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 *((float *)v15 + 8) = *(float *)&v15[(char *)&static_AE33A0.pVertices[0].flt_20 - (char *)pVertices];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 *((float *)v15 + 9) = *(float *)&v15[(char *)&static_AE33A0.pVertices[0].u - (char *)pVertices];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 v13 = static_AE33A0.uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131 v15 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
132 if ( a3b >= static_AE33A0.uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
136 v7 = pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
137 v8 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 *pOutNumVertices = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140 result = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141 ++a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 v8 += 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 v18 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 while ( v17 < (signed int)uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146 if ( v21 < 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 LABEL_32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 *v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151 // AE3FE4: using guessed type char static_init_flag__AE3FB4_bit1__AE3FA4_bit2__AE33A0_bit3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 //----- (004985FB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154 bool stru9::_4985FB(struct RenderVertexSoft *a1, signed int a2, struct RenderVertexSoft *a3, unsigned int *pOutNumVertices, struct Vec3_float_ *a5, float a6, char *a7, int unused)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156 RenderVertexSoft *v9; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157 Vec3_float_ *v10; // esi@1
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
158 //char *v11; // ebx@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 RenderVertexSoft *v12; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160 double v13; // st7@1
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
161 //bool result; // eax@4
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162 signed int v15; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 RenderVertexSoft *v16; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 double v17; // st7@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 double v18; // st6@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166 signed int v19; // [sp+Ch] [bp-Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 float v20; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 bool v21; // [sp+14h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
169
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
170 v9 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
171 v10 = a5;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
172 //v11 = (char *)&a1->vWorldPosition.z;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
173 auto v11 = a1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
174 v12 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 v13 = a1->vWorldPosition.y * a5->y + a5->x * a1->vWorldPosition.x + a1->vWorldPosition.z * a5->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 v20 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 v21 = v13 >= a6;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
178
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179 *pOutNumVertices = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180 if ( a2 <= 0 )
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
181 return false;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
182 v19 = 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 if ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187 ++a3;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
188 memcpy(v12, v11, sizeof(RenderVertexSoft));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
189 ++*pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
190 v10 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
191 v12 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
192 v9 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
194 v15 = 0;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
195 v16 = &v9[v19 % a2];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
196 v17 = v16->vWorldPosition.z * v10->z + v16->vWorldPosition.y * v10->y + v10->x * v16->vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
197 if ( v17 >= a6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
198 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
199 if ( v21 != v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
201 v18 = (a6 - v20) / (v17 - v20);
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
202 v12->vWorldPosition.x = (v16->vWorldPosition.x - v11->vWorldPosition.x) * v18 + v11->vWorldPosition.x;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
203 v12->vWorldPosition.y = (v16->vWorldPosition.y - v11->vWorldPosition.y) * v18 + v11->vWorldPosition.y;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
204 v12->vWorldPosition.z = (v16->vWorldPosition.z - v11->vWorldPosition.z) * v18 + v11->vWorldPosition.z;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
205 v12->u = (v16->u - v11->u) * v18 + v11->u;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
206 v12->v = (v16->v - v11->v) * v18 + v11->v;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
207 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
208 a3 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
209 ++*pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
210 *a7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
211 }
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
212
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
213 v11++;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
214 v21 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
215 v20 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
216 if ( v19 >= a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
217 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
218 v9 = a1;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
219 v19++;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
220 }
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
221
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 0
diff changeset
222 return *pOutNumVertices >= 3;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
223 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
225 //----- (00498737) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
226 void stru9::AddVertex(struct VertexBuffer *pVertexBuffer, struct RenderVertexSoft *pVertex)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
228 RenderVertexSoft *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
229
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
230 v3 = &pVertexBuffer->pVertices[pVertexBuffer->uNumVertices];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
231 v3->vWorldPosition.x = pVertex->vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
232 v3->vWorldPosition.y = pVertex->vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
233 v3->vWorldPosition.z = pVertex->vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
234 v3->u = pVertex->u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
235 v3->v = pVertex->v;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
236 ++pVertexBuffer->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
238
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
239 //----- (00498774) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
240 bool stru9::_498774(struct RenderVertexSoft *a1, struct RenderVertexSoft *a2, struct RenderVertexSoft *a3, struct stru312 *a4, struct RenderVertexSoft *a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
242 RenderVertexSoft *v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
243 bool result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
244 double v8; // st7@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
245 __int16 v9; // fps@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
246 double v10; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
247 double v11; // st6@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
248 double v12; // st6@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
249 char v13; // c0@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
250 char v14; // c2@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
251 char v15; // c3@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
252 float a1a; // [sp+10h] [bp+8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
253
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
254 static stru312 static_AE3388;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
255 /*if ( !(static_init_flag__AE3388_bit1__AE3378_bit2 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
257 static_init_flag__AE3388_bit1__AE3378_bit2 |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
258 stru312::stru312(&static_AE3388);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
259 atexit(nullsub_16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
260 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
261 static stru312 static_AE3378;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
262 /*if ( !(static_init_flag__AE3388_bit1__AE3378_bit2 & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
264 static_init_flag__AE3388_bit1__AE3378_bit2 |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
265 stru312::stru312(&static_AE3378);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
266 atexit(nullsub_15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
267 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
268 v6 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
269 static_AE3378.flt_0 = a1->vWorldPosition.x - a3->vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
270 static_AE3378.flt_4 = a1->vWorldPosition.y - a3->vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
271 HIWORD(result) = HIWORD(a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
272 static_AE3378.flt_8 = a1->vWorldPosition.z - a3->vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
273 static_AE3388.flt_0 = a2->vWorldPosition.x - a1->vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
274 static_AE3388.flt_4 = a2->vWorldPosition.y - a1->vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
275 static_AE3388.flt_8 = a2->vWorldPosition.z - a1->vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
276 a1a = static_AE3388.flt_0 * a4->flt_0 + static_AE3388.flt_8 * a4->flt_8 + static_AE3388.flt_4 * a4->flt_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
277 v8 = static_AE3378.flt_0 * a4->flt_0 + static_AE3378.flt_8 * a4->flt_8 + static_AE3378.flt_4 * a4->flt_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
278 //UNDEF(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
279 if ( a1a != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
281 v10 = -(v8 / a1a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
282 if ( a1a <= 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
284 if ( v10 <= 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
285 v12 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
286 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
287 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
288 if ( v12 <= 1.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
290 if ( v10 <= 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
291 v10 = (float)0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
292 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
293 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
295 v10 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
298 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
300 if ( v10 >= 1.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
301 v11 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
302 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
303 v11 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
304 if ( v11 >= 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
306 if ( v10 >= 1.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
307 v10 = (float)1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
309 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
311 v10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
313 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
314 result = (bool)a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
315 a5->vWorldPosition.x = (a2->vWorldPosition.x - v6->vWorldPosition.x) * v10 + v6->vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
316 a5->vWorldPosition.y = (a2->vWorldPosition.y - v6->vWorldPosition.y) * v10 + v6->vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
317 a5->vWorldPosition.z = (a2->vWorldPosition.z - v6->vWorldPosition.z) * v10 + v6->vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
318 a5->u = (a2->u - v6->u) * v10 + v6->u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
319 a5->v = (a2->v - v6->v) * v10 + v6->v;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
320 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
322 v13 = v8 < 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
323 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
324 v15 = v8 == 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
325 BYTE1(result) = HIBYTE(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
326 if ( v8 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
327 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
328 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
329 LOBYTE(result) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
330 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
331 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
332 LOBYTE(result) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
333 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
334 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
335 // AE3398: using guessed type char static_init_flag__AE3388_bit1__AE3378_bit2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
336
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
337 //----- (0049895A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
338 bool stru9::_49895A(struct RenderVertexSoft *a1, struct RenderVertexSoft *a2, struct stru312 *a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
339 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
340 double v4; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
341 double v5; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
342 __int16 v6; // fps@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
343 char v7; // c0@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
344 char v8; // c2@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
345 char v9; // c3@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
346 bool result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
347
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
348 static stru312 static_F942A0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
349 /*static bool __init_flag1 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
350 if (!__init_flag1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
352 __init_flag1 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
353
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
354 stru312::stru312(&static_F942A0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
355 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
356
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
357 static_F942A0.flt_0 = a1->vWorldPosition.x - a2->vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
358 static_F942A0.flt_4 = a1->vWorldPosition.y - a2->vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
359 v4 = a1->vWorldPosition.z - a2->vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
360 HIWORD(result) = HIWORD(a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
361 static_F942A0.flt_8 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
362 v5 = v4 * a3->flt_8 + static_F942A0.flt_4 * a3->flt_4 + static_F942A0.flt_0 * a3->flt_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
363 //UNDEF(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
364 flt_F942B0 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
365 v7 = v5 < 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
366 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
367 v9 = v5 == 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
368 BYTE1(result) = HIBYTE(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
369 LOBYTE(result) = v5 >= 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
370 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
372
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
373
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
374 //----- (004989E1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
375 bool stru9::_4989E1(struct RenderVertexSoft *a1, struct RenderVertexSoft *a2, struct RenderVertexSoft *a3, struct stru312 *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
377 bool r1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
378 bool r2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
379
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
380 r1 = _49895A(a1, a3, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
381 r2 = _49895A(a2, a3, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
382 return !r1 && r2 == 1 ||
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
383 r1 == 1 && !r2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
385
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
386 //----- (004980B9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
387 bool stru9::_4980B9(RenderVertexSoft *a1, signed int a2, float a3, float a4, float a5, RenderVertexSoft *a6, unsigned int *pOutNumVertices)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
389 bool result; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
390 unsigned int *v9; // ebx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
391 char *v10; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
392 RenderVertexSoft *v11; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
393 RenderVertexSoft *v12; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
394 double v13; // st7@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
395 double v14; // st6@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
396 double v15; // st5@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
397 RenderVertexSoft *v16; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
398 int v17; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
399 VertexBuffer *v18; // edx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
400 char *v19; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
401 unsigned int i; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
402 bool v21; // [sp+0h] [bp-24h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
403 char *v22; // [sp+Ch] [bp-18h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
404 RenderVertexSoft *a2a; // [sp+10h] [bp-14h]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
405 RenderVertexSoft *a1a; // [sp+14h] [bp-10h]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
406 signed int v25; // [sp+18h] [bp-Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
407 signed int v26; // [sp+1Ch] [bp-8h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
408 int v27; // [sp+1Ch] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
409 stru9 *thisa; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
410
59
5159d2e6f559 BLV render
Nomad
parents: 52
diff changeset
411 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
412 thisa = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
413
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
414 static RenderVertexSoft stru_AE4BFC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
415 static bool __init_flag1 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
416 if (!__init_flag1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
418 __init_flag1 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
419
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
420 stru_AE4BFC.flt_2C = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
422
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
423 static stru312 static_sub_4980B9_stru_AE4BEC; // idb
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
424 static bool __init_flag2 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
425 if (!__init_flag2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
426 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
427 __init_flag2 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
428
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
429 //stru312::stru312(&static_sub_4980B9_stru_AE4BEC);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
431
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
432 static VertexBuffer static_sub_4980B9_stru_AE3FE8; // idb
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
433 static bool __init_flag3 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
434 if (!__init_flag3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
436 __init_flag3 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
437
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
438 //VertexBuffer::VertexBuffer(&static_sub_4980B9_stru_AE3FE8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
440
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
441 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
442 v9 = pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
443 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
444 if ( a2 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
445 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
446 v10 = (char *)&a1->vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
447 v22 = (char *)&a1->vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
448 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
449 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
450 v11 = (RenderVertexSoft *)(v10 - 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
451 v21 = result + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
452 v12 = &a1[(result + 1) % a2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
453 if ( *((float *)v10 - 2) != v12->vWorldPosition.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
454 || *((float *)v10 - 1) != v12->vWorldPosition.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
455 || *(float *)v10 != v12->vWorldPosition.z )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
457 v13 = v12->vWorldPosition.x - v11->vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
458 v14 = v12->vWorldPosition.y - *((float *)v10 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
459 v15 = v12->vWorldPosition.z - *(float *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
460 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
461 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
462 static_sub_4980B9_stru_AE3FE8.uNumVertices = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
463 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
464 static_sub_4980B9_stru_AE4BEC.flt_0 = a4 * v15 - v14 * a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
465 static_sub_4980B9_stru_AE4BEC.flt_4 = v13 * a5 - v15 * a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
466 static_sub_4980B9_stru_AE4BEC.flt_8 = v14 * a3 - v13 * a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
467 if ( (signed int)*v9 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
468 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
469 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
471 v16 = &a6[result];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
472 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
473 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
474 if ( _4989E1(a1a, &a6[result], v11, &static_sub_4980B9_stru_AE4BEC)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
475 && _498774(a1a, v16, v11, &static_sub_4980B9_stru_AE4BEC, &stru_AE4BFC) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
476 AddVertex(&static_sub_4980B9_stru_AE3FE8, &stru_AE4BFC);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
478 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
479 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
480 a2a = &a6[result];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
481 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
482 a1a = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
483 if ( _49895A(v16, v11, &static_sub_4980B9_stru_AE4BEC) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
484 AddVertex(&static_sub_4980B9_stru_AE3FE8, v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
485 v9 = pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
486 result = v26++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
488 while ( v26 < (signed int)*pOutNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
489 if ( !static_sub_4980B9_stru_AE3FE8.uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
490 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
491 if ( _4989E1(v16, a2a, v11, &static_sub_4980B9_stru_AE4BEC)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
492 && _498774(v16, a2a, v11, &static_sub_4980B9_stru_AE4BEC, &stru_AE4BFC) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
493 AddVertex(&static_sub_4980B9_stru_AE3FE8, &stru_AE4BFC);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
494 v17 = static_sub_4980B9_stru_AE3FE8.uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
495 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
496 if ( static_sub_4980B9_stru_AE3FE8.uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
498 v18 = &static_sub_4980B9_stru_AE3FE8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
499 v19 = (char *)&a6->vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
500 for ( i = (char *)&static_sub_4980B9_stru_AE3FE8.pVertices[0].flt_20 - (char *)a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
501 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
502 i = (char *)&static_sub_4980B9_stru_AE3FE8.pVertices[0].flt_20 - (char *)a6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
503 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
504 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
505 *((int *)v19 - 1) = LODWORD(v18->pVertices[0].vWorldPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
506 v18 = (VertexBuffer *)((char *)v18 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
507 *(float *)v19 = *(float *)&v19[(char *)&static_sub_4980B9_stru_AE3FE8 - (char *)a6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
508 *((float *)v19 + 1) = *(float *)&v19[(char *)&static_sub_4980B9_stru_AE3FE8.pVertices[0].vWorldPosition.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
509 - (char *)a6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
510 *((float *)v19 + 8) = *(float *)&v19[i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
511 *((float *)v19 + 9) = *(float *)&v19[(char *)&static_sub_4980B9_stru_AE3FE8.pVertices[0].u - (char *)a6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
512 v17 = static_sub_4980B9_stru_AE3FE8.uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
513 v19 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
514 if ( v27 >= static_sub_4980B9_stru_AE3FE8.uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
515 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
516 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
518 v9 = pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
519 v10 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
520 *pOutNumVertices = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
522 result = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
523 v10 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
524 v22 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
526 while ( v21 < a2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
527 if ( v25 < 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
528 LABEL_32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
529 *v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
530 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
531 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
532 // AE4C2C: using guessed type char static_sub_4980B9_byte_AE4C2C_init_flag;