1 (* Copyright (C) DooM 2D:Forever Developers
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 {$INCLUDE ../shared/a_modes.inc}
23 MAPDEF
, BinEditor
, g_textures
, xdynrec
;
26 TAddTextureArray
= Array of
32 TPanel
= Class (TObject
)
41 False: (Tex
: Cardinal);
42 True: (AnTex
: TAnimation
);
45 mMovingSpeed
: TDFPoint
;
46 mMovingStart
: TDFPoint
;
48 mMovingActive
: Boolean;
51 function getx1 (): Integer; inline;
52 function gety1 (): Integer; inline;
53 function getvisvalid (): Boolean; inline;
56 FCurTexture
: Integer; // Íîìåð òåêóùåé òåêñòóðû
60 FWidth
, FHeight
: Word;
62 FSaveIt
: Boolean; // Ñîõðàíÿòü ïðè SaveState?
68 arrIdx
: Integer; // index in one of internal arrays; sorry
69 tag
: Integer; // used in coldets and such; sorry
70 proxyId
: Integer; // proxy id in map grid (DO NOT USE!)
72 constructor Create(PanelRec
: TDynRecord
;
73 AddTextures
: TAddTextureArray
;
75 var Textures
: TLevelTextureArray
);
76 destructor Destroy(); override;
79 procedure DrawShadowVolume(lightX
: Integer; lightY
: Integer; radius
: Integer);
81 procedure SetFrame(Frame
: Integer; Count
: Byte);
82 procedure NextTexture(AnimLoop
: Byte = 0);
83 procedure SetTexture(ID
: Integer; AnimLoop
: Byte = 0);
84 function GetTextureID(): Cardinal;
85 function GetTextureCount(): Integer;
87 procedure SaveState(var Mem
: TBinMemoryWriter
);
88 procedure LoadState(var Mem
: TBinMemoryReader
);
91 property visvalid
: Boolean read getvisvalid
; // panel is "visvalid" when it's width and height are positive
94 property x0
: Integer read FX
;
95 property y0
: Integer read FY
;
96 property x1
: Integer read getx1
; // inclusive!
97 property y1
: Integer read gety1
; // inclusive!
98 property x
: Integer read FX write FX
;
99 property y
: Integer read FY write FY
;
100 property width
: Word read FWidth write FWidth
;
101 property height
: Word read FHeight write FHeight
;
102 property panelType
: Word read FPanelType write FPanelType
;
103 property saveIt
: Boolean read FSaveIt write FSaveIt
; // Ñîõðàíÿòü ïðè SaveState?
104 property enabled
: Boolean read FEnabled write FEnabled
; // Ñîõðàíÿòü ïðè SaveState?
105 property door
: Boolean read FDoor write FDoor
; // Ñîõðàíÿòü ïðè SaveState?
106 property moved
: Boolean read FMoved write FMoved
; // Ñîõðàíÿòü ïðè SaveState?
107 property liftType
: Byte read FLiftType write FLiftType
; // Ñîõðàíÿòü ïðè SaveState?
108 property lastAnimLoop
: Byte read FLastAnimLoop write FLastAnimLoop
; // Ñîõðàíÿòü ïðè SaveState?
110 property movingActive
: Boolean read mMovingActive write mMovingActive
;
113 property movingSpeed
: TDFPoint read mMovingSpeed write mMovingSpeed
;
114 property movingStart
: TDFPoint read mMovingStart write mMovingStart
;
115 property movingEnd
: TDFPoint read mMovingEnd write mMovingEnd
;
118 TPanelArray
= Array of TPanel
;
123 SysUtils
, g_basic
, g_map
, g_game
, e_graphics
,
124 g_console
, g_language
, g_monsters
, g_player
, e_log
, GL
;
127 PANEL_SIGNATURE
= $4C4E4150; // 'PANL'
131 constructor TPanel
.Create(PanelRec
: TDynRecord
;
132 AddTextures
: TAddTextureArray
;
134 var Textures
: TLevelTextureArray
);
140 Width
:= PanelRec
.Width
;
141 Height
:= PanelRec
.Height
;
149 mMovingSpeed
:= PanelRec
.moveSpeed
;
150 mMovingStart
:= PanelRec
.moveStart
;
151 mMovingEnd
:= PanelRec
.moveEnd
;
152 mMovingActive
:= PanelRec
['move_active'].varvalue
;
155 PanelType
:= PanelRec
.PanelType
;
193 if ByteBool(PanelRec
.Flags
and PANEL_FLAG_HIDE
) then
195 SetLength(FTextureIDs
, 0);
199 // Ïàíåëè, íå èñïîëüçóþùèå òåêñòóðû:
200 if ByteBool(PanelType
and
205 PANEL_BLOCKMON
)) then
207 SetLength(FTextureIDs
, 0);
212 // Åñëè ýòî æèäêîñòü áåç òåêñòóðû - ñïåöòåêñòóðó:
213 if WordBool(PanelType
and (PANEL_WATER
or PANEL_ACID1
or PANEL_ACID2
)) and
214 (not ByteBool(PanelRec
.Flags
and PANEL_FLAG_WATERTEXTURES
)) then
216 SetLength(FTextureIDs
, 1);
217 FTextureIDs
[0].Anim
:= False;
219 case PanelRec
.PanelType
of
221 FTextureIDs
[0].Tex
:= LongWord(TEXTURE_SPECIAL_WATER
);
223 FTextureIDs
[0].Tex
:= LongWord(TEXTURE_SPECIAL_ACID1
);
225 FTextureIDs
[0].Tex
:= LongWord(TEXTURE_SPECIAL_ACID2
);
232 SetLength(FTextureIDs
, Length(AddTextures
));
237 if CurTex
>= Length(FTextureIDs
) then
238 FCurTexture
:= Length(FTextureIDs
) - 1
240 FCurTexture
:= CurTex
;
242 for i
:= 0 to Length(FTextureIDs
)-1 do
244 FTextureIDs
[i
].Anim
:= AddTextures
[i
].Anim
;
245 if FTextureIDs
[i
].Anim
then
246 begin // Àíèìèðîâàííàÿ òåêñòóðà
247 FTextureIDs
[i
].AnTex
:=
248 TAnimation
.Create(Textures
[AddTextures
[i
].Texture
].FramesID
,
249 True, Textures
[AddTextures
[i
].Texture
].Speed
);
250 FTextureIDs
[i
].AnTex
.Blending
:= ByteBool(PanelRec
.Flags
and PANEL_FLAG_BLENDING
);
251 FTextureIDs
[i
].AnTex
.Alpha
:= PanelRec
.Alpha
;
255 begin // Îáû÷íàÿ òåêñòóðà
256 FTextureIDs
[i
].Tex
:= Textures
[AddTextures
[i
].Texture
].TextureID
;
260 // Òåêñòóð íåñêîëüêî - íóæíî ñîõðàíÿòü òåêóùóþ:
261 if Length(FTextureIDs
) > 1 then
264 // Åñëè íå ñïåöòåêñòóðà, òî çàäàåì ðàçìåðû:
265 if PanelRec
.TextureNum
> High(Textures
) then
267 e_WriteLog(Format('WTF?! PanelRec.TextureNum is out of limits! (%d : %d)', [PanelRec
.TextureNum
, High(Textures
)]), MSG_FATALERROR
);
271 FBlending
:= ByteBool(0);
273 else if not g_Map_IsSpecialTexture(Textures
[PanelRec
.TextureNum
].TextureName
) then
275 FTextureWidth
:= Textures
[PanelRec
.TextureNum
].Width
;
276 FTextureHeight
:= Textures
[PanelRec
.TextureNum
].Height
;
277 FAlpha
:= PanelRec
.Alpha
;
278 FBlending
:= ByteBool(PanelRec
.Flags
and PANEL_FLAG_BLENDING
);
282 destructor TPanel
.Destroy();
286 for i
:= 0 to High(FTextureIDs
) do
287 if FTextureIDs
[i
].Anim
then
288 FTextureIDs
[i
].AnTex
.Free();
289 SetLength(FTextureIDs
, 0);
294 function TPanel
.getx1 (): Integer; inline; begin result
:= X
+Width
-1; end;
295 function TPanel
.gety1 (): Integer; inline; begin result
:= Y
+Height
-1; end;
296 function TPanel
.getvisvalid (): Boolean; inline; begin result
:= (Width
> 0) and (Height
> 0); end;
298 procedure TPanel
.Draw();
304 if {Enabled and} (FCurTexture
>= 0) and
305 (Width
> 0) and (Height
> 0) and (FAlpha
< 255) and
306 (g_dbg_scale_05
or g_Collide(X
, Y
, Width
, Height
, sX
, sY
, sWidth
, sHeight
)) then
308 if FTextureIDs
[FCurTexture
].Anim
then
309 begin // Àíèìèðîâàííàÿ òåêñòóðà
310 if FTextureIDs
[FCurTexture
].AnTex
= nil then
313 for xx
:= 0 to (Width
div FTextureWidth
)-1 do
314 for yy
:= 0 to (Height
div FTextureHeight
)-1 do
315 FTextureIDs
[FCurTexture
].AnTex
.Draw(
316 X
+ xx
*FTextureWidth
,
317 Y
+ yy
*FTextureHeight
, M_NONE
);
320 begin // Îáû÷íàÿ òåêñòóðà
321 case FTextureIDs
[FCurTexture
].Tex
of
322 LongWord(TEXTURE_SPECIAL_WATER
):
323 e_DrawFillQuad(X
, Y
, X
+Width
-1, Y
+Height
-1,
324 0, 0, 255, 0, B_FILTER
);
325 LongWord(TEXTURE_SPECIAL_ACID1
):
326 e_DrawFillQuad(X
, Y
, X
+Width
-1, Y
+Height
-1,
327 0, 128, 0, 0, B_FILTER
);
328 LongWord(TEXTURE_SPECIAL_ACID2
):
329 e_DrawFillQuad(X
, Y
, X
+Width
-1, Y
+Height
-1,
330 128, 0, 0, 0, B_FILTER
);
331 LongWord(TEXTURE_NONE
):
332 if g_Texture_Get('NOTEXTURE', NoTextureID
) then
334 e_GetTextureSize(NoTextureID
, @NW
, @NH
);
335 e_DrawFill(NoTextureID
, X
, Y
, Width
div NW
, Height
div NH
,
339 xx
:= X
+ (Width
div 2);
340 yy
:= Y
+ (Height
div 2);
341 e_DrawFillQuad(X
, Y
, xx
, yy
,
343 e_DrawFillQuad(xx
, Y
, X
+Width
-1, yy
,
345 e_DrawFillQuad(X
, yy
, xx
, Y
+Height
-1,
347 e_DrawFillQuad(xx
, yy
, X
+Width
-1, Y
+Height
-1,
352 e_DrawFill(FTextureIDs
[FCurTexture
].Tex
, X
, Y
,
353 Width
div FTextureWidth
,
354 Height
div FTextureHeight
,
355 FAlpha
, True, FBlending
);
361 procedure TPanel
.DrawShadowVolume(lightX
: Integer; lightY
: Integer; radius
: Integer);
362 procedure extrude (x
: Integer; y
: Integer);
364 glVertex2i(x
+(x
-lightX
)*500, y
+(y
-lightY
)*500);
365 //e_WriteLog(Format(' : (%d,%d)', [x+(x-lightX)*300, y+(y-lightY)*300]), MSG_WARNING);
368 procedure drawLine (x0
: Integer; y0
: Integer; x1
: Integer; y1
: Integer);
370 // does this side facing the light?
371 if ((x1
-x0
)*(lightY
-y0
)-(lightX
-x0
)*(y1
-y0
) >= 0) then exit
;
372 //e_WriteLog(Format('lightpan: (%d,%d)-(%d,%d)', [x0, y0, x1, y1]), MSG_WARNING);
373 // this edge is facing the light, extrude and draw it
381 if radius
< 4 then exit
;
382 if Enabled
and (FCurTexture
>= 0) and (Width
> 0) and (Height
> 0) and (FAlpha
< 255) and g_Collide(X
, Y
, Width
, Height
, sX
, sY
, sWidth
, sHeight
) then
384 if not FTextureIDs
[FCurTexture
].Anim
then
386 case FTextureIDs
[FCurTexture
].Tex
of
387 LongWord(TEXTURE_SPECIAL_WATER
): exit
;
388 LongWord(TEXTURE_SPECIAL_ACID1
): exit
;
389 LongWord(TEXTURE_SPECIAL_ACID2
): exit
;
390 LongWord(TEXTURE_NONE
): exit
;
393 if (X
+Width
< lightX
-radius
) then exit
;
394 if (Y
+Height
< lightY
-radius
) then exit
;
395 if (X
> lightX
+radius
) then exit
;
396 if (Y
> lightY
+radius
) then exit
;
397 //e_DrawFill(FTextureIDs[FCurTexture].Tex, X, Y, Width div FTextureWidth, Height div FTextureHeight, FAlpha, True, FBlending);
400 drawLine(x
, y
, x
+width
, y
); // top
401 drawLine(x
+width
, y
, x
+width
, y
+height
); // right
402 drawLine(x
+width
, y
+height
, x
, y
+height
); // bottom
403 drawLine(x
, y
+height
, x
, y
); // left
410 monMoveList
: array of TMonster
= nil;
411 monMoveListUsed
: Integer = 0;
413 procedure TPanel
.Update();
418 function doPush (px
, py
, pw
, ph
: Integer; out dx
, dy
: Integer): Boolean;
420 result
:= g_Collide(px
, py
, pw
, ph
, nx
, ny
, Width
, Height
);
424 if (mMovingSpeed
.X
< 0) then dx
:= nx
-(px
+pw
)
425 else if (mMovingSpeed
.X
> 0) then dx
:= (nx
+Width
)-px
427 if (mMovingSpeed
.Y
< 0) then dy
:= ny
-(py
+ph
)
428 else if (mMovingSpeed
.Y
> 0) then dy
:= (ny
+Height
)-py
438 function monMove (mon
: TMonster
): Boolean;
440 result
:= false; // don't stop
441 mon
.GameX
:= mon
.GameX
+mMovingSpeed
.X
;
442 mon
.GameY
:= mon
.GameY
+mMovingSpeed
.Y
;
443 if (monMoveListUsed
>= Length(monMoveList
)) then SetLength(monMoveList
, monMoveListUsed
+64);
444 monMoveList
[monMoveListUsed
] := mon
;
445 Inc(monMoveListUsed
);
448 function monPush (mon
: TMonster
): Boolean;
450 px
, py
, pw
, ph
, dx
, dy
: Integer;
452 result
:= false; // don't stop
453 mon
.getMapBox(px
, py
, pw
, ph
);
454 if doPush(px
, py
, pw
, ph
, dx
, dy
) then
456 mon
.GameX
:= mon
.GameX
+dx
;
457 mon
.GameY
:= mon
.GameY
+dy
;
458 if (monMoveListUsed
>= Length(monMoveList
)) then SetLength(monMoveList
, monMoveListUsed
+64);
459 monMoveList
[monMoveListUsed
] := mon
;
460 Inc(monMoveListUsed
);
464 procedure plrMove (plr
: TPlayer
);
466 px
, py
, pw
, ph
, dx
, dy
: Integer;
468 if (plr
= nil) then exit
;
469 plr
.getMapBox(px
, py
, pw
, ph
);
473 if doPush(px
, py
, pw
, ph
, dx
, dy
) then
475 plr
.GameX
:= plr
.GameX
+dx
;
476 plr
.GameY
:= plr
.GameY
+dy
;
477 plr
.positionChanged();
481 if (px
+pw
<= X
) then exit
;
482 if (px
>= X
+Width
) then exit
;
483 plr
.GameX
:= plr
.GameX
+mMovingSpeed
.X
;
484 plr
.GameY
:= plr
.GameY
+mMovingSpeed
.Y
;
485 plr
.positionChanged();
489 if Enabled
and (FCurTexture
>= 0) and
490 (FTextureIDs
[FCurTexture
].Anim
) and
491 (FTextureIDs
[FCurTexture
].AnTex
<> nil) and
492 (Width
> 0) and (Height
> 0) and (FAlpha
< 255) then
494 FTextureIDs
[FCurTexture
].AnTex
.Update();
495 FCurFrame
:= FTextureIDs
[FCurTexture
].AnTex
.CurrentFrame
;
496 FCurFrameCount
:= FTextureIDs
[FCurTexture
].AnTex
.CurrentCounter
;
499 if mMovingActive
and (not mMovingSpeed
.isZero
) then
501 monMoveListUsed
:= 0;
502 nx
:= X
+mMovingSpeed
.X
;
503 ny
:= Y
+mMovingSpeed
.Y
;
504 g_Mons_ForEachAt(X
, Y
-1, Width
, 1, monMove
);
505 g_Mons_ForEachAt(nx
, ny
, Width
, Height
, monPush
);
506 for f
:= 0 to High(gPlayers
) do plrMove(gPlayers
[f
]);
507 if (mMovingSpeed
.X
< 0) and (nx
<= mMovingStart
.X
) then mMovingSpeed
.X
:= -mMovingSpeed
.X
508 else if (mMovingSpeed
.X
> 0) and (nx
>= mMovingEnd
.X
) then mMovingSpeed
.X
:= -mMovingSpeed
.X
;
509 if (mMovingSpeed
.Y
< 0) and (ny
<= mMovingStart
.Y
) then mMovingSpeed
.Y
:= -mMovingSpeed
.Y
510 else if (mMovingSpeed
.Y
> 0) and (ny
>= mMovingEnd
.Y
) then mMovingSpeed
.Y
:= -mMovingSpeed
.Y
;
511 //!!!g_Mark(X, Y, Width, Height, MARK_FREE);
514 //!!!g_Mark(X, Y, Width, Height, MARK_WALL);
515 if (proxyId
>= 0) then mapGrid
.moveBody(proxyId
, nx
, ny
);
516 for f
:= 0 to monMoveListUsed
-1 do monMoveList
[f
].positionChanged();
520 procedure TPanel
.SetFrame(Frame
: Integer; Count
: Byte);
522 function ClampInt(X
, A
, B
: Integer): Integer;
525 if X
< A
then Result
:= A
else if X
> B
then Result
:= B
;
529 if Enabled
and (FCurTexture
>= 0) and
530 (FTextureIDs
[FCurTexture
].Anim
) and
531 (FTextureIDs
[FCurTexture
].AnTex
<> nil) and
532 (Width
> 0) and (Height
> 0) and (FAlpha
< 255) then
534 FCurFrame
:= ClampInt(Frame
, 0, FTextureIDs
[FCurTexture
].AnTex
.TotalFrames
);
535 FCurFrameCount
:= Count
;
536 FTextureIDs
[FCurTexture
].AnTex
.CurrentFrame
:= FCurFrame
;
537 FTextureIDs
[FCurTexture
].AnTex
.CurrentCounter
:= FCurFrameCount
;
541 procedure TPanel
.NextTexture(AnimLoop
: Byte = 0);
543 Assert(FCurTexture
>= -1, 'FCurTexture < -1');
546 if Length(FTextureIDs
) = 0 then
549 // Òîëüêî îäíà òåêñòóðà:
550 if Length(FTextureIDs
) = 1 then
552 if FCurTexture
= 0 then
558 // Áîëüøå îäíîé òåêñòóðû:
562 // Ñëåäóþùåé íåò - âîçâðàò ê íà÷àëó:
563 if FCurTexture
>= Length(FTextureIDs
) then
567 // Ïåðåêëþ÷èëèñü íà âèäèìóþ àíèì. òåêñòóðó:
568 if (FCurTexture
>= 0) and FTextureIDs
[FCurTexture
].Anim
then
570 if (FTextureIDs
[FCurTexture
].AnTex
= nil) then
572 g_FatalError(_lc
[I_GAME_ERROR_SWITCH_TEXTURE
]);
577 FTextureIDs
[FCurTexture
].AnTex
.Loop
:= True
580 FTextureIDs
[FCurTexture
].AnTex
.Loop
:= False;
582 FTextureIDs
[FCurTexture
].AnTex
.Reset();
585 LastAnimLoop
:= AnimLoop
;
588 procedure TPanel
.SetTexture(ID
: Integer; AnimLoop
: Byte = 0);
591 if Length(FTextureIDs
) = 0 then
594 // Òîëüêî îäíà òåêñòóðà:
595 if Length(FTextureIDs
) = 1 then
597 if (ID
= 0) or (ID
= -1) then
601 // Áîëüøå îäíîé òåêñòóðû:
603 if (ID
>= -1) and (ID
<= High(FTextureIDs
)) then
607 // Ïåðåêëþ÷èëèñü íà âèäèìóþ àíèì. òåêñòóðó:
608 if (FCurTexture
>= 0) and FTextureIDs
[FCurTexture
].Anim
then
610 if (FTextureIDs
[FCurTexture
].AnTex
= nil) then
612 g_FatalError(_lc
[I_GAME_ERROR_SWITCH_TEXTURE
]);
617 FTextureIDs
[FCurTexture
].AnTex
.Loop
:= True
620 FTextureIDs
[FCurTexture
].AnTex
.Loop
:= False;
622 FTextureIDs
[FCurTexture
].AnTex
.Reset();
625 LastAnimLoop
:= AnimLoop
;
628 function TPanel
.GetTextureID(): DWORD
;
630 Result
:= LongWord(TEXTURE_NONE
);
632 if (FCurTexture
>= 0) then
634 if FTextureIDs
[FCurTexture
].Anim
then
635 Result
:= FTextureIDs
[FCurTexture
].AnTex
.FramesID
637 Result
:= FTextureIDs
[FCurTexture
].Tex
;
641 function TPanel
.GetTextureCount(): Integer;
643 Result
:= Length(FTextureIDs
);
644 if Enabled
and (FCurTexture
>= 0) then
645 if (FTextureIDs
[FCurTexture
].Anim
) and
646 (FTextureIDs
[FCurTexture
].AnTex
<> nil) and
647 (Width
> 0) and (Height
> 0) and (FAlpha
< 255) then
648 Result
:= Result
+ 100;
651 procedure TPanel
.SaveState(Var Mem
: TBinMemoryWriter
);
656 if (Mem
= nil) then exit
;
657 //if not SaveIt then exit;
660 sig
:= PANEL_SIGNATURE
; // 'PANL'
662 // Îòêðûòà/çàêðûòà, åñëè äâåðü:
663 Mem
.WriteBoolean(FEnabled
);
664 // Íàïðàâëåíèå ëèôòà, åñëè ëèôò:
665 Mem
.WriteByte(FLiftType
);
666 // Íîìåð òåêóùåé òåêñòóðû:
667 Mem
.WriteInt(FCurTexture
);
671 // Àíèìèðîâàííàÿ ëè òåêóùàÿ òåêñòóðà:
672 if (FCurTexture
>= 0) and (FTextureIDs
[FCurTexture
].Anim
) then
674 Assert(FTextureIDs
[FCurTexture
].AnTex
<> nil,
675 'TPanel.SaveState: No animation object');
680 Mem
.WriteBoolean(anim
);
681 // Åñëè äà - ñîõðàíÿåì àíèìàöèþ:
683 FTextureIDs
[FCurTexture
].AnTex
.SaveState(Mem
);
684 // moving platform state
685 Mem
.WriteInt(mMovingSpeed
.X
);
686 Mem
.WriteInt(mMovingSpeed
.Y
);
687 Mem
.WriteInt(mMovingStart
.X
);
688 Mem
.WriteInt(mMovingStart
.Y
);
689 Mem
.WriteInt(mMovingEnd
.X
);
690 Mem
.WriteInt(mMovingEnd
.Y
);
691 Mem
.WriteBoolean(mMovingActive
);
694 procedure TPanel
.LoadState(var Mem
: TBinMemoryReader
);
700 if (Mem
= nil) then exit
;
701 //if not SaveIt then exit;
705 if sig
<> PANEL_SIGNATURE
then // 'PANL'
707 raise EBinSizeError
.Create('TPanel.LoadState: Wrong Panel Signature');
709 // Îòêðûòà/çàêðûòà, åñëè äâåðü:
710 Mem
.ReadBoolean(FEnabled
);
711 // Íàïðàâëåíèå ëèôòà, åñëè ëèôò:
712 Mem
.ReadByte(FLiftType
);
713 // Íîìåð òåêóùåé òåêñòóðû:
714 Mem
.ReadInt(FCurTexture
);
720 //e_LogWritefln('panel %s(%s): old=(%s,%s); new=(%s,%s); delta=(%s,%s)', [arrIdx, proxyId, ox, oy, FX, FY, FX-ox, FY-oy]);
721 // Àíèìèðîâàííàÿ ëè òåêóùàÿ òåêñòóðà:
722 Mem
.ReadBoolean(anim
);
723 // Åñëè äà - çàãðóæàåì àíèìàöèþ:
726 Assert((FCurTexture
>= 0) and
727 (FTextureIDs
[FCurTexture
].Anim
) and
728 (FTextureIDs
[FCurTexture
].AnTex
<> nil),
729 'TPanel.LoadState: No animation object');
730 FTextureIDs
[FCurTexture
].AnTex
.LoadState(Mem
);
732 // moving platform state
733 Mem
.ReadInt(mMovingSpeed
.X
);
734 Mem
.ReadInt(mMovingSpeed
.Y
);
735 Mem
.ReadInt(mMovingStart
.X
);
736 Mem
.ReadInt(mMovingStart
.Y
);
737 Mem
.ReadInt(mMovingEnd
.X
);
738 Mem
.ReadInt(mMovingEnd
.Y
);
739 Mem
.ReadBoolean(mMovingActive
);
741 if (proxyId
>= 0) then mapGrid
.moveBody(proxyId
, X
, Y
);