author | unc0rr |
Fri, 09 Jan 2009 17:56:53 +0000 (2009-01-09) | |
changeset 1627 | efcf6e976869 |
parent 1505 | 3a96e93572cb |
child 1642 | 177b440773de |
permissions | -rw-r--r-- |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
1 |
(* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
3 |
* Copyright (c) 2008 Andrey Korotaev <unC0Rr@gmail.com> |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
4 |
* |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License as published by |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
7 |
* the Free Software Foundation; version 2 of the License |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
8 |
* |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
13 |
* |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
17 |
*) |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
18 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
19 |
unit uVisualGears; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
20 |
interface |
805 | 21 |
uses SDLh, uConsts, uFloat, GL; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
22 |
{$INCLUDE options.inc} |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
23 |
const AllInactive: boolean = false; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
24 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
25 |
type PVisualGear = ^TVisualGear; |
1505 | 26 |
TVGearStepProcedure = procedure (Gear: PVisualGear; Steps: Longword); |
27 |
TVisualGear = record |
|
28 |
NextGear, PrevGear: PVisualGear; |
|
29 |
Frame, |
|
30 |
FrameTicks: Longword; |
|
31 |
X : hwFloat; |
|
32 |
Y : hwFloat; |
|
33 |
dX: hwFloat; |
|
34 |
dY: hwFloat; |
|
35 |
mdY: QWord; |
|
36 |
Angle, dAngle: real; |
|
37 |
Kind: TVisualGearType; |
|
38 |
doStep: TVGearStepProcedure; |
|
39 |
Tex: PTexture; |
|
40 |
end; |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
41 |
|
805 | 42 |
function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
43 |
procedure ProcessVisualGears(Steps: Longword); |
1045 | 44 |
procedure DrawVisualGears(Layer: LongWord); |
1041 | 45 |
procedure DeleteVisualGear(Gear: PVisualGear); |
803 | 46 |
procedure AddClouds; |
1505 | 47 |
procedure AddDamageTag(X, Y, Damage, Color: LongWord); |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
48 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
49 |
var VisualGearsList: PVisualGear = nil; |
1505 | 50 |
vobFrameTicks, vobFramesCount: Longword; |
51 |
vobVelocity, vobFallSpeed: LongInt; |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
52 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
53 |
implementation |
805 | 54 |
uses uWorld, uMisc, uStore; |
1047 | 55 |
const cExplFrameTicks = 110; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
56 |
|
1505 | 57 |
procedure AddDamageTag(X, Y, Damage, Color: LongWord); |
58 |
var s: shortstring; |
|
59 |
begin |
|
60 |
if cAltDamage then |
|
61 |
with AddVisualGear(X, Y, vgtSmallDamageTag)^ do |
|
62 |
begin |
|
63 |
str(Damage, s); |
|
64 |
Tex:= RenderStringTex(s, Color, fntSmall); |
|
65 |
end; |
|
66 |
end; |
|
67 |
||
68 |
||
803 | 69 |
// ================================================================== |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
70 |
procedure doStepFlake(Gear: PVisualGear; Steps: Longword); |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
71 |
begin |
805 | 72 |
with Gear^ do |
1505 | 73 |
begin |
74 |
inc(FrameTicks, Steps); |
|
75 |
if FrameTicks > vobFrameTicks then |
|
76 |
begin |
|
77 |
dec(FrameTicks, vobFrameTicks); |
|
78 |
inc(Frame); |
|
79 |
if Frame = vobFramesCount then Frame:= 0 |
|
80 |
end |
|
81 |
end; |
|
805 | 82 |
|
83 |
Gear^.X:= Gear^.X + (cWindSpeed * 200 + Gear^.dX) * Steps; |
|
808 | 84 |
Gear^.Y:= Gear^.Y + (Gear^.dY + cGravity * vobFallSpeed) * Steps; |
85 |
Gear^.Angle:= Gear^.Angle + Gear^.dAngle * Steps; |
|
805 | 86 |
|
87 |
if hwRound(Gear^.X) < -cScreenWidth - 64 then Gear^.X:= int2hwFloat(cScreenWidth + 2048) else |
|
88 |
if hwRound(Gear^.X) > cScreenWidth + 2048 then Gear^.X:= int2hwFloat(-cScreenWidth - 64); |
|
938 | 89 |
if hwRound(Gear^.Y) > 1100 then Gear^.Y:= Gear^.Y - int2hwFloat(1228) |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
90 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
91 |
|
803 | 92 |
procedure doStepCloud(Gear: PVisualGear; Steps: Longword); |
1079 | 93 |
var i: Longword; |
803 | 94 |
begin |
95 |
Gear^.X:= Gear^.X + (cWindSpeed * 200 + Gear^.dX) * Steps; |
|
805 | 96 |
|
1079 | 97 |
for i:= 0 to Steps - 1 do |
98 |
begin |
|
99 |
if hwRound(Gear^.Y) > -160 then |
|
100 |
Gear^.dY:= Gear^.dY - _1div50000 |
|
101 |
else |
|
102 |
Gear^.dY:= Gear^.dY + _1div50000; |
|
103 |
||
104 |
Gear^.Y:= Gear^.Y + Gear^.dY |
|
105 |
end; |
|
805 | 106 |
|
803 | 107 |
if hwRound(Gear^.X) < -cScreenWidth - 256 then Gear^.X:= int2hwFloat(cScreenWidth + 2048) else |
108 |
if hwRound(Gear^.X) > cScreenWidth + 2048 then Gear^.X:= int2hwFloat(-cScreenWidth - 256) |
|
109 |
end; |
|
110 |
||
1041 | 111 |
procedure doStepExpl(Gear: PVisualGear; Steps: Longword); |
112 |
begin |
|
1046 | 113 |
Gear^.X:= Gear^.X + Gear^.dX * Steps; |
1041 | 114 |
|
1046 | 115 |
Gear^.Y:= Gear^.Y + Gear^.dY * Steps; |
116 |
//Gear^.dY:= Gear^.dY + cGravity; |
|
1041 | 117 |
|
1045 | 118 |
if Gear^.FrameTicks <= Steps then |
119 |
if Gear^.Frame = 0 then DeleteVisualGear(Gear) |
|
120 |
else |
|
121 |
begin |
|
122 |
dec(Gear^.Frame); |
|
123 |
Gear^.FrameTicks:= cExplFrameTicks |
|
124 |
end |
|
125 |
else dec(Gear^.FrameTicks, Steps) |
|
1041 | 126 |
end; |
127 |
||
1046 | 128 |
procedure doStepFire(Gear: PVisualGear; Steps: Longword); |
129 |
begin |
|
130 |
Gear^.X:= Gear^.X + Gear^.dX * Steps; |
|
131 |
||
132 |
Gear^.Y:= Gear^.Y + Gear^.dY * Steps;// + cGravity * (Steps * Steps); |
|
133 |
Gear^.dY:= Gear^.dY + cGravity * Steps; |
|
134 |
||
135 |
if Gear^.FrameTicks <= Steps then |
|
136 |
DeleteVisualGear(Gear) |
|
137 |
else |
|
138 |
dec(Gear^.FrameTicks, Steps) |
|
139 |
end; |
|
140 |
||
1505 | 141 |
procedure doStepSmallDamage(Gear: PVisualGear; Steps: Longword); |
142 |
begin |
|
143 |
Gear^.Y:= Gear^.Y - _0_02 * Steps; |
|
144 |
||
145 |
if Gear^.FrameTicks <= Steps then |
|
146 |
DeleteVisualGear(Gear) |
|
147 |
else |
|
148 |
dec(Gear^.FrameTicks, Steps) |
|
149 |
end; |
|
150 |
||
803 | 151 |
// ================================================================== |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
152 |
const doStepHandlers: array[TVisualGearType] of TVGearStepProcedure = |
1505 | 153 |
( |
154 |
@doStepFlake, |
|
155 |
@doStepCloud, |
|
156 |
@doStepExpl, |
|
157 |
@doStepExpl, |
|
158 |
@doStepFire, |
|
159 |
@doStepSmallDamage |
|
160 |
); |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
161 |
|
805 | 162 |
function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
163 |
var Result: PVisualGear; |
1045 | 164 |
t: Longword; |
165 |
sp: hwFloat; |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
166 |
begin |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
167 |
New(Result); |
812
cbc392576990
Fix memory corrupt due to wrong parameter in sizeof()
unc0rr
parents:
808
diff
changeset
|
168 |
FillChar(Result^, sizeof(TVisualGear), 0); |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
169 |
Result^.X:= int2hwFloat(X); |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
170 |
Result^.Y:= int2hwFloat(Y); |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
171 |
Result^.Kind := Kind; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
172 |
Result^.doStep:= doStepHandlers[Kind]; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
173 |
|
1505 | 174 |
with Result^ do |
175 |
case Kind of |
|
176 |
vgtFlake: begin |
|
177 |
FrameTicks:= random(vobFrameTicks); |
|
178 |
Frame:= random(vobFramesCount); |
|
179 |
Angle:= random * 360; |
|
180 |
dx.isNegative:= random(2) = 0; |
|
181 |
dx.QWordValue:= random(100000000); |
|
182 |
dy.isNegative:= false; |
|
183 |
dy.QWordValue:= random(70000000); |
|
184 |
dAngle:= (random(2) * 2 - 1) * (1 + random) * vobVelocity / 1000 |
|
185 |
end; |
|
186 |
vgtCloud: begin |
|
187 |
Frame:= random(4); |
|
188 |
dx.isNegative:= random(2) = 0; |
|
189 |
dx.QWordValue:= random(214748364); |
|
190 |
dy.isNegative:= random(2) = 0; |
|
191 |
dy.QWordValue:= 21474836 + random(64424509); |
|
192 |
mdY:= dy.QWordValue |
|
193 |
end; |
|
194 |
vgtExplPart, |
|
195 |
vgtExplPart2: begin |
|
196 |
t:= random(1024); |
|
197 |
sp:= _0_001 * (random(95) + 70); |
|
198 |
dx:= AngleSin(t) * sp; |
|
199 |
dx.isNegative:= random(2) = 0; |
|
200 |
dy:= AngleCos(t) * sp; |
|
201 |
dy.isNegative:= random(2) = 0; |
|
202 |
Frame:= 7 - random(3); |
|
203 |
FrameTicks:= cExplFrameTicks |
|
204 |
end; |
|
205 |
vgtFire: begin |
|
206 |
t:= random(1024); |
|
207 |
sp:= _0_001 * (random(85) + 95); |
|
208 |
dx:= AngleSin(t) * sp; |
|
209 |
dx.isNegative:= random(2) = 0; |
|
210 |
dy:= AngleCos(t) * sp; |
|
211 |
dy.isNegative:= random(2) = 0; |
|
212 |
FrameTicks:= 650 + random(250); |
|
213 |
Frame:= random(8) |
|
214 |
end; |
|
215 |
vgtSmallDamageTag: begin |
|
216 |
Result^.FrameTicks:= 1100 |
|
217 |
end; |
|
218 |
end; |
|
803 | 219 |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
220 |
if VisualGearsList <> nil then |
1505 | 221 |
begin |
222 |
VisualGearsList^.PrevGear:= Result; |
|
223 |
Result^.NextGear:= VisualGearsList |
|
224 |
end; |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
225 |
VisualGearsList:= Result; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
226 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
227 |
AddVisualGear:= Result |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
228 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
229 |
|
1041 | 230 |
procedure DeleteVisualGear(Gear: PVisualGear); |
231 |
begin |
|
1505 | 232 |
if Gear^.Tex <> nil then |
233 |
FreeTexture(Gear^.Tex); |
|
234 |
||
1041 | 235 |
if Gear^.NextGear <> nil then Gear^.NextGear^.PrevGear:= Gear^.PrevGear; |
236 |
if Gear^.PrevGear <> nil then Gear^.PrevGear^.NextGear:= Gear^.NextGear |
|
237 |
else VisualGearsList:= Gear^.NextGear; |
|
238 |
||
239 |
Dispose(Gear) |
|
240 |
end; |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
241 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
242 |
procedure ProcessVisualGears(Steps: Longword); |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
243 |
var Gear, t: PVisualGear; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
244 |
begin |
803 | 245 |
if Steps = 0 then exit; |
246 |
||
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
247 |
t:= VisualGearsList; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
248 |
while t <> nil do |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
249 |
begin |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
250 |
Gear:= t; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
251 |
t:= Gear^.NextGear; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
252 |
Gear^.doStep(Gear, Steps) |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
253 |
end |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
254 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
255 |
|
1045 | 256 |
procedure DrawVisualGears(Layer: LongWord); |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
257 |
var Gear: PVisualGear; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
258 |
begin |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
259 |
Gear:= VisualGearsList; |
1045 | 260 |
case Layer of |
261 |
0: while Gear <> nil do |
|
262 |
begin |
|
263 |
case Gear^.Kind of |
|
264 |
vgtFlake: if vobVelocity = 0 then |
|
265 |
DrawSprite(sprFlake, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Frame) |
|
266 |
else |
|
267 |
DrawRotatedF(sprFlake, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
|
268 |
vgtCloud: DrawSprite(sprCloud, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Frame); |
|
269 |
end; |
|
270 |
Gear:= Gear^.NextGear |
|
271 |
end; |
|
272 |
1: while Gear <> nil do |
|
273 |
begin |
|
274 |
case Gear^.Kind of |
|
275 |
vgtExplPart: DrawSprite(sprExplPart, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 7 - Gear^.Frame); |
|
1047 | 276 |
vgtExplPart2: DrawSprite(sprExplPart2, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 7 - Gear^.Frame); |
1046 | 277 |
vgtFire: DrawSprite(sprFlame, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (RealTicks div 64 + Gear^.Frame) mod 8); |
1505 | 278 |
vgtSmallDamageTag: DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex); |
1045 | 279 |
end; |
280 |
Gear:= Gear^.NextGear |
|
281 |
end |
|
282 |
end |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
283 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
284 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
285 |
procedure AddClouds; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
286 |
var i: LongInt; |
803 | 287 |
begin |
1132 | 288 |
for i:= 0 to cCloudsNumber - 1 do |
289 |
AddVisualGear( - cScreenWidth + i * ((cScreenWidth * 2 + 2304) div (cCloudsNumber + 1)), -160, vgtCloud) |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
290 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
291 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
292 |
initialization |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
293 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
294 |
finalization |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
295 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
296 |
end. |