X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_panel.pas;h=7f3e35f9a0b4fabe792e93b17e435450c323fad5;hb=a4f25c41dfd783a925aa2dab4b9b84753d5c3f18;hp=c46cf8c456d1f591698f72dc96593132c17680e0;hpb=2a9dada1550aeeb1ca055fb9f88952c930a64760;p=d2df-sdl.git diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas index c46cf8c..7f3e35f 100644 --- a/src/game/g_panel.pas +++ b/src/game/g_panel.pas @@ -14,12 +14,13 @@ * along with this program. If not, see . *) {$INCLUDE ../shared/a_modes.inc} +{$M+} unit g_panel; interface uses - MAPDEF, BinEditor, g_textures; + MAPDEF, BinEditor, g_textures, xdynrec; type TAddTextureArray = Array of @@ -50,20 +51,20 @@ type FCurTexture: Integer; // Íîìåð òåêóùåé òåêñòóðû FCurFrame: Integer; FCurFrameCount: Byte; - X, Y: Integer; - Width, Height: Word; - PanelType: Word; - SaveIt: Boolean; // Ñîõðàíÿòü ïðè SaveState? - Enabled: Boolean; - Door: Boolean; - Moved: Boolean; - LiftType: Byte; - LastAnimLoop: Byte; + FX, FY: Integer; + FWidth, FHeight: Word; + FPanelType: Word; + FSaveIt: Boolean; // Ñîõðàíÿòü ïðè SaveState? + FEnabled: Boolean; + FDoor: Boolean; + FMoved: Boolean; + FLiftType: Byte; + FLastAnimLoop: Byte; arrIdx: Integer; // index in one of internal arrays; sorry tag: Integer; // used in coldets and such; sorry proxyId: Integer; // proxy id in map grid (DO NOT USE!) - constructor Create(PanelRec: TPanelRec_1; + constructor Create(PanelRec: TDynRecord; AddTextures: TAddTextureArray; CurTex: Integer; var Textures: TLevelTextureArray); @@ -81,14 +82,27 @@ type procedure SaveState(var Mem: TBinMemoryWriter); procedure LoadState(var Mem: TBinMemoryReader); - property x0: Integer read X; - property y0: Integer read Y; + public + property visvalid: Boolean read getvisvalid; // panel is "visvalid" when it's width and height are positive + + published + property x0: Integer read FX; + property y0: Integer read FY; property x1: Integer read getx1; // inclusive! property y1: Integer read gety1; // inclusive! - property visvalid: Boolean read getvisvalid; // panel is "visvalid" when it's width and height are positive + property x: Integer read FX write FX; + property y: Integer read FY write FY; + property width: Word read FWidth write FWidth; + property height: Word read FHeight write FHeight; + property panelType: Word read FPanelType write FPanelType; + property saveIt: Boolean read FSaveIt write FSaveIt; // Ñîõðàíÿòü ïðè SaveState? + property enabled: Boolean read FEnabled write FEnabled; // Ñîõðàíÿòü ïðè SaveState? + property door: Boolean read FDoor write FDoor; // Ñîõðàíÿòü ïðè SaveState? + property moved: Boolean read FMoved write FMoved; // Ñîõðàíÿòü ïðè SaveState? + property liftType: Byte read FLiftType write FLiftType; // Ñîõðàíÿòü ïðè SaveState? + property lastAnimLoop: Byte read FLastAnimLoop write FLastAnimLoop; // Ñîõðàíÿòü ïðè SaveState? end; - PPanel = ^TPanel; TPanelArray = Array of TPanel; implementation @@ -102,7 +116,7 @@ const { T P a n e l : } -constructor TPanel.Create(PanelRec: TPanelRec_1; +constructor TPanel.Create(PanelRec: TDynRecord; AddTextures: TAddTextureArray; CurTex: Integer; var Textures: TLevelTextureArray); @@ -530,14 +544,14 @@ begin sig := PANEL_SIGNATURE; // 'PANL' Mem.WriteDWORD(sig); // Îòêðûòà/çàêðûòà, åñëè äâåðü: - Mem.WriteBoolean(Enabled); + Mem.WriteBoolean(FEnabled); // Íàïðàâëåíèå ëèôòà, åñëè ëèôò: - Mem.WriteByte(LiftType); + Mem.WriteByte(FLiftType); // Íîìåð òåêóùåé òåêñòóðû: Mem.WriteInt(FCurTexture); // Êîîðäû - Mem.WriteInt(X); - Mem.WriteInt(Y); + Mem.WriteInt(FX); + Mem.WriteInt(FY); // Àíèìèðîâàííàÿ ëè òåêóùàÿ òåêñòóðà: if (FCurTexture >= 0) and (FTextureIDs[FCurTexture].Anim) then begin @@ -568,14 +582,14 @@ begin raise EBinSizeError.Create('TPanel.LoadState: Wrong Panel Signature'); end; // Îòêðûòà/çàêðûòà, åñëè äâåðü: - Mem.ReadBoolean(Enabled); + Mem.ReadBoolean(FEnabled); // Íàïðàâëåíèå ëèôòà, åñëè ëèôò: - Mem.ReadByte(LiftType); + Mem.ReadByte(FLiftType); // Íîìåð òåêóùåé òåêñòóðû: Mem.ReadInt(FCurTexture); // Êîîðäû - Mem.ReadInt(X); - Mem.ReadInt(Y); + Mem.ReadInt(FX); + Mem.ReadInt(FY); // Àíèìèðîâàííàÿ ëè òåêóùàÿ òåêñòóðà: Mem.ReadBoolean(anim); // Åñëè äà - çàãðóæàåì àíèìàöèþ: