From 77f11945865e02c6f2f30409ccae938fc1e3800d Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 10 Feb 2017 11:51:58 +0200 Subject: CRYO: Move all static data for Lost Eden to cryo.dat (2/2) --- engines/cryo/defs.h | 27 --- engines/cryo/eden.cpp | 128 +++++++++++- engines/cryo/eden.h | 28 ++- engines/cryo/module.mk | 1 - engines/cryo/staticdata.cpp | 487 -------------------------------------------- 5 files changed, 151 insertions(+), 520 deletions(-) delete mode 100644 engines/cryo/staticdata.cpp (limited to 'engines') diff --git a/engines/cryo/defs.h b/engines/cryo/defs.h index b7206dc7e4..e646b9fc72 100644 --- a/engines/cryo/defs.h +++ b/engines/cryo/defs.h @@ -783,33 +783,6 @@ enum { LAB_W }; -extern byte kLabyrinthPath[]; - -extern char kDinoSpeedForCitaLevel[16]; - -extern char kTabletView[]; - -// special character backgrounds for specific rooms -extern char kPersoRoomBankTable[]; - -// area transition descriptors -extern Goto gotos[]; -extern object_t _objects[]; -extern uint16 kObjectLocations[100]; -extern perso_t kPersons[]; -extern Citadel _citadelList[]; - -struct prect_t { - int16 left, top, right, bottom; -}; - -extern prect_t _characterRects[]; -extern byte _characterArray[][5]; -extern Area kAreasTable[]; -extern int16 tab_2CEF0[64]; -extern int16 tab_2CF70[64]; -extern int16 kActionCursors[299]; - struct CubeFace { int tri; char ff_4; diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp index 214744f530..47cd1e05a3 100644 --- a/engines/cryo/eden.cpp +++ b/engines/cryo/eden.cpp @@ -4732,6 +4732,42 @@ void EdenGame::loadpermfiles() { Common::File f; const int kNumIcons = 136; const int kNumRooms = 424; + const int kNumFollowers = 15; + const int kNumLabyrinthPath = 70; + const int kNumDinoSpeedForCitaLevel = 16; + const int kNumTabletView = 12; + const int kNumPersoRoomBankTable = 84; + const int kNumGotos = 130; + const int kNumObjects = 42; + const int kNumObjectLocations = 45; + const int kNumPersons = 58; + const int kNumCitadel = 7; + const int kNumCharacterRects = 19; + const int kNumCharacters = 20; + const int kNumAreas = 12; + // tab_2CEF0 + // tab_2CF70 + const int kNumActionCursors = 299; + + const int expectedDataSize = + kNumIcons * sizeof(Icon) + + kNumRooms * sizeof(Room) + + kNumFollowers * sizeof(Follower) + + kNumLabyrinthPath + + kNumDinoSpeedForCitaLevel + + kNumTabletView + + kNumPersoRoomBankTable + + kNumGotos * sizeof(Goto) + + kNumObjects * sizeof(object_t) + + kNumObjectLocations * 2 + + kNumPersons * sizeof(perso_t) + + kNumCitadel * sizeof(Citadel) + + kNumCharacterRects * 8 + + kNumCharacters * 5 + + kNumAreas * (sizeof(Area) - 4) + + 64 * 2 + + 64 * 2 + + kNumActionCursors; if (f.open("cryo.dat")) { const int dataSize = f.size() - 8 - 1; // CRYODATA + version @@ -4745,8 +4781,8 @@ void EdenGame::loadpermfiles() { if (f.readByte() != CRYO_DAT_VER) error("Incorrect aux data version"); - if (dataSize != kNumIcons * sizeof(Icon) + kNumRooms * sizeof(Room)) - error("Mismatching data in aux data file"); + if (dataSize != expectedDataSize) + error("Mismatching data in aux data file (got %d, expected %d)", dataSize, expectedDataSize); } else error("Can not load aux data"); @@ -4763,7 +4799,7 @@ void EdenGame::loadpermfiles() { _gameIcons[i]._objectId = f.readUint32LE(); } - for (int i = 0; i