author | Michael Hartman <omh1280@gmail.com> |
Sun, 30 Dec 2012 09:23:30 -0500 | |
branch | webgl |
changeset 8334 | abb48dd39e26 |
parent 8330 | aaefa587e277 |
child 8444 | 75db7bb8dce8 |
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 |
6700 | 3 |
* Copyright (c) 2004-2012 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 |
5855
74c621e12baa
I do believe the only thing that was *ever* wrong with camera shake was someone decided to use getRandom on something that had always been a visual effect anyway. Pretty sure WorldDx is in fact safe to modify.
nemo
parents:
5832
diff
changeset
|
32 |
uses uConsts, uFloat, GLunit, uTypes, uWorld; |
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 |
|
6986
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
37 |
function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear; inline; |
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
38 |
function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord): PVisualGear; inline; |
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
39 |
function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord; Critical: Boolean): PVisualGear; |
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
40 |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
41 |
procedure ProcessVisualGears(Steps: Longword); |
1045 | 42 |
procedure DrawVisualGears(Layer: LongWord); |
1041 | 43 |
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
|
44 |
function VisualGearByUID(uid : Longword) : PVisualGear; |
6986
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
45 |
|
803 | 46 |
procedure AddClouds; |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
47 |
procedure AddFlakes; |
6986
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
48 |
procedure AddDamageTag(X, Y, Damage, Color: LongWord); |
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
49 |
|
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
50 |
procedure ChangeToSDClouds; |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
51 |
procedure ChangeToSDFlakes; |
6986
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
52 |
|
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
53 |
procedure KickFlakes(Radius, X, Y: LongInt); |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
54 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
55 |
implementation |
8204 | 56 |
uses uSound, uVariables, uTextures, uRender, Math, uRenderUtils, uStore, uUtils; |
4368 | 57 |
|
8330 | 58 |
const |
8145
6408c0ba4ba1
Move global variables to units that use them
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
7822
diff
changeset
|
59 |
cExplFrameTicks = 110; |
6408c0ba4ba1
Move global variables to units that use them
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
7822
diff
changeset
|
60 |
cSmokeZ = 499; |
7028 | 61 |
var VGCounter: LongWord; |
8145
6408c0ba4ba1
Move global variables to units that use them
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
7822
diff
changeset
|
62 |
VisualGearLayers: array[0..6] of PVisualGear; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
63 |
|
5121
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
64 |
// 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
|
65 |
// in a separate file. |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
66 |
{$INCLUDE "VGSHandlers.inc"} |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
67 |
|
1505 | 68 |
procedure AddDamageTag(X, Y, Damage, Color: LongWord); |
69 |
var s: shortstring; |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
70 |
Gear: PVisualGear; |
1505 | 71 |
begin |
72 |
if cAltDamage then |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
73 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
74 |
Gear:= AddVisualGear(X, Y, vgtSmallDamageTag); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
75 |
if Gear <> nil then |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
76 |
with Gear^ do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
77 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
78 |
str(Damage, s); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
79 |
Tex:= RenderStringTex(s, Color, fntSmall); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
80 |
end |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
81 |
end |
1505 | 82 |
end; |
83 |
||
84 |
||
803 | 85 |
// ================================================================== |
2042
905c554d62e6
Move Speech to visual gears. This checkin CRASHES on deletion of visual gear outside the doStep
nemo
parents:
2014
diff
changeset
|
86 |
|
803 | 87 |
// ================================================================== |
8026
4a4f21070479
merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents:
7822
diff
changeset
|
88 |
const vdoStepHandlers: array[TVisualGearType] of TVGearStepProcedure = |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
89 |
( |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
90 |
@doStepFlake, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
91 |
@doStepCloud, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
92 |
@doStepExpl, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
93 |
@doStepExpl, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
94 |
@doStepFire, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
95 |
@doStepSmallDamage, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
96 |
@doStepTeamHealthSorter, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
97 |
@doStepSpeechBubble, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
98 |
@doStepBubble, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
99 |
@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
|
100 |
@doStepAmmo, |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
101 |
@doStepSmoke, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
102 |
@doStepSmoke, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
103 |
@doStepShell, |
2974 | 104 |
@doStepDust, |
2982 | 105 |
@doStepSplash, |
3032 | 106 |
@doStepDroplet, |
3080 | 107 |
@doStepSmokeRing, |
3115 | 108 |
@doStepBeeTrace, |
3145 | 109 |
@doStepEgg, |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
110 |
@doStepFeather, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
111 |
@doStepHealthTag, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
112 |
@doStepSmokeTrace, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
113 |
@doStepSmokeTrace, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
114 |
@doStepExplosion, |
3689 | 115 |
@doStepBigExplosion, |
3704 | 116 |
@doStepChunk, |
4279 | 117 |
@doStepNote, |
4327 | 118 |
@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
|
119 |
@doStepBulletHit, |
5357
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5256
diff
changeset
|
120 |
@doStepCircle, |
5562 | 121 |
@doStepSmoothWindBar, |
122 |
@doStepStraightShot |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
123 |
); |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
124 |
|
6986
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
125 |
function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear; inline; |
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
126 |
begin |
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
127 |
AddVisualGear:= AddVisualGear(X, Y, Kind, 0, false); |
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
128 |
end; |
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
129 |
|
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
130 |
function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord): PVisualGear; inline; |
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
131 |
begin |
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
132 |
AddVisualGear:= AddVisualGear(X, Y, Kind, State, false); |
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
133 |
end; |
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
134 |
|
409dd3851309
add support for default pascal mode by removing default arguments value (maybe this also helps the parser)
koda
parents:
6982
diff
changeset
|
135 |
function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord; Critical: Boolean): PVisualGear; |
2695 | 136 |
var gear: PVisualGear; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
137 |
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
|
138 |
sp: real; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
139 |
begin |
5562 | 140 |
AddVisualGear:= nil; |
7180 | 141 |
if ((GameType = gmtSave) or (fastUntilLag and (GameType = gmtNet)) or fastScrolling) and // we are scrolling now |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
142 |
((Kind <> vgtCloud) and (not Critical)) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
143 |
exit; |
1642 | 144 |
|
4809
9c7d5f802618
rearrange quality flags a little, disable snow rendering on rqLowRes
koda
parents:
4806
diff
changeset
|
145 |
if ((cReducedQuality and rqAntiBoom) <> 0) and |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6380
diff
changeset
|
146 |
(not Critical) and |
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6380
diff
changeset
|
147 |
(not (Kind in |
3447
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
148 |
[vgtTeamHealthSorter, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
149 |
vgtSmallDamageTag, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
150 |
vgtSpeechBubble, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
151 |
vgtHealthTag, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
152 |
vgtExplosion, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
153 |
vgtSmokeTrace, |
3704 | 154 |
vgtEvilTrace, |
5357
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5256
diff
changeset
|
155 |
vgtNote, |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
156 |
vgtSmoothWindBar])) then |
8330 | 157 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
158 |
exit; |
1812 | 159 |
|
4422 | 160 |
inc(VGCounter); |
2695 | 161 |
New(gear); |
162 |
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
|
163 |
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
|
164 |
gear^.Y:= real(Y); |
2695 | 165 |
gear^.Kind := Kind; |
8026
4a4f21070479
merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents:
7822
diff
changeset
|
166 |
gear^.doStep:= vdoStepHandlers[Kind]; |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
167 |
gear^.State:= 0; |
3475 | 168 |
gear^.Tint:= $FFFFFFFF; |
4422 | 169 |
gear^.uid:= VGCounter; |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
170 |
gear^.Layer:= 0; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
171 |
|
2695 | 172 |
with gear^ do |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
173 |
case Kind of |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
174 |
vgtFlake: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
175 |
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
|
176 |
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
|
177 |
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
|
178 |
tdY:= 0; |
6553
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
179 |
Scale:= 1.0; |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
180 |
if SuddenDeathDmg then |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
181 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
182 |
FrameTicks:= random(vobSDFrameTicks); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
183 |
Frame:= random(vobSDFramesCount); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
184 |
end |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
185 |
else |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
186 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
187 |
FrameTicks:= random(vobFrameTicks); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
188 |
Frame:= random(vobFramesCount); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
189 |
end; |
7151 | 190 |
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
|
191 |
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
|
192 |
dy:= 0.000003506096 * random(7000); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
193 |
if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
194 |
dx := -dx; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
195 |
if SuddenDeathDmg then |
7151 | 196 |
dAngle:= (random(2) * 2 - 1) * (vobSDVelocity + random(vobSDVelocity)) / 1000 |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
197 |
else |
7151 | 198 |
dAngle:= (random(2) * 2 - 1) * (vobVelocity + random(vobVelocity)) / 1000 |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
199 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
200 |
vgtCloud: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
201 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
202 |
Frame:= random(4); |
3994
486da687d76a
fix/tweak let clouds reflect wind speed and direction again + stronger
sheepluva
parents:
3976
diff
changeset
|
203 |
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
|
204 |
timer:= random(4096); |
6553
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
205 |
Scale:= 1.0 |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
206 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
207 |
vgtExplPart, |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
208 |
vgtExplPart2: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
209 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
210 |
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
|
211 |
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
|
212 |
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
|
213 |
dy:= hwFloat2Float(AngleCos(t)) * sp; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
214 |
if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
215 |
dx := -dx; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
216 |
if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
217 |
dy := -dy; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
218 |
Frame:= 7 - random(3); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
219 |
FrameTicks:= cExplFrameTicks |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
220 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
221 |
vgtFire: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
222 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
223 |
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
|
224 |
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
|
225 |
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
|
226 |
dy:= hwFloat2Float(AngleCos(t)) * sp; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
227 |
if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
228 |
dx := -dx; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
229 |
if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
230 |
dy := -dy; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
231 |
FrameTicks:= 650 + random(250); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
232 |
Frame:= random(8) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
233 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
234 |
vgtEgg: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
235 |
begin |
3115 | 236 |
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
|
237 |
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
|
238 |
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
|
239 |
dy:= hwFloat2Float(AngleCos(t)) * sp; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
240 |
if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
241 |
dx := -dx; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
242 |
if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
243 |
dy := -dy; |
3115 | 244 |
FrameTicks:= 650 + random(250); |
245 |
Frame:= 1 |
|
246 |
end; |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
247 |
vgtShell: FrameTicks:= 500; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
248 |
vgtSmallDamageTag: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
249 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
250 |
gear^.FrameTicks:= 1100 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
251 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
252 |
vgtBubble: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
253 |
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
|
254 |
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
|
255 |
dy:= 0; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
256 |
if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
257 |
dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
258 |
FrameTicks:= 250 + random(1751); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
259 |
Frame:= random(5) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
260 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
261 |
vgtSteam: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
262 |
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.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
|
264 |
dy:= 0.001 * (random(85) + 95); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
265 |
if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
266 |
dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
267 |
Frame:= 7 - random(3); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
268 |
FrameTicks:= cExplFrameTicks * 2; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
269 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
270 |
vgtAmmo: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
271 |
begin |
2972
82828fd23dea
Patch by soreau (polished by me): show floating away ammo icon when you pick up a crate
unc0rr
parents:
2948
diff
changeset
|
272 |
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
|
273 |
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
|
274 |
end; |
3697 | 275 |
vgtSmokeWhite, |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
276 |
vgtSmoke: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
277 |
begin |
5690
f6e0c5bd8020
Allow vgtSmoke to scale. Scale it down 50% for mines, so smoke doesn't seem so oversized
nemo
parents:
5596
diff
changeset
|
278 |
Scale:= 1.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
|
279 |
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
|
280 |
dy:= 0.0002 * (random(45) + 10); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
281 |
if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
282 |
dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
283 |
Frame:= 7 - random(2); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
284 |
FrameTicks:= cExplFrameTicks * 2; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
285 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
286 |
vgtDust: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
287 |
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
|
288 |
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
|
289 |
dy:= 0.001 * (random(40) + 20); |
7597
1ef520fea21c
make cheating a bit easier (mikade insisted). Also, try flipping dust for a bit more variety.
nemo
parents:
7543
diff
changeset
|
290 |
if random(2) = 0 then dx := -dx; |
1ef520fea21c
make cheating a bit easier (mikade insisted). Also, try flipping dust for a bit more variety.
nemo
parents:
7543
diff
changeset
|
291 |
if random(2) = 0 then Tag:= 1 |
1ef520fea21c
make cheating a bit easier (mikade insisted). Also, try flipping dust for a bit more variety.
nemo
parents:
7543
diff
changeset
|
292 |
else Tag:= -1; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
293 |
Frame:= 7 - random(2); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
294 |
FrameTicks:= random(20) + 15; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
295 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
296 |
vgtSplash: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
297 |
begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
298 |
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
|
299 |
dy:= 0; |
2974 | 300 |
FrameTicks:= 740; |
301 |
Frame:= 19; |
|
7420 | 302 |
Scale:= 0.75; |
303 |
Timer:= 1; |
|
2974 | 304 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
305 |
vgtDroplet: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
306 |
begin |
7372
fcc002658832
Spread the droplets around more so it looks less square (looked especially bad with piano). Slow down large splashes a bit for dramatic purposes, also taking low-g into account. Small splashes you can't really tell anyway.
nemo
parents:
7276
diff
changeset
|
307 |
dx:= 0.001 * (random(180) - 90); |
fcc002658832
Spread the droplets around more so it looks less square (looked especially bad with piano). Slow down large splashes a bit for dramatic purposes, also taking low-g into account. Small splashes you can't really tell anyway.
nemo
parents:
7276
diff
changeset
|
308 |
dy:= -0.001 * (random(160) + 40); |
2982 | 309 |
FrameTicks:= 250 + random(1751); |
310 |
Frame:= random(3) |
|
311 |
end; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
312 |
vgtBeeTrace: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
313 |
begin |
3080 | 314 |
FrameTicks:= 1000; |
315 |
Frame:= random(16); |
|
316 |
end; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
317 |
vgtSmokeRing: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
318 |
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
|
319 |
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
|
320 |
dy:= 0; |
3032 | 321 |
FrameTicks:= 600; |
322 |
Timer:= 0; |
|
323 |
Frame:= 0; |
|
324 |
scale:= 0.6; |
|
325 |
alpha:= 1; |
|
326 |
angle:= random(360); |
|
327 |
end; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
328 |
vgtFeather: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
329 |
begin |
3145 | 330 |
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
|
331 |
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
|
332 |
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
|
333 |
dy:= hwFloat2Float(AngleCos(t)) * sp; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
334 |
if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
335 |
dx := -dx; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
336 |
if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
337 |
dy := -dy; |
3145 | 338 |
FrameTicks:= 650 + random(250); |
339 |
Frame:= 1 |
|
340 |
end; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
341 |
vgtHealthTag: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
342 |
begin |
5574 | 343 |
Frame:= 0; |
344 |
Timer:= 1500; |
|
5576 | 345 |
dY:= -0.08; |
5596 | 346 |
dX:= 0; |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
347 |
//gear^.Z:= 2002; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
348 |
end; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
349 |
vgtSmokeTrace, |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
350 |
vgtEvilTrace: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
351 |
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
|
352 |
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
|
353 |
gear^.Y:= gear^.Y - 16; |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
354 |
gear^.State:= 8; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
355 |
//gear^.Z:= cSmokeZ |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
356 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
357 |
vgtBigExplosion: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
358 |
begin |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
359 |
gear^.Angle:= random(360); |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
360 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
361 |
vgtChunk: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
362 |
begin |
3689 | 363 |
gear^.Frame:= random(4); |
364 |
t:= random(1024); |
|
365 |
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
|
366 |
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
|
367 |
dy:= hwFloat2Float(AngleCos(t)) * sp * -2; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
368 |
if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
369 |
dx := -dx; |
3689 | 370 |
end; |
8330 | 371 |
vgtNote: |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
372 |
begin |
3704 | 373 |
dx:= 0.005 * (random(15) + 10); |
3706 | 374 |
dy:= -0.001 * (random(40) + 20); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
375 |
if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
376 |
dx := -dx; |
3704 | 377 |
Frame:= random(4); |
378 |
FrameTicks:= random(2000) + 1500; |
|
379 |
end; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
380 |
vgtBulletHit: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
381 |
begin |
4327 | 382 |
dx:= 0; |
383 |
dy:= 0; |
|
384 |
FrameTicks:= 350; |
|
385 |
Frame:= 7; |
|
5748
70d7f8e40f53
Just for fun. Flowers! Also, use a less blatant image in ammo menu.
nemo
parents:
5690
diff
changeset
|
386 |
Angle:= 0; |
4327 | 387 |
end; |
8330 | 388 |
vgtSmoothWindBar: |
6913 | 389 |
begin |
390 |
Angle:= hwFloat2Float(cMaxWindSpeed)*2 / 1440; // seems rate below is supposed to change wind bar at 1px per 10ms. Max time, 1440ms. This tries to match the rate of change |
|
391 |
Tag:= hwRound(cWindSpeed * 72 / cMaxWindSpeed); |
|
392 |
end; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
393 |
vgtStraightShot: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
394 |
begin |
5924
82fc26c53d2a
Tweak sparkles, glass. Left glass commented out in case he prefers old behaviour.
nemo
parents:
5874
diff
changeset
|
395 |
Angle:= 0; |
5748
70d7f8e40f53
Just for fun. Flowers! Also, use a less blatant image in ammo menu.
nemo
parents:
5690
diff
changeset
|
396 |
Scale:= 1.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
|
397 |
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
|
398 |
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
|
399 |
State:= ord(sprHealth); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
400 |
if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
401 |
dx := -dx; |
5562 | 402 |
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
|
403 |
FrameTicks:= random(750) + 1250; |
5563 | 404 |
State:= ord(sprSnowDust); |
5562 | 405 |
end; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
406 |
end; |
803 | 407 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
408 |
if State <> 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
409 |
gear^.State:= State; |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
410 |
|
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
|
411 |
case Gear^.Kind of |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
412 |
vgtFlake: if cFlattenFlakes then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
413 |
gear^.Layer:= 0 |
8330 | 414 |
else if random(3) = 0 then |
6553
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
415 |
begin |
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
416 |
gear^.Scale:= 0.5; |
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
417 |
gear^.Layer:= 0 // 33% - far back |
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
418 |
end |
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
419 |
else if random(3) = 0 then |
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
420 |
begin |
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
421 |
gear^.Scale:= 0.8; |
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
422 |
gear^.Layer:= 4 // 22% - mid-distance |
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
423 |
end |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
424 |
else if random(3) <> 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
425 |
gear^.Layer:= 5 // 30% - just behind land |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
426 |
else if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
427 |
gear^.Layer:= 6 // 7% - just in front of land |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
428 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
429 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
430 |
gear^.Scale:= 1.5; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
431 |
gear^.Layer:= 2; // 7% - close up |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
432 |
end; |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
433 |
|
6302
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
434 |
vgtCloud: if cFlattenClouds then gear^.Layer:= 5 |
6553
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
435 |
else if random(3) = 0 then |
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
436 |
begin |
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
437 |
gear^.Scale:= 0.25; |
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
438 |
gear^.Layer:= 0 |
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
439 |
end |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
440 |
else if random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
441 |
gear^.Layer:= 5 |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
442 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
443 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
444 |
gear^.Scale:= 0.4; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
445 |
gear^.Layer:= 4 |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
446 |
end; |
6302
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
447 |
|
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
448 |
// 0: this layer is very distant in the background when in 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
|
449 |
vgtTeamHealthSorter, |
6302
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
450 |
vgtSmoothWindBar: gear^.Layer:= 0; |
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
451 |
|
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
452 |
|
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
|
453 |
// 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
|
454 |
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
|
455 |
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
|
456 |
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
|
457 |
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
|
458 |
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
|
459 |
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
|
460 |
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
|
461 |
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
|
462 |
vgtDroplet, |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
463 |
vgtBubble: gear^.Layer:= 1; |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
464 |
|
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
|
465 |
// 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
|
466 |
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
|
467 |
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
|
468 |
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
|
469 |
vgtStraightShot, |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
470 |
vgtChunk: gear^.Layer:= 3; |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
471 |
|
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
|
472 |
// 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
|
473 |
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
|
474 |
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
|
475 |
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
|
476 |
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
|
477 |
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
|
478 |
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
|
479 |
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
|
480 |
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
|
481 |
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
|
482 |
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
|
483 |
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
|
484 |
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
|
485 |
vgtBulletHit, |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
486 |
vgtCircle: gear^.Layer:= 2 |
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
|
487 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
488 |
|
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
489 |
if VisualGearLayers[gear^.Layer] <> nil then |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
490 |
begin |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
491 |
VisualGearLayers[gear^.Layer]^.PrevGear:= gear; |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
492 |
gear^.NextGear:= VisualGearLayers[gear^.Layer] |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
493 |
end; |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
494 |
VisualGearLayers[gear^.Layer]:= gear; |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
495 |
|
2695 | 496 |
AddVisualGear:= gear; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
497 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
498 |
|
1041 | 499 |
procedure DeleteVisualGear(Gear: PVisualGear); |
500 |
begin |
|
6380
1ff5ad1d771b
Remove a bunch of unnecessary nil checks. FreeTexture does its own nil check.
nemo
parents:
6323
diff
changeset
|
501 |
FreeTexture(Gear^.Tex); |
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
|
502 |
Gear^.Tex:= nil; |
1505 | 503 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
504 |
if Gear^.NextGear <> nil then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
505 |
Gear^.NextGear^.PrevGear:= Gear^.PrevGear; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
506 |
if Gear^.PrevGear <> nil then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
507 |
Gear^.PrevGear^.NextGear:= Gear^.NextGear |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
508 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
509 |
VisualGearLayers[Gear^.Layer]:= Gear^.NextGear; |
1041 | 510 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
511 |
if lastVisualGearByUID = Gear then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
512 |
lastVisualGearByUID:= 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
|
513 |
|
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
|
514 |
Dispose(Gear); |
1041 | 515 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
516 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
517 |
procedure ProcessVisualGears(Steps: Longword); |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
518 |
var Gear, t: PVisualGear; |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
519 |
i: LongWord; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
520 |
begin |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
521 |
if Steps = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
522 |
exit; |
803 | 523 |
|
6302
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
524 |
for i:= 0 to 6 do |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
525 |
begin |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
526 |
t:= VisualGearLayers[i]; |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
527 |
while t <> nil do |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
528 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
529 |
Gear:= t; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
530 |
t:= Gear^.NextGear; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
531 |
Gear^.doStep(Gear, Steps) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
532 |
end; |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
533 |
end |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
534 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
535 |
|
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
|
536 |
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
|
537 |
var Gear, t: PVisualGear; |
6302
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
538 |
dmg, i: 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
|
539 |
begin |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
540 |
if (vobCount = 0) or (vobCount > 200) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
541 |
exit; |
6306 | 542 |
for i:= 2 to 6 do |
543 |
if i <> 3 then |
|
544 |
begin |
|
545 |
t:= VisualGearLayers[i]; |
|
546 |
while t <> nil do |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
547 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
548 |
Gear:= t; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
549 |
if Gear^.Kind = vgtFlake then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
550 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
551 |
// Damage calc from doMakeExplosion |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
552 |
dmg:= Min(101, Radius + cHHRadius div 2 - LongInt(abs(round(Gear^.X) - X) + abs(round(Gear^.Y) - Y)) div 5); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
553 |
if dmg > 1 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
554 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
555 |
Gear^.tdX:= 0.02 * dmg + 0.01; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
556 |
if Gear^.X - X < 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
557 |
Gear^.tdX := -Gear^.tdX; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
558 |
Gear^.tdY:= 0.02 * dmg + 0.01; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
559 |
if Gear^.Y - Y < 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
560 |
Gear^.tdY := -Gear^.tdY; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
561 |
Gear^.Timer:= 200 |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
562 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
563 |
end; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
564 |
t:= Gear^.NextGear |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
565 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
566 |
end |
2985
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
567 |
end; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
568 |
|
1045 | 569 |
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
|
570 |
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
|
571 |
tinted: boolean; |
4545 | 572 |
tmp: real; |
5748
70d7f8e40f53
Just for fun. Flowers! Also, use a less blatant image in ammo menu.
nemo
parents:
5690
diff
changeset
|
573 |
i: LongInt; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
574 |
begin |
1045 | 575 |
case Layer of |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
576 |
// 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
|
577 |
0: begin |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
578 |
Gear:= VisualGearLayers[0]; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
579 |
while Gear <> nil do |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
580 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
581 |
if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
582 |
case Gear^.Kind of |
6302
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
583 |
vgtCloud: if SuddenDeathDmg then |
6553
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
584 |
DrawTextureF(SpritesData[sprSDCloud].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height) |
6302
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
585 |
else |
6553
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
586 |
DrawTextureF(SpritesData[sprCloud].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height); |
6288
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
587 |
vgtFlake: if cFlattenFlakes then |
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
588 |
begin |
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
589 |
if SuddenDeathDmg then |
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
590 |
if vobSDVelocity = 0 then |
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
591 |
DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
592 |
else |
6999 | 593 |
DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) |
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
|
594 |
else |
6288
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
595 |
if vobVelocity = 0 then |
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
596 |
DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
597 |
else |
6999 | 598 |
DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) |
6288
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
599 |
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
|
600 |
else |
6288
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
601 |
begin |
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
602 |
if SuddenDeathDmg then |
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
603 |
if vobSDVelocity = 0 then |
6553
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
604 |
DrawTextureF(SpritesData[sprSDFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) |
6288
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
605 |
else |
6999 | 606 |
DrawTextureRotatedF(SpritesData[sprSDFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) |
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
|
607 |
else |
6288
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
608 |
if vobVelocity = 0 then |
6553
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
609 |
DrawTextureF(SpritesData[sprFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) |
6288
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
610 |
else |
6999 | 611 |
DrawTextureRotatedF(SpritesData[sprFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) |
6288
fcc50b96d20a
Flatten flakes for halloween theme, based on feedback from sheepluva
nemo
parents:
6184
diff
changeset
|
612 |
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
|
613 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
614 |
if Gear^.Tint <> $FFFFFFFF then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
615 |
Tint($FF,$FF,$FF,$FF); |
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
|
616 |
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
|
617 |
end |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
618 |
end; |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
619 |
// 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
|
620 |
1: begin |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
621 |
Gear:= VisualGearLayers[1]; |
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
|
622 |
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
|
623 |
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
|
624 |
//tinted:= false; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
625 |
if Gear^.Tint <> $FFFFFFFF then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
626 |
Tint(Gear^.Tint); |
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
|
627 |
case Gear^.Kind of |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
628 |
vgtFlake: if SuddenDeathDmg then |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
629 |
if vobSDVelocity = 0 then |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
630 |
DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
631 |
else |
6999 | 632 |
DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
633 |
else |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
634 |
if vobVelocity = 0 then |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
635 |
DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
636 |
else |
6999 | 637 |
DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
638 |
vgtSmokeTrace: if Gear^.State < 8 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
639 |
DrawSprite(sprSmokeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
640 |
vgtEvilTrace: if Gear^.State < 8 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
641 |
DrawSprite(sprEvilTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State); |
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
|
642 |
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
|
643 |
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
|
644 |
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
|
645 |
case Gear^.Kind of |
6323
c1aa6a3c84a7
Dir should not be 0, but set it to 1 if 0 in case I missed some other place this was done. Also correct cloud scaling.
nemo
parents:
6322
diff
changeset
|
646 |
vgtSmoke: DrawTextureF(SpritesData[sprSmoke].Texture, Gear^.scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 7 - Gear^.Frame, 1, SpritesData[sprSmoke].Width, SpritesData[sprSmoke].Height); |
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 |
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
|
648 |
vgtDust: if Gear^.State = 1 then |
7597
1ef520fea21c
make cheating a bit easier (mikade insisted). Also, try flipping dust for a bit more variety.
nemo
parents:
7543
diff
changeset
|
649 |
DrawSpriteRotatedF(sprSnowDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame, Gear^.Tag, Gear^.Angle) |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
650 |
else |
7597
1ef520fea21c
make cheating a bit easier (mikade insisted). Also, try flipping dust for a bit more variety.
nemo
parents:
7543
diff
changeset
|
651 |
DrawSpriteRotatedF(sprDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame, Gear^.Tag, Gear^.Angle); |
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
|
652 |
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
|
653 |
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
|
654 |
else |
6322
b310f0bc8dde
If I'm going to be arbitrary about it, might as well go for the more minimal arbitrariness
nemo
parents:
6318
diff
changeset
|
655 |
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); |
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
|
656 |
vgtSplash: if SuddenDeathDmg then |
6803
0e70f3ea3bf8
bit of an experiment in variable splash sizes based on object/speed. not sure if it looks good yet. need to drown more stuff.
nemo
parents:
6700
diff
changeset
|
657 |
//DrawSprite(sprSDSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37)) |
7372
fcc002658832
Spread the droplets around more so it looks less square (looked especially bad with piano). Slow down large splashes a bit for dramatic purposes, also taking low-g into account. Small splashes you can't really tell anyway.
nemo
parents:
7276
diff
changeset
|
658 |
DrawTextureF(SpritesData[sprSDSplash].Texture, Gear^.scale, round(Gear^.X + WorldDx), round(Gear^.Y + WorldDy - ((SpritesData[sprSDSplash].Height+8)*Gear^.Scale)/2), 19 - (Gear^.FrameTicks div Gear^.Timer div 37), 1, SpritesData[sprSDSplash].Width, SpritesData[sprSDSplash].Height) |
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
|
659 |
else |
6803
0e70f3ea3bf8
bit of an experiment in variable splash sizes based on object/speed. not sure if it looks good yet. need to drown more stuff.
nemo
parents:
6700
diff
changeset
|
660 |
//DrawSprite(sprSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37)); |
7372
fcc002658832
Spread the droplets around more so it looks less square (looked especially bad with piano). Slow down large splashes a bit for dramatic purposes, also taking low-g into account. Small splashes you can't really tell anyway.
nemo
parents:
7276
diff
changeset
|
661 |
DrawTextureF(SpritesData[sprSplash].Texture, Gear^.scale, round(Gear^.X + WorldDx), round(Gear^.Y + WorldDy - ((SpritesData[sprSplash].Height+8)*Gear^.Scale)/2), 19 - (Gear^.FrameTicks div Gear^.Timer div 37), 1, SpritesData[sprSplash].Width, SpritesData[sprSplash].Height); |
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
|
662 |
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
|
663 |
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
|
664 |
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
|
665 |
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
|
666 |
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
|
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 |
//if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
669 |
if (Gear^.Tint <> $FFFFFFFF) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
670 |
Tint($FF,$FF,$FF,$FF); |
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
|
671 |
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
|
672 |
end |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
673 |
end; |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
674 |
// 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
|
675 |
3: begin |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
676 |
Gear:= VisualGearLayers[3]; |
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
|
677 |
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
|
678 |
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
|
679 |
tinted:= false; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
680 |
if Gear^.Tint <> $FFFFFFFF then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
681 |
Tint(Gear^.Tint); |
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
|
682 |
case Gear^.Kind of |
6302
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
683 |
(* |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
684 |
vgtFlake: if SuddenDeathDmg then |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
685 |
if vobSDVelocity = 0 then |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
686 |
DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
687 |
else |
6999 | 688 |
DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
689 |
else |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
690 |
if vobVelocity = 0 then |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
691 |
DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
692 |
else |
6999 | 693 |
DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);*) |
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
|
694 |
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
|
695 |
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
|
696 |
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
|
697 |
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
|
698 |
Tint($FF, $FF, $FF, $66); |
6999 | 699 |
DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex) |
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
|
700 |
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
|
701 |
else if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team = CurrentTeam)) or (Gear^.State = 2)) then |
6999 | 702 |
DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
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
|
703 |
end; |
6999 | 704 |
vgtSmallDamageTag: DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
8330 | 705 |
vgtHealthTag: if Gear^.Tex <> nil 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
|
706 |
begin |
8330 | 707 |
if Gear^.Frame = 0 then |
6999 | 708 |
DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex) |
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
|
709 |
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
|
710 |
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
|
711 |
SetScale(cDefaultZoomLevel); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
712 |
if Gear^.Angle = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
713 |
DrawTexture(round(Gear^.X), round(Gear^.Y), Gear^.Tex) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
714 |
else |
8330 | 715 |
DrawTexture(round(Gear^.X), round(Gear^.Y), Gear^.Tex, Gear^.Angle); |
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
|
716 |
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
|
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 |
end; |
8330 | 719 |
vgtStraightShot: begin |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
720 |
if Gear^.dX < 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
721 |
i:= -1 |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
722 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
723 |
i:= 1; |
6999 | 724 |
DrawTextureRotatedF(SpritesData[TSprite(Gear^.State)].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, i, SpritesData[TSprite(Gear^.State)].Width, SpritesData[TSprite(Gear^.State)].Height, Gear^.Angle); |
5748
70d7f8e40f53
Just for fun. Flowers! Also, use a less blatant image in ammo menu.
nemo
parents:
5690
diff
changeset
|
725 |
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
|
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 |
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
|
728 |
case Gear^.Kind of |
6999 | 729 |
vgtChunk: DrawSpriteRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
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
|
730 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
731 |
if (Gear^.Tint <> $FFFFFFFF) or tinted then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
732 |
Tint($FF,$FF,$FF,$FF); |
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
|
733 |
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
|
734 |
end |
4818
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
735 |
end; |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
736 |
// 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
|
737 |
2: begin |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
738 |
Gear:= VisualGearLayers[2]; |
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
|
739 |
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
|
740 |
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
|
741 |
tinted:= false; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
742 |
if Gear^.Tint <> $FFFFFFFF then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
743 |
Tint(Gear^.Tint); |
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
|
744 |
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
|
745 |
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
|
746 |
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
|
747 |
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
|
748 |
Tint($FF, $FF, $FF, round($FF * (1 - power(Gear^.Timer / 250, 4)))); |
6999 | 749 |
DrawTextureRotatedF(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
|
750 |
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
|
751 |
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
|
752 |
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
|
753 |
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
|
754 |
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
|
755 |
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
|
756 |
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
|
757 |
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
|
758 |
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
|
759 |
Tint($FF, $FF, $FF, round(Gear^.alpha * $FF)); |
6322
b310f0bc8dde
If I'm going to be arbitrary about it, might as well go for the more minimal arbitrariness
nemo
parents:
6318
diff
changeset
|
760 |
DrawTextureF(ropeIconTex, Gear^.scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 32, 32); |
b310f0bc8dde
If I'm going to be arbitrary about it, might as well go for the more minimal arbitrariness
nemo
parents:
6318
diff
changeset
|
761 |
DrawTextureF(SpritesData[sprAMAmmos].Texture, Gear^.scale * 0.90, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame - 1, 1, 32, 32); |
3115 | 762 |
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
|
763 |
vgtShell: begin |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
764 |
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
|
765 |
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
|
766 |
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
|
767 |
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
|
768 |
end; |
6999 | 769 |
DrawSpriteRotatedF(sprShell, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
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
|
770 |
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
|
771 |
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
|
772 |
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
|
773 |
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
|
774 |
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
|
775 |
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
|
776 |
end; |
6999 | 777 |
DrawSpriteRotatedF(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
|
778 |
end; |
6999 | 779 |
vgtEgg: DrawSpriteRotatedF(sprEgg, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
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
|
780 |
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
|
781 |
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
|
782 |
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
|
783 |
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
|
784 |
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
|
785 |
tinted:= true; |
6999 | 786 |
DrawSpriteRotatedF(sprBeeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, (RealTicks shr 4) mod cMaxAngle); |
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
|
787 |
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
|
788 |
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
|
789 |
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
|
790 |
Tint($FF, $FF, $FF, round(Gear^.alpha * $FF)); |
6999 | 791 |
DrawTextureRotatedF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle); |
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
|
792 |
end; |
6999 | 793 |
vgtNote: DrawSpriteRotatedF(sprNote, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
794 |
vgtBulletHit: DrawSpriteRotatedF(sprBulletHit, round(Gear^.X) + WorldDx - 0, round(Gear^.Y) + WorldDy - 0, 7 - (Gear^.FrameTicks div 50), 1, Gear^.Angle); |
|
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
|
795 |
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
|
796 |
case Gear^.Kind of |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
797 |
vgtFlake: if SuddenDeathDmg then |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
798 |
if vobSDVelocity = 0 then |
6553
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
799 |
DrawTextureF(SpritesData[sprSDFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
800 |
else |
6999 | 801 |
DrawTextureRotatedF(SpritesData[sprSDFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
802 |
else |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
803 |
if vobVelocity = 0 then |
6553
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6453
diff
changeset
|
804 |
DrawTextureF(SpritesData[sprFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
805 |
else |
6999 | 806 |
DrawTextureRotatedF(SpritesData[sprFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle); |
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
|
807 |
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
|
808 |
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
|
809 |
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
|
810 |
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
|
811 |
end |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
812 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
813 |
DrawCircle(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State, Gear^.Timer); |
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
|
814 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
815 |
if (Gear^.Tint <> $FFFFFFFF) or tinted then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
816 |
Tint($FF,$FF,$FF,$FF); |
6302
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
817 |
Gear:= Gear^.NextGear |
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
818 |
end |
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
819 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
820 |
// this layer is half-way between the screen plane (depth = 0) when in stereo, and the land |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
821 |
4: begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
822 |
Gear:= VisualGearLayers[4]; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
823 |
while Gear <> nil do |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
824 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
825 |
if Gear^.Tint <> $FFFFFFFF then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
826 |
Tint(Gear^.Tint); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
827 |
case Gear^.Kind of |
6302
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
828 |
vgtCloud: if SuddenDeathDmg then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
829 |
DrawTextureF(SpritesData[sprSDCloud].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
830 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
831 |
DrawTextureF(SpritesData[sprCloud].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height); |
6302
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
832 |
vgtFlake: if SuddenDeathDmg then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
833 |
if vobSDVelocity = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
834 |
DrawTextureF(SpritesData[sprSDFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
835 |
else |
6999 | 836 |
DrawTextureRotatedF(SpritesData[sprSDFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
837 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
838 |
if vobVelocity = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
839 |
DrawTextureF(SpritesData[sprFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
840 |
else |
6999 | 841 |
DrawTextureRotatedF(SpritesData[sprFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
842 |
end; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
843 |
if (Gear^.Tint <> $FFFFFFFF) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
844 |
Tint($FF,$FF,$FF,$FF); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
845 |
Gear:= Gear^.NextGear |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
846 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
847 |
end; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
848 |
// this layer is on the screen plane (depth = 0) when stereo, but just behind the land |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
849 |
5: begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
850 |
Gear:= VisualGearLayers[5]; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
851 |
while Gear <> nil do |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
852 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
853 |
if Gear^.Tint <> $FFFFFFFF then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
854 |
Tint(Gear^.Tint); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
855 |
case Gear^.Kind of |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
856 |
vgtCloud: if SuddenDeathDmg then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
857 |
DrawSprite(sprSDCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
858 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
859 |
DrawSprite(sprCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
860 |
vgtFlake: if SuddenDeathDmg then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
861 |
if vobSDVelocity = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
862 |
DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
863 |
else |
6999 | 864 |
DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
865 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
866 |
if vobVelocity = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
867 |
DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
868 |
else |
6999 | 869 |
DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
870 |
end; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
871 |
if (Gear^.Tint <> $FFFFFFFF) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
872 |
Tint($FF,$FF,$FF,$FF); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
873 |
Gear:= Gear^.NextGear |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
874 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
875 |
end; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
876 |
// this layer is on the screen plane (depth = 0) when stereo, but just in front of the land |
6302
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
877 |
6: begin |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
878 |
Gear:= VisualGearLayers[6]; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
879 |
while Gear <> nil do |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
880 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
881 |
if Gear^.Tint <> $FFFFFFFF then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
882 |
Tint(Gear^.Tint); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
883 |
case Gear^.Kind of |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
884 |
vgtFlake: if SuddenDeathDmg then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
885 |
if vobSDVelocity = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
886 |
DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
887 |
else |
6999 | 888 |
DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
889 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
890 |
if vobVelocity = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
891 |
DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
892 |
else |
6999 | 893 |
DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
894 |
end; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
895 |
if (Gear^.Tint <> $FFFFFFFF) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
896 |
Tint($FF,$FF,$FF,$FF); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
897 |
Gear:= Gear^.NextGear |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
898 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
899 |
end; |
4452 | 900 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
901 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
902 |
|
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
|
903 |
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
|
904 |
var vg: PVisualGear; |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
905 |
i: LongWord; |
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
|
906 |
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
|
907 |
VisualGearByUID:= nil; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
908 |
if uid = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
909 |
exit; |
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
|
910 |
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
|
911 |
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
|
912 |
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
|
913 |
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
|
914 |
end; |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
915 |
// search in an order that is more likely to return layers they actually use. Could perhaps track statistically AddVisualGear in uScript, since that is most likely the ones they want |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
916 |
for i:= 2 to 5 do |
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
|
917 |
begin |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
918 |
vg:= VisualGearLayers[i mod 4]; |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
919 |
while vg <> nil do |
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
|
920 |
begin |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
921 |
if vg^.uid = uid then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
922 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
923 |
lastVisualGearByUID:= vg; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
924 |
VisualGearByUID:= vg; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
925 |
exit |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
926 |
end; |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
927 |
vg:= vg^.NextGear |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
928 |
end |
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
|
929 |
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
|
930 |
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
|
931 |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
932 |
procedure AddClouds; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
933 |
var i: LongInt; |
803 | 934 |
begin |
1132 | 935 |
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
|
936 |
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
|
937 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
938 |
|
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
|
939 |
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
|
940 |
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
|
941 |
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
|
942 |
begin |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
943 |
if cCloudsNumber = cSDCloudsNumber then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
944 |
exit; |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
945 |
vg:= VisualGearLayers[0]; |
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
|
946 |
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
|
947 |
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
|
948 |
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
|
949 |
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
|
950 |
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
|
951 |
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
|
952 |
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
|
953 |
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
|
954 |
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
|
955 |
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
|
956 |
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
|
957 |
|
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
958 |
procedure AddFlakes; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
959 |
var i: LongInt; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
960 |
begin |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
961 |
if (cReducedQuality and rqKillFlakes) <> 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
962 |
exit; |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
963 |
|
6117
2a4829172a29
Experiment in making ice more treacherous. also tweak to snow/christmas flake spawn
nemo
parents:
5924
diff
changeset
|
964 |
if hasBorder or ((Theme <> 'Snow') and (Theme <> 'Christmas')) then |
7543
a0dc770538e1
Poor visual gear value in theme now bears little resemblance to the number of gears actually spawned. But, it certainly shouldn't be related to LAND_WIDTH.
nemo
parents:
7420
diff
changeset
|
965 |
for i:= 0 to Pred(vobCount * cScreenSpace div 4096) do |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
966 |
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
|
967 |
else |
7543
a0dc770538e1
Poor visual gear value in theme now bears little resemblance to the number of gears actually spawned. But, it certainly shouldn't be related to LAND_WIDTH.
nemo
parents:
7420
diff
changeset
|
968 |
for i:= 0 to Pred((vobCount * cScreenSpace div 4096) div 3) do |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
969 |
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
|
970 |
end; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
971 |
|
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
972 |
procedure ChangeToSDFlakes; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
973 |
var i: LongInt; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
974 |
vg, tmp: PVisualGear; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
975 |
begin |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
976 |
if (cReducedQuality and rqKillFlakes) <> 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
977 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
978 |
if vobCount = vobSDCount then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
979 |
exit; |
6302
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
980 |
for i:= 0 to 6 do |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
981 |
begin |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
982 |
vg:= VisualGearLayers[i]; |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
983 |
while vg <> nil do |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
984 |
if vg^.Kind = vgtFlake then |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
985 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
986 |
tmp:= vg^.NextGear; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
987 |
DeleteVisualGear(vg); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
988 |
vg:= tmp |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
989 |
end |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
990 |
else vg:= vg^.NextGear; |
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
991 |
end; |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
992 |
if ((GameFlags and gfBorder) <> 0) or ((Theme <> 'Snow') and (Theme <> 'Christmas')) then |
7822
61ff669d610f
missed this one when fixing regular flakes. issue #444
nemo
parents:
7615
diff
changeset
|
993 |
for i:= 0 to Pred(vobSDCount * cScreenSpace div 4096) do |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
994 |
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
|
995 |
else |
7822
61ff669d610f
missed this one when fixing regular flakes. issue #444
nemo
parents:
7615
diff
changeset
|
996 |
for i:= 0 to Pred((vobSDCount * cScreenSpace div 4096) div 3) do |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
997 |
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
|
998 |
end; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
999 |
|
3038 | 1000 |
procedure initModule; |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
1001 |
var i: LongWord; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
1002 |
begin |
6982 | 1003 |
VGCounter:= 0; |
6302
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
1004 |
for i:= 0 to 6 do |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
1005 |
VisualGearLayers[i]:= nil; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
1006 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
1007 |
|
3038 | 1008 |
procedure freeModule; |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
1009 |
var i: LongWord; |
2715
0e4e0db79e2a
Free up some unfreed memory. Needed for Koda's iphone lib work
nemo
parents:
2713
diff
changeset
|
1010 |
begin |
6982 | 1011 |
VGCounter:= 0; |
6302
db8bdbb34e03
Spread flakes out over 5 layers now (far back, mid distance, just behind land, just in front of lands and hog, near distance). Spread clouds out over 3 layers (far back, mid distance, just behind land). Add a flatten clouds option, use
nemo
parents:
6291
diff
changeset
|
1012 |
for i:= 0 to 6 do |
6179
b529f88d37d0
Bit of an experiment with giving flakes a bit more depth. Might need to be theme flagged, or theme flakes reworked on some themes. Looks neat in stereo. Also finally use an array for the layers
nemo
parents:
6117
diff
changeset
|
1013 |
while VisualGearLayers[i] <> nil do DeleteVisualGear(VisualGearLayers[i]); |
2715
0e4e0db79e2a
Free up some unfreed memory. Needed for Koda's iphone lib work
nemo
parents:
2713
diff
changeset
|
1014 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
1015 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
1016 |
end. |