22 MARK_BLOCKED
= MARK_WALL
+ MARK_DOOR
;
23 MARK_LIQUID
= MARK_WATER
+ MARK_ACID
;
24 MARK_LIFT
= MARK_LIFTDOWN
+ MARK_LIFTUP
+ MARK_LIFTLEFT
+ MARK_LIFTRIGHT
;
26 procedure g_GFX_Init();
27 procedure g_GFX_Free();
29 procedure g_GFX_Blood(fX
, fY
: Integer; Count
: Word; vx
, vy
: Integer;
30 DevX
, DevY
: Word; CR
, CG
, CB
: Byte; Kind
: Byte = BLOOD_NORMAL
);
31 procedure g_GFX_Spark(fX
, fY
: Integer; Count
: Word; Angle
: SmallInt; DevX
, DevY
: Byte);
32 procedure g_GFX_Water(fX
, fY
: Integer; Count
: Word; fVelX
, fVelY
: Single; DevX
, DevY
, Color
: Byte);
33 procedure g_GFX_SimpleWater(fX
, fY
: Integer; Count
: Word; fVelX
, fVelY
: Single; DefColor
, CR
, CG
, CB
: Byte);
34 procedure g_GFX_Bubbles(fX
, fY
: Integer; Count
: Word; DevX
, DevY
: Byte);
35 procedure g_GFX_SetMax(Count
: Integer);
36 function g_GFX_GetMax(): Integer;
38 procedure g_GFX_OnceAnim(X
, Y
: Integer; Anim
: TAnimation
; AnimType
: Byte = 0);
40 procedure g_Mark(x
, y
, Width
, Height
: Integer; t
: Byte; st
: Boolean);
42 procedure g_GFX_Update();
43 procedure g_GFX_Draw();
46 gCollideMap
: Array of Array of Byte;
51 g_map
, g_basic
, Math
, e_graphics
, GL
, GLExt
,
52 g_options
, g_console
, SysUtils
, g_triggers
, MAPDEF
,
53 g_game
, g_language
, g_net
;
59 AccelX
, AccelY
: Single;
60 Red
, Green
, Blue
: Byte;
65 offsetX
, offsetY
: ShortInt;
71 Animation
: TAnimation
;
84 Particles
: Array of TParticle
;
85 OnceAnims
: Array of TOnceAnim
;
86 MaxParticles
: Integer;
87 CurrentParticle
: Integer;
89 procedure g_Mark(x
, y
, Width
, Height
: Integer; t
: Byte; st
: Boolean);
91 yy
, y2
, xx
, x2
: Integer;
104 Height
:= Height
+ y
;
111 if x
> gMapInfo
.Width
then
113 if y
> gMapInfo
.Height
then
116 y2
:= y
+ Height
- 1;
117 if y2
> gMapInfo
.Height
then
118 y2
:= gMapInfo
.Height
;
121 if x2
> gMapInfo
.Width
then
122 x2
:= gMapInfo
.Width
;
125 begin // Óñòàíîâèòü ïðèçíàê
128 gCollideMap
[yy
][xx
] := gCollideMap
[yy
][xx
] or t
;
131 begin // Óáðàòü ïðèçíàê
135 gCollideMap
[yy
][xx
] := gCollideMap
[yy
][xx
] and t
;
139 procedure CreateCollideMap();
143 g_Game_SetLoadingText(_lc
[I_LOAD_COLLIDE_MAP
]+' 1/6', 0, False);
144 SetLength(gCollideMap
, gMapInfo
.Height
+1);
145 for a
:= 0 to High(gCollideMap
) do
146 SetLength(gCollideMap
[a
], gMapInfo
.Width
+1);
148 if gWater
<> nil then
150 g_Game_SetLoadingText(_lc
[I_LOAD_COLLIDE_MAP
]+' 2/6', 0, True);
151 for a
:= 0 to High(gWater
) do
153 g_Mark(X
, Y
, Width
, Height
, MARK_WATER
, True);
156 if gAcid1
<> nil then
158 g_Game_SetLoadingText(_lc
[I_LOAD_COLLIDE_MAP
]+' 3/6', 0, True);
159 for a
:= 0 to High(gAcid1
) do
161 g_Mark(X
, Y
, Width
, Height
, MARK_ACID
, True);
164 if gAcid2
<> nil then
166 g_Game_SetLoadingText(_lc
[I_LOAD_COLLIDE_MAP
]+' 4/6', 0, True);
167 for a
:= 0 to High(gAcid2
) do
169 g_Mark(X
, Y
, Width
, Height
, MARK_ACID
, True);
172 if gLifts
<> nil then
174 g_Game_SetLoadingText(_lc
[I_LOAD_COLLIDE_MAP
]+' 5/6', 0, True);
175 for a
:= 0 to High(gLifts
) do
178 g_Mark(X
, Y
, Width
, Height
, MARK_LIFT
, False);
181 g_Mark(X
, Y
, Width
, Height
, MARK_LIFTUP
, True)
182 else if LiftType
= 1 then
183 g_Mark(X
, Y
, Width
, Height
, MARK_LIFTDOWN
, True)
184 else if LiftType
= 2 then
185 g_Mark(X
, Y
, Width
, Height
, MARK_LIFTLEFT
, True)
186 else if LiftType
= 3 then
187 g_Mark(X
, Y
, Width
, Height
, MARK_LIFTRIGHT
, True)
191 if gWalls
<> nil then
193 g_Game_SetLoadingText(_lc
[I_LOAD_COLLIDE_MAP
]+' 6/6', 0, True);
194 for a
:= 0 to High(gWalls
) do
196 if gWalls
[a
].Door
then
199 if gWalls
[a
].Enabled
then
201 g_Mark(X
, Y
, Width
, Height
, MARK_DOOR
, True)
202 else // Îòêðûòàÿ äâåðü:
203 if gWalls
[a
].Enabled
then
205 g_Mark(X
, Y
, Width
, Height
, MARK_DOOR
, False);
209 g_Mark(X
, Y
, Width
, Height
, MARK_WALL
, True);
214 procedure g_GFX_Init();
219 procedure g_GFX_Free();
224 SetLength(Particles
, MaxParticles
);
225 CurrentParticle
:= 0;
227 if OnceAnims
<> nil then
229 for a
:= 0 to High(OnceAnims
) do
230 OnceAnims
[a
].Animation
.Free();
238 procedure CorrectOffsets(id
: Integer);
240 with Particles
[id
] do
242 if (X
>= 0) and (Y
> 0) and
243 (Y
< Length(gCollideMap
)) and (X
< Length(gCollideMap
[0])) and
244 (ByteBool(gCollideMap
[Y
-1, X
] and MARK_BLOCKED
)) then
245 offsetY
:= 1 // Ñòåíà ñâåðõó
249 if (X
> 0) and (Y
>= 0) and
250 (Y
< Length(gCollideMap
)) and (X
< Length(gCollideMap
[0])) and
251 (ByteBool(gCollideMap
[Y
, X
-1] and MARK_BLOCKED
)) then
252 offsetX
:= 1 // Ñòåíà ñëåâà
258 procedure g_GFX_SparkVel(fX
, fY
: Integer; Count
: Word; VX
, VY
: Integer; DevX
, DevY
: Byte);
265 l
:= Length(Particles
);
276 for a
:= 1 to Count
do
278 with Particles
[CurrentParticle
] do
280 X
:= fX
-DevX1
+Random(DevX2
);
281 Y
:= fY
-DevY1
+Random(DevY2
);
283 VelX
:= VX
+ (Random
-Random
)*3;
284 VelY
:= VY
+ (Random
-Random
)*3;
292 AccelX
:= -Sign(VelX
)*Random
/100;
296 Green
:= 100+Random(155);
300 State
:= STATE_NORMAL
;
302 LiveTime
:= 30+Random(60);
303 ParticleType
:= PARTICLE_SPARK
;
305 CorrectOffsets(CurrentParticle
);
308 if CurrentParticle
+2 > MaxParticles
then
311 CurrentParticle
:= CurrentParticle
+1;
315 procedure g_GFX_Blood(fX
, fY
: Integer; Count
: Word; vx
, vy
: Integer;
316 DevX
, DevY
: Word; CR
, CG
, CB
: Byte; Kind
: Byte = BLOOD_NORMAL
);
325 if Kind
= BLOOD_SPARKS
then
327 g_GFX_SparkVel(fX
, fY
, 2 + Random(2), -VX
div 2, -VY
div 2, DevX
, DevY
);
330 l
:= Length(Particles
);
341 for a
:= 1 to Count
do
343 with Particles
[CurrentParticle
] do
345 X
:= fX
- DevX1
+ Random(DevX2
);
346 Y
:= fY
- DevY1
+ Random(DevY2
);
348 if (X
< 0) or (X
> gMapInfo
.Width
-1) or
349 (Y
< 0) or (Y
> gMapInfo
.Height
-1) or
350 ByteBool(gCollideMap
[Y
, X
] and MARK_WALL
) then
353 VelX
:= vx
+ (Random
-Random
)*3;
354 VelY
:= vy
+ (Random
-Random
)*3;
362 AccelX
:= -Sign(VelX
)*Random
/100;
365 CRnd
:= 20*Random(6);
368 CC
:= CR
+ CRnd
- 50;
369 if CC
< 0 then CC
:= 0;
370 if CC
> 255 then CC
:= 255;
376 CC
:= CG
+ CRnd
- 50;
377 if CC
< 0 then CC
:= 0;
378 if CC
> 255 then CC
:= 255;
384 CC
:= CB
+ CRnd
- 50;
385 if CC
< 0 then CC
:= 0;
386 if CC
> 255 then CC
:= 255;
393 State
:= STATE_NORMAL
;
395 LiveTime
:= 120+Random(40);
396 ParticleType
:= PARTICLE_BLOOD
;
398 CorrectOffsets(CurrentParticle
);
401 if CurrentParticle
>= MaxParticles
-1 then
404 CurrentParticle
:= CurrentParticle
+1;
408 procedure g_GFX_Spark(fX
, fY
: Integer; Count
: Word; Angle
: SmallInt; DevX
, DevY
: Byte);
414 BaseVelX
, BaseVelY
: Single;
417 l
:= Length(Particles
);
423 Angle
:= 360 - Angle
;
430 b
:= DegToRad(Angle
);
432 BaseVelY
:= 1.6*sin(b
);
433 if Abs(BaseVelX
) < 0.01 then
435 if Abs(BaseVelY
) < 0.01 then
437 for a
:= 1 to Count
do
439 with Particles
[CurrentParticle
] do
441 X
:= fX
-DevX1
+Random(DevX2
);
442 Y
:= fY
-DevY1
+Random(DevY2
);
444 VelX
:= BaseVelX
*Random
;
445 VelY
:= BaseVelY
-Random
;
450 Green
:= 100+Random(155);
454 State
:= STATE_NORMAL
;
456 LiveTime
:= 30+Random(60);
457 ParticleType
:= PARTICLE_SPARK
;
459 CorrectOffsets(CurrentParticle
);
462 if CurrentParticle
+2 > MaxParticles
then
465 CurrentParticle
:= CurrentParticle
+1;
469 procedure g_GFX_Water(fX
, fY
: Integer; Count
: Word; fVelX
, fVelY
: Single; DevX
, DevY
, Color
: Byte);
476 l
:= Length(Particles
);
482 if Abs(fVelX
) < 3.0 then
483 fVelX
:= 3.0 - 6.0*Random
;
490 for a
:= 1 to Count
do
492 with Particles
[CurrentParticle
] do
494 X
:= fX
-DevX1
+Random(DevX2
);
495 Y
:= fY
-DevY1
+Random(DevY2
);
497 if Abs(fVelX
) < 0.5 then
498 VelX
:= 1.0 - 2.0*Random
500 VelX
:= fVelX
*Random
;
501 if Random(10) < 7 then
503 VelY
:= fVelY
*Random
;
510 Red
:= 155 + Random(9)*10;
511 Green
:= Trunc(150*Random
);
516 Red
:= Trunc(150*Random
);
517 Green
:= 175 + Random(9)*10;
522 Red
:= Trunc(200*Random
);
524 Blue
:= 175 + Random(9)*10;
528 Red
:= 90 + Random(12)*10;
536 State
:= STATE_NORMAL
;
538 LiveTime
:= 60+Random(60);
539 ParticleType
:= PARTICLE_WATER
;
541 CorrectOffsets(CurrentParticle
);
544 if CurrentParticle
+2 > MaxParticles
then
547 CurrentParticle
:= CurrentParticle
+1;
551 procedure g_GFX_SimpleWater(fX
, fY
: Integer; Count
: Word; fVelX
, fVelY
: Single; DefColor
, CR
, CG
, CB
: Byte);
556 l
:= Length(Particles
);
562 for a
:= 1 to Count
do
564 with Particles
[CurrentParticle
] do
577 Red
:= 155 + Random(9)*10;
578 Green
:= Trunc(150*Random
);
583 Red
:= Trunc(150*Random
);
584 Green
:= 175 + Random(9)*10;
589 Red
:= Trunc(200*Random
);
591 Blue
:= 175 + Random(9)*10;
593 4: // Ñâîé öâåò, ñâåòëåå
595 Red
:= 20 + Random(19)*10;
598 Red
:= Min(Red
+ CR
, 255);
599 Green
:= Min(Green
+ CG
, 255);
600 Blue
:= Min(Blue
+ CB
, 255);
602 5: // Ñâîé öâåò, òåìíåå
604 Red
:= 20 + Random(19)*10;
607 Red
:= Max(CR
- Red
, 0);
608 Green
:= Max(CG
- Green
, 0);
609 Blue
:= Max(CB
- Blue
, 0);
613 Red
:= 90 + Random(12)*10;
621 State
:= STATE_NORMAL
;
623 LiveTime
:= 60+Random(60);
624 ParticleType
:= PARTICLE_WATER
;
626 CorrectOffsets(CurrentParticle
);
629 if CurrentParticle
+2 > MaxParticles
then
632 CurrentParticle
:= CurrentParticle
+1;
636 procedure g_GFX_Bubbles(fX
, fY
: Integer; Count
: Word; DevX
, DevY
: Byte);
643 l
:= Length(Particles
);
654 for a
:= 1 to Count
do
656 with Particles
[CurrentParticle
] do
658 X
:= fX
-DevX1
+Random(DevX2
);
659 Y
:= fY
-DevY1
+Random(DevY2
);
661 if (X
>= gMapInfo
.Width
) or (X
<= 0) or
662 (Y
>= gMapInfo
.Height
) or (Y
<= 0) then
665 if not ByteBool(gCollideMap
[Y
, X
] and MARK_LIQUID
) then
678 State
:= STATE_NORMAL
;
681 ParticleType
:= PARTICLE_BUBBLES
;
683 CorrectOffsets(CurrentParticle
);
686 if CurrentParticle
+2 > MaxParticles
then
689 CurrentParticle
:= CurrentParticle
+1;
693 procedure g_GFX_SetMax(Count
: Integer);
695 if Count
> 50000 then
698 SetLength(Particles
, Count
);
699 MaxParticles
:= Count
;
700 if CurrentParticle
>= Count
then
701 CurrentParticle
:= 0;
704 function g_GFX_GetMax(): Integer;
706 Result
:= MaxParticles
;
709 function FindOnceAnim
: DWORD
;
713 if OnceAnims
<> nil then
714 for i
:= 0 to High(OnceAnims
) do
715 if OnceAnims
[i
].Animation
= nil then
721 if OnceAnims
= nil then
723 SetLength(OnceAnims
, 16);
728 Result
:= High(OnceAnims
) + 1;
729 SetLength(OnceAnims
, Length(OnceAnims
) + 16);
733 procedure g_GFX_OnceAnim(X
, Y
: Integer; Anim
: TAnimation
; AnimType
: Byte = 0);
740 find_id
:= FindOnceAnim();
742 OnceAnims
[find_id
].AnimType
:= AnimType
;
743 OnceAnims
[find_id
].Animation
:= TAnimation
.Create(Anim
.FramesID
, Anim
.Loop
, Anim
.Speed
);
744 OnceAnims
[find_id
].Animation
.Blending
:= Anim
.Blending
;
745 OnceAnims
[find_id
].Animation
.Alpha
:= Anim
.Alpha
;
746 OnceAnims
[find_id
].X
:= X
;
747 OnceAnims
[find_id
].Y
:= Y
;
750 procedure g_GFX_Update();
759 if Particles
<> nil then
762 h
:= gMapInfo
.Height
;
764 len
:= High(Particles
);
767 if Particles
[a
].State
<> 0 then
770 if Time
= LiveTime
then
772 if (X
+1 >= w
) or (Y
+1 >= h
) or (X
<= 0) or (Y
<= 0) then
774 if State
= STATE_FREE
then
782 if (State
= STATE_STICK
) then
783 if (not ByteBool(gCollideMap
[Y
-1, X
] and MARK_BLOCKED
)) and
784 (not ByteBool(gCollideMap
[Y
+1, X
] and MARK_BLOCKED
)) and
785 (not ByteBool(gCollideMap
[Y
, X
-1] and MARK_BLOCKED
)) and
786 (not ByteBool(gCollideMap
[Y
, X
+1] and MARK_BLOCKED
)) then
787 begin // Îòëèïëà - êàïàåò
790 State
:= STATE_NORMAL
;
793 if Random(200) = 100 then
794 begin // Ïðèëåïëåíà - íî âîçìîæíî ñòåêàåò
800 if not ByteBool(gCollideMap
[Y
, X
] and MARK_BLOCKED
) then
802 if ByteBool(gCollideMap
[Y
, X
] and MARK_LIFTUP
) then
804 if VelY
> -4-Random(3) then
806 if Abs(VelX
) > 0.1 then
807 VelX
:= VelX
- VelX
/10.0;
808 VelX
:= VelX
+ (Random
-Random
)*0.2;
811 if ByteBool(gCollideMap
[Y
, X
] and MARK_LIFTLEFT
) then
813 if VelX
> -8-Random(3) then
817 if ByteBool(gCollideMap
[Y
, X
] and MARK_LIFTRIGHT
) then
818 begin // Ïîòîê âïðàâî
819 if VelX
< 8+Random(3) then
828 if (Abs(VelX
) < 0.1) and (Abs(VelY
) < 0.1) then
829 if (State
<> STATE_STICK
) and
830 (not ByteBool(gCollideMap
[Y
-1, X
] and MARK_BLOCKED
)) and
831 (not ByteBool(gCollideMap
[Y
, X
] and MARK_BLOCKED
)) and
832 (not ByteBool(gCollideMap
[Y
+1, X
] and MARK_BLOCKED
)) then
833 begin // Âèñèò â âîçäóõå - êàïàåò
836 State
:= STATE_NORMAL
;
850 if (X
+s
>= w
) or (X
+s
<= 0) then
856 c
:= gCollideMap
[Y
, X
+s
];
858 if ByteBool(c
and MARK_BLOCKED
) then
864 State
:= STATE_STICK
;
883 if (Y
+s
>= h
) or (Y
+s
<= 0) then
889 c
:= gCollideMap
[Y
+s
, X
];
891 if ByteBool(c
and MARK_BLOCKED
) then
897 if (s
> 0) and (State
<> STATE_STICK
) then
898 State
:= STATE_NORMAL
900 State
:= STATE_STICK
;
913 if (X
+dX
>= w
) or (Y
+dY
>= h
) or
914 (X
+dX
<= 0) or (Y
+dY
<= 0) or
915 ByteBool(gCollideMap
[Y
+dY
, X
+dX
] and MARK_BLOCKED
) then
916 begin // Ñòåíà/äâåðü/ãðàíèöà
928 VelX
:= VelX
+ AccelX
;
929 VelY
:= VelY
+ AccelY
;
931 // Êðîâü ðàñòâîðÿåòñÿ â æèäêîñòè:
932 if ByteBool(gCollideMap
[Y
, X
] and MARK_LIQUID
) then
936 Alpha
:= 255 - Trunc((255.0 * Time
) / LiveTime
);
945 if (Abs(VelX
) < 0.1) and (Abs(VelY
) < 0.1) and
946 (not ByteBool(gCollideMap
[Y
-1, X
] and MARK_BLOCKED
)) and
947 (not ByteBool(gCollideMap
[Y
, X
] and MARK_BLOCKED
)) and
948 (not ByteBool(gCollideMap
[Y
+1, X
] and MARK_BLOCKED
)) then
949 begin // Âèñèò â âîçäóõå
965 if (X
+s
>= w
) or (X
+s
<= 0) then
971 c
:= gCollideMap
[Y
, X
+s
];
973 if ByteBool(c
and MARK_BLOCKED
) then
974 begin // Ñòåíà/äâåðü - ïàäàåò âåðòèêàëüíî
980 if c
= MARK_FREE
then
1001 if (Y
+s
>= h
) or (Y
+s
<= 0) then
1003 State
:= STATE_FREE
;
1007 c
:= gCollideMap
[Y
+s
, X
];
1009 if ByteBool(c
and MARK_BLOCKED
) then
1010 begin // Ñòåíà/äâåðü - ïàäàåò âåðòèêàëüíî
1014 AccelY
:= Abs(AccelY
);
1016 else // Èëè íå ïàäàåò
1027 if c
= MARK_FREE
then
1031 State
:= STATE_FREE
;
1038 VelX
:= VelX
+ AccelX
;
1042 AccelY
:= AccelY
+ 0.08;
1043 VelY
:= VelY
+ AccelY
;
1051 if (State
= STATE_STICK
) and (Random(30) = 15) then
1052 begin // Ñòåêàåò/îòëèïàåò
1055 if (not ByteBool(gCollideMap
[Y
, X
-1] and MARK_BLOCKED
)) and
1056 (not ByteBool(gCollideMap
[Y
, X
+1] and MARK_BLOCKED
)) then
1057 State
:= STATE_NORMAL
;
1061 if not ByteBool(gCollideMap
[Y
, X
] and MARK_BLOCKED
) then
1063 if ByteBool(gCollideMap
[Y
, X
] and MARK_LIFTUP
) then
1065 if VelY
> -4-Random(3) then
1067 if Abs(VelX
) > 0.1 then
1068 VelX
:= VelX
- VelX
/10.0;
1069 VelX
:= VelX
+ (Random
-Random
)*0.2;
1072 if ByteBool(gCollideMap
[Y
, X
] and MARK_LIFTLEFT
) then
1073 begin // Ïîòîê âëåâî
1074 if VelX
> -8-Random(3) then
1078 if ByteBool(gCollideMap
[Y
, X
] and MARK_LIFTRIGHT
) then
1079 begin // Ïîòîê âïðàâî
1080 if VelX
< 8+Random(3) then
1089 if (Abs(VelX
) < 0.1) and (Abs(VelY
) < 0.1) then
1090 if (State
<> STATE_STICK
) and
1091 (not ByteBool(gCollideMap
[Y
-1, X
] and MARK_BLOCKED
)) and
1092 (not ByteBool(gCollideMap
[Y
, X
] and MARK_BLOCKED
)) and
1093 (not ByteBool(gCollideMap
[Y
+1, X
] and MARK_BLOCKED
)) then
1094 begin // Âèñèò â âîçäóõå - êàïàåò
1097 State
:= STATE_NORMAL
;
1107 for b
:= 1 to Abs(dX
) do
1109 if (X
+s
>= w
) or (X
+s
<= 0) then
1110 begin // Ñáîêó ãðàíèöà
1111 State
:= STATE_FREE
;
1115 c
:= gCollideMap
[Y
, X
+s
];
1117 if ByteBool(c
and MARK_LIQUID
) and (dY
> 0) then
1118 begin // Ñáîêó æèäêîñòü, à ÷àñòèöà óæå ïàäàåò
1119 State
:= STATE_FREE
;
1123 if ByteBool(c
and MARK_BLOCKED
) then
1124 begin // Ñòåíà/äâåðü
1129 State
:= STATE_STICK
;
1144 for b
:= 1 to Abs(dY
) do
1146 if (Y
+s
>= h
) or (Y
+s
<= 0) then
1147 begin // Ñíèçó/ñâåðõó ãðàíèöà
1148 State
:= STATE_FREE
;
1152 c
:= gCollideMap
[Y
+s
, X
];
1154 if ByteBool(c
and MARK_LIQUID
) and (dY
> 0) then
1155 begin // Ñíèçó æèäêîñòü, à ÷àñòèöà óæå ïàäàåò
1156 State
:= STATE_FREE
;
1160 if ByteBool(c
and MARK_BLOCKED
) then
1161 begin // Ñòåíà/äâåðü
1166 if (s
> 0) and (State
<> STATE_STICK
) then
1167 State
:= STATE_NORMAL
1169 State
:= STATE_STICK
;
1177 VelX
:= VelX
+ AccelX
;
1178 VelY
:= VelY
+ AccelY
;
1194 for b
:= 1 to Abs(dY
) do
1196 if (Y
+s
>= h
) or (Y
+s
<= 0) then
1198 State
:= STATE_FREE
;
1202 if not ByteBool(gCollideMap
[Y
+s
, X
] and MARK_LIQUID
) then
1203 begin // Óæå íå æèäêîñòü
1204 State
:= STATE_FREE
;
1213 VelY
:= VelY
+ AccelY
;
1221 end; // Particles <> nil
1223 if OnceAnims
<> nil then
1225 for a
:= 0 to High(OnceAnims
) do
1226 if OnceAnims
[a
].Animation
<> nil then
1228 case OnceAnims
[a
].AnimType
of
1231 if Random(3) = 0 then
1232 OnceAnims
[a
].X
:= OnceAnims
[a
].X
-1+Random(3);
1233 if Random(2) = 0 then
1234 OnceAnims
[a
].Y
:= OnceAnims
[a
].Y
-Random(2);
1238 if OnceAnims
[a
].Animation
.Played
then
1240 OnceAnims
[a
].Animation
.Free();
1241 OnceAnims
[a
].Animation
:= nil;
1244 OnceAnims
[a
].Animation
.Update();
1249 procedure g_GFX_Draw();
1253 if Particles
<> nil then
1255 glDisable(GL_TEXTURE_2D
);
1259 glBlendFunc(GL_SRC_ALPHA
, GL_ONE_MINUS_SRC_ALPHA
);
1263 len
:= High(Particles
);
1265 for a
:= 0 to len
do
1266 with Particles
[a
] do
1267 if (State
<> STATE_FREE
) and (X
>= sX
) and (Y
>= sY
) and
1268 (X
<= sX
+sWidth
) and (sY
<= sY
+sHeight
) then
1270 glColor4ub(Red
, Green
, Blue
, Alpha
);
1271 glVertex2i(X
+ offsetX
, Y
+ offsetY
);
1276 glDisable(GL_BLEND
);
1279 if OnceAnims
<> nil then
1280 for a
:= 0 to High(OnceAnims
) do
1281 if OnceAnims
[a
].Animation
<> nil then
1282 with OnceAnims
[a
] do
1283 Animation
.Draw(X
, Y
, M_NONE
);