summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7f717e1)
raw | patch | inline | side by side (parent: 7f717e1)
author | FGSFDSFGS <derp.primus@gmail.com> | |
Wed, 29 Jun 2016 00:23:45 +0000 (03:23 +0300) | ||
committer | FGSFDSFGS <derp.primus@gmail.com> | |
Wed, 29 Jun 2016 13:09:01 +0000 (16:09 +0300) |
src/game/g_netmsg.pas | patch | blob | history | |
src/game/g_panel.pas | patch | blob | history | |
src/game/g_saveload.pas | patch | blob | history |
diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas
index 1c678ecaf025866271191a651e9f38cb58d65dfd..869da64bf5c6556f5f7ef047c8d0380d40183a18 100644 (file)
--- a/src/game/g_netmsg.pas
+++ b/src/game/g_netmsg.pas
for I := Low(gRenderForegrounds) to High(gRenderForegrounds) do
if gRenderForegrounds[I] <> nil then
with gRenderForegrounds[I] do
+ begin
if (GetTextureCount > 1) then
MH_SEND_PanelTexture(PanelType, I, LastAnimLoop, ID);
+ if Moved then
+ MH_SEND_PanelState(PanelType, I, ID);
+ end;
if gRenderBackgrounds <> nil then
for I := Low(gRenderBackgrounds) to High(gRenderBackgrounds) do
if gRenderBackgrounds[I] <> nil then
with gRenderBackgrounds[I] do
- if GetTextureCount > 1 then
+ begin
+ if (GetTextureCount > 1) then
MH_SEND_PanelTexture(PanelType, I, LastAnimLoop, ID);
+ if Moved then
+ MH_SEND_PanelState(PanelType, I, ID);
+ end;
if gWater <> nil then
for I := Low(gWater) to High(gWater) do
if gWater[I] <> nil then
TP := gWalls[PID];
PANEL_LIFTUP, PANEL_LIFTDOWN, PANEL_LIFTLEFT, PANEL_LIFTRIGHT:
TP := gLifts[PID];
+ PANEL_BACK:
+ begin
+ TP := gRenderBackgrounds[PID];
+ TP.Moved := True;
+ end;
+ PANEL_FORE:
+ begin
+ TP := gRenderForegrounds[PID];
+ TP.Moved := True;
+ end;
else
Exit;
end;
e_Buffer_Write(@NetOut, PID);
e_Buffer_Write(@NetOut, Byte(TP.Enabled));
e_Buffer_Write(@NetOut, TP.LiftType);
+ e_Buffer_Write(@NetOut, TP.X);
+ e_Buffer_Write(@NetOut, TP.Y);
g_Net_Host_Send(ID, True, NET_CHAN_LARGEDATA);
end;
E: Boolean;
Lift: Byte;
PType: Word;
+ X, Y: Integer;
begin
if not gGameOn then Exit;
PType := e_Raw_Read_Word(P);
ID := e_Raw_Read_LongWord(P);
E := (e_Raw_Read_Byte(P) <> 0);
Lift := e_Raw_Read_Byte(P);
+ X := e_Raw_Read_LongInt(P);
+ Y := e_Raw_Read_LongInt(P);
case PType of
PANEL_WALL, PANEL_OPENDOOR, PANEL_CLOSEDOOR:
PANEL_LIFTUP, PANEL_LIFTDOWN, PANEL_LIFTLEFT, PANEL_LIFTRIGHT:
g_Map_SetLift(ID, Lift);
+
+ PANEL_BACK:
+ begin
+ gRenderBackgrounds[ID].X := X;
+ gRenderBackgrounds[ID].Y := Y;
+ end;
+
+ PANEL_FORE:
+ begin
+ gRenderForegrounds[ID].X := X;
+ gRenderForegrounds[ID].Y := Y;
+ end;
end;
end;
diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas
index c13693e7b0bc3aa3cefd820bfdd433fb35446973..8897c47f555b88b6dc6dbf70e081cff205b5372c 100644 (file)
--- a/src/game/g_panel.pas
+++ b/src/game/g_panel.pas
SaveIt: Boolean; // Ñîõðàíÿòü ïðè SaveState?
Enabled: Boolean;
Door: Boolean;
+ Moved: Boolean;
LiftType: Byte;
LastAnimLoop: Byte;
FCurFrame := 0;
FCurFrameCount := 0;
LastAnimLoop := 0;
+ Moved := False;
// Òèï ïàíåëè:
PanelType := PanelRec.PanelType;
Mem.WriteByte(LiftType);
// Íîìåð òåêóùåé òåêñòóðû:
Mem.WriteInt(FCurTexture);
+// Êîîðäû
+ Mem.WriteInt(X);
+ Mem.WriteInt(Y);
// Àíèìèðîâàííàÿ ëè òåêóùàÿ òåêñòóðà:
if (FCurTexture >= 0) and (FTextureIDs[FCurTexture].Anim) then
begin
Mem.ReadByte(LiftType);
// Íîìåð òåêóùåé òåêñòóðû:
Mem.ReadInt(FCurTexture);
+// Êîîðäû
+ Mem.ReadInt(X);
+ Mem.ReadInt(Y);
// Àíèìèðîâàííàÿ ëè òåêóùàÿ òåêñòóðà:
Mem.ReadBoolean(anim);
// Åñëè äà - çàãðóæàåì àíèìàöèþ:
index c77147f87537902a514173bbfe081821576d6a96..f020b9bb69bc77aba28390dd431c50d1c3695550 100644 (file)
--- a/src/game/g_saveload.pas
+++ b/src/game/g_saveload.pas
const
SAVE_SIGNATURE = $56534644; // 'DFSV'
- SAVE_VERSION = $02;
+ SAVE_VERSION = $03;
END_MARKER_STRING = 'END';
PLAYER_VIEW_SIGNATURE = $57564C50; // 'PLVW'
OBJ_SIGNATURE = $4A424F5F; // '_OBJ'