23 MARK_BLOCKED
= MARK_WALL
+ MARK_DOOR
;
24 MARK_LIQUID
= MARK_WATER
+ MARK_ACID
;
25 MARK_LIFT
= MARK_LIFTDOWN
+ MARK_LIFTUP
+ MARK_LIFTLEFT
+ MARK_LIFTRIGHT
;
27 procedure g_GFX_Init();
28 procedure g_GFX_Free();
30 procedure g_GFX_Blood(fX
, fY
: Integer; Count
: Word; vx
, vy
: Integer;
31 DevX
, DevY
: Word; CR
, CG
, CB
: Byte; Kind
: Byte = BLOOD_NORMAL
);
32 procedure g_GFX_Spark(fX
, fY
: Integer; Count
: Word; Angle
: SmallInt; DevX
, DevY
: Byte);
33 procedure g_GFX_Water(fX
, fY
: Integer; Count
: Word; fVelX
, fVelY
: Single; DevX
, DevY
, Color
: Byte);
34 procedure g_GFX_SimpleWater(fX
, fY
: Integer; Count
: Word; fVelX
, fVelY
: Single; DefColor
, CR
, CG
, CB
: Byte);
35 procedure g_GFX_Bubbles(fX
, fY
: Integer; Count
: Word; DevX
, DevY
: Byte);
36 procedure g_GFX_SetMax(Count
: Integer);
37 function g_GFX_GetMax(): Integer;
39 procedure g_GFX_OnceAnim(X
, Y
: Integer; Anim
: TAnimation
; AnimType
: Byte = 0);
41 procedure g_Mark(x
, y
, Width
, Height
: Integer; t
: Byte; st
: Boolean);
43 procedure g_GFX_Update();
44 procedure g_GFX_Draw();
47 gCollideMap
: Array of Array of Byte;
52 g_map
, g_basic
, Math
, e_graphics
, GL
, GLExt
,
53 g_options
, g_console
, SysUtils
, g_triggers
, MAPDEF
,
54 g_game
, g_language
, g_net
;
60 AccelX
, AccelY
: Single;
61 Red
, Green
, Blue
: Byte;
66 offsetX
, offsetY
: ShortInt;
72 Animation
: TAnimation
;
85 Particles
: Array of TParticle
;
86 OnceAnims
: Array of TOnceAnim
;
87 MaxParticles
: Integer;
88 CurrentParticle
: Integer;
90 procedure g_Mark(x
, y
, Width
, Height
: Integer; t
: Byte; st
: Boolean);
92 yy
, y2
, xx
, x2
: Integer;
105 Height
:= Height
+ y
;
112 if x
> gMapInfo
.Width
then
114 if y
> gMapInfo
.Height
then
117 y2
:= y
+ Height
- 1;
118 if y2
> gMapInfo
.Height
then
119 y2
:= gMapInfo
.Height
;
122 if x2
> gMapInfo
.Width
then
123 x2
:= gMapInfo
.Width
;
126 begin // Óñòàíîâèòü ïðèçíàê
129 gCollideMap
[yy
][xx
] := gCollideMap
[yy
][xx
] or t
;
132 begin // Óáðàòü ïðèçíàê
136 gCollideMap
[yy
][xx
] := gCollideMap
[yy
][xx
] and t
;
140 procedure CreateCollideMap();
144 g_Game_SetLoadingText(_lc
[I_LOAD_COLLIDE_MAP
]+' 1/6', 0, False);
145 SetLength(gCollideMap
, gMapInfo
.Height
+1);
146 for a
:= 0 to High(gCollideMap
) do
147 SetLength(gCollideMap
[a
], gMapInfo
.Width
+1);
149 if gWater
<> nil then
151 g_Game_SetLoadingText(_lc
[I_LOAD_COLLIDE_MAP
]+' 2/6', 0, True);
152 for a
:= 0 to High(gWater
) do
154 g_Mark(X
, Y
, Width
, Height
, MARK_WATER
, True);
157 if gAcid1
<> nil then
159 g_Game_SetLoadingText(_lc
[I_LOAD_COLLIDE_MAP
]+' 3/6', 0, True);
160 for a
:= 0 to High(gAcid1
) do
162 g_Mark(X
, Y
, Width
, Height
, MARK_ACID
, True);
165 if gAcid2
<> nil then
167 g_Game_SetLoadingText(_lc
[I_LOAD_COLLIDE_MAP
]+' 4/6', 0, True);
168 for a
:= 0 to High(gAcid2
) do
170 g_Mark(X
, Y
, Width
, Height
, MARK_ACID
, True);
173 if gLifts
<> nil then
175 g_Game_SetLoadingText(_lc
[I_LOAD_COLLIDE_MAP
]+' 5/6', 0, True);
176 for a
:= 0 to High(gLifts
) do
179 g_Mark(X
, Y
, Width
, Height
, MARK_LIFT
, False);
182 g_Mark(X
, Y
, Width
, Height
, MARK_LIFTUP
, True)
183 else if LiftType
= 1 then
184 g_Mark(X
, Y
, Width
, Height
, MARK_LIFTDOWN
, True)
185 else if LiftType
= 2 then
186 g_Mark(X
, Y
, Width
, Height
, MARK_LIFTLEFT
, True)
187 else if LiftType
= 3 then
188 g_Mark(X
, Y
, Width
, Height
, MARK_LIFTRIGHT
, True)
192 if gWalls
<> nil then
194 g_Game_SetLoadingText(_lc
[I_LOAD_COLLIDE_MAP
]+' 6/6', 0, True);
195 for a
:= 0 to High(gWalls
) do
197 if gWalls
[a
].Door
then
200 if gWalls
[a
].Enabled
then
202 g_Mark(X
, Y
, Width
, Height
, MARK_DOOR
, True)
203 else // Îòêðûòàÿ äâåðü:
204 if gWalls
[a
].Enabled
then
206 g_Mark(X
, Y
, Width
, Height
, MARK_DOOR
, False);
210 g_Mark(X
, Y
, Width
, Height
, MARK_WALL
, True);
215 procedure g_GFX_Init();
220 procedure g_GFX_Free();
225 SetLength(Particles
, MaxParticles
);
226 CurrentParticle
:= 0;
228 if OnceAnims
<> nil then
230 for a
:= 0 to High(OnceAnims
) do
231 OnceAnims
[a
].Animation
.Free();
239 procedure CorrectOffsets(id
: Integer);
241 with Particles
[id
] do
243 if (X
>= 0) and (Y
> 0) and
244 (Y
< Length(gCollideMap
)) and (X
< Length(gCollideMap
[0])) and
245 (ByteBool(gCollideMap
[Y
-1, X
] and MARK_BLOCKED
)) then
246 offsetY
:= 1 // Ñòåíà ñâåðõó
250 if (X
> 0) and (Y
>= 0) and
251 (Y
< Length(gCollideMap
)) and (X
< Length(gCollideMap
[0])) and
252 (ByteBool(gCollideMap
[Y
, X
-1] and MARK_BLOCKED
)) then
253 offsetX
:= 1 // Ñòåíà ñëåâà
259 procedure g_GFX_SparkVel(fX
, fY
: Integer; Count
: Word; VX
, VY
: Integer; DevX
, DevY
: Byte);
266 l
:= Length(Particles
);
277 for a
:= 1 to Count
do
279 with Particles
[CurrentParticle
] do
281 X
:= fX
-DevX1
+Random(DevX2
);
282 Y
:= fY
-DevY1
+Random(DevY2
);
284 VelX
:= VX
+ (Random
-Random
)*3;
285 VelY
:= VY
+ (Random
-Random
)*3;
293 AccelX
:= -Sign(VelX
)*Random
/100;
297 Green
:= 100+Random(155);
301 State
:= STATE_NORMAL
;
303 LiveTime
:= 30+Random(60);
304 ParticleType
:= PARTICLE_SPARK
;
306 CorrectOffsets(CurrentParticle
);
309 if CurrentParticle
+2 > MaxParticles
then
312 CurrentParticle
:= CurrentParticle
+1;
316 procedure g_GFX_Blood(fX
, fY
: Integer; Count
: Word; vx
, vy
: Integer;
317 DevX
, DevY
: Word; CR
, CG
, CB
: Byte; Kind
: Byte = BLOOD_NORMAL
);
326 if Kind
= BLOOD_SPARKS
then
328 g_GFX_SparkVel(fX
, fY
, 2 + Random(2), -VX
div 2, -VY
div 2, DevX
, DevY
);
331 l
:= Length(Particles
);
342 for a
:= 1 to Count
do
344 with Particles
[CurrentParticle
] do
346 X
:= fX
- DevX1
+ Random(DevX2
);
347 Y
:= fY
- DevY1
+ Random(DevY2
);
349 if (X
< 0) or (X
> gMapInfo
.Width
-1) or
350 (Y
< 0) or (Y
> gMapInfo
.Height
-1) or
351 ByteBool(gCollideMap
[Y
, X
] and MARK_WALL
) then
354 VelX
:= vx
+ (Random
-Random
)*3;
355 VelY
:= vy
+ (Random
-Random
)*3;
363 AccelX
:= -Sign(VelX
)*Random
/100;
366 CRnd
:= 20*Random(6);
369 CC
:= CR
+ CRnd
- 50;
370 if CC
< 0 then CC
:= 0;
371 if CC
> 255 then CC
:= 255;
377 CC
:= CG
+ CRnd
- 50;
378 if CC
< 0 then CC
:= 0;
379 if CC
> 255 then CC
:= 255;
385 CC
:= CB
+ CRnd
- 50;
386 if CC
< 0 then CC
:= 0;
387 if CC
> 255 then CC
:= 255;
394 State
:= STATE_NORMAL
;
396 LiveTime
:= 120+Random(40);
397 ParticleType
:= PARTICLE_BLOOD
;
399 CorrectOffsets(CurrentParticle
);
402 if CurrentParticle
>= MaxParticles
-1 then
405 CurrentParticle
:= CurrentParticle
+1;
409 procedure g_GFX_Spark(fX
, fY
: Integer; Count
: Word; Angle
: SmallInt; DevX
, DevY
: Byte);
415 BaseVelX
, BaseVelY
: Single;
418 l
:= Length(Particles
);
424 Angle
:= 360 - Angle
;
431 b
:= DegToRad(Angle
);
433 BaseVelY
:= 1.6*sin(b
);
434 if Abs(BaseVelX
) < 0.01 then
436 if Abs(BaseVelY
) < 0.01 then
438 for a
:= 1 to Count
do
440 with Particles
[CurrentParticle
] do
442 X
:= fX
-DevX1
+Random(DevX2
);
443 Y
:= fY
-DevY1
+Random(DevY2
);
445 VelX
:= BaseVelX
*Random
;
446 VelY
:= BaseVelY
-Random
;
451 Green
:= 100+Random(155);
455 State
:= STATE_NORMAL
;
457 LiveTime
:= 30+Random(60);
458 ParticleType
:= PARTICLE_SPARK
;
460 CorrectOffsets(CurrentParticle
);
463 if CurrentParticle
+2 > MaxParticles
then
466 CurrentParticle
:= CurrentParticle
+1;
470 procedure g_GFX_Water(fX
, fY
: Integer; Count
: Word; fVelX
, fVelY
: Single; DevX
, DevY
, Color
: Byte);
477 l
:= Length(Particles
);
483 if Abs(fVelX
) < 3.0 then
484 fVelX
:= 3.0 - 6.0*Random
;
491 for a
:= 1 to Count
do
493 with Particles
[CurrentParticle
] do
495 X
:= fX
-DevX1
+Random(DevX2
);
496 Y
:= fY
-DevY1
+Random(DevY2
);
498 if Abs(fVelX
) < 0.5 then
499 VelX
:= 1.0 - 2.0*Random
501 VelX
:= fVelX
*Random
;
502 if Random(10) < 7 then
504 VelY
:= fVelY
*Random
;
511 Red
:= 155 + Random(9)*10;
512 Green
:= Trunc(150*Random
);
517 Red
:= Trunc(150*Random
);
518 Green
:= 175 + Random(9)*10;
523 Red
:= Trunc(200*Random
);
525 Blue
:= 175 + Random(9)*10;
529 Red
:= 90 + Random(12)*10;
537 State
:= STATE_NORMAL
;
539 LiveTime
:= 60+Random(60);
540 ParticleType
:= PARTICLE_WATER
;
542 CorrectOffsets(CurrentParticle
);
545 if CurrentParticle
+2 > MaxParticles
then
548 CurrentParticle
:= CurrentParticle
+1;
552 procedure g_GFX_SimpleWater(fX
, fY
: Integer; Count
: Word; fVelX
, fVelY
: Single; DefColor
, CR
, CG
, CB
: Byte);
557 l
:= Length(Particles
);
563 for a
:= 1 to Count
do
565 with Particles
[CurrentParticle
] do
578 Red
:= 155 + Random(9)*10;
579 Green
:= Trunc(150*Random
);
584 Red
:= Trunc(150*Random
);
585 Green
:= 175 + Random(9)*10;
590 Red
:= Trunc(200*Random
);
592 Blue
:= 175 + Random(9)*10;
594 4: // Ñâîé öâåò, ñâåòëåå
596 Red
:= 20 + Random(19)*10;
599 Red
:= Min(Red
+ CR
, 255);
600 Green
:= Min(Green
+ CG
, 255);
601 Blue
:= Min(Blue
+ CB
, 255);
603 5: // Ñâîé öâåò, òåìíåå
605 Red
:= 20 + Random(19)*10;
608 Red
:= Max(CR
- Red
, 0);
609 Green
:= Max(CG
- Green
, 0);
610 Blue
:= Max(CB
- Blue
, 0);
614 Red
:= 90 + Random(12)*10;
622 State
:= STATE_NORMAL
;
624 LiveTime
:= 60+Random(60);
625 ParticleType
:= PARTICLE_WATER
;
627 CorrectOffsets(CurrentParticle
);
630 if CurrentParticle
+2 > MaxParticles
then
633 CurrentParticle
:= CurrentParticle
+1;
637 procedure g_GFX_Bubbles(fX
, fY
: Integer; Count
: Word; DevX
, DevY
: Byte);
644 l
:= Length(Particles
);
655 for a
:= 1 to Count
do
657 with Particles
[CurrentParticle
] do
659 X
:= fX
-DevX1
+Random(DevX2
);
660 Y
:= fY
-DevY1
+Random(DevY2
);
662 if (X
>= gMapInfo
.Width
) or (X
<= 0) or
663 (Y
>= gMapInfo
.Height
) or (Y
<= 0) then
666 if not ByteBool(gCollideMap
[Y
, X
] and MARK_LIQUID
) then
679 State
:= STATE_NORMAL
;
682 ParticleType
:= PARTICLE_BUBBLES
;
684 CorrectOffsets(CurrentParticle
);
687 if CurrentParticle
+2 > MaxParticles
then
690 CurrentParticle
:= CurrentParticle
+1;
694 procedure g_GFX_SetMax(Count
: Integer);
696 if Count
> 50000 then
699 SetLength(Particles
, Count
);
700 MaxParticles
:= Count
;
701 if CurrentParticle
>= Count
then
702 CurrentParticle
:= 0;
705 function g_GFX_GetMax(): Integer;
707 Result
:= MaxParticles
;
710 function FindOnceAnim
: DWORD
;
714 if OnceAnims
<> nil then
715 for i
:= 0 to High(OnceAnims
) do
716 if OnceAnims
[i
].Animation
= nil then
722 if OnceAnims
= nil then
724 SetLength(OnceAnims
, 16);
729 Result
:= High(OnceAnims
) + 1;
730 SetLength(OnceAnims
, Length(OnceAnims
) + 16);
734 procedure g_GFX_OnceAnim(X
, Y
: Integer; Anim
: TAnimation
; AnimType
: Byte = 0);
741 find_id
:= FindOnceAnim();
743 OnceAnims
[find_id
].AnimType
:= AnimType
;
744 OnceAnims
[find_id
].Animation
:= TAnimation
.Create(Anim
.FramesID
, Anim
.Loop
, Anim
.Speed
);
745 OnceAnims
[find_id
].Animation
.Blending
:= Anim
.Blending
;
746 OnceAnims
[find_id
].Animation
.Alpha
:= Anim
.Alpha
;
747 OnceAnims
[find_id
].X
:= X
;
748 OnceAnims
[find_id
].Y
:= Y
;
751 procedure g_GFX_Update();
760 if Particles
<> nil then
763 h
:= gMapInfo
.Height
;
765 len
:= High(Particles
);
768 if Particles
[a
].State
<> 0 then
771 if Time
= LiveTime
then
773 if (X
+1 >= w
) or (Y
+1 >= h
) or (X
<= 0) or (Y
<= 0) then
775 if State
= STATE_FREE
then
783 if (State
= STATE_STICK
) then
784 if (not ByteBool(gCollideMap
[Y
-1, X
] and MARK_BLOCKED
)) and
785 (not ByteBool(gCollideMap
[Y
+1, X
] and MARK_BLOCKED
)) and
786 (not ByteBool(gCollideMap
[Y
, X
-1] and MARK_BLOCKED
)) and
787 (not ByteBool(gCollideMap
[Y
, X
+1] and MARK_BLOCKED
)) then
788 begin // Îòëèïëà - êàïàåò
791 State
:= STATE_NORMAL
;
794 if Random(200) = 100 then
795 begin // Ïðèëåïëåíà - íî âîçìîæíî ñòåêàåò
801 if not ByteBool(gCollideMap
[Y
, X
] and MARK_BLOCKED
) then
803 if ByteBool(gCollideMap
[Y
, X
] and MARK_LIFTUP
) then
805 if VelY
> -4-Random(3) then
807 if Abs(VelX
) > 0.1 then
808 VelX
:= VelX
- VelX
/10.0;
809 VelX
:= VelX
+ (Random
-Random
)*0.2;
812 if ByteBool(gCollideMap
[Y
, X
] and MARK_LIFTLEFT
) then
814 if VelX
> -8-Random(3) then
818 if ByteBool(gCollideMap
[Y
, X
] and MARK_LIFTRIGHT
) then
819 begin // Ïîòîê âïðàâî
820 if VelX
< 8+Random(3) then
829 if (Abs(VelX
) < 0.1) and (Abs(VelY
) < 0.1) then
830 if (State
<> STATE_STICK
) and
831 (not ByteBool(gCollideMap
[Y
-1, X
] and MARK_BLOCKED
)) and
832 (not ByteBool(gCollideMap
[Y
, X
] and MARK_BLOCKED
)) and
833 (not ByteBool(gCollideMap
[Y
+1, X
] and MARK_BLOCKED
)) then
834 begin // Âèñèò â âîçäóõå - êàïàåò
837 State
:= STATE_NORMAL
;
851 if (X
+s
>= w
) or (X
+s
<= 0) then
857 c
:= gCollideMap
[Y
, X
+s
];
859 if ByteBool(c
and MARK_BLOCKED
) then
865 State
:= STATE_STICK
;
884 if (Y
+s
>= h
) or (Y
+s
<= 0) then
890 c
:= gCollideMap
[Y
+s
, X
];
892 if ByteBool(c
and MARK_BLOCKED
) then
898 if (s
> 0) and (State
<> STATE_STICK
) then
899 State
:= STATE_NORMAL
901 State
:= STATE_STICK
;
914 if (X
+dX
>= w
) or (Y
+dY
>= h
) or
915 (X
+dX
<= 0) or (Y
+dY
<= 0) or
916 ByteBool(gCollideMap
[Y
+dY
, X
+dX
] and MARK_BLOCKED
) then
917 begin // Ñòåíà/äâåðü/ãðàíèöà
929 VelX
:= VelX
+ AccelX
;
930 VelY
:= VelY
+ AccelY
;
932 // Êðîâü ðàñòâîðÿåòñÿ â æèäêîñòè:
933 if ByteBool(gCollideMap
[Y
, X
] and MARK_LIQUID
) then
937 Alpha
:= 255 - Trunc((255.0 * Time
) / LiveTime
);
946 if (Abs(VelX
) < 0.1) and (Abs(VelY
) < 0.1) and
947 (not ByteBool(gCollideMap
[Y
-1, X
] and MARK_BLOCKED
)) and
948 (not ByteBool(gCollideMap
[Y
, X
] and MARK_BLOCKED
)) and
949 (not ByteBool(gCollideMap
[Y
+1, X
] and MARK_BLOCKED
)) then
950 begin // Âèñèò â âîçäóõå
966 if (X
+s
>= w
) or (X
+s
<= 0) then
972 c
:= gCollideMap
[Y
, X
+s
];
974 if ByteBool(c
and MARK_BLOCKED
) then
975 begin // Ñòåíà/äâåðü - ïàäàåò âåðòèêàëüíî
981 if c
= MARK_FREE
then
1002 if (Y
+s
>= h
) or (Y
+s
<= 0) then
1004 State
:= STATE_FREE
;
1008 c
:= gCollideMap
[Y
+s
, X
];
1010 if ByteBool(c
and MARK_BLOCKED
) then
1011 begin // Ñòåíà/äâåðü - ïàäàåò âåðòèêàëüíî
1015 AccelY
:= Abs(AccelY
);
1017 else // Èëè íå ïàäàåò
1028 if c
= MARK_FREE
then
1032 State
:= STATE_FREE
;
1039 VelX
:= VelX
+ AccelX
;
1043 AccelY
:= AccelY
+ 0.08;
1044 VelY
:= VelY
+ AccelY
;
1052 if (State
= STATE_STICK
) and (Random(30) = 15) then
1053 begin // Ñòåêàåò/îòëèïàåò
1056 if (not ByteBool(gCollideMap
[Y
, X
-1] and MARK_BLOCKED
)) and
1057 (not ByteBool(gCollideMap
[Y
, X
+1] and MARK_BLOCKED
)) then
1058 State
:= STATE_NORMAL
;
1062 if not ByteBool(gCollideMap
[Y
, X
] and MARK_BLOCKED
) then
1064 if ByteBool(gCollideMap
[Y
, X
] and MARK_LIFTUP
) then
1066 if VelY
> -4-Random(3) then
1068 if Abs(VelX
) > 0.1 then
1069 VelX
:= VelX
- VelX
/10.0;
1070 VelX
:= VelX
+ (Random
-Random
)*0.2;
1073 if ByteBool(gCollideMap
[Y
, X
] and MARK_LIFTLEFT
) then
1074 begin // Ïîòîê âëåâî
1075 if VelX
> -8-Random(3) then
1079 if ByteBool(gCollideMap
[Y
, X
] and MARK_LIFTRIGHT
) then
1080 begin // Ïîòîê âïðàâî
1081 if VelX
< 8+Random(3) then
1090 if (Abs(VelX
) < 0.1) and (Abs(VelY
) < 0.1) then
1091 if (State
<> STATE_STICK
) and
1092 (not ByteBool(gCollideMap
[Y
-1, X
] and MARK_BLOCKED
)) and
1093 (not ByteBool(gCollideMap
[Y
, X
] and MARK_BLOCKED
)) and
1094 (not ByteBool(gCollideMap
[Y
+1, X
] and MARK_BLOCKED
)) then
1095 begin // Âèñèò â âîçäóõå - êàïàåò
1098 State
:= STATE_NORMAL
;
1108 for b
:= 1 to Abs(dX
) do
1110 if (X
+s
>= w
) or (X
+s
<= 0) then
1111 begin // Ñáîêó ãðàíèöà
1112 State
:= STATE_FREE
;
1116 c
:= gCollideMap
[Y
, X
+s
];
1118 if ByteBool(c
and MARK_LIQUID
) and (dY
> 0) then
1119 begin // Ñáîêó æèäêîñòü, à ÷àñòèöà óæå ïàäàåò
1120 State
:= STATE_FREE
;
1124 if ByteBool(c
and MARK_BLOCKED
) then
1125 begin // Ñòåíà/äâåðü
1130 State
:= STATE_STICK
;
1145 for b
:= 1 to Abs(dY
) do
1147 if (Y
+s
>= h
) or (Y
+s
<= 0) then
1148 begin // Ñíèçó/ñâåðõó ãðàíèöà
1149 State
:= STATE_FREE
;
1153 c
:= gCollideMap
[Y
+s
, X
];
1155 if ByteBool(c
and MARK_LIQUID
) and (dY
> 0) then
1156 begin // Ñíèçó æèäêîñòü, à ÷àñòèöà óæå ïàäàåò
1157 State
:= STATE_FREE
;
1161 if ByteBool(c
and MARK_BLOCKED
) then
1162 begin // Ñòåíà/äâåðü
1167 if (s
> 0) and (State
<> STATE_STICK
) then
1168 State
:= STATE_NORMAL
1170 State
:= STATE_STICK
;
1178 VelX
:= VelX
+ AccelX
;
1179 VelY
:= VelY
+ AccelY
;
1195 for b
:= 1 to Abs(dY
) do
1197 if (Y
+s
>= h
) or (Y
+s
<= 0) then
1199 State
:= STATE_FREE
;
1203 if not ByteBool(gCollideMap
[Y
+s
, X
] and MARK_LIQUID
) then
1204 begin // Óæå íå æèäêîñòü
1205 State
:= STATE_FREE
;
1214 VelY
:= VelY
+ AccelY
;
1222 end; // Particles <> nil
1224 if OnceAnims
<> nil then
1226 for a
:= 0 to High(OnceAnims
) do
1227 if OnceAnims
[a
].Animation
<> nil then
1229 case OnceAnims
[a
].AnimType
of
1232 if Random(3) = 0 then
1233 OnceAnims
[a
].X
:= OnceAnims
[a
].X
-1+Random(3);
1234 if Random(2) = 0 then
1235 OnceAnims
[a
].Y
:= OnceAnims
[a
].Y
-Random(2);
1239 if OnceAnims
[a
].Animation
.Played
then
1241 OnceAnims
[a
].Animation
.Free();
1242 OnceAnims
[a
].Animation
:= nil;
1245 OnceAnims
[a
].Animation
.Update();
1250 procedure g_GFX_Draw();
1254 if Particles
<> nil then
1256 glDisable(GL_TEXTURE_2D
);
1260 glBlendFunc(GL_SRC_ALPHA
, GL_ONE_MINUS_SRC_ALPHA
);
1264 len
:= High(Particles
);
1266 for a
:= 0 to len
do
1267 with Particles
[a
] do
1268 if (State
<> STATE_FREE
) and (X
>= sX
) and (Y
>= sY
) and
1269 (X
<= sX
+sWidth
) and (sY
<= sY
+sHeight
) then
1271 glColor4ub(Red
, Green
, Blue
, Alpha
);
1272 glVertex2i(X
+ offsetX
, Y
+ offsetY
);
1277 glDisable(GL_BLEND
);
1280 if OnceAnims
<> nil then
1281 for a
:= 0 to High(OnceAnims
) do
1282 if OnceAnims
[a
].Animation
<> nil then
1283 with OnceAnims
[a
] do
1284 Animation
.Draw(X
, Y
, M_NONE
);