2019-11-20 16:21:32 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010-2019 EDuke32 developers and contributors
|
|
|
|
Copyright (C) 2019 sirlemonhead, Nuke.YKT
|
|
|
|
This file is part of PCExhumed.
|
|
|
|
PCExhumed is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License version 2
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
2019-11-22 23:11:37 +00:00
|
|
|
#include "ns.h"
|
2019-08-26 03:59:14 +00:00
|
|
|
#include <stdio.h>
|
2019-12-26 21:00:04 +00:00
|
|
|
#include <stdarg.h>
|
2020-08-18 08:28:19 +00:00
|
|
|
#include "build.h"
|
2020-04-12 06:08:31 +00:00
|
|
|
#include "raze_music.h"
|
2019-08-26 03:59:14 +00:00
|
|
|
#include "engine.h"
|
2019-12-26 21:00:04 +00:00
|
|
|
#include "exhumed.h"
|
|
|
|
#include "savegamehelp.h"
|
2019-12-27 21:17:36 +00:00
|
|
|
#include "sound.h"
|
2020-08-23 14:24:54 +00:00
|
|
|
#include "mapinfo.h"
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
BEGIN_PS_NS
|
|
|
|
|
2020-11-30 00:13:40 +00:00
|
|
|
void SerializeState(FSerializer& arc);
|
2020-11-29 23:47:53 +00:00
|
|
|
void SerializeAnim(FSerializer& arc);
|
2020-11-30 00:10:52 +00:00
|
|
|
void SerializeBullet(FSerializer& arc);
|
|
|
|
void SerializeGrenade(FSerializer& arc);
|
2020-11-30 00:07:14 +00:00
|
|
|
void SerializeGun(FSerializer& arc);
|
2020-11-30 00:08:19 +00:00
|
|
|
void SerializeInit(FSerializer& arc);
|
2020-11-29 23:51:56 +00:00
|
|
|
void SerializeItems(FSerializer& arc);
|
|
|
|
void SerializeMove(FSerializer& arc);
|
2020-11-30 00:05:17 +00:00
|
|
|
void SerializeLighting(FSerializer& arc);
|
2020-11-29 23:49:25 +00:00
|
|
|
void SerializeObjects(FSerializer& arc);
|
2020-11-29 23:47:53 +00:00
|
|
|
void SerializePlayer(FSerializer& arc);
|
2020-11-29 23:29:34 +00:00
|
|
|
void SerializeRa(FSerializer& arc);
|
2020-11-29 23:23:57 +00:00
|
|
|
void SerializeRand(FSerializer& arc);
|
|
|
|
void SerializeRunList(FSerializer& arc);
|
2020-11-29 23:18:32 +00:00
|
|
|
void SerializeSequence(FSerializer& arc);
|
|
|
|
void SerializeSnake(FSerializer& arc);
|
2020-11-29 22:32:28 +00:00
|
|
|
void SerializeSwitch(FSerializer& arc);
|
|
|
|
void SerializeView(FSerializer& arc);
|
|
|
|
|
2020-11-29 23:40:25 +00:00
|
|
|
void SerializeQueen(FSerializer& arc);
|
2020-11-29 19:39:27 +00:00
|
|
|
void SerializeRat(FSerializer& arc);
|
2020-11-29 18:15:59 +00:00
|
|
|
|
|
|
|
void GameInterface::SerializeGameState(FSerializer& arc)
|
|
|
|
{
|
2020-12-10 19:25:20 +00:00
|
|
|
if (arc.BeginObject("exhumed"))
|
|
|
|
{
|
|
|
|
SerializeState(arc);
|
|
|
|
SerializeAnim(arc);
|
|
|
|
SerializeBullet(arc);
|
|
|
|
SerializeGrenade(arc);
|
|
|
|
SerializeGun(arc);
|
|
|
|
SerializeInit(arc);
|
|
|
|
SerializeItems(arc);
|
|
|
|
SerializeMove(arc);
|
|
|
|
SerializeLighting(arc);
|
|
|
|
SerializeObjects(arc);
|
|
|
|
SerializePlayer(arc);
|
|
|
|
SerializeRa(arc);
|
|
|
|
SerializeRand(arc);
|
|
|
|
SerializeRunList(arc);
|
|
|
|
SerializeSequence(arc);
|
|
|
|
SerializeSnake(arc);
|
|
|
|
SerializeSwitch(arc);
|
|
|
|
SerializeView(arc);
|
2020-11-30 13:16:46 +00:00
|
|
|
|
2020-12-10 19:25:20 +00:00
|
|
|
SerializeQueen(arc);
|
|
|
|
SerializeRat(arc);
|
|
|
|
}
|
|
|
|
if (arc.isReading())
|
|
|
|
{
|
2019-12-27 21:17:36 +00:00
|
|
|
|
2020-12-10 19:25:20 +00:00
|
|
|
// reset the sky in case it hasn't been done yet.
|
|
|
|
psky_t* pSky = tileSetupSky(DEFAULTPSKY);
|
|
|
|
pSky->tileofs[0] = 0;
|
|
|
|
pSky->tileofs[1] = 0;
|
|
|
|
pSky->tileofs[2] = 0;
|
|
|
|
pSky->tileofs[3] = 0;
|
|
|
|
pSky->yoffs = 256;
|
2021-05-08 20:08:05 +00:00
|
|
|
pSky->yoffs2 = 256;
|
2020-12-10 19:25:20 +00:00
|
|
|
pSky->lognumtiles = 2;
|
|
|
|
pSky->horizfrac = 65536;
|
|
|
|
pSky->yscale = 65536;
|
|
|
|
parallaxtype = 2;
|
|
|
|
g_visibility = 1024;
|
2019-12-27 21:17:36 +00:00
|
|
|
|
2021-05-02 13:54:19 +00:00
|
|
|
if (currentLevel->gameflags & LEVEL_EX_ALTSOUND)
|
2020-12-10 19:25:20 +00:00
|
|
|
{
|
|
|
|
nSwitchSound = 35;
|
|
|
|
nStoneSound = 23;
|
|
|
|
nElevSound = 51;
|
|
|
|
nStopSound = 35;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
nSwitchSound = 33;
|
|
|
|
nStoneSound = 23;
|
|
|
|
nElevSound = 23;
|
|
|
|
nStopSound = 66;
|
|
|
|
}
|
|
|
|
|
|
|
|
Mus_ResumeSaved();
|
|
|
|
}
|
2019-12-26 21:00:04 +00:00
|
|
|
}
|
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
END_PS_NS
|