Mercurial > mm7
annotate SpriteObject.cpp @ 2073:38bf1c70fc70
some text rendering fix
author | Gloval |
---|---|
date | Wed, 04 Dec 2013 08:50:24 +0400 |
parents | a290d9fbdc95 |
children | 52abdea20b9e |
rev | line source |
---|---|
1016 | 1 #include "BSPModel.h" |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
2 #include "SpriteObject.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
3 #include "Party.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
4 #include "TurnEngine.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
5 #include "MapInfo.h" |
2037
7a9477135943
Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents:
1980
diff
changeset
|
6 #include "OurMath.h" |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
7 #include "ObjectList.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
8 #include "Indoor.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
9 #include "Outdoor.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
10 #include "ParticleEngine.h" |
2044 | 11 #include "Timer.h" |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
12 #include "Game.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
13 #include "LOD.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
14 #include "Actor.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
15 #include "Events.h" |
1828
35c1e4ff6ba7
party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents:
1643
diff
changeset
|
16 #include "Level/Decoration.h" |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
17 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
18 #include "mm7_data.h" |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
19 #include "MM7.h" |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
20 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
21 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
22 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
23 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
24 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
25 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
26 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
27 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
28 size_t uNumSpriteObjects; |
1207
96a81634669e
arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents:
1205
diff
changeset
|
29 std::array<SpriteObject, MAX_SPRITE_OBJECTS> pSpriteObjects; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
30 |
781 | 31 //----- (00404828) -------------------------------------------------------- |
32 SpriteObject::SpriteObject() | |
33 { | |
34 field_22_glow_radius_multiplier = 1; | |
35 uSoundID = 0; | |
36 uFacing = 0; | |
37 vVelocity.z = 0; | |
38 vVelocity.y = 0; | |
39 vVelocity.x = 0; | |
40 uType = 0; | |
41 uObjectDescID = 0; | |
42 field_61 = 0; | |
43 field_60_distance_related_prolly_lod = 0; | |
44 field_20 = 0; | |
45 uSpriteFrameID = 0; | |
822 | 46 spell_skill = 0; |
47 spell_level = 0; | |
48 spell_id = 0; | |
781 | 49 field_54 = 0; |
50 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
51 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
52 //----- (0042F5ED) -------------------------------------------------------- |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
53 int SpriteObject::Create(int yaw, int pitch, int a4, int a5) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
54 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
55 signed int v6; // ebx@2 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
56 int v13; // ST2C_4@20 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
57 Vec3_int_ v17; // [sp-20h] [bp-30h]@11 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
58 int angle; // [sp+Ch] [bp-4h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
59 int a5a; // [sp+20h] [bp+10h]@20 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
60 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
61 angle = yaw; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
62 if (!uObjectDescID) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
63 return -1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
64 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
65 v6 = 1000; |
810 | 66 for (uint i = 0; i < MAX_SPRITE_OBJECTS; ++i) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
67 if (!pSpriteObjects[i].uObjectDescID) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
68 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
69 v6 = i; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
70 break; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
71 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
72 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
73 if ( v6 >= 1000 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
74 return -1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
75 field_64.x = vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
76 field_64.y = vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
77 field_64.z = vPosition.z; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
78 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
79 assert(sizeof(SpriteObject) == 0x70); |
1406 | 80 memcpy(&pSpriteObjects[v6], this, sizeof(*this)); |
81 if ( a5 == 0 ) | |
82 { | |
83 pSpriteObjects[v6].vVelocity.z = 0; | |
84 if ( a4 ) | |
85 { | |
1643 | 86 v13 = fixpoint_mul(stru_5C6E00->Cos(angle), stru_5C6E00->Cos(pitch)); |
87 a5a = fixpoint_mul(stru_5C6E00->Sin(angle), stru_5C6E00->Cos(pitch)); | |
88 pSpriteObjects[v6].vVelocity.x = fixpoint_mul(v13, a4); | |
89 pSpriteObjects[v6].vVelocity.y = fixpoint_mul(a5a, a4); | |
90 pSpriteObjects[v6].vVelocity.z = fixpoint_mul(stru_5C6E00->Sin(pitch), a4); | |
1406 | 91 } |
92 else | |
93 { | |
94 pSpriteObjects[v6].vVelocity.y = 0; | |
95 pSpriteObjects[v6].vVelocity.x = 0; | |
96 } | |
97 if ( v6 >= (signed int)uNumSpriteObjects ) | |
98 uNumSpriteObjects = v6 + 1; | |
99 return v6; | |
100 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
101 if ( a5 == 1 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
102 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
103 v17.x = vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
104 v17.y = vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
105 v17.z = vPosition.z; |
1406 | 106 Vec3_int_::Rotate(24, stru_5C6E00->uIntegerHalfPi + pSpriteObjects[v6].uFacing, 0, v17, &pSpriteObjects[v6].vPosition.x, |
107 &pSpriteObjects[v6].vPosition.y, &pSpriteObjects[v6].vPosition.z); | |
108 pSpriteObjects[v6].vVelocity.z = 0; | |
109 if ( a4 ) | |
110 { | |
1643 | 111 v13 = fixpoint_mul(stru_5C6E00->Cos(angle), stru_5C6E00->Cos(pitch)); |
112 a5a = fixpoint_mul(stru_5C6E00->Sin(angle), stru_5C6E00->Cos(pitch)); | |
113 pSpriteObjects[v6].vVelocity.x = fixpoint_mul(v13, a4); | |
114 pSpriteObjects[v6].vVelocity.y = fixpoint_mul(a5a, a4); | |
115 pSpriteObjects[v6].vVelocity.z = fixpoint_mul(stru_5C6E00->Sin(pitch), a4); | |
1406 | 116 } |
117 else | |
118 { | |
119 pSpriteObjects[v6].vVelocity.y = 0; | |
120 pSpriteObjects[v6].vVelocity.x = 0; | |
121 } | |
122 if ( v6 >= (signed int)uNumSpriteObjects ) | |
123 uNumSpriteObjects = v6 + 1; | |
124 return v6; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
125 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
126 if ( a5 == 2 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
127 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
128 v17.x = vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
129 v17.y = vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
130 v17.z = vPosition.z; |
1406 | 131 Vec3_int_::Rotate(8, stru_5C6E00->uIntegerHalfPi + pSpriteObjects[v6].uFacing, 0, v17, &pSpriteObjects[v6].vPosition.x, |
132 &pSpriteObjects[v6].vPosition.y, &pSpriteObjects[v6].vPosition.z); | |
133 pSpriteObjects[v6].vVelocity.z = 0; | |
134 if ( a4 ) | |
135 { | |
1643 | 136 v13 = fixpoint_mul(stru_5C6E00->Cos(angle), stru_5C6E00->Cos(pitch)) >> 16; |
137 a5a = fixpoint_mul(stru_5C6E00->Sin(angle), stru_5C6E00->Cos(pitch)) >> 16; | |
138 pSpriteObjects[v6].vVelocity.x = fixpoint_mul(v13, a4); | |
139 pSpriteObjects[v6].vVelocity.y = fixpoint_mul(a5a, a4); | |
140 pSpriteObjects[v6].vVelocity.z = fixpoint_mul(stru_5C6E00->Sin(pitch), a4); | |
1406 | 141 } |
142 else | |
143 { | |
144 pSpriteObjects[v6].vVelocity.y = 0; | |
145 pSpriteObjects[v6].vVelocity.x = 0; | |
146 } | |
147 if ( v6 >= (signed int)uNumSpriteObjects ) | |
148 uNumSpriteObjects = v6 + 1; | |
149 return v6; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
150 } |
1406 | 151 if ( a5 == 3 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
152 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
153 v17.x = vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
154 v17.y = vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
155 v17.z = vPosition.z; |
1406 | 156 Vec3_int_::Rotate(8, pSpriteObjects[v6].uFacing - stru_5C6E00->uIntegerHalfPi, 0, v17, &pSpriteObjects[v6].vPosition.x, |
157 &pSpriteObjects[v6].vPosition.y, &pSpriteObjects[v6].vPosition.z); | |
158 pSpriteObjects[v6].vVelocity.z = 0; | |
159 if ( a4 ) | |
160 { | |
1643 | 161 v13 = fixpoint_mul(stru_5C6E00->Cos(angle), stru_5C6E00->Cos(pitch)); |
162 a5a = fixpoint_mul(stru_5C6E00->Sin(angle), stru_5C6E00->Cos(pitch)); | |
163 pSpriteObjects[v6].vVelocity.x = fixpoint_mul(v13, a4); | |
164 pSpriteObjects[v6].vVelocity.y = fixpoint_mul(a5a, a4); | |
165 pSpriteObjects[v6].vVelocity.z = fixpoint_mul(stru_5C6E00->Sin(pitch), a4); | |
1406 | 166 } |
167 else | |
168 { | |
169 pSpriteObjects[v6].vVelocity.y = 0; | |
170 pSpriteObjects[v6].vVelocity.x = 0; | |
171 } | |
172 if ( v6 >= (signed int)uNumSpriteObjects ) | |
173 uNumSpriteObjects = v6 + 1; | |
174 return v6; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
175 } |
1406 | 176 if ( a5 == 4 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
177 { |
1406 | 178 v17.x = vPosition.x; |
179 v17.y = vPosition.y; | |
180 v17.z = vPosition.z; | |
181 Vec3_int_::Rotate(24, pSpriteObjects[v6].uFacing - stru_5C6E00->uIntegerHalfPi, 0, v17, &pSpriteObjects[v6].vPosition.x, | |
182 &pSpriteObjects[v6].vPosition.y, &pSpriteObjects[v6].vPosition.z); | |
183 pSpriteObjects[v6].vVelocity.z = 0; | |
184 if ( a4 ) | |
185 { | |
1643 | 186 v13 = fixpoint_mul(stru_5C6E00->Cos(angle), stru_5C6E00->Cos(pitch)); |
187 a5a = fixpoint_mul(stru_5C6E00->Sin(angle), stru_5C6E00->Cos(pitch)); | |
188 pSpriteObjects[v6].vVelocity.x = fixpoint_mul(v13, a4); | |
189 pSpriteObjects[v6].vVelocity.y = fixpoint_mul(a5a, a4); | |
190 pSpriteObjects[v6].vVelocity.z = fixpoint_mul(stru_5C6E00->Sin(pitch), a4); | |
1406 | 191 } |
192 else | |
193 { | |
194 pSpriteObjects[v6].vVelocity.y = 0; | |
195 pSpriteObjects[v6].vVelocity.x = 0; | |
196 } | |
197 if ( v6 >= (signed int)uNumSpriteObjects ) | |
198 uNumSpriteObjects = v6 + 1; | |
199 return v6; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
200 } |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1406
diff
changeset
|
201 |
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1406
diff
changeset
|
202 assert(false); |
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1406
diff
changeset
|
203 return 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
204 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
205 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
206 //----- (00471C03) -------------------------------------------------------- |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
207 void SpriteObject::UpdateObject_fn0_ODM(unsigned int uLayingItemID) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
208 { |
2068 | 209 //SpriteObject *v1; // esi@1 |
210 ObjectDesc *object; // ebx@1 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
211 signed int v3; // edx@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
212 int v4; // ecx@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
213 int v5; // ST04_4@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
214 int v6; // eax@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
215 int v7; // ecx@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
216 int v8; // edi@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
217 int v9; // eax@4 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
218 __int16 v10; // ax@7 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
219 int v11; // edx@11 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
220 int v12; // ecx@11 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
221 signed int v13; // edx@14 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
222 signed int v14; // edx@16 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
223 int v15; // eax@24 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
224 int v16; // eax@25 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
225 int v17; // ST10_4@25 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
226 signed int v18; // eax@25 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
227 signed int v19; // eax@28 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
228 Actor *v20; // edi@31 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
229 int v21; // eax@41 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
230 int v22; // ecx@43 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
231 __int16 v23; // bx@45 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
232 char v24; // al@46 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
233 signed int i; // edi@50 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
234 int v26; // edi@52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
235 int v27; // eax@52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
236 __int16 v28; // cx@55 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
237 int v29; // eax@55 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
238 signed int v30; // edi@59 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
239 BSPModel *v31; // ecx@61 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
240 ODMFace *v32; // edi@61 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
241 int v33; // eax@62 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
242 int v34; // ecx@62 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
243 int v35; // eax@63 |
1267 | 244 int v36; // ecx@67 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
245 __int16 v37; // ax@67 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
246 int v38; // eax@72 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
247 int v39; // eax@72 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
248 unsigned __int64 v40; // qax@72 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
249 int v41; // eax@72 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
250 unsigned __int8 v42; // sf@74 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
251 unsigned __int8 v43; // of@74 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
252 int v44; // eax@77 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
253 __int16 v45; // bx@81 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
254 int v46; // eax@85 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
255 const char *v47; // [sp-8h] [bp-B0h]@83 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
256 enum TEXTURE_TYPE v48; // [sp-4h] [bp-ACh]@46 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
257 int v49; // [sp+Ch] [bp-9Ch]@52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
258 int v50; // [sp+10h] [bp-98h]@52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
259 Vec3_int_ v51; // [sp+14h] [bp-94h]@11 |
619 | 260 Particle_sw Dst; // [sp+20h] [bp-88h]@45 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
261 unsigned int uLayingItemID_; // [sp+88h] [bp-20h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
262 int v54; // [sp+8Ch] [bp-1Ch]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
263 int v55; // [sp+90h] [bp-18h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
264 int v56; // [sp+94h] [bp-14h]@11 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
265 int v57; // [sp+98h] [bp-10h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
266 int v58; // [sp+9Ch] [bp-Ch]@1 |
1267 | 267 int on_water; // [sp+A0h] [bp-8h]@1 |
268 int v60; // [sp+A4h] [bp-4h]@11 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
269 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
270 uLayingItemID_ = uLayingItemID; |
2068 | 271 //v1 = &pSpriteObjects[uLayingItemID]; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
272 v58 = 0; |
2068 | 273 object = &pObjectList->pObjects[pSpriteObjects[uLayingItemID].uObjectDescID]; |
274 v57 = IsTerrainSlopeTooHigh(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y); | |
275 v3 = pSpriteObjects[uLayingItemID].vPosition.y; | |
276 v4 = pSpriteObjects[uLayingItemID].vPosition.x; | |
277 v5 = object->uHeight; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
278 v55 = 0; |
2068 | 279 v6 = ODM_GetFloorLevel(v4, v3, pSpriteObjects[uLayingItemID].vPosition.z, v5, &on_water, &v55, 0); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
280 v7 = v6; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
281 v54 = v6; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
282 v8 = v6 + 1; |
2068 | 283 if ( pSpriteObjects[uLayingItemID].vPosition.z <= v6 + 1 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
284 { |
1267 | 285 if ( on_water ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
286 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
287 v9 = v6 + 60; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
288 if ( v55 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
289 v9 = v7 + 30; |
2068 | 290 sub_42F960_create_object(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, v9); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
291 SpriteObject::OnInteraction(uLayingItemID_); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
292 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
293 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
294 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
295 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
296 v58 = 1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
297 } |
2068 | 298 v10 = object->uFlags; |
299 if ( !(object->uFlags & OBJECT_DESC_NO_GRAVITY) ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
300 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
301 if ( v58 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
302 { |
2068 | 303 pSpriteObjects[uLayingItemID].vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength(); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
304 goto LABEL_13; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
305 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
306 if ( v57 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
307 { |
2068 | 308 v11 = pSpriteObjects[uLayingItemID].vPosition.y; |
309 v12 = pSpriteObjects[uLayingItemID].vPosition.x; | |
310 pSpriteObjects[uLayingItemID].vPosition.z = v8; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
311 ODM_GetTerrainNormalAt(v12, v11, &v51); |
2068 | 312 pSpriteObjects[uLayingItemID].vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength(); |
313 v56 = abs(v51.y * pSpriteObjects[uLayingItemID].vVelocity.y + v51.z * pSpriteObjects[uLayingItemID].vVelocity.z + v51.x * pSpriteObjects[uLayingItemID].vVelocity.x) >> 16; | |
1546 | 314 //v60 = ((unsigned __int64)(v56 * (signed __int64)v51.x) >> 16); |
2068 | 315 pSpriteObjects[uLayingItemID].vVelocity.x += fixpoint_mul(v56, v51.x); |
1546 | 316 //v60 = ((unsigned __int64)(v56 * (signed __int64)v51.y) >> 16); |
2068 | 317 pSpriteObjects[uLayingItemID].vVelocity.y += fixpoint_mul(v56, v51.y); |
1546 | 318 //v60 = ((unsigned __int64)(v56 * (signed __int64)v51.z) >> 16); |
2068 | 319 pSpriteObjects[uLayingItemID].vVelocity.z += fixpoint_mul(v56, v51.z); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
320 v7 = v54; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
321 goto LABEL_13; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
322 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
323 if ( v10 & 0x40 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
324 { |
2068 | 325 if ( pSpriteObjects[uLayingItemID].vPosition.z < v7 ) |
326 pSpriteObjects[uLayingItemID].vPosition.z = v8; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
327 if ( !_46BFFA_check_object_intercept(uLayingItemID_, 0) ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
328 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
329 } |
2068 | 330 pSpriteObjects[uLayingItemID].vPosition.z = v8; |
331 if ( !(object->uFlags & OBJECT_DESC_BOUNCE) || (v21 = -pSpriteObjects[uLayingItemID].vVelocity.z >> 1, pSpriteObjects[uLayingItemID].vVelocity.z = v21, (signed __int16)v21 < 10) ) | |
332 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1267 | 333 |
2068 | 334 pSpriteObjects[uLayingItemID].vVelocity.x = fixpoint_mul(58500, pSpriteObjects[uLayingItemID].vVelocity.x); |
335 pSpriteObjects[uLayingItemID].vVelocity.y = fixpoint_mul(58500, pSpriteObjects[uLayingItemID].vVelocity.y); | |
336 pSpriteObjects[uLayingItemID].vVelocity.z = fixpoint_mul(58500, pSpriteObjects[uLayingItemID].vVelocity.z); | |
1267 | 337 |
2068 | 338 if ( (pSpriteObjects[uLayingItemID].vVelocity.y * pSpriteObjects[uLayingItemID].vVelocity.y + pSpriteObjects[uLayingItemID].vVelocity.x * pSpriteObjects[uLayingItemID].vVelocity.x) < 400 ) |
1267 | 339 { |
340 | |
2068 | 341 pSpriteObjects[uLayingItemID].vVelocity.y = 0; |
342 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
343 memset(&Dst, 0, 0x68u); |
2068 | 344 Dst.x = (double)pSpriteObjects[uLayingItemID].vPosition.x; |
345 Dst.y = (double)pSpriteObjects[uLayingItemID].vPosition.y; | |
346 Dst.z = (double)pSpriteObjects[uLayingItemID].vPosition.z; | |
1390 | 347 Dst.r = 0.0; |
348 Dst.g = 0.0; | |
349 Dst.b = 0.0; | |
2068 | 350 if (object->uFlags & OBJECT_DESC_TRIAL_FIRE ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
351 { |
619 | 352 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
353 Dst.uDiffuse = 0xFF3C1E; | |
1267 | 354 Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128; |
355 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); | |
356 Dst.flt_28 = 1.0; | |
357 pGame->pParticleEngine->AddParticle(&Dst); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
358 } |
2068 | 359 else if ( object->uFlags & OBJECT_DESC_TRIAL_LINE) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
360 { |
1267 | 361 |
619 | 362 Dst.type = ParticleType_Line; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
363 Dst.uDiffuse = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
364 Dst.timeToLive = 64; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
365 Dst.uTextureID = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
366 Dst.flt_28 = 1.0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
367 pGame->pParticleEngine->AddParticle(&Dst); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
368 } |
2068 | 369 else if ( object->uFlags & OBJECT_DESC_TRIAL_PARTICLE ) |
1267 | 370 { |
619 | 371 Dst.type = ParticleType_Bitmap | ParticleType_8; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
372 Dst.uDiffuse = rand(); |
1267 | 373 Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128; |
374 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT); | |
375 Dst.flt_28 = 1.0; | |
376 pGame->pParticleEngine->AddParticle(&Dst); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
377 } |
1267 | 378 return; |
379 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
380 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
381 LABEL_13: |
2068 | 382 if ( pSpriteObjects[uLayingItemID].vPosition.z > v7 |
383 && (v13 = pSpriteObjects[uLayingItemID].vPosition.x, v13 >= -0x8000) | |
1267 | 384 && v13 <= 0x8000 |
2068 | 385 && (v14 = pSpriteObjects[uLayingItemID].vPosition.y, v14 >= -0x8000) |
1267 | 386 && v14 <= 0x8000 |
2068 | 387 && pSpriteObjects[uLayingItemID].vPosition.z <= 13000 |
388 || !(object->uFlags & OBJECT_DESC_INTERACTABLE) ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
389 goto LABEL_92; |
2068 | 390 if ( pSpriteObjects[uLayingItemID].vPosition.z < v7 ) |
391 pSpriteObjects[uLayingItemID].vPosition.z = v8; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
392 if ( _46BFFA_check_object_intercept(uLayingItemID_, 0) ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
393 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
394 LABEL_92: |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
395 stru_721530.field_0 = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
396 v55 = 0; |
2068 | 397 stru_721530.prolly_normal_d = object->uRadius; |
398 stru_721530.height = object->uHeight; | |
1546 | 399 stru_721530.field_8_radius = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
400 stru_721530.field_70 = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
401 while ( 1 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
402 { |
2068 | 403 stru_721530.position.x = pSpriteObjects[uLayingItemID].vPosition.x; |
1546 | 404 stru_721530.normal.x = stru_721530.position.x; |
2068 | 405 v15 = pSpriteObjects[uLayingItemID].vPosition.y; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
406 stru_721530.uSectorID = 0; |
1546 | 407 stru_721530.position.y = v15; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
408 stru_721530.normal.y = v15; |
2068 | 409 stru_721530.position.z = pSpriteObjects[uLayingItemID].vPosition.z + stru_721530.prolly_normal_d + 1; |
1546 | 410 stru_721530.normal.z = stru_721530.position.z; |
2068 | 411 stru_721530.velocity.x = pSpriteObjects[uLayingItemID].vVelocity.x; |
412 stru_721530.velocity.y = pSpriteObjects[uLayingItemID].vVelocity.y; | |
413 stru_721530.velocity.z = pSpriteObjects[uLayingItemID].vVelocity.z; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
414 if ( stru_721530._47050A(0) ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
415 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
416 _46E889_collide_against_bmodels(0); |
2068 | 417 v16 = WorldPosToGridCellZ(pSpriteObjects[uLayingItemID].vPosition.y); |
418 v18 = WorldPosToGridCellX(pSpriteObjects[uLayingItemID].vPosition.x); | |
1267 | 419 _46E26D_collide_against_sprites(v18, v16); |
2068 | 420 if (PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid) != OBJECT_Player) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
421 _46EF01_collision_chech_player(0); |
2068 | 422 if (PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid) == OBJECT_Actor) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
423 { |
2068 | 424 v19 = PID_ID(pSpriteObjects[uLayingItemID].spell_caster_pid); |
1267 | 425 if (( v19 >= 0 )&&( v19 < (signed int)(uNumActors - 1) )) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
426 { |
1267 | 427 |
428 v20 = &pActors[v19]; | |
429 for (v56 =0; v56 < uNumActors; ++v56) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
430 { |
1267 | 431 if ( v20->GetActorsRelation(&pActors[v56]) ) |
1897
436553b0603c
_46DF1A_collide_against_actor cleaned up, moved to Actor.h
Grumpy7
parents:
1828
diff
changeset
|
432 Actor::_46DF1A_collide_against_actor(v56, 0); |
1267 | 433 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
434 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
435 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
436 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
437 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
438 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
439 for ( i = 0; i < (signed int)uNumActors; ++i ) |
1897
436553b0603c
_46DF1A_collide_against_actor cleaned up, moved to Actor.h
Grumpy7
parents:
1828
diff
changeset
|
440 Actor::_46DF1A_collide_against_actor(i, 0); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
441 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
442 v26 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; |
2068 | 443 v27 = ODM_GetFloorLevel( stru_721530.normal2.x, stru_721530.normal2.y, stru_721530.normal2.z - stru_721530.prolly_normal_d - 1, |
444 object->uHeight, &v49, &v50, 0); | |
1267 | 445 if ( on_water && v26 < v27 + 60 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
446 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
447 if ( v50 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
448 v44 = v27 + 30; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
449 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
450 v44 = v54 + 60; |
2068 | 451 sub_42F960_create_object(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, v44); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
452 SpriteObject::OnInteraction(uLayingItemID_); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
453 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
454 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
455 if ( stru_721530.field_7C >= stru_721530.field_6C ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
456 { |
2068 | 457 pSpriteObjects[uLayingItemID].vPosition.x = stru_721530.normal2.x; |
458 pSpriteObjects[uLayingItemID].vPosition.y = stru_721530.normal2.y; | |
459 pSpriteObjects[uLayingItemID].vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; | |
460 pSpriteObjects[uLayingItemID].uSectorID = LOWORD(stru_721530.uSectorID); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
461 memset(&Dst, 0, 0x68u); |
2068 | 462 Dst.x = (double)pSpriteObjects[uLayingItemID].vPosition.x; |
463 Dst.y = (double)pSpriteObjects[uLayingItemID].vPosition.y; | |
464 Dst.z = (double)pSpriteObjects[uLayingItemID].vPosition.z; | |
1390 | 465 Dst.r = 0.0; |
466 Dst.g = 0.0; | |
467 Dst.b = 0.0; | |
2068 | 468 if ( object->uFlags & OBJECT_DESC_TRIAL_FIRE ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
469 { |
619 | 470 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
471 Dst.uDiffuse = 0xFF3C1E; | |
1267 | 472 Dst.timeToLive = (unsigned __int8)( rand() & 0x80) + 128; |
473 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); | |
474 Dst.flt_28 = 1.0; | |
475 pGame->pParticleEngine->AddParticle(&Dst); | |
476 return; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
477 } |
2068 | 478 else if ( object->uFlags & OBJECT_DESC_TRIAL_LINE ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
479 { |
619 | 480 Dst.type = ParticleType_Line; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
481 Dst.uTextureID = 0; |
1267 | 482 Dst.uDiffuse = rand(); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
483 Dst.timeToLive = 64; |
1267 | 484 Dst.flt_28 = 1.0; |
485 pGame->pParticleEngine->AddParticle(&Dst); | |
486 return; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
487 } |
2068 | 488 else if ( object->uFlags & OBJECT_DESC_TRIAL_PARTICLE) |
489 { | |
490 Dst.type = ParticleType_Bitmap | ParticleType_8; | |
491 Dst.uDiffuse = rand(); | |
492 Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128; | |
493 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT); | |
494 Dst.flt_28 = 1.0; | |
495 pGame->pParticleEngine->AddParticle(&Dst); | |
496 } | |
1267 | 497 return; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
498 } |
1546 | 499 //v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.x) >> 16); |
2068 | 500 pSpriteObjects[uLayingItemID].vPosition.x += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.x); |
1546 | 501 //v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.y) >> 16); |
2068 | 502 pSpriteObjects[uLayingItemID].vPosition.y += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.y); |
1546 | 503 //v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.z) >> 16); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
504 v28 = LOWORD(stru_721530.uSectorID); |
2068 | 505 pSpriteObjects[uLayingItemID].vPosition.z += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.z); |
506 v29 = pSpriteObjects[uLayingItemID].vPosition.z; | |
507 pSpriteObjects[uLayingItemID].uSectorID = v28; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
508 stru_721530.field_70 += stru_721530.field_7C; |
2068 | 509 if ( object->uFlags & OBJECT_DESC_INTERACTABLE ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
510 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
511 if ( v29 < v54 ) |
2068 | 512 pSpriteObjects[uLayingItemID].vPosition.z = v54 + 1; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
513 if ( !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
514 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
515 } |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
516 v30 = (signed int)PID_ID(stru_721530.uFaceID); |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
517 if (PID_TYPE(stru_721530.uFaceID) == OBJECT_Decoration) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
518 break; |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
519 if (PID_TYPE(stru_721530.uFaceID) == OBJECT_BModel) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
520 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
521 v31 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9]; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
522 v32 = &v31->pFaces[v30 & 0x3F]; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
523 if ( v32->uPolygonType != 3 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
524 { |
2068 | 525 v56 = abs(v32->pFacePlane.vNormal.z * pSpriteObjects[uLayingItemID].vVelocity.z + v32->pFacePlane.vNormal.y * pSpriteObjects[uLayingItemID].vVelocity.y |
526 + v32->pFacePlane.vNormal.x * pSpriteObjects[uLayingItemID].vVelocity.x) >> 16; | |
1546 | 527 if ( (stru_721530.speed >> 3) > v56 ) |
528 v56 = stru_721530.speed >> 3; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
529 v57 = v32->pFacePlane.vNormal.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
530 v57 = (unsigned __int64)(v56 * (signed __int64)v57) >> 16; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
531 v58 = v32->pFacePlane.vNormal.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
532 v58 = (unsigned __int64)(v56 * (signed __int64)v58) >> 16; |
1546 | 533 v60 = ((unsigned __int64)(v56 * (signed __int64)v32->pFacePlane.vNormal.z) >> 16); |
2068 | 534 pSpriteObjects[uLayingItemID].vVelocity.x += 2 * v57; |
535 pSpriteObjects[uLayingItemID].vVelocity.y += 2 * v58; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
536 if ( v32->pFacePlane.vNormal.z <= 32000 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
537 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
538 v37 = 2 * (short)v60; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
539 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
540 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
541 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
542 v36 = v60; |
2068 | 543 pSpriteObjects[uLayingItemID].vVelocity.z += (signed __int16)v60; |
1267 | 544 v58 = (unsigned __int64)(32000 * (signed __int64)(signed int)v36) >> 16; |
545 v37 = (unsigned int)(32000 * v36) >> 16; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
546 } |
2068 | 547 pSpriteObjects[uLayingItemID].vVelocity.z += v37; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
548 if ( BYTE3(v32->uAttributes) & 0x10 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
549 EventProcessor(v32->sCogTriggeredID, 0, 1); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
550 goto LABEL_74; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
551 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
552 v33 = v31->pVertices.pVertices[v32->pVertexIDs[0]].z; |
2068 | 553 v34 = pSpriteObjects[uLayingItemID].vVelocity.x; |
554 pSpriteObjects[uLayingItemID].vPosition.z = v33 + 1; | |
555 if ( pSpriteObjects[uLayingItemID].vVelocity.y * pSpriteObjects[uLayingItemID].vVelocity.y + v34 * v34 >= 400 ) | |
556 { | |
557 if ( BYTE3(v32->uAttributes) & 0x10 ) | |
558 EventProcessor(v32->sCogTriggeredID, 0, 1); | |
559 goto LABEL_74; | |
560 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
561 LOWORD(v35) = 0; |
2068 | 562 pSpriteObjects[uLayingItemID].vVelocity.z = 0; |
563 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
564 pSpriteObjects[uLayingItemID].vVelocity.y = v35; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
565 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
566 LABEL_74: |
2068 | 567 pSpriteObjects[uLayingItemID].vVelocity.x = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)pSpriteObjects[uLayingItemID].vVelocity.x) >> 16); |
568 pSpriteObjects[uLayingItemID].vVelocity.y = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)pSpriteObjects[uLayingItemID].vVelocity.y) >> 16); | |
569 pSpriteObjects[uLayingItemID].vVelocity.z = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)pSpriteObjects[uLayingItemID].vVelocity.z) >> 16); | |
1267 | 570 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
571 ++v55; |
1267 | 572 //v43 = __OFSUB__(v55, 100); |
573 // v42 = v55 - 100 < 0; | |
574 if (v55>=100 )//!(v42 ^ v43) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
575 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
576 } |
2068 | 577 v57 = integer_sqrt(pSpriteObjects[uLayingItemID].vVelocity.y * pSpriteObjects[uLayingItemID].vVelocity.y + pSpriteObjects[uLayingItemID].vVelocity.x * pSpriteObjects[uLayingItemID].vVelocity.x); |
578 v38 = stru_5C6E00->Atan2(pSpriteObjects[uLayingItemID].vPosition.x - pLevelDecorations[v30].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y - pLevelDecorations[v30].vPosition.y); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
579 v56 = v38; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
580 v39 = stru_5C6E00->Cos(v38); |
1267 | 581 // v60 = v39; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
582 v40 = v39 * (signed __int64)v57; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
583 v58 = v40 >> 16; |
2068 | 584 pSpriteObjects[uLayingItemID].vVelocity.x = WORD1(v40); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
585 v41 = stru_5C6E00->Sin(v56 - stru_5C6E00->uIntegerHalfPi); |
1267 | 586 // v60 = v41; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
587 v35 = (unsigned __int64)(v41 * (signed __int64)v57) >> 16; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
588 v58 = v35; |
2068 | 589 pSpriteObjects[uLayingItemID].vVelocity.y = v35; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
590 goto LABEL_74; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
591 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
592 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
593 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
594 //----- (0047136C) -------------------------------------------------------- |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
595 void SpriteObject::UpdateObject_fn0_BLV(unsigned int uLayingItemID) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
596 { |
717 | 597 SpriteObject *pSpriteObject; // esi@1 |
598 ObjectDesc *pObject; // edi@1 | |
599 //int v3; // ST08_4@1 | |
600 //__int16 v4; // ax@5 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
601 __int16 v5; // ax@7 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
602 BLVFace *v6; // ecx@11 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
603 BLVFace *v7; // eax@11 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
604 signed int v8; // ebx@12 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
605 int v9; // ecx@16 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
606 __int16 v10; // di@18 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
607 char v11; // al@19 |
1546 | 608 //int v12; // eax@25 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
609 int v13; // eax@31 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
610 int v14; // ebx@34 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
611 signed int v15; // ebx@46 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
612 BLVFace *v16; // edi@48 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
613 int v17; // eax@50 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
614 int v18; // eax@52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
615 int v19; // ecx@52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
616 Vec3_short_ *v20; // ecx@53 |
1574 | 617 //int v21; // ecx@57 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
618 __int16 v22; // ax@57 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
619 int v23; // edi@62 |
1574 | 620 //int v24; // edi@62 |
621 //int v25; // eax@62 | |
622 //unsigned __int64 v26; // qax@62 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
623 unsigned __int8 v27; // sf@64 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
624 unsigned __int8 v28; // of@64 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
625 __int16 v29; // di@67 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
626 char v30; // al@68 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
627 const char *v31; // [sp-8h] [bp-98h]@19 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
628 const char *v32; // [sp-8h] [bp-98h]@68 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
629 enum TEXTURE_TYPE v33; // [sp-4h] [bp-94h]@19 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
630 enum TEXTURE_TYPE v34; // [sp-4h] [bp-94h]@68 |
619 | 631 Particle_sw Dst; // [sp+Ch] [bp-84h]@18 |
717 | 632 //unsigned int uLayingItemID_; // [sp+74h] [bp-1Ch]@1 |
633 //ObjectDesc *v37; // [sp+78h] [bp-18h]@1 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
634 unsigned int uFaceID; // [sp+7Ch] [bp-14h]@4 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
635 int v39; // [sp+80h] [bp-10h]@33 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
636 Actor *v39b; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
637 int v40; // [sp+84h] [bp-Ch]@28 |
1574 | 638 //int v41; // [sp+88h] [bp-8h]@34 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
639 int v42; // [sp+8Ch] [bp-4h]@4 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
640 |
717 | 641 //uLayingItemID_ = uLayingItemID; |
642 pSpriteObject = &pSpriteObjects[uLayingItemID]; | |
643 pObject = &pObjectList->pObjects[pSpriteObject->uObjectDescID]; | |
644 //v3 = pSpriteObject->vPosition.x; | |
645 //v37 = &pObjectList->pObjects[pSpriteObject->uObjectDescID]; | |
646 pSpriteObject->uSectorID = pIndoor->GetSector(pSpriteObject->vPosition.x, pSpriteObject->vPosition.y, pSpriteObject->vPosition.z); | |
723 | 647 v42 = BLV_GetFloorLevel(pSpriteObject->vPosition.x, pSpriteObject->vPosition.y, pSpriteObject->vPosition.z, pSpriteObject->uSectorID, &uFaceID); |
717 | 648 if ( abs(pSpriteObject->vPosition.x) > 32767 |
649 || abs(pSpriteObject->vPosition.y) > 32767 | |
650 || abs(pSpriteObject->vPosition.z) > 20000 | |
651 || v42 <= -30000 | |
652 && (pSpriteObject->uSectorID == 0)) | |
653 // || (v42 = _46CEC3_get_floor_level(pSpriteObject->vPosition.x, pSpriteObject->vPosition.y, pSpriteObject->vPosition.z, v4, &uFaceID), v42 == -30000)) ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
654 { |
717 | 655 SpriteObject::OnInteraction(uLayingItemID); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
656 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
657 } |
717 | 658 v5 = pObject->uFlags; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
659 if ( v5 & 0x20 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
660 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
661 LABEL_24: |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
662 v8 = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
663 LABEL_25: |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
664 stru_721530.field_0 = v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
665 uFaceID = v8; |
717 | 666 stru_721530.prolly_normal_d = pObject->uRadius; |
1546 | 667 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
668 stru_721530.field_84 = -1; |
1546 | 669 stru_721530.height = pObject->uHeight; |
670 stru_721530.field_8_radius = v8; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
671 stru_721530.field_70 = v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
672 while ( 1 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
673 { |
1546 | 674 stru_721530.position.x = pSpriteObject->vPosition.x; |
675 stru_721530.normal.x = stru_721530.position.x; | |
676 stru_721530.position.y = pSpriteObject->vPosition.y; | |
677 stru_721530.normal.y = stru_721530.position.y; | |
678 stru_721530.position.z = stru_721530.prolly_normal_d + pSpriteObject->vPosition.z + 1; | |
679 stru_721530.normal.z = stru_721530.position.z; | |
680 stru_721530.velocity.x = pSpriteObject->vVelocity.x; | |
681 stru_721530.velocity.y = pSpriteObject->vVelocity.y; | |
682 stru_721530.velocity.z = pSpriteObject->vVelocity.z; | |
717 | 683 stru_721530.uSectorID = pSpriteObject->uSectorID; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
684 if ( stru_721530._47050A(v8) ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
685 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
686 v40 = v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
687 do |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
688 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
689 _46E44E_collide_against_faces_and_portals(0); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
690 _46E0B2_collide_against_decorations(); |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
691 if (PID_TYPE(pSpriteObject->spell_caster_pid) != OBJECT_Player) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
692 _46EF01_collision_chech_player(1); |
822 | 693 v13 = pSpriteObject->spell_caster_pid; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
694 v42 = v8; |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
695 if (PID_TYPE(v13) == OBJECT_Actor) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
696 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
697 if ( (signed int)uNumActors > v8 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
698 { |
1202 | 699 v39b = pActors.data();//[0].word_000086_some_monster_id; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
700 do |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
701 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
702 //v41 = pActors[v1->field_58 >> 3].pMonsterInfo.uID - 1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
703 //v14 = (signed __int64)((double)v41 * 0.3333333333333333); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
704 //v41 = *(short *)(v39 - 38) - 1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
705 //if ( v14 != (unsigned int)(signed __int64)((double)v41 * 0.3333333333333333) ) |
822 | 706 if( pActors[pSpriteObject->spell_caster_pid >> 3].pMonsterInfo.uID != v39b->pMonsterInfo.uID ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
707 //not sure: pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius |
1897
436553b0603c
_46DF1A_collide_against_actor cleaned up, moved to Actor.h
Grumpy7
parents:
1828
diff
changeset
|
708 Actor::_46DF1A_collide_against_actor(v42, pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
709 ++v42; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
710 ++v39b;// += 836; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
711 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
712 while ( v42 < (signed int)uNumActors ); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
713 v8 = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
714 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
715 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
716 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
717 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
718 if ( (signed int)uNumActors > v8 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
719 { |
1202 | 720 v39b = pActors.data();//[0].word_000086_some_monster_id; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
721 do |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
722 { |
1897
436553b0603c
_46DF1A_collide_against_actor cleaned up, moved to Actor.h
Grumpy7
parents:
1828
diff
changeset
|
723 Actor::_46DF1A_collide_against_actor(v42++, pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
724 ++v39b; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
725 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
726 while ( v42 < (signed int)uNumActors ); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
727 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
728 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
729 if ( _46F04E_collide_against_portals() ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
730 break; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
731 ++v40; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
732 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
733 while ( v40 < 100 ); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
734 if ( stru_721530.field_7C >= stru_721530.field_6C ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
735 { |
717 | 736 pSpriteObject->vPosition.x = stru_721530.normal2.x; |
737 pSpriteObject->vPosition.y = stru_721530.normal2.y; | |
738 pSpriteObject->vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; | |
739 pSpriteObject->uSectorID = LOWORD(stru_721530.uSectorID); | |
740 if ( !(HIBYTE(pObject->uFlags) & 1) ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
741 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
742 memset(&Dst, v8, 0x68u); |
717 | 743 v29 = pObject->uFlags; |
744 Dst.x = (double)pSpriteObject->vPosition.x; | |
745 Dst.y = (double)pSpriteObject->vPosition.y; | |
746 Dst.z = (double)pSpriteObject->vPosition.z; | |
1390 | 747 Dst.r = 0.0; |
748 Dst.g = 0.0; | |
749 Dst.b = 0.0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
750 if ( v29 & 0x200 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
751 { |
619 | 752 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
753 Dst.uDiffuse = 0xFF3C1E; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
754 v30 = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
755 v34 = (TEXTURE_TYPE)v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
756 v32 = "effpar01"; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
757 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
758 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
759 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
760 if ( v29 & 0x400 ) |
717 | 761 { |
762 Dst.type = ParticleType_Line; | |
763 Dst.uDiffuse = rand(); | |
764 Dst.timeToLive = 64; | |
765 Dst.uTextureID = v8; | |
766 Dst.flt_28 = 1.0; | |
767 pGame->pParticleEngine->AddParticle(&Dst); | |
768 return; | |
769 } | |
619 | 770 Dst.type = ParticleType_Bitmap | ParticleType_8; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
771 Dst.uDiffuse = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
772 v30 = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
773 v34 = (TEXTURE_TYPE)v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
774 v32 = "effpar03"; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
775 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
776 Dst.timeToLive = (unsigned __int8)(v30 & 0x80) + 128; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
777 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v32, v34); |
717 | 778 Dst.flt_28 = 1.0; |
779 pGame->pParticleEngine->AddParticle(&Dst); | |
780 return; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
781 } |
1546 | 782 //v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.x) >> 16; |
1643 | 783 pSpriteObject->vPosition.x += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.x); |
1546 | 784 //v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.y) >> 16; |
1643 | 785 pSpriteObject->vPosition.y += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.y); |
1546 | 786 //v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.z) >> 16; |
1643 | 787 pSpriteObject->vPosition.z += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.z); |
1574 | 788 pSpriteObject->uSectorID = stru_721530.uSectorID; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
789 stru_721530.field_70 += stru_721530.field_7C; |
717 | 790 if ( pObject->uFlags & 0x40 && !_46BFFA_check_object_intercept(uLayingItemID, stru_721530.uFaceID) ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
791 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
792 v15 = (signed int)stru_721530.uFaceID >> 3; |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
793 if (PID_TYPE(stru_721530.uFaceID) == OBJECT_Decoration) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
794 { |
717 | 795 v40 = integer_sqrt(pSpriteObject->vVelocity.x * pSpriteObject->vVelocity.x + pSpriteObject->vVelocity.y * pSpriteObject->vVelocity.y); |
796 v23 = stru_5C6E00->Atan2(pSpriteObject->vPosition.x - pLevelDecorations[v15].vPosition.x, | |
797 pSpriteObject->vPosition.y - pLevelDecorations[v15].vPosition.y); | |
1643 | 798 pSpriteObject->vVelocity.x = fixpoint_mul(stru_5C6E00->Cos(v23), v40); |
799 pSpriteObject->vVelocity.y = fixpoint_mul(stru_5C6E00->Sin(v23), v40); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
800 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
801 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
802 { |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
803 if (PID_TYPE(stru_721530.uFaceID) != OBJECT_BModel) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
804 goto LABEL_64; |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
805 stru_721530.field_84 = (signed int)PID_ID(stru_721530.uFaceID); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
806 v16 = &pIndoor->pFaces[v15]; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
807 if ( v16->uPolygonType != 3 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
808 { |
717 | 809 v42 = abs(v16->pFacePlane_old.vNormal.x * pSpriteObject->vVelocity.x + v16->pFacePlane_old.vNormal.z * pSpriteObject->vVelocity.z |
810 + v16->pFacePlane_old.vNormal.y * pSpriteObject->vVelocity.y) >> 16; | |
1546 | 811 if ( (stru_721530.speed >> 3) > v42 ) |
812 v42 = stru_721530.speed >> 3; | |
1643 | 813 pSpriteObject->vVelocity.x += 2 * fixpoint_mul(v42, v16->pFacePlane_old.vNormal.x); |
814 pSpriteObject->vVelocity.y += 2 * fixpoint_mul(v42, v16->pFacePlane_old.vNormal.y); | |
815 v39 = fixpoint_mul(v42, v16->pFacePlane_old.vNormal.z); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
816 if ( v16->pFacePlane_old.vNormal.z <= 32000 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
817 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
818 v22 = 2 * v39; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
819 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
820 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
821 { |
717 | 822 pSpriteObject->vVelocity.z += v39; |
1643 | 823 v22 = fixpoint_mul(32000, v39); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
824 } |
717 | 825 pSpriteObject->vVelocity.z += v22; |
826 if ( BYTE3(v16->uAttributes) & 0x10 ) | |
827 EventProcessor(pIndoor->pFaceExtras[v16->uFaceExtraID].uEventID, 0, 1); | |
828 goto LABEL_63; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
829 } |
717 | 830 if ( pObject->uFlags & 0x80 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
831 { |
717 | 832 v17 = -pSpriteObject->vVelocity.z >> 1; |
833 pSpriteObject->vVelocity.z = v17; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
834 if ( (signed __int16)v17 < 10 ) |
717 | 835 pSpriteObject->vVelocity.z = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
836 if ( BYTE3(v16->uAttributes) & 0x10 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
837 EventProcessor(pIndoor->pFaceExtras[v16->uFaceExtraID].uEventID, 0, 1); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
838 goto LABEL_63; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
839 } |
717 | 840 v18 = pSpriteObject->vVelocity.y; |
841 v19 = pSpriteObject->vVelocity.x; | |
842 pSpriteObject->vVelocity.z = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
843 if ( v19 * v19 + v18 * v18 >= 400 ) |
717 | 844 { |
845 if ( BYTE3(v16->uAttributes) & 0x10 ) | |
846 EventProcessor(pIndoor->pFaceExtras[v16->uFaceExtraID].uEventID, 0, 1); | |
847 goto LABEL_63; | |
848 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
849 v20 = pIndoor->pVertices; |
717 | 850 pSpriteObject->vVelocity.z = 0; |
851 pSpriteObject->vVelocity.y = 0; | |
852 pSpriteObject->vVelocity.x = 0; | |
853 pSpriteObject->vPosition.z = v20[*v16->pVertexIDs].z + 1; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
854 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
855 LABEL_63: |
717 | 856 //v2 = v37; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
857 LABEL_64: |
1643 | 858 pSpriteObject->vVelocity.x = fixpoint_mul(58500, pSpriteObject->vVelocity.x); |
859 pSpriteObject->vVelocity.y = fixpoint_mul(58500, pSpriteObject->vVelocity.y); | |
860 pSpriteObject->vVelocity.z = fixpoint_mul(58500, pSpriteObject->vVelocity.z); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
861 ++uFaceID; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
862 v28 = __OFSUB__(uFaceID, 100); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
863 v27 = uFaceID - 100 < 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
864 if ( !(v27 ^ v28) ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
865 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
866 v8 = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
867 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
868 } |
717 | 869 if ( v42 <= pSpriteObject->vPosition.z - 3 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
870 { |
717 | 871 pSpriteObject->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength(); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
872 goto LABEL_24; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
873 } |
717 | 874 if ( !(v5 & 0x40) || _46BFFA_check_object_intercept(uLayingItemID, 0) ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
875 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
876 v6 = pIndoor->pFaces; |
717 | 877 pSpriteObject->vPosition.z = v42 + 1; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
878 v7 = &v6[uFaceID]; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
879 if ( v7->uPolygonType == 3 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
880 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
881 v8 = 0; |
717 | 882 pSpriteObject->vVelocity.z = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
883 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
884 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
885 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
886 if ( v7->pFacePlane_old.vNormal.z < 45000 ) |
717 | 887 pSpriteObject->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength(); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
888 v8 = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
889 } |
1643 | 890 pSpriteObject->vVelocity.x = fixpoint_mul(58500, pSpriteObject->vVelocity.x); |
891 pSpriteObject->vVelocity.y = fixpoint_mul(58500, pSpriteObject->vVelocity.y); | |
892 pSpriteObject->vVelocity.z = fixpoint_mul(58500, pSpriteObject->vVelocity.z); | |
717 | 893 v9 = pSpriteObject->vVelocity.x; |
894 if ( v9 * v9 + pSpriteObject->vVelocity.y * pSpriteObject->vVelocity.y < 400 ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
895 { |
717 | 896 pSpriteObject->vVelocity.z = v8; |
897 pSpriteObject->vVelocity.y = v8; | |
898 pSpriteObject->vVelocity.x = v8; | |
899 if ( !(pObject->uFlags & 1) ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
900 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
901 memset(&Dst, v8, 0x68u); |
717 | 902 v10 = pObject->uFlags; |
903 Dst.x = (double)pSpriteObject->vPosition.x; | |
904 Dst.y = (double)pSpriteObject->vPosition.y; | |
905 Dst.z = (double)pSpriteObject->vPosition.z; | |
1390 | 906 Dst.r = 0.0; |
907 Dst.g = 0.0; | |
908 Dst.b = 0.0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
909 if ( v10 & 0x200 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
910 { |
619 | 911 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
912 Dst.uDiffuse = 0xFF3C1E; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
913 Dst.flt_28 = 1.0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
914 v11 = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
915 v33 = (TEXTURE_TYPE)v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
916 v31 = "effpar01"; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
917 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
918 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
919 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
920 if ( v10 & 0x400 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
921 { |
619 | 922 Dst.type = ParticleType_Line; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
923 Dst.uDiffuse = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
924 Dst.timeToLive = 64; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
925 Dst.uTextureID = v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
926 Dst.flt_28 = 1.0; |
717 | 927 pGame->pParticleEngine->AddParticle(&Dst); |
928 return; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
929 } |
619 | 930 Dst.type = ParticleType_Bitmap | ParticleType_8; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
931 Dst.uDiffuse = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
932 Dst.flt_28 = 1.0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
933 v11 = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
934 v33 = (TEXTURE_TYPE)v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
935 v31 = "effpar03"; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
936 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
937 Dst.timeToLive = (unsigned __int8)(v11 & 0x80) + 128; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
938 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v31, v33); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
939 pGame->pParticleEngine->AddParticle(&Dst); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
940 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
941 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
942 goto LABEL_25; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
943 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
944 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
945 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
946 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
947 //----- (00438E35) -------------------------------------------------------- |
1406 | 948 void SpriteObject::ExplosionTraps() |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
949 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
950 MapInfo *pMapInfo; // esi@1 |
1406 | 951 int dir_x; // ebx@1 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
952 int v7; // edx@2 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
953 unsigned int v10; // eax@7 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
954 signed int v11; // ebx@8 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
955 signed int v13; // edi@20 |
1406 | 956 int dir_y; // [sp+Ch] [bp-Ch]@1 |
957 int dir_z; // [sp+10h] [bp-8h]@1 | |
958 DAMAGE_TYPE pDamageType; // [sp+14h] [bp-4h]@14 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
959 |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1450
diff
changeset
|
960 pMapInfo = &pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)]; |
1406 | 961 dir_x = abs(pParty->vPosition.x - this->vPosition.x); |
962 dir_y = abs(pParty->vPosition.y - this->vPosition.y); | |
963 dir_z = abs(pParty->vPosition.z + pParty->sEyelevel - this->vPosition.z); | |
964 if ( dir_x < dir_y ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
965 { |
1406 | 966 v7 = dir_x; |
967 dir_x = dir_y; | |
968 dir_y = v7; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
969 } |
1406 | 970 if ( dir_x < dir_z ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
971 { |
1406 | 972 v7 = dir_x; |
973 dir_x = dir_z; | |
974 dir_z = v7; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
975 } |
1406 | 976 if ( dir_y < dir_z ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
977 { |
1406 | 978 v7 = dir_z; |
979 dir_z = dir_y; | |
980 dir_y = v7; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
981 } |
1406 | 982 v10 = ((unsigned int)(11 * dir_y) >> 5) + (dir_z / 4) + dir_x; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
983 if ( (signed int)v10 <= 768 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
984 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
985 v11 = 5; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
986 if ( pMapInfo->Trap_D20 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
987 { |
1406 | 988 for ( uint i = 0; i < pMapInfo->Trap_D20; ++i ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
989 v11 += rand() % 20 + 1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
990 } |
1406 | 991 switch ( this->uType ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
992 { |
1406 | 993 case 811: |
994 pDamageType = DMGT_FIRE; | |
995 break; | |
996 case 812: | |
997 pDamageType = DMGT_ELECTR; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
998 break; |
1406 | 999 case 813: |
1000 pDamageType = DMGT_COLD; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1001 break; |
1406 | 1002 case 814: |
1003 pDamageType = DMGT_BODY; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1004 break; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1005 default: |
1406 | 1006 return; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1007 } |
1406 | 1008 for ( uint i = 1; i <= 4; ++i ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1009 { |
1406 | 1010 if ( pPlayers[i]->CanAct() && (v13 = pPlayers[i]->GetPerception() + 20, rand() % v13 > 20) ) |
1011 pPlayers[i]->PlaySound(SPEECH_6, 0); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1012 else |
1406 | 1013 pPlayers[i]->ReceiveDamage(v11, pDamageType); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1014 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1015 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1016 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1017 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1018 //----- (0042F933) -------------------------------------------------------- |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1019 void SpriteObject::OnInteraction(unsigned int uLayingItemID) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1020 { |
837 | 1021 pSpriteObjects[uLayingItemID].uObjectDescID = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1022 if ( pParty->bTurnBasedModeOn == 1 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1023 { |
837 | 1024 if (pSpriteObjects[uLayingItemID].uAttributes & 4 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1025 { |
1062 | 1026 pSpriteObjects[uLayingItemID].uAttributes &= 0xFFFB; |
1450 | 1027 --pTurnEngine->pending_actions; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1028 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1029 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1030 } |
810 | 1031 |
1032 | |
1033 //----- (0042FA22) -------------------------------------------------------- | |
1034 void CompactLayingItemsList() | |
1035 { | |
1036 int new_obj_pos=0; | |
1037 | |
1038 for (int i=0; i<MAX_SPRITE_OBJECTS; ++i) | |
1039 { | |
1040 if (pSpriteObjects[i].uObjectDescID) | |
1041 memcpy(&pSpriteObjects[new_obj_pos++], &pSpriteObjects[i],sizeof(SpriteObject)); | |
1042 } | |
1043 uNumSpriteObjects = new_obj_pos; | |
1297 | 1044 } |
1045 //----- (00408896) -------------------------------------------------------- | |
1046 void InitializeSpriteObjects() | |
1047 { | |
1048 for (uint i = 0; i < uNumSpriteObjects; ++i) | |
1049 { | |
1980 | 1050 SpriteObject* item = &pSpriteObjects[i]; |
1297 | 1051 |
1052 if (item->uType && | |
1053 (item->uSoundID & 8 || pObjectList->pObjects[item->uType].uFlags & 0x10)) | |
1054 SpriteObject::OnInteraction(i); | |
1055 } | |
1056 } | |
1057 //----- (0046BEF1) -------------------------------------------------------- | |
1058 void SpriteObject::_46BEF1_apply_spells_aoe() | |
1059 { | |
1060 SpriteObject *v1; // edi@1 | |
1061 Actor *v2; // esi@2 | |
1062 __int16 v3; // fps@4 | |
1063 unsigned __int8 v4; // c0@4 | |
1064 unsigned __int8 v5; // c3@4 | |
1065 signed int v6; // [sp+8h] [bp-4h]@1 | |
1066 | |
1067 int v7,v8,v9,v10,v11; | |
1068 | |
1069 v6 = 0; | |
1070 v1 = this; | |
1071 if ( (signed int)uNumActors > 0 ) | |
1072 { | |
1073 v2 = pActors.data();//[0].vPosition.y; | |
1074 do | |
1075 { | |
1076 if ( v2->CanAct() ) | |
1077 { | |
1078 //UNDEF(v3); | |
1079 //.text:0046BF26 movsx eax, word ptr [esi-2] | |
1080 //.text:0046BF2A sub eax, [edi+4] | |
1081 //.text:0046BF31 mov [ebp+var_8], eax | |
1082 //.text:0046BF37 fild [ebp+var_8] | |
1083 // v7 pushed to stack | |
1084 v7 = v2->vPosition.x - this->vPosition.x; | |
1085 | |
1086 //.text:0046BF2D movsx ecx, word ptr [esi+2] | |
1087 v8 = v2->vPosition.z; | |
1088 | |
1089 //.text:0046BF34 movsx eax, word ptr [esi] | |
1090 //.text:0046BF3A sub eax, [edi+8] | |
1091 //.text:0046BF3D mov [ebp+var_8], eax | |
1092 //.text:0046BF44 fild [ebp+var_8] | |
1093 // v9 pushed to stack | |
1094 v9 = v2->vPosition.y - this->vPosition.y; | |
1095 | |
1096 //.text:0046BF40 movsx eax, word ptr [esi-6] | |
1097 //.text:0046BF47 sar eax, 1 | |
1098 //.text:0046BF49 add eax, ecx | |
1099 //.text:0046BF4B sub eax, [edi+0Ch] | |
1100 //.text:0046BF4E mov [ebp+var_8], eax | |
1101 //.text:0046BF51 fild [ebp+var_8] | |
1102 //.text:0046BF58 fld st | |
1103 // v10 pushed to stack, two times | |
1104 v10 = v2->uActorHeight / 2 + v8 - this->vVelocity.y; | |
1105 | |
1106 //.text:0046BF54 movsx eax, word ptr [esi-8] | |
1107 //.text:0046BF5A add eax, 100h | |
1108 //.text:0046BF63 mov ecx, eax | |
1109 v11 = this->vVelocity.x; | |
1110 | |
1111 //.text:0046BF5F fmul st, st(1) | |
1112 // stack: v10*v10, v10, v9, v7 | |
1113 //.text:0046BF61 fld st(2) | |
1114 // stack: v7, v10*v10, v10, v9, v7 | |
1115 | |
1116 | |
1117 //.text:0046BF65 fmul st, st(3) | |
1118 // stack: v7*v9, v10*v10, v10, v9, v7 | |
1119 | |
1120 //.text:0046BF67 imul ecx, eax | |
1121 v11 = v11 * v11; | |
1122 | |
1123 //.text:0046BF6A faddp st(1), st | |
1124 // stack: v10*v10+v7*v9, v10, v9, v7 | |
1125 //.text:0046BF6C fld st(3) | |
1126 // stack: v7, v10*v10+v7*v9, v10, v9, v7 | |
1127 //.text:0046BF6E fmul st, st(4) | |
1128 // stack: v7*v7, v10*v10+v7*v9, v10, v9, v7 | |
1129 //.text:0046BF70 faddp st(1), st | |
1130 // stack: v10*v10+v7*v9+v7*v7, v10, v9, v7 | |
1131 | |
1132 //.text:0046BF72 mov [ebp+var_8], ecx | |
1133 //.text:0046BF75 fild [ebp+var_8] | |
1134 // v11 pushed to stack | |
1135 | |
1136 //.text:0046BF78 fcompp | |
1137 // if ( v11 > v10*v10+v7*v9+v7*v7 ) | |
1138 // stack: v10, v9, v7 | |
1139 | |
1140 //.text:0046BF7A fstp st | |
1141 // stack: v9, v7 | |
1142 | |
1143 //.text:0046BF7C fnstsw ax | |
1144 //.text:0046BF7E fstp st | |
1145 // stack: v7 | |
1146 | |
1147 //.text:0046BF80 test ah, 41h | |
1148 //.text:0046BF83 fstp st | |
1149 //.text:0046BF85 jnz short loc_46BFDD | |
1150 | |
1151 if ( v11 >= v10*v10+v7*v9+v7*v7 ) | |
1152 { | |
1153 if ( stru_50C198.GetMagicalResistance(v2, 0xAu) ) | |
1154 { | |
1155 v2->pActorBuffs[v1->spell_id].Apply( | |
1156 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v1->spell_level << 7) * 0.033333335), | |
1157 v1->spell_skill, | |
1158 4u, | |
1159 0, | |
1160 0); | |
1161 HIWORD(v2->uAttributes) |= 8u; | |
1162 } | |
1163 } | |
1164 } | |
1165 ++v6; | |
1166 ++v2; | |
1167 } | |
1168 while ( v6 < (signed int)uNumActors ); | |
1169 } | |
1170 } |