diff --git a/source/exhumed/src/aistuff.h b/source/exhumed/src/aistuff.h index 5ecfb1607..665a6703c 100644 --- a/source/exhumed/src/aistuff.h +++ b/source/exhumed/src/aistuff.h @@ -268,13 +268,6 @@ void FuncMummy(int nSector, int edx, int nRun); // object -enum -{ - kMaxPoints = 1024, - kMaxSlides = 128, - kMaxElevs = 1024 -}; - enum kStatus { kStatDestructibleSprite = 97, @@ -487,12 +480,6 @@ void FuncSpider(int a, int b, int nRun); // switch -enum -{ - kMaxLinks = 1024, - kMaxSwitches = 1024 -}; - void InitLink(); void InitSwitch(); diff --git a/source/exhumed/src/exhumed.h b/source/exhumed/src/exhumed.h index 1a3bfec46..8e9beaedc 100644 --- a/source/exhumed/src/exhumed.h +++ b/source/exhumed/src/exhumed.h @@ -223,19 +223,6 @@ const uint32_t kSpiritX = 106; const uint32_t kSpiritY = 97; const uint32_t WorktileSize = kSpiritX * 2 * kSpiritY * 2; -struct SavegameHelper -{ - FString Name; - TArray> Elements; - SavegameHelper(const char* name, ...); - void Load(); - void Save(); -}; - -#define SV(v) &v, sizeof(v) -#define SA(a) &a, sizeof(a) - - struct GameInterface : ::GameInterface { @@ -248,8 +235,6 @@ struct GameInterface : ::GameInterface bool StartGame(FNewGameStartup& gs) override; FSavegameInfo GetSaveSig() override; void SerializeGameState(FSerializer& arc); - bool LoadGame() override; - bool SaveGame() override; bool CanSave() override; ReservedSpace GetReservedScreenSpace(int viewsize) override { return { 0, 24 }; } void QuitToTitle() override; diff --git a/source/exhumed/src/menu.cpp b/source/exhumed/src/menu.cpp index af3e7014c..ef9f52dc3 100644 --- a/source/exhumed/src/menu.cpp +++ b/source/exhumed/src/menu.cpp @@ -36,6 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "statistics.h" #include "v_draw.h" #include +#include "mapinfo.h" #include @@ -75,6 +76,7 @@ unsigned int menu_RandomBit2() void InitEnergyTile() { + word_9AB5B = 0; memset(energytile, 96, sizeof(energytile)); } diff --git a/source/exhumed/src/save.cpp b/source/exhumed/src/save.cpp index 88d94bb1a..48ae3987e 100644 --- a/source/exhumed/src/save.cpp +++ b/source/exhumed/src/save.cpp @@ -63,60 +63,44 @@ void SerializeSet(FSerializer& arc); void SerializeSpider(FSerializer& arc); void SerializeWasp(FSerializer& arc); -static TArray sghelpers(TArray::NoInit); - -bool GameInterface::SaveGame() -{ - for (auto sgh : sghelpers) sgh->Save(); - return 1; // CHECKME -} - void GameInterface::SerializeGameState(FSerializer& arc) { if (arc.BeginObject("exhumed")) { - SerializeState(arc); - SerializeAnim(arc); - SerializeBubbles(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); + SerializeState(arc); + SerializeAnim(arc); + SerializeBubbles(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); - SerializeAnubis(arc); - SerializeFish(arc); - SerializeLavadude(arc); - SerializeLion(arc); - SerializeMummy(arc); - SerializeQueen(arc); - SerializeRat(arc); - SerializeRex(arc); - SerializeRoach(arc); - SerializeScorpion(arc); - SerializeSet(arc); - SerializeSpider(arc); - SerializeWasp(arc); + SerializeAnubis(arc); + SerializeFish(arc); + SerializeLavadude(arc); + SerializeLion(arc); + SerializeMummy(arc); + SerializeQueen(arc); + SerializeRat(arc); + SerializeRex(arc); + SerializeRoach(arc); + SerializeScorpion(arc); + SerializeSet(arc); + SerializeSpider(arc); + SerializeWasp(arc); } -} - -bool GameInterface::LoadGame() -{ - - for (auto sgh : sghelpers) sgh->Load(); - FinishSavegameRead(); - // reset the sky in case it hasn't been done yet. psky_t* pSky = tileSetupSky(DEFAULTPSKY); pSky->tileofs[0] = 0; @@ -146,43 +130,6 @@ bool GameInterface::LoadGame() } Mus_ResumeSaved(); - return 1; // CHECKME -} - - -SavegameHelper::SavegameHelper(const char* name, ...) -{ - Name = name; - sghelpers.Push(this); - va_list ap; - va_start(ap, name); - for(;;) - { - void* addr = va_arg(ap, void*); - if (!addr) break; - size_t size = va_arg(ap, size_t); - Elements.Push(std::make_pair(addr, size)); - } -} - -void SavegameHelper::Load() -{ - auto fr = ReadSavegameChunk(Name); - if (!fr.isOpen()) return; - for (auto& entry : Elements) - { - auto read = fr.Read(entry.first, entry.second); - if (read != entry.second) I_Error("Save game read error in %s", Name.GetChars()); - } -} -void SavegameHelper::Save() -{ - auto fw = WriteSavegameChunk(Name); - for (auto& entry : Elements) - { - auto write = fw->Write(entry.first, entry.second); - if (write != entry.second) I_Error("Save game write error in %s", Name.GetChars()); - } } END_PS_NS