author | Xeli |
Fri, 26 Aug 2011 18:20:18 +0200 | |
branch | hedgeroid |
changeset 5659 | 20eb5765a5d0 |
parent 5596 | 555c4fc1f3bd |
child 5690 | f6e0c5bd8020 |
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 |
4976 | 3 |
* Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com> |
802
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; |
5121
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
22 |
(* |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
23 |
* This unit defines the behavior and the appearance of visual gears. |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
24 |
* |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
25 |
* Visual gears are "things"/"objects" in the game that do not need to be |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
26 |
* perfectly synchronized over all clients since their effect is only |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
27 |
* of visual nature. |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
28 |
* |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
29 |
* E.g.: background flakes, visual effects: explosion, smoke trails, etc. |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
30 |
*) |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
31 |
interface |
4379
6cd6b77df8b8
No need for Extended data type just to draw some visual gears. It's a shame we have Math unit dependency
unC0Rr
parents:
4378
diff
changeset
|
32 |
uses uConsts, uFloat, GLunit, uTypes; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
33 |
|
3038 | 34 |
procedure initModule; |
35 |
procedure freeModule; |
|
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
36 |
|
4420
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4390
diff
changeset
|
37 |
function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0; Critical: Boolean = false): PVisualGear; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
38 |
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
|
39 |
procedure KickFlakes(Radius, X, Y: LongInt); |
1045 | 40 |
procedure DrawVisualGears(Layer: LongWord); |
1041 | 41 |
procedure DeleteVisualGear(Gear: PVisualGear); |
4443
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
42 |
function VisualGearByUID(uid : Longword) : PVisualGear; |
803 | 43 |
procedure AddClouds; |
4792
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
44 |
procedure ChangeToSDClouds; |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
45 |
procedure AddFlakes; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
46 |
procedure ChangeToSDFlakes; |
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 |
implementation |
5570 | 50 |
uses uSound, uMobile, uVariables, uTextures, uRender, Math, uRenderUtils, uStore; |
4368 | 51 |
|
1047 | 52 |
const cExplFrameTicks = 110; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
53 |
|
5121
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
54 |
// For better maintainability the step handlers of visual gears are stored |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
55 |
// in a separate file. |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
56 |
{$INCLUDE "VGSHandlers.inc"} |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
57 |
|
1505 | 58 |
procedure AddDamageTag(X, Y, Damage, Color: LongWord); |
59 |
var s: shortstring; |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
60 |
Gear: PVisualGear; |
1505 | 61 |
begin |
62 |
if cAltDamage then |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
63 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
64 |
Gear:= AddVisualGear(X, Y, vgtSmallDamageTag); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
65 |
if Gear <> nil then |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
66 |
with Gear^ do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
67 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
68 |
str(Damage, s); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
69 |
Tex:= RenderStringTex(s, Color, fntSmall); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
70 |
end |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
71 |
end |
1505 | 72 |
end; |
73 |
||
74 |
||
803 | 75 |
// ================================================================== |
2042
905c554d62e6
Move Speech to visual gears. This checkin CRASHES on deletion of visual gear outside the doStep
nemo
parents:
2014
diff
changeset
|
76 |
|
803 | 77 |
// ================================================================== |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
78 |
const doStepHandlers: array[TVisualGearType] of TVGearStepProcedure = |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
79 |
( |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
80 |
@doStepFlake, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
81 |
@doStepCloud, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
82 |
@doStepExpl, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
83 |
@doStepExpl, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
84 |
@doStepFire, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
85 |
@doStepSmallDamage, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
86 |
@doStepTeamHealthSorter, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
87 |
@doStepSpeechBubble, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
88 |
@doStepBubble, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
89 |
@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
|
90 |
@doStepAmmo, |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
91 |
@doStepSmoke, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
92 |
@doStepSmoke, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
93 |
@doStepShell, |
2974 | 94 |
@doStepDust, |
2982 | 95 |
@doStepSplash, |
3032 | 96 |
@doStepDroplet, |
3080 | 97 |
@doStepSmokeRing, |
3115 | 98 |
@doStepBeeTrace, |
3145 | 99 |
@doStepEgg, |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
100 |
@doStepFeather, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
101 |
@doStepHealthTag, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
102 |
@doStepSmokeTrace, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
103 |
@doStepSmokeTrace, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
104 |
@doStepExplosion, |
3689 | 105 |
@doStepBigExplosion, |
3704 | 106 |
@doStepChunk, |
4279 | 107 |
@doStepNote, |
4327 | 108 |
@doStepLineTrail, |
4420
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4390
diff
changeset
|
109 |
@doStepBulletHit, |
5357
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5256
diff
changeset
|
110 |
@doStepCircle, |
5562 | 111 |
@doStepSmoothWindBar, |
112 |
@doStepStraightShot |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
113 |
); |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
114 |
|
4420
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4390
diff
changeset
|
115 |
function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0; Critical: Boolean = false): PVisualGear; |
4422 | 116 |
const VGCounter: Longword = 0; |
2695 | 117 |
var gear: PVisualGear; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
118 |
t: Longword; |
4379
6cd6b77df8b8
No need for Extended data type just to draw some visual gears. It's a shame we have Math unit dependency
unC0Rr
parents:
4378
diff
changeset
|
119 |
sp: real; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
120 |
begin |
5562 | 121 |
AddVisualGear:= nil; |
122 |
if ((GameType = gmtSave) or (fastUntilLag and (GameType = gmtNet))) and // we are scrolling now |
|
123 |
((Kind <> vgtCloud) and not Critical) then exit; |
|
1642 | 124 |
|
4809
9c7d5f802618
rearrange quality flags a little, disable snow rendering on rqLowRes
koda
parents:
4806
diff
changeset
|
125 |
if ((cReducedQuality and rqAntiBoom) <> 0) and |
4420
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4390
diff
changeset
|
126 |
not Critical and |
3447
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
127 |
not (Kind in |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
128 |
[vgtTeamHealthSorter, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
129 |
vgtSmallDamageTag, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
130 |
vgtSpeechBubble, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
131 |
vgtHealthTag, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
132 |
vgtExplosion, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
133 |
vgtSmokeTrace, |
3704 | 134 |
vgtEvilTrace, |
5357
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5256
diff
changeset
|
135 |
vgtNote, |
5562 | 136 |
vgtSmoothWindBar]) then exit; |
1812 | 137 |
|
4422 | 138 |
inc(VGCounter); |
2695 | 139 |
New(gear); |
140 |
FillChar(gear^, sizeof(TVisualGear), 0); |
|
4379
6cd6b77df8b8
No need for Extended data type just to draw some visual gears. It's a shame we have Math unit dependency
unC0Rr
parents:
4378
diff
changeset
|
141 |
gear^.X:= real(X); |
6cd6b77df8b8
No need for Extended data type just to draw some visual gears. It's a shame we have Math unit dependency
unC0Rr
parents:
4378
diff
changeset
|
142 |
gear^.Y:= real(Y); |
2695 | 143 |
gear^.Kind := Kind; |
144 |
gear^.doStep:= doStepHandlers[Kind]; |
|
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
145 |
gear^.State:= 0; |
3475 | 146 |
gear^.Tint:= $FFFFFFFF; |
4422 | 147 |
gear^.uid:= VGCounter; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
148 |
|
2695 | 149 |
with gear^ do |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
150 |
case Kind of |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
151 |
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
|
152 |
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
|
153 |
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
|
154 |
tdY:= 0; |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
155 |
if SuddenDeathDmg then |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
156 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
157 |
FrameTicks:= random(vobSDFrameTicks); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
158 |
Frame:= random(vobSDFramesCount); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
159 |
end |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
160 |
else |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
161 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
162 |
FrameTicks:= random(vobFrameTicks); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
163 |
Frame:= random(vobFramesCount); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
164 |
end; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
165 |
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
|
166 |
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
|
167 |
dy:= 0.000003506096 * random(7000); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
168 |
if random(2) = 0 then dx := -dx; |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
169 |
if SuddenDeathDmg then dAngle:= (random(2) * 2 - 1) * (1 + random) * vobSDVelocity / 1000 |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
170 |
else dAngle:= (random(2) * 2 - 1) * (1 + random) * vobVelocity / 1000 |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
171 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
172 |
vgtCloud: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
173 |
Frame:= random(4); |
3994
486da687d76a
fix/tweak let clouds reflect wind speed and direction again + stronger
sheepluva
parents:
3976
diff
changeset
|
174 |
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
|
175 |
timer:= random(4096); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
176 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
177 |
vgtExplPart, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
178 |
vgtExplPart2: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
179 |
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
|
180 |
sp:= 0.001 * (random(95) + 70); |
5151
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
181 |
dx:= hwFloat2Float(AngleSin(t)) * sp; |
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
182 |
dy:= hwFloat2Float(AngleCos(t)) * sp; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
183 |
if random(2) = 0 then dx := -dx; |
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
184 |
if random(2) = 0 then dy := -dy; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
185 |
Frame:= 7 - random(3); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
186 |
FrameTicks:= cExplFrameTicks |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
187 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
188 |
vgtFire: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
189 |
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
|
190 |
sp:= 0.001 * (random(85) + 95); |
5151
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
191 |
dx:= hwFloat2Float(AngleSin(t)) * sp; |
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
192 |
dy:= hwFloat2Float(AngleCos(t)) * sp; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
193 |
if random(2) = 0 then dx := -dx; |
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
194 |
if random(2) = 0 then dy := -dy; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
195 |
FrameTicks:= 650 + random(250); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
196 |
Frame:= random(8) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
197 |
end; |
3115 | 198 |
vgtEgg: begin |
199 |
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
|
200 |
sp:= 0.001 * (random(85) + 95); |
5151
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
201 |
dx:= hwFloat2Float(AngleSin(t)) * sp; |
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
202 |
dy:= hwFloat2Float(AngleCos(t)) * sp; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
203 |
if random(2) = 0 then dx := -dx; |
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
204 |
if random(2) = 0 then dy := -dy; |
3115 | 205 |
FrameTicks:= 650 + random(250); |
206 |
Frame:= 1 |
|
207 |
end; |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
208 |
vgtShell: FrameTicks:= 500; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
209 |
vgtSmallDamageTag: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
210 |
gear^.FrameTicks:= 1100 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
211 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
212 |
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
|
213 |
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
|
214 |
dy:= 0; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
215 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
216 |
FrameTicks:= 250 + random(1751); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
217 |
Frame:= random(5) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
218 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
219 |
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
|
220 |
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
|
221 |
dy:= 0.001 * (random(85) + 95); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
222 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
223 |
Frame:= 7 - random(3); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
224 |
FrameTicks:= cExplFrameTicks * 2; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
225 |
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
|
226 |
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
|
227 |
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
|
228 |
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
|
229 |
end; |
3697 | 230 |
vgtSmokeWhite, |
2713 | 231 |
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
|
232 |
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
|
233 |
dy:= 0.0002 * (random(45) + 10); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
234 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
235 |
Frame:= 7 - random(2); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
236 |
FrameTicks:= cExplFrameTicks * 2; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
237 |
end; |
2848 | 238 |
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
|
239 |
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
|
240 |
dy:= 0.001 * (random(40) + 20); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
241 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
242 |
Frame:= 7 - random(2); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
243 |
FrameTicks:= random(20) + 15; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
244 |
end; |
2974 | 245 |
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
|
246 |
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
|
247 |
dy:= 0; |
2974 | 248 |
FrameTicks:= 740; |
249 |
Frame:= 19; |
|
250 |
end; |
|
2982 | 251 |
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
|
252 |
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
|
253 |
dy:= -0.001 * (random(80) + 120); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
254 |
if random(2) = 0 then dx := -dx; |
2982 | 255 |
FrameTicks:= 250 + random(1751); |
256 |
Frame:= random(3) |
|
257 |
end; |
|
3080 | 258 |
vgtBeeTrace: begin |
259 |
FrameTicks:= 1000; |
|
260 |
Frame:= random(16); |
|
261 |
end; |
|
3032 | 262 |
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
|
263 |
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
|
264 |
dy:= 0; |
3032 | 265 |
FrameTicks:= 600; |
266 |
Timer:= 0; |
|
267 |
Frame:= 0; |
|
268 |
scale:= 0.6; |
|
269 |
alpha:= 1; |
|
270 |
angle:= random(360); |
|
271 |
end; |
|
3145 | 272 |
vgtFeather: begin |
273 |
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
|
274 |
sp:= 0.001 * (random(85) + 95); |
5151
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
275 |
dx:= hwFloat2Float(AngleSin(t)) * sp; |
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
276 |
dy:= hwFloat2Float(AngleCos(t)) * sp; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
277 |
if random(2) = 0 then dx := -dx; |
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
278 |
if random(2) = 0 then dy := -dy; |
3145 | 279 |
FrameTicks:= 650 + random(250); |
280 |
Frame:= 1 |
|
281 |
end; |
|
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
282 |
vgtHealthTag: begin |
5574 | 283 |
Frame:= 0; |
284 |
Timer:= 1500; |
|
5576 | 285 |
dY:= -0.08; |
5596 | 286 |
dX:= 0; |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
287 |
//gear^.Z:= 2002; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
288 |
end; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
289 |
vgtSmokeTrace, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
290 |
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
|
291 |
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
|
292 |
gear^.Y:= gear^.Y - 16; |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
293 |
gear^.State:= 8; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
294 |
//gear^.Z:= cSmokeZ |
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 |
vgtBigExplosion: begin |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
297 |
gear^.Angle:= random(360); |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
298 |
end; |
3689 | 299 |
vgtChunk: begin |
300 |
gear^.Frame:= random(4); |
|
301 |
t:= random(1024); |
|
302 |
sp:= 0.001 * (random(85) + 47); |
|
5151
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
303 |
dx:= hwFloat2Float(AngleSin(t)) * sp; |
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
304 |
dy:= hwFloat2Float(AngleCos(t)) * sp * -2; |
3689 | 305 |
if random(2) = 0 then dx := -dx; |
306 |
end; |
|
3704 | 307 |
vgtNote: begin |
308 |
dx:= 0.005 * (random(15) + 10); |
|
3706 | 309 |
dy:= -0.001 * (random(40) + 20); |
3704 | 310 |
if random(2) = 0 then dx := -dx; |
311 |
Frame:= random(4); |
|
312 |
FrameTicks:= random(2000) + 1500; |
|
313 |
end; |
|
4327 | 314 |
vgtBulletHit: begin |
315 |
dx:= 0; |
|
316 |
dy:= 0; |
|
317 |
FrameTicks:= 350; |
|
318 |
Frame:= 7; |
|
319 |
Angle := 0; |
|
320 |
end; |
|
5357
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5256
diff
changeset
|
321 |
vgtSmoothWindBar: Tag:= hwRound(cWindSpeed * 72 / cMaxWindSpeed); |
5562 | 322 |
vgtStraightShot: begin |
5564
4f42009237df
For mikade's sake, use old dx/dy/frametick as default, so health crosses move the same
nemo
parents:
5563
diff
changeset
|
323 |
dx:= 0.001 * random(45); |
4f42009237df
For mikade's sake, use old dx/dy/frametick as default, so health crosses move the same
nemo
parents:
5563
diff
changeset
|
324 |
dy:= 0.001 * (random(20) + 25); |
4f42009237df
For mikade's sake, use old dx/dy/frametick as default, so health crosses move the same
nemo
parents:
5563
diff
changeset
|
325 |
State:= ord(sprHealth); |
5562 | 326 |
if random(2) = 0 then dx := -dx; |
327 |
Frame:= 0; |
|
5564
4f42009237df
For mikade's sake, use old dx/dy/frametick as default, so health crosses move the same
nemo
parents:
5563
diff
changeset
|
328 |
FrameTicks:= random(750) + 1250; |
5563 | 329 |
State:= ord(sprSnowDust); |
5562 | 330 |
end; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
331 |
end; |
803 | 332 |
|
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
333 |
if State <> 0 then gear^.State:= State; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
334 |
|
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
335 |
case Gear^.Kind of |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
336 |
// 0: this layer is very distant in the background when stereo |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
337 |
vgtTeamHealthSorter, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
338 |
vgtSmoothWindBar, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
339 |
vgtFlake, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
340 |
vgtCloud: begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
341 |
if VisualGearsLayer0 <> nil then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
342 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
343 |
VisualGearsLayer0^.PrevGear:= gear; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
344 |
gear^.NextGear:= VisualGearsLayer0 |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
345 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
346 |
gear^.Layer:= 0; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
347 |
VisualGearsLayer0:= gear |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
348 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
349 |
// 1: this layer is on the land level (which is close but behind the screen plane) when stereo |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
350 |
vgtSmokeTrace, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
351 |
vgtEvilTrace, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
352 |
vgtLineTrail, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
353 |
vgtSmoke, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
354 |
vgtSmokeWhite, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
355 |
vgtDust, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
356 |
vgtFire, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
357 |
vgtSplash, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
358 |
vgtDroplet, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
359 |
vgtBubble: begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
360 |
if VisualGearsLayer1 <> nil then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
361 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
362 |
VisualGearsLayer1^.PrevGear:= gear; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
363 |
gear^.NextGear:= VisualGearsLayer1 |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
364 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
365 |
gear^.Layer:= 1; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
366 |
VisualGearsLayer1:= gear |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
367 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
368 |
// 3: this layer is on the screen plane (depth = 0) when stereo |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
369 |
vgtSpeechBubble, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
370 |
vgtSmallDamageTag, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
371 |
vgtHealthTag, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
372 |
vgtStraightShot, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
373 |
vgtChunk: begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
374 |
if VisualGearsLayer3 <> nil then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
375 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
376 |
VisualGearsLayer3^.PrevGear:= gear; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
377 |
gear^.NextGear:= VisualGearsLayer3 |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
378 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
379 |
gear^.Layer:= 3; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
380 |
VisualGearsLayer3:= gear |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
381 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
382 |
// 2: this layer is outside the screen when stereo |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
383 |
vgtExplosion, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
384 |
vgtBigExplosion, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
385 |
vgtExplPart, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
386 |
vgtExplPart2, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
387 |
vgtSteam, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
388 |
vgtAmmo, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
389 |
vgtShell, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
390 |
vgtFeather, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
391 |
vgtEgg, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
392 |
vgtBeeTrace, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
393 |
vgtSmokeRing, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
394 |
vgtNote, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
395 |
vgtBulletHit, |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
396 |
vgtCircle: begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
397 |
if VisualGearsLayer2 <> nil then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
398 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
399 |
VisualGearsLayer2^.PrevGear:= gear; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
400 |
gear^.NextGear:= VisualGearsLayer2 |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
401 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
402 |
gear^.Layer:= 2; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
403 |
VisualGearsLayer2:= gear |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
404 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
405 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
406 |
|
2695 | 407 |
AddVisualGear:= gear; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
408 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
409 |
|
1041 | 410 |
procedure DeleteVisualGear(Gear: PVisualGear); |
411 |
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
|
412 |
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
|
413 |
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
|
414 |
Gear^.Tex:= nil; |
1505 | 415 |
|
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
|
416 |
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
|
417 |
if Gear^.PrevGear <> nil then Gear^.PrevGear^.NextGear:= Gear^.NextGear |
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
418 |
else |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
419 |
case Gear^.Layer of |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
420 |
0: VisualGearsLayer0:= Gear^.NextGear; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
421 |
1: VisualGearsLayer1:= Gear^.NextGear; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
422 |
2: VisualGearsLayer2:= Gear^.NextGear; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
423 |
3: VisualGearsLayer3:= Gear^.NextGear; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
424 |
end; |
1041 | 425 |
|
4780
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
426 |
if lastVisualGearByUID = Gear then lastVisualGearByUID:= nil; |
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
427 |
|
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
|
428 |
Dispose(Gear); |
1041 | 429 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
430 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
431 |
procedure ProcessVisualGears(Steps: Longword); |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
432 |
var Gear, t: PVisualGear; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
433 |
begin |
803 | 434 |
if Steps = 0 then exit; |
435 |
||
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
436 |
t:= VisualGearsLayer0; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
437 |
while t <> nil do |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
438 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
439 |
Gear:= t; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
440 |
t:= Gear^.NextGear; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
441 |
Gear^.doStep(Gear, Steps) |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
442 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
443 |
t:= VisualGearsLayer1; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
444 |
while t <> nil do |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
445 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
446 |
Gear:= t; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
447 |
t:= Gear^.NextGear; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
448 |
Gear^.doStep(Gear, Steps) |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
449 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
450 |
t:= VisualGearsLayer2; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
451 |
while t <> nil do |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
452 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
453 |
Gear:= t; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
454 |
t:= Gear^.NextGear; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
455 |
Gear^.doStep(Gear, Steps) |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
456 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
457 |
t:= VisualGearsLayer3; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
458 |
while t <> nil do |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
459 |
begin |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
460 |
Gear:= t; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
461 |
t:= Gear^.NextGear; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
462 |
Gear^.doStep(Gear, Steps) |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
463 |
end |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
464 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
465 |
|
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
|
466 |
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
|
467 |
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
|
468 |
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
|
469 |
begin |
3641 | 470 |
if (vobCount = 0) or (vobCount > 200) then exit; |
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
471 |
t:= VisualGearsLayer0; |
2985
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
472 |
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
|
473 |
begin |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
474 |
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
|
475 |
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
|
476 |
begin |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
477 |
// Damage calc from doMakeExplosion |
4379
6cd6b77df8b8
No need for Extended data type just to draw some visual gears. It's a shame we have Math unit dependency
unC0Rr
parents:
4378
diff
changeset
|
478 |
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
|
479 |
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
|
480 |
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
|
481 |
Gear^.tdX:= 0.02 * dmg + 0.01; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
482 |
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
|
483 |
Gear^.tdY:= 0.02 * dmg + 0.01; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
484 |
if Gear^.Y - Y < 0 then Gear^.tdY := -Gear^.tdY; |
2986 | 485 |
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
|
486 |
end |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
487 |
end; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
488 |
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
|
489 |
end |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
490 |
end; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
491 |
|
1045 | 492 |
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
|
493 |
var Gear: PVisualGear; |
4475
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4465
diff
changeset
|
494 |
tinted: boolean; |
4545 | 495 |
tmp: real; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
496 |
begin |
1045 | 497 |
case Layer of |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
498 |
// this layer is very distant in the background when stereo |
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
499 |
0: begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
500 |
Gear:= VisualGearsLayer0; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
501 |
while Gear <> nil do |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
502 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
503 |
if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
504 |
case Gear^.Kind of |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
505 |
vgtFlake: if SuddenDeathDmg then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
506 |
if vobSDVelocity = 0 then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
507 |
DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
508 |
else |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
509 |
DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
510 |
else |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
511 |
if vobVelocity = 0 then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
512 |
DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
513 |
else |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
514 |
DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
515 |
vgtCloud: if SuddenDeathDmg then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
516 |
DrawSprite(sprSDCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
517 |
else |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
518 |
DrawSprite(sprCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
519 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
520 |
if Gear^.Tint <> $FFFFFFFF then Tint($FF,$FF,$FF,$FF); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
521 |
Gear:= Gear^.NextGear |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
522 |
end |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
523 |
end; |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
524 |
// this layer is on the land level (which is close but behind the screen plane) when stereo |
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
525 |
1: begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
526 |
Gear:= VisualGearsLayer1; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
527 |
while Gear <> nil do |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
528 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
529 |
//tinted:= false; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
530 |
if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
531 |
case Gear^.Kind of |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
532 |
vgtSmokeTrace: if Gear^.State < 8 then DrawSprite(sprSmokeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
533 |
vgtEvilTrace: if Gear^.State < 8 then DrawSprite(sprEvilTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
534 |
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)); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
535 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
536 |
if (cReducedQuality and rqAntiBoom) = 0 then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
537 |
case Gear^.Kind of |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
538 |
vgtSmoke: DrawSprite(sprSmoke, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
539 |
vgtSmokeWhite: DrawSprite(sprSmokeWhite, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
540 |
vgtDust: if Gear^.State = 1 then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
541 |
DrawSprite(sprSnowDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame) |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
542 |
else |
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
543 |
DrawSprite(sprDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
544 |
vgtFire: if (Gear^.State and gstTmpFlag) = 0 then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
545 |
DrawSprite(sprFlame, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy, (RealTicks shr 6 + Gear^.Frame) mod 8) |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
546 |
else |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
547 |
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); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
548 |
vgtSplash: if SuddenDeathDmg then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
549 |
DrawSprite(sprSDSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37)) |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
550 |
else |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
551 |
DrawSprite(sprSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37)); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
552 |
vgtDroplet: if SuddenDeathDmg then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
553 |
DrawSprite(sprSDDroplet, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame) |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
554 |
else |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
555 |
DrawSprite(sprDroplet, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
556 |
vgtBubble: DrawSprite(sprBubbles, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame);//(RealTicks div 64 + Gear^.Frame) mod 8); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
557 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
558 |
//if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
559 |
if (Gear^.Tint <> $FFFFFFFF) then Tint($FF,$FF,$FF,$FF); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
560 |
Gear:= Gear^.NextGear |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
561 |
end |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
562 |
end; |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
563 |
// this layer is on the screen plane (depth = 0) when stereo |
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
564 |
3: begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
565 |
Gear:= VisualGearsLayer3; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
566 |
while Gear <> nil do |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
567 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
568 |
tinted:= false; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
569 |
if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
570 |
case Gear^.Kind of |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
571 |
vgtSpeechBubble: begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
572 |
if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team <> CurrentTeam)) or (Gear^.State = 1)) then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
573 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
574 |
tinted:= true; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
575 |
Tint($FF, $FF, $FF, $66); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
576 |
DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex) |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
577 |
end |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
578 |
else if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team = CurrentTeam)) or (Gear^.State = 2)) then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
579 |
DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
580 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
581 |
vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
582 |
vgtHealthTag: if Gear^.Tex <> nil then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
583 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
584 |
if Gear^.Frame = 0 then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
585 |
DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex) |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
586 |
else |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
587 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
588 |
SetScale(cDefaultZoomLevel); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
589 |
if Gear^.Angle = 0 then DrawTexture(round(Gear^.X), round(Gear^.Y), Gear^.Tex) |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
590 |
else DrawTexture(round(Gear^.X), round(Gear^.Y), Gear^.Tex, Gear^.Angle); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
591 |
SetScale(zoom) |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
592 |
end |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
593 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
594 |
//if Ger^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
595 |
vgtStraightShot: DrawRotatedF(TSprite(Gear^.State), round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
596 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
597 |
if (cReducedQuality and rqAntiBoom) = 0 then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
598 |
case Gear^.Kind of |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
599 |
vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
600 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
601 |
if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
602 |
Gear:= Gear^.NextGear |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
603 |
end |
4818
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
604 |
end; |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
605 |
// this layer is outside the screen when stereo |
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
606 |
2: begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
607 |
Gear:= VisualGearsLayer2; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
608 |
while Gear <> nil do |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
609 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
610 |
tinted:= false; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
611 |
if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
612 |
case Gear^.Kind of |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
613 |
vgtExplosion: DrawSprite(sprExplosion50, round(Gear^.X) - 32 + WorldDx, round(Gear^.Y) - 32 + WorldDy, Gear^.State); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
614 |
vgtBigExplosion: begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
615 |
tinted:= true; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
616 |
Tint($FF, $FF, $FF, round($FF * (1 - power(Gear^.Timer / 250, 4)))); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
617 |
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); |
4818
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
618 |
end; |
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
619 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
620 |
if (cReducedQuality and rqAntiBoom) = 0 then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
621 |
case Gear^.Kind of |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
622 |
vgtExplPart: DrawSprite(sprExplPart, round(Gear^.X) + WorldDx - 16, round(Gear^.Y) + WorldDy - 16, 7 - Gear^.Frame); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
623 |
vgtExplPart2: DrawSprite(sprExplPart2, round(Gear^.X) + WorldDx - 16, round(Gear^.Y) + WorldDy - 16, 7 - Gear^.Frame); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
624 |
vgtSteam: DrawSprite(sprSmokeWhite, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
625 |
vgtAmmo: begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
626 |
tinted:= true; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
627 |
Tint($FF, $FF, $FF, round(Gear^.alpha * $FF)); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
628 |
DrawTextureF(ropeIconTex, Gear^.scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 32, 32); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
629 |
DrawTextureF(SpritesData[sprAMAmmos].Texture, Gear^.scale * 0.90, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame - 1, 1, 32, 32); |
3115 | 630 |
end; |
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
631 |
vgtShell: begin |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
632 |
if Gear^.FrameTicks < $FF then |
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
633 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
634 |
Tint($FF, $FF, $FF, Gear^.FrameTicks); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
635 |
tinted:= true |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
636 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
637 |
DrawRotatedF(sprShell, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
638 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
639 |
vgtFeather: begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
640 |
if Gear^.FrameTicks < 255 then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
641 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
642 |
Tint($FF, $FF, $FF, Gear^.FrameTicks); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
643 |
tinted:= true |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
644 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
645 |
DrawRotatedF(sprFeather, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
646 |
end; |
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
647 |
vgtEgg: begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
648 |
if Gear^.FrameTicks < $FF then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
649 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
650 |
Tint($FF, $FF, $FF, Gear^.FrameTicks); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
651 |
tinted:= true |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
652 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
653 |
DrawRotatedF(sprEgg, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
654 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
655 |
vgtBeeTrace: begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
656 |
if Gear^.FrameTicks < $FF then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
657 |
Tint($FF, $FF, $FF, Gear^.FrameTicks div 2) |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
658 |
else |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
659 |
Tint($FF, $FF, $FF, $80); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
660 |
tinted:= true; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
661 |
DrawRotatedF(sprBeeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, (RealTicks shr 4) mod cMaxAngle); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
662 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
663 |
vgtSmokeRing: begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
664 |
tinted:= true; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
665 |
Tint($FF, $FF, $FF, round(Gear^.alpha * $FF)); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
666 |
DrawRotatedTextureF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
667 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
668 |
vgtNote: DrawRotatedF(sprNote, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
669 |
vgtBulletHit: DrawRotatedF(sprBulletHit, round(Gear^.X) + WorldDx - 0, round(Gear^.Y) + WorldDy - 0, 7 - (Gear^.FrameTicks div 50), 1, Gear^.Angle); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
670 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
671 |
case Gear^.Kind of |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
672 |
vgtCircle: if gear^.Angle = 1 then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
673 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
674 |
tmp:= Gear^.State / 100; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
675 |
DrawTexture(round(Gear^.X-24*tmp) + WorldDx, round(Gear^.Y-24*tmp) + WorldDy, SpritesData[sprVampiric].Texture, tmp) |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
676 |
end |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
677 |
else DrawCircle(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State, Gear^.Timer); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
678 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
679 |
if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
680 |
Gear:= Gear^.NextGear |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
681 |
end |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
682 |
end |
4452 | 683 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
684 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
685 |
|
4443
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
686 |
function VisualGearByUID(uid : Longword) : PVisualGear; |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
687 |
var vg: PVisualGear; |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
688 |
begin |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
689 |
VisualGearByUID:= nil; |
4780
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
690 |
if uid = 0 then exit; |
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
691 |
if (lastVisualGearByUID <> nil) and (lastVisualGearByUID^.uid = uid) then |
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
692 |
begin |
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
693 |
VisualGearByUID:= lastVisualGearByUID; |
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
694 |
exit |
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
695 |
end; |
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
696 |
vg:= VisualGearsLayer0; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
697 |
while vg <> nil do |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
698 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
699 |
if vg^.uid = uid then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
700 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
701 |
lastVisualGearByUID:= vg; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
702 |
VisualGearByUID:= vg; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
703 |
exit |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
704 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
705 |
vg:= vg^.NextGear |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
706 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
707 |
vg:= VisualGearsLayer1; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
708 |
while vg <> nil do |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
709 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
710 |
if vg^.uid = uid then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
711 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
712 |
lastVisualGearByUID:= vg; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
713 |
VisualGearByUID:= vg; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
714 |
exit |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
715 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
716 |
vg:= vg^.NextGear |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
717 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
718 |
vg:= VisualGearsLayer2; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
719 |
while vg <> nil do |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
720 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
721 |
if vg^.uid = uid then |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
722 |
begin |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
723 |
lastVisualGearByUID:= vg; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
724 |
VisualGearByUID:= vg; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
725 |
exit |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
726 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
727 |
vg:= vg^.NextGear |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
728 |
end; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
729 |
vg:= VisualGearsLayer3; |
4443
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
730 |
while vg <> nil do |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
731 |
begin |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
732 |
if vg^.uid = uid then |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
733 |
begin |
4780
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
734 |
lastVisualGearByUID:= vg; |
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
735 |
VisualGearByUID:= vg; |
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
736 |
exit |
4443
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
737 |
end; |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
738 |
vg:= vg^.NextGear |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
739 |
end |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
740 |
end; |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
741 |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
742 |
procedure AddClouds; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
743 |
var i: LongInt; |
803 | 744 |
begin |
1132 | 745 |
for i:= 0 to cCloudsNumber - 1 do |
5179
8d64dcb566ea
Fix "Mixing signed expressions and longwords gives a 64bit result" warnings
unc0rr
parents:
5151
diff
changeset
|
746 |
AddVisualGear(cLeftScreenBorder + i * LongInt(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
|
747 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
748 |
|
4792
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
749 |
procedure ChangeToSDClouds; |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
750 |
var i: LongInt; |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
751 |
vg, tmp: PVisualGear; |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
752 |
begin |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
753 |
if cCloudsNumber = cSDCloudsNumber then exit; |
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
754 |
vg:= VisualGearsLayer0; |
4792
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
755 |
while vg <> nil do |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
756 |
if vg^.Kind = vgtCloud then |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
757 |
begin |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
758 |
tmp:= vg^.NextGear; |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
759 |
DeleteVisualGear(vg); |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
760 |
vg:= tmp |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
761 |
end |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
762 |
else vg:= vg^.NextGear; |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
763 |
for i:= 0 to cSDCloudsNumber - 1 do |
5179
8d64dcb566ea
Fix "Mixing signed expressions and longwords gives a 64bit result" warnings
unc0rr
parents:
5151
diff
changeset
|
764 |
AddVisualGear(cLeftScreenBorder + i * LongInt(cScreenSpace div (cSDCloudsNumber + 1)), LAND_HEIGHT-1184, vgtCloud) |
4792
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
765 |
end; |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
766 |
|
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
767 |
procedure AddFlakes; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
768 |
var i: LongInt; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
769 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
770 |
if (cReducedQuality and rqKillFlakes) <> 0 then exit; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
771 |
|
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
772 |
if ((GameFlags and gfBorder) <> 0) or ((Theme <> 'Snow') and (Theme <> 'Christmas')) then |
5014 | 773 |
for i:= 0 to Pred(vobCount * cScreenSpace div LAND_WIDTH) do |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
774 |
AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake) |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
775 |
else |
5014 | 776 |
for i:= 0 to Pred((vobCount * cScreenSpace div LAND_WIDTH) div 3) do |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
777 |
AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
778 |
end; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
779 |
|
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
780 |
procedure ChangeToSDFlakes; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
781 |
var i: LongInt; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
782 |
vg, tmp: PVisualGear; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
783 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
784 |
if (cReducedQuality and rqKillFlakes) <> 0 then exit; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
785 |
if vobCount = vobSDCount then exit; |
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
786 |
vg:= VisualGearsLayer0; |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
787 |
while vg <> nil do |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
788 |
if vg^.Kind = vgtFlake then |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
789 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
790 |
tmp:= vg^.NextGear; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
791 |
DeleteVisualGear(vg); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
792 |
vg:= tmp |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
793 |
end |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
794 |
else vg:= vg^.NextGear; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
795 |
if ((GameFlags and gfBorder) <> 0) or ((Theme <> 'Snow') and (Theme <> 'Christmas')) then |
5014 | 796 |
for i:= 0 to Pred(vobSDCount * cScreenSpace div LAND_WIDTH) do |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
797 |
AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake) |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
798 |
else |
5014 | 799 |
for i:= 0 to Pred((vobSDCount * cScreenSpace div LAND_WIDTH) div 3) do |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
800 |
AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
801 |
end; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
802 |
|
3038 | 803 |
procedure initModule; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
804 |
begin |
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
805 |
VisualGearsLayer0:= nil; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
806 |
VisualGearsLayer1:= nil; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
807 |
VisualGearsLayer2:= nil; |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
808 |
VisualGearsLayer3:= nil; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
809 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
810 |
|
3038 | 811 |
procedure freeModule; |
2715
0e4e0db79e2a
Free up some unfreed memory. Needed for Koda's iphone lib work
nemo
parents:
2713
diff
changeset
|
812 |
begin |
5585
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
813 |
while VisualGearsLayer0 <> nil do DeleteVisualGear(VisualGearsLayer0); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
814 |
while VisualGearsLayer1 <> nil do DeleteVisualGear(VisualGearsLayer1); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
815 |
while VisualGearsLayer2 <> nil do DeleteVisualGear(VisualGearsLayer2); |
c09f5b41644a
Break visual gears list up into 4, to avoid iterating over entire list to draw a single layer. Also fix error in tag zoom.
nemo
parents:
5583
diff
changeset
|
816 |
while VisualGearsLayer3 <> nil do DeleteVisualGear(VisualGearsLayer3); |
2715
0e4e0db79e2a
Free up some unfreed memory. Needed for Koda's iphone lib work
nemo
parents:
2713
diff
changeset
|
817 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
818 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
819 |
end. |