author | unC0Rr |
Wed, 17 Nov 2010 17:22:36 +0300 | |
changeset 4357 | a1fcfc341a52 |
parent 4327 | 224efdd648e1 |
child 4359 | 83ef50815535 |
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 |
|
2599 | 19 |
{$INCLUDE "options.inc"} |
2587
0dfa56a8513c
fix a segfault in the iphone simulator by moving options.inc at the beginning of the file
koda
parents:
2428
diff
changeset
|
20 |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
21 |
unit uVisualGears; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
22 |
interface |
4357
a1fcfc341a52
Introduce unit uTypes in order to remove some cyclic unit dependencies
unC0Rr
parents:
4327
diff
changeset
|
23 |
uses uConsts, uFloat, Math, GLunit, uTypes; |
802
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; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
26 |
TVGearStepProcedure = procedure (Gear: PVisualGear; Steps: Longword); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
27 |
TVisualGear = record |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
28 |
NextGear, PrevGear: PVisualGear; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
29 |
Frame, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
30 |
FrameTicks: Longword; |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
31 |
X : float; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
32 |
Y : float; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
33 |
dX: float; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
34 |
dY: float; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
35 |
tdX: float; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
36 |
tdY: float; |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
37 |
State : Longword; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
38 |
Timer: Longword; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
39 |
Angle, dAngle: real; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
40 |
Kind: TVisualGearType; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
41 |
doStep: TVGearStepProcedure; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
42 |
Tex: PTexture; |
2972
82828fd23dea
Patch by soreau (polished by me): show floating away ammo icon when you pick up a crate
unc0rr
parents:
2948
diff
changeset
|
43 |
alpha, scale: GLfloat; |
2042
905c554d62e6
Move Speech to visual gears. This checkin CRASHES on deletion of visual gear outside the doStep
nemo
parents:
2014
diff
changeset
|
44 |
Hedgehog: pointer; |
3475 | 45 |
Text: shortstring; |
46 |
Tint: Longword; |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
47 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
48 |
|
3038 | 49 |
procedure initModule; |
50 |
procedure freeModule; |
|
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
51 |
|
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
52 |
function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0): PVisualGear; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
53 |
procedure ProcessVisualGears(Steps: Longword); |
3083
8da8f2515221
Eliminate flake kick on themes with no flakes, more than 200 flakes (city) or explosions of 25 or smaller
nemo
parents:
3080
diff
changeset
|
54 |
procedure KickFlakes(Radius, X, Y: LongInt); |
1045 | 55 |
procedure DrawVisualGears(Layer: LongWord); |
1041 | 56 |
procedure DeleteVisualGear(Gear: PVisualGear); |
803 | 57 |
procedure AddClouds; |
1505 | 58 |
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
|
59 |
|
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
60 |
var VisualGearsList: PVisualGear; |
3083
8da8f2515221
Eliminate flake kick on themes with no flakes, more than 200 flakes (city) or explosions of 25 or smaller
nemo
parents:
3080
diff
changeset
|
61 |
vobFrameTicks, vobFramesCount, vobCount: Longword; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
62 |
vobVelocity, vobFallSpeed: LongInt; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
63 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
64 |
implementation |
4034
634a8c8682de
add some phone rumbling to big explosions, airbomb and sinegun
koda
parents:
3994
diff
changeset
|
65 |
uses uWorld, uMisc, uStore, uTeams, uSound, uMobile; |
1047 | 66 |
const cExplFrameTicks = 110; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
67 |
|
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
68 |
{$INCLUDE "VGSHandlers.inc"} |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
69 |
|
1505 | 70 |
procedure AddDamageTag(X, Y, Damage, Color: LongWord); |
71 |
var s: shortstring; |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
72 |
Gear: PVisualGear; |
1505 | 73 |
begin |
74 |
if cAltDamage then |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
75 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
76 |
Gear:= AddVisualGear(X, Y, vgtSmallDamageTag); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
77 |
if Gear <> nil then |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
78 |
with Gear^ do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
79 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
80 |
str(Damage, s); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
81 |
Tex:= RenderStringTex(s, Color, fntSmall); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
82 |
end |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
83 |
end |
1505 | 84 |
end; |
85 |
||
86 |
||
803 | 87 |
// ================================================================== |
2042
905c554d62e6
Move Speech to visual gears. This checkin CRASHES on deletion of visual gear outside the doStep
nemo
parents:
2014
diff
changeset
|
88 |
|
803 | 89 |
// ================================================================== |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
90 |
const doStepHandlers: array[TVisualGearType] of TVGearStepProcedure = |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
91 |
( |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
92 |
@doStepFlake, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
93 |
@doStepCloud, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
94 |
@doStepExpl, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
95 |
@doStepExpl, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
96 |
@doStepFire, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
97 |
@doStepSmallDamage, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
98 |
@doStepTeamHealthSorter, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
99 |
@doStepSpeechBubble, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
100 |
@doStepBubble, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
101 |
@doStepSteam, |
2972
82828fd23dea
Patch by soreau (polished by me): show floating away ammo icon when you pick up a crate
unc0rr
parents:
2948
diff
changeset
|
102 |
@doStepAmmo, |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
103 |
@doStepSmoke, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
104 |
@doStepSmoke, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
105 |
@doStepHealth, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
106 |
@doStepShell, |
2974 | 107 |
@doStepDust, |
2982 | 108 |
@doStepSplash, |
3032 | 109 |
@doStepDroplet, |
3080 | 110 |
@doStepSmokeRing, |
3115 | 111 |
@doStepBeeTrace, |
3145 | 112 |
@doStepEgg, |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
113 |
@doStepFeather, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
114 |
@doStepHealthTag, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
115 |
@doStepSmokeTrace, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
116 |
@doStepSmokeTrace, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
117 |
@doStepExplosion, |
3689 | 118 |
@doStepBigExplosion, |
3704 | 119 |
@doStepChunk, |
4279 | 120 |
@doStepNote, |
4327 | 121 |
@doStepLineTrail, |
122 |
@doStepBulletHit |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
123 |
); |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
124 |
|
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
125 |
function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0): PVisualGear; |
2695 | 126 |
var gear: PVisualGear; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
127 |
t: Longword; |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
128 |
sp: float; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
129 |
begin |
2671
7e0f88013fe8
smaller patches, one missing Sky-lowres, IMG_Init and Mix_Init (might require newer libraries), updates to SDL bindings, code cleanup, new compile flags
koda
parents:
2599
diff
changeset
|
130 |
if (GameType = gmtSave) or (fastUntilLag and (GameType = gmtNet)) then // we are scrolling now |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
131 |
if Kind <> vgtCloud then |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
132 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
133 |
AddVisualGear:= nil; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
134 |
exit |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
135 |
end; |
1642 | 136 |
|
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3593
diff
changeset
|
137 |
if ((cReducedQuality and rqFancyBoom) <> 0) and |
3447
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
138 |
not (Kind in |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
139 |
[vgtTeamHealthSorter, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
140 |
vgtSmallDamageTag, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
141 |
vgtSpeechBubble, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
142 |
vgtHealthTag, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
143 |
vgtExplosion, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
144 |
vgtSmokeTrace, |
3704 | 145 |
vgtEvilTrace, |
146 |
vgtNote]) then |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
147 |
begin |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3593
diff
changeset
|
148 |
AddVisualGear:= nil; |
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3593
diff
changeset
|
149 |
exit |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
150 |
end; |
1812 | 151 |
|
2695 | 152 |
New(gear); |
153 |
FillChar(gear^, sizeof(TVisualGear), 0); |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
154 |
gear^.X:= float(X); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
155 |
gear^.Y:= float(Y); |
2695 | 156 |
gear^.Kind := Kind; |
157 |
gear^.doStep:= doStepHandlers[Kind]; |
|
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
158 |
gear^.State:= 0; |
3475 | 159 |
gear^.Tint:= $FFFFFFFF; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
160 |
|
2695 | 161 |
with gear^ do |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
162 |
case Kind of |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
163 |
vgtFlake: begin |
2985
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
164 |
Timer:= 0; |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
165 |
tdX:= 0; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
166 |
tdY:= 0; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
167 |
FrameTicks:= random(vobFrameTicks); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
168 |
Frame:= random(vobFramesCount); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
169 |
Angle:= random * 360; |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
170 |
dx:= 0.0000038654705 * random(10000); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
171 |
dy:= 0.000003506096 * random(7000); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
172 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
173 |
dAngle:= (random(2) * 2 - 1) * (1 + random) * vobVelocity / 1000 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
174 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
175 |
vgtCloud: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
176 |
Frame:= random(4); |
3994
486da687d76a
fix/tweak let clouds reflect wind speed and direction again + stronger
sheepluva
parents:
3976
diff
changeset
|
177 |
dx:= 0.5 + 0.1 * random(5); // how much the cloud will be affected by wind |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
178 |
timer:= random(4096); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
179 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
180 |
vgtExplPart, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
181 |
vgtExplPart2: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
182 |
t:= random(1024); |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
183 |
sp:= 0.001 * (random(95) + 70); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
184 |
dx:= AngleSin(t).QWordValue/4294967296 * sp; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
185 |
dy:= AngleCos(t).QWordValue/4294967296 * sp; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
186 |
if random(2) = 0 then dx := -dx; |
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
187 |
if random(2) = 0 then dy := -dy; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
188 |
Frame:= 7 - random(3); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
189 |
FrameTicks:= cExplFrameTicks |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
190 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
191 |
vgtFire: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
192 |
t:= random(1024); |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
193 |
sp:= 0.001 * (random(85) + 95); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
194 |
dx:= AngleSin(t).QWordValue/4294967296 * sp; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
195 |
dy:= AngleCos(t).QWordValue/4294967296 * sp; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
196 |
if random(2) = 0 then dx := -dx; |
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
197 |
if random(2) = 0 then dy := -dy; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
198 |
FrameTicks:= 650 + random(250); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
199 |
Frame:= random(8) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
200 |
end; |
3115 | 201 |
vgtEgg: begin |
202 |
t:= random(1024); |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
203 |
sp:= 0.001 * (random(85) + 95); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
204 |
dx:= AngleSin(t).QWordValue/4294967296 * sp; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
205 |
dy:= AngleCos(t).QWordValue/4294967296 * sp; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
206 |
if random(2) = 0 then dx := -dx; |
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
207 |
if random(2) = 0 then dy := -dy; |
3115 | 208 |
FrameTicks:= 650 + random(250); |
209 |
Frame:= 1 |
|
210 |
end; |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
211 |
vgtShell: FrameTicks:= 500; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
212 |
vgtSmallDamageTag: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
213 |
gear^.FrameTicks:= 1100 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
214 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
215 |
vgtBubble: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
216 |
dx:= 0.0000038654705 * random(10000); |
3909
4ba25a3d15af
remove windspeed from bubbles, remove initial dY from bubbles, apply dY/dX to bubbles, correct offsets on flying saucer flame graphics, add bubbles when flying saucer thrusts underwater, make flying saucer sink more slowly underwater
nemo
parents:
3836
diff
changeset
|
217 |
dy:= 0; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
218 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
219 |
FrameTicks:= 250 + random(1751); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
220 |
Frame:= random(5) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
221 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
222 |
vgtSteam: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
223 |
dx:= 0.0000038654705 * random(10000); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
224 |
dy:= 0.001 * (random(85) + 95); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
225 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
226 |
Frame:= 7 - random(3); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
227 |
FrameTicks:= cExplFrameTicks * 2; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
228 |
end; |
2972
82828fd23dea
Patch by soreau (polished by me): show floating away ammo icon when you pick up a crate
unc0rr
parents:
2948
diff
changeset
|
229 |
vgtAmmo: begin |
82828fd23dea
Patch by soreau (polished by me): show floating away ammo icon when you pick up a crate
unc0rr
parents:
2948
diff
changeset
|
230 |
alpha:= 1.0; |
82828fd23dea
Patch by soreau (polished by me): show floating away ammo icon when you pick up a crate
unc0rr
parents:
2948
diff
changeset
|
231 |
scale:= 1.0 |
82828fd23dea
Patch by soreau (polished by me): show floating away ammo icon when you pick up a crate
unc0rr
parents:
2948
diff
changeset
|
232 |
end; |
3697 | 233 |
vgtSmokeWhite, |
2713 | 234 |
vgtSmoke: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
235 |
dx:= 0.0002 * (random(45) + 10); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
236 |
dy:= 0.0002 * (random(45) + 10); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
237 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
238 |
Frame:= 7 - random(2); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
239 |
FrameTicks:= cExplFrameTicks * 2; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
240 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
241 |
vgtHealth: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
242 |
dx:= 0.001 * random(45); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
243 |
dy:= 0.001 * (random(20) + 25); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
244 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
245 |
Frame:= 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
246 |
FrameTicks:= random(750) + 1250; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
247 |
end; |
2848 | 248 |
vgtDust: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
249 |
dx:= 0.005 * (random(15) + 10); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
250 |
dy:= 0.001 * (random(40) + 20); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
251 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
252 |
Frame:= 7 - random(2); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
253 |
FrameTicks:= random(20) + 15; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
254 |
end; |
2974 | 255 |
vgtSplash: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
256 |
dx:= 0; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
257 |
dy:= 0; |
2974 | 258 |
FrameTicks:= 740; |
259 |
Frame:= 19; |
|
260 |
end; |
|
2982 | 261 |
vgtDroplet: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
262 |
dx:= 0.001 * (random(75) + 15); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
263 |
dy:= -0.001 * (random(80) + 120); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
264 |
if random(2) = 0 then dx := -dx; |
2982 | 265 |
FrameTicks:= 250 + random(1751); |
266 |
Frame:= random(3) |
|
267 |
end; |
|
3080 | 268 |
vgtBeeTrace: begin |
269 |
FrameTicks:= 1000; |
|
270 |
Frame:= random(16); |
|
271 |
end; |
|
3032 | 272 |
vgtSmokeRing: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
273 |
dx:= 0; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
274 |
dy:= 0; |
3032 | 275 |
FrameTicks:= 600; |
276 |
Timer:= 0; |
|
277 |
Frame:= 0; |
|
278 |
scale:= 0.6; |
|
279 |
alpha:= 1; |
|
280 |
angle:= random(360); |
|
281 |
end; |
|
3145 | 282 |
vgtFeather: begin |
283 |
t:= random(1024); |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
284 |
sp:= 0.001 * (random(85) + 95); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
285 |
dx:= AngleSin(t).QWordValue/4294967296 * sp; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
286 |
dy:= AngleCos(t).QWordValue/4294967296 * sp; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
287 |
if random(2) = 0 then dx := -dx; |
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
288 |
if random(2) = 0 then dy := -dy; |
3145 | 289 |
FrameTicks:= 650 + random(250); |
290 |
Frame:= 1 |
|
291 |
end; |
|
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
292 |
vgtHealthTag: begin |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
293 |
gear^.Timer:= 1500; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
294 |
//gear^.Z:= 2002; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
295 |
end; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
296 |
vgtSmokeTrace, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
297 |
vgtEvilTrace: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
298 |
gear^.X:= gear^.X - 16; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
299 |
gear^.Y:= gear^.Y - 16; |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
300 |
gear^.State:= 8; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
301 |
//gear^.Z:= cSmokeZ |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
302 |
end; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
303 |
vgtBigExplosion: begin |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
304 |
gear^.Angle:= random(360); |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
305 |
end; |
3689 | 306 |
vgtChunk: begin |
307 |
gear^.Frame:= random(4); |
|
308 |
t:= random(1024); |
|
309 |
sp:= 0.001 * (random(85) + 47); |
|
310 |
dx:= AngleSin(t).QWordValue/4294967296 * sp; |
|
3706 | 311 |
dy:= AngleCos(t).QWordValue/4294967296 * sp * -2; |
3689 | 312 |
if random(2) = 0 then dx := -dx; |
313 |
end; |
|
3704 | 314 |
vgtNote: begin |
315 |
dx:= 0.005 * (random(15) + 10); |
|
3706 | 316 |
dy:= -0.001 * (random(40) + 20); |
3704 | 317 |
if random(2) = 0 then dx := -dx; |
318 |
Frame:= random(4); |
|
319 |
FrameTicks:= random(2000) + 1500; |
|
320 |
end; |
|
4327 | 321 |
vgtBulletHit: begin |
322 |
dx:= 0; |
|
323 |
dy:= 0; |
|
324 |
FrameTicks:= 350; |
|
325 |
Frame:= 7; |
|
326 |
Angle := 0; |
|
327 |
end; |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
328 |
end; |
803 | 329 |
|
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
330 |
if State <> 0 then gear^.State:= State; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
331 |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
332 |
if VisualGearsList <> nil then |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
333 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
334 |
VisualGearsList^.PrevGear:= gear; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
335 |
gear^.NextGear:= VisualGearsList |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
336 |
end; |
2695 | 337 |
VisualGearsList:= gear; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
338 |
|
2695 | 339 |
AddVisualGear:= gear; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
340 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
341 |
|
1041 | 342 |
procedure DeleteVisualGear(Gear: PVisualGear); |
343 |
begin |
|
3513
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3475
diff
changeset
|
344 |
if Gear^.Tex <> nil then |
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3475
diff
changeset
|
345 |
FreeTexture(Gear^.Tex); |
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3475
diff
changeset
|
346 |
Gear^.Tex:= nil; |
1505 | 347 |
|
3513
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3475
diff
changeset
|
348 |
if Gear^.NextGear <> nil then Gear^.NextGear^.PrevGear:= Gear^.PrevGear; |
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3475
diff
changeset
|
349 |
if Gear^.PrevGear <> nil then Gear^.PrevGear^.NextGear:= Gear^.NextGear |
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3475
diff
changeset
|
350 |
else VisualGearsList:= Gear^.NextGear; |
1041 | 351 |
|
3513
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3475
diff
changeset
|
352 |
Dispose(Gear); |
1041 | 353 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
354 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
355 |
procedure ProcessVisualGears(Steps: Longword); |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
356 |
var Gear, t: PVisualGear; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
357 |
begin |
803 | 358 |
if Steps = 0 then exit; |
359 |
||
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
360 |
t:= VisualGearsList; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
361 |
while t <> nil do |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
362 |
begin |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
363 |
Gear:= t; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
364 |
t:= Gear^.NextGear; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
365 |
Gear^.doStep(Gear, Steps) |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
366 |
end |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
367 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
368 |
|
3083
8da8f2515221
Eliminate flake kick on themes with no flakes, more than 200 flakes (city) or explosions of 25 or smaller
nemo
parents:
3080
diff
changeset
|
369 |
procedure KickFlakes(Radius, X, Y: LongInt); |
2985
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
370 |
var Gear, t: PVisualGear; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
371 |
dmg: LongInt; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
372 |
begin |
3641 | 373 |
if (vobCount = 0) or (vobCount > 200) then exit; |
2985
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
374 |
t:= VisualGearsList; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
375 |
while t <> nil do |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
376 |
begin |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
377 |
Gear:= t; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
378 |
if Gear^.Kind = vgtFlake then |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
379 |
begin |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
380 |
// Damage calc from doMakeExplosion |
4159
64e677349124
REmove stupid int64 conversions, provide real fixes to compiler hints
unc0rr
parents:
4034
diff
changeset
|
381 |
dmg:= min(101, Radius + cHHRadius div 2 - LongInt(abs(round(Gear^.X) - X) + abs(round(Gear^.Y) - Y)) div 5); |
2985
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
382 |
if dmg > 1 then |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
383 |
begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
384 |
Gear^.tdX:= 0.02 * dmg + 0.01; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
385 |
if Gear^.X - X < 0 then Gear^.tdX := -Gear^.tdX; |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
386 |
Gear^.tdY:= 0.02 * dmg + 0.01; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
387 |
if Gear^.Y - Y < 0 then Gear^.tdY := -Gear^.tdY; |
2986 | 388 |
Gear^.Timer:= 200 |
2985
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
389 |
end |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
390 |
end; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
391 |
t:= Gear^.NextGear |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
392 |
end |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
393 |
end; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
394 |
|
1045 | 395 |
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
|
396 |
var Gear: PVisualGear; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
397 |
begin |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
398 |
Gear:= VisualGearsList; |
1045 | 399 |
case Layer of |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
400 |
0: while Gear <> nil do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
401 |
begin |
3475 | 402 |
Tint(Gear^.Tint); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
403 |
case Gear^.Kind of |
3641 | 404 |
vgtFlake: if vobVelocity = 0 then |
405 |
DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
|
406 |
else |
|
407 |
DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
408 |
vgtCloud: DrawSprite(sprCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
409 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
410 |
Gear:= Gear^.NextGear |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
411 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
412 |
1: while Gear <> nil do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
413 |
begin |
3475 | 414 |
Tint(Gear^.Tint); |
3447
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
415 |
case Gear^.Kind of |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
416 |
vgtSmokeTrace: if Gear^.State < 8 then DrawSprite(sprSmokeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
417 |
vgtEvilTrace: if Gear^.State < 8 then DrawSprite(sprEvilTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State); |
4279 | 418 |
vgtLineTrail: DrawLine(Gear^.X, Gear^.Y, Gear^.dX, Gear^.dY, 1.0, $FF, min(Gear^.Timer, $C0), min(Gear^.Timer, $80), min(Gear^.Timer, $FF)); |
3447
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
419 |
end; |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3593
diff
changeset
|
420 |
if (cReducedQuality and rqFancyBoom) = 0 then |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
421 |
case Gear^.Kind of |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
422 |
vgtSmoke: DrawSprite(sprSmoke, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
423 |
vgtSmokeWhite: DrawSprite(sprSmokeWhite, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
424 |
vgtDust: DrawSprite(sprDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
3148 | 425 |
vgtFeather: begin |
3376 | 426 |
if Gear^.FrameTicks < 255 then |
427 |
Tint($FF, $FF, $FF, Gear^.FrameTicks); |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
428 |
DrawRotatedF(sprFeather, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
3148 | 429 |
end; |
3443
14d12df0d363
finishing the gtHealthTag -> vgtHealthTag, no segfaults and hogzombies no more, hopefully
sheepluva
parents:
3440
diff
changeset
|
430 |
end; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
431 |
Gear:= Gear^.NextGear |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
432 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
433 |
2: while Gear <> nil do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
434 |
begin |
3475 | 435 |
Tint(Gear^.Tint); |
3443
14d12df0d363
finishing the gtHealthTag -> vgtHealthTag, no segfaults and hogzombies no more, hopefully
sheepluva
parents:
3440
diff
changeset
|
436 |
case Gear^.Kind of |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
437 |
vgtExplosion: DrawSprite(sprExplosion50, round(Gear^.X) - 32 + WorldDx, round(Gear^.Y) - 32 + WorldDy, Gear^.State); |
3443
14d12df0d363
finishing the gtHealthTag -> vgtHealthTag, no segfaults and hogzombies no more, hopefully
sheepluva
parents:
3440
diff
changeset
|
438 |
vgtBigExplosion: begin |
14d12df0d363
finishing the gtHealthTag -> vgtHealthTag, no segfaults and hogzombies no more, hopefully
sheepluva
parents:
3440
diff
changeset
|
439 |
Tint($FF, $FF, $FF, floor($FF * (1 - power(Gear^.Timer / 250, 4)))); |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
440 |
DrawRotatedTextureF(SpritesData[sprBigExplosion].Texture, 0.85 * (-power(2, -10 * Int(Gear^.Timer)/250) + 1) + 0.4, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 385, 385, Gear^.Angle); |
3443
14d12df0d363
finishing the gtHealthTag -> vgtHealthTag, no segfaults and hogzombies no more, hopefully
sheepluva
parents:
3440
diff
changeset
|
441 |
end; |
14d12df0d363
finishing the gtHealthTag -> vgtHealthTag, no segfaults and hogzombies no more, hopefully
sheepluva
parents:
3440
diff
changeset
|
442 |
end; |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3593
diff
changeset
|
443 |
if (cReducedQuality and rqFancyBoom) = 0 then |
2047
805f7b62cff6
Allow speech bubble/small damage tags in "reduced quality"
nemo
parents:
2045
diff
changeset
|
444 |
case Gear^.Kind of |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
445 |
vgtExplPart: DrawSprite(sprExplPart, round(Gear^.X) + WorldDx - 16, round(Gear^.Y) + WorldDy - 16, 7 - Gear^.Frame); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
446 |
vgtExplPart2: DrawSprite(sprExplPart2, round(Gear^.X) + WorldDx - 16, round(Gear^.Y) + WorldDy - 16, 7 - Gear^.Frame); |
3751 | 447 |
vgtFire: if (Gear^.State and gstTmpFlag) = 0 then |
448 |
DrawSprite(sprFlame, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy, (RealTicks shr 6 + Gear^.Frame) mod 8) |
|
449 |
else |
|
450 |
DrawTextureF(SpritesData[sprFlame].Texture, Gear^.FrameTicks / 900, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, (RealTicks shr 7 + Gear^.Frame) mod 8, 1, 16, 16); |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
451 |
vgtBubble: DrawSprite(sprBubbles, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame);//(RealTicks div 64 + Gear^.Frame) mod 8); |
3754 | 452 |
vgtSteam: DrawSprite(sprSmokeWhite, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
2972
82828fd23dea
Patch by soreau (polished by me): show floating away ammo icon when you pick up a crate
unc0rr
parents:
2948
diff
changeset
|
453 |
vgtAmmo: begin |
3376 | 454 |
Tint($FF, $FF, $FF, floor(Gear^.alpha * $FF)); |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
455 |
DrawTextureF(ropeIconTex, Gear^.scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 32, 32); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
456 |
DrawTextureF(SpritesData[sprAMAmmos].Texture, Gear^.scale * 0.90, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame - 1, 1, 32, 32); |
2972
82828fd23dea
Patch by soreau (polished by me): show floating away ammo icon when you pick up a crate
unc0rr
parents:
2948
diff
changeset
|
457 |
end; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
458 |
vgtHealth: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
459 |
case Gear^.Frame div 10 of |
3376 | 460 |
0:Tint(0, $FF, 0, floor(Gear^.FrameTicks * $FF / 1000)); |
461 |
1:Tint($FF, 0, 0, floor(Gear^.FrameTicks * $FF / 1000)); |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
462 |
end; |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
463 |
DrawSprite(sprHealth, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, 0); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
464 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
465 |
vgtShell: begin |
3376 | 466 |
if Gear^.FrameTicks < $FF then |
467 |
Tint($FF, $FF, $FF, Gear^.FrameTicks); |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
468 |
DrawRotatedF(sprShell, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
469 |
end; |
3115 | 470 |
vgtEgg: begin |
3376 | 471 |
if Gear^.FrameTicks < $FF then |
472 |
Tint($FF, $FF, $FF, Gear^.FrameTicks); |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
473 |
DrawRotatedF(sprEgg, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
3115 | 474 |
end; |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
475 |
vgtSplash: DrawSprite(sprSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37)); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
476 |
vgtDroplet: DrawSprite(sprDroplet, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame); |
3080 | 477 |
vgtBeeTrace: begin |
3376 | 478 |
if Gear^.FrameTicks < $FF then |
479 |
Tint($FF, $FF, $FF, Gear^.FrameTicks div 2) |
|
3080 | 480 |
else |
3390 | 481 |
Tint($FF, $FF, $FF, $80); |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
482 |
DrawRotatedF(sprBeeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, (RealTicks shr 4) mod cMaxAngle); |
3080 | 483 |
end; |
3032 | 484 |
vgtSmokeRing: begin |
3376 | 485 |
Tint($FF, $FF, $FF, floor(Gear^.alpha * $FF)); |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
486 |
DrawRotatedTextureF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle); |
3032 | 487 |
end; |
3689 | 488 |
vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
3704 | 489 |
vgtNote: DrawRotatedF(sprNote, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
4327 | 490 |
vgtBulletHit: DrawRotatedF(sprBulletHit, round(Gear^.X) + WorldDx - 0, round(Gear^.Y) + WorldDy - 0, 7 - (Gear^.FrameTicks div 50), 1, Gear^.Angle); |
2047
805f7b62cff6
Allow speech bubble/small damage tags in "reduced quality"
nemo
parents:
2045
diff
changeset
|
491 |
end; |
805f7b62cff6
Allow speech bubble/small damage tags in "reduced quality"
nemo
parents:
2045
diff
changeset
|
492 |
case Gear^.Kind of |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
493 |
vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
494 |
vgtSpeechBubble: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
495 |
vgtHealthTag: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
2047
805f7b62cff6
Allow speech bubble/small damage tags in "reduced quality"
nemo
parents:
2045
diff
changeset
|
496 |
end; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
497 |
Gear:= Gear^.NextGear |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
498 |
end |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
499 |
end |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
500 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
501 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
502 |
procedure AddClouds; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
503 |
var i: LongInt; |
803 | 504 |
begin |
1132 | 505 |
for i:= 0 to cCloudsNumber - 1 do |
3764 | 506 |
AddVisualGear(cLeftScreenBorder + i * cScreenSpace div (cCloudsNumber + 1), LAND_HEIGHT-1184, vgtCloud) |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
507 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
508 |
|
3038 | 509 |
procedure initModule; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
510 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
511 |
VisualGearsList:= nil; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
512 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
513 |
|
3038 | 514 |
procedure freeModule; |
2715
0e4e0db79e2a
Free up some unfreed memory. Needed for Koda's iphone lib work
nemo
parents:
2713
diff
changeset
|
515 |
begin |
3615 | 516 |
while VisualGearsList <> nil do DeleteVisualGear(VisualGearsList); |
2715
0e4e0db79e2a
Free up some unfreed memory. Needed for Koda's iphone lib work
nemo
parents:
2713
diff
changeset
|
517 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
518 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
519 |
end. |