diff options
author | Filippos Karapetis | 2015-10-08 06:46:33 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2015-12-15 00:05:02 +0100 |
commit | 92bb4a522abb2f707fd94a529e7e384203ca2b88 (patch) | |
tree | 73f856f86e7b5e94aaf0d405b4240f7a6225c7b3 /engines/lab/readparse.cpp | |
parent | 01dffc75a1fec635879f176f9a62a539269d9adf (diff) | |
download | scummvm-rg350-92bb4a522abb2f707fd94a529e7e384203ca2b88.tar.gz scummvm-rg350-92bb4a522abb2f707fd94a529e7e384203ca2b88.tar.bz2 scummvm-rg350-92bb4a522abb2f707fd94a529e7e384203ca2b88.zip |
LAB: Replace readRoomData() and readInventory()
Diffstat (limited to 'engines/lab/readparse.cpp')
-rw-r--r-- | engines/lab/readparse.cpp | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/engines/lab/readparse.cpp b/engines/lab/readparse.cpp index 3d3c270c31..624f7a3b89 100644 --- a/engines/lab/readparse.cpp +++ b/engines/lab/readparse.cpp @@ -58,49 +58,6 @@ static bool rallocate(void **Ptr, uint32 Size) { /*****************************************************************************/ -/* Reads in the RoomData. */ -/*****************************************************************************/ -bool readRoomData(const char *fileName) { - byte **file; - uint16 Counter; - char Temp[5]; - - if ((file = g_music->newOpen(fileName)) != NULL) { - readBlock(Temp, 4L, file); - Temp[4] = '\0'; - - if (strcmp(Temp, "DOR1") != 0) - return false; - - readBlock(&ManyRooms, 2L, file); - swapUShortPtr(&ManyRooms, 1); - readBlock(&HighestCondition, 2L, file); - swapUShortPtr(&HighestCondition, 1); - - if ((Rooms = (RoomData *)calloc(ManyRooms + 1, sizeof(RoomData)))) { - for (Counter = 1; Counter <= ManyRooms; Counter++) { - readBlock(&(Rooms[Counter].NorthDoor), 2L, file); - readBlock(&(Rooms[Counter].SouthDoor), 2L, file); - readBlock(&(Rooms[Counter].EastDoor), 2L, file); - readBlock(&(Rooms[Counter].WestDoor), 2L, file); - - swapUShortPtr(&(Rooms[Counter].NorthDoor), 1); - swapUShortPtr(&(Rooms[Counter].SouthDoor), 1); - swapUShortPtr(&(Rooms[Counter].EastDoor), 1); - swapUShortPtr(&(Rooms[Counter].WestDoor), 1); - - readBlock(&(Rooms[Counter].WipeType), 1L, file); - } - } else - return false; - } else - return false; - - return true; -} - - -/*****************************************************************************/ /* Reads in a NULL terminated string, and allocates memory for it. */ /*****************************************************************************/ static bool readString(char **string, byte **file) { @@ -129,52 +86,6 @@ static bool readString(char **string, byte **file) { /*****************************************************************************/ -/* Reads in the Inventory data. */ -/*****************************************************************************/ -bool readInventory(const char *fileName) { - byte **file; - uint16 Counter; - char Temp[5]; - - if ((file = g_music->newOpen(fileName)) != NULL) { - readBlock(Temp, 4L, file); - Temp[4] = '\0'; - - if (strcmp(Temp, "INV1") != 0) - return false; - - readBlock(&NumInv, 2L, file); - swapUShortPtr(&NumInv, 1); - - UseMemory = true; - - if (rallocate((void **) &Inventory, (NumInv + 1) * sizeof(InventoryData))) { - for (Counter = 1; Counter <= NumInv; Counter++) { - readBlock(&(Inventory[Counter].Many), 2L, file); - swapUShortPtr(&(Inventory[Counter].Many), 1); - - if (!readString(&(Inventory[Counter].name), file)) { - UseMemory = false; - return false; - } - - if (!readString(&(Inventory[Counter].BInvName), file)) { - UseMemory = false; - return false; - } - } - } else { - UseMemory = false; - return false; - } - } else - return false; - - UseMemory = false; - return true; -} - -/*****************************************************************************/ /* Reads in a list of conditions. */ /*****************************************************************************/ static int16 *readConditions(byte **file) { |