[Scummvm-git-logs] scummvm master -> 8c7edfcc878edfa05dc8067a891c22d129acf6d0

bluegr bluegr at gmail.com
Fri Feb 10 09:10:23 CET 2017


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
95feec2aa6 Revert "CRYO: Add explicit sizes to some static data arrays"
3e4710bb20 Revert "CRYO: Use cryo.dat for all game versions"
79e774b806 Revert "CRYO: Add handling for the cryo.dat aux data file"
cbe576a4bc Revert "CRYO: Rename create_led_dat to create_cryo_dat"
8c7edfcc87 Revert "CRYO: Add ID and versioning to cryo.dat"


Commit: 95feec2aa6f7898cf82c4ebb206e88f9c7abb033
    https://github.com/scummvm/scummvm/commit/95feec2aa6f7898cf82c4ebb206e88f9c7abb033
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2017-02-10T10:07:37+02:00

Commit Message:
Revert "CRYO: Add explicit sizes to some static data arrays"

This reverts commit 2fd2eeed1c21047744c9d79b1283c52c009b5406.

Changed paths:
    engines/cryo/staticdata.cpp


diff --git a/engines/cryo/staticdata.cpp b/engines/cryo/staticdata.cpp
index ad33ce3..1184791 100644
--- a/engines/cryo/staticdata.cpp
+++ b/engines/cryo/staticdata.cpp
@@ -25,7 +25,7 @@
 
 namespace Cryo {
 
-Follower followerList[15] = {
+Follower followerList[] = {
 //            char,                 X,  sx, sy,  ex,  ey,bank,
 	{ PersonId::pidGregor,          5, 211,  9, 320, 176, 228,   0,  0 },
 	{ PersonId::pidEloi,            4, 162, 47, 223, 176, 228, 112, 78 },
@@ -44,7 +44,15 @@ Follower followerList[15] = {
 	{ -1,                          -1,  -1, -1,  -1,  -1,  -1,  -1, -1 }
 };
 
-byte kLabyrinthPath[70] = {
+
+/*
+  Labyrinth of Mo
+
+  | | | | | | | |
+
+*/
+
+byte kLabyrinthPath[] = {
 // each nibble tells which direction to choose to exit the labyrinth
 	0x11, 0x11, 0x11, 0x22, 0x33, 0x55, 0x25, 0x44, 0x25, 0x11, 0x11, 0x11,
 	0x11, 0x35, 0x55, 0x45, 0x45, 0x44, 0x44, 0x34, 0x44, 0x34, 0x32, 0x52,
@@ -56,7 +64,7 @@ byte kLabyrinthPath[70] = {
 
 char kDinoSpeedForCitaLevel[16] = { 1, 2, 3, 4, 4, 5, 6, 7, 8, 9 };
 
-char kTabletView[12] = {          //TODO: make as struct?
+char kTabletView[] = {          //TODO: make as struct?
 	// opposite tablet id, video id
 	Objects::obUnused10, 83,
 	Objects::obUnused10, 84,
@@ -67,7 +75,7 @@ char kTabletView[12] = {          //TODO: make as struct?
 };
 
 // special character backgrounds for specific rooms
-char kPersoRoomBankTable[84] = {
+char kPersoRoomBankTable[] = {
 	// first entry is default bank, then pairs of [roomNum, bankNum], terminated by -1
 	0,  3, 33, -1,
 	21, 17, 35, -1,
@@ -94,7 +102,7 @@ char kPersoRoomBankTable[84] = {
 };
 
 // area transition descriptors
-Goto gotos[130] = {
+Goto gotos[] = {
 // area, oldarea, vid, time, valleyVid
 	{  0,  1,   0,  2,  20 },
 	{  0,  1, 162,  3, 168 },
@@ -228,7 +236,7 @@ Goto gotos[130] = {
 	{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },
 };
 
-object_t _objects[42] = {
+object_t _objects[] = {
 	//id,fl,loc,masklow,maskhi,ct
 	{  1, 0,  3,      1,     0, 0},     // Eve's Way Stone
 	{  2, 0,  3,      2,     0, 0},     // Thau's Seashell
@@ -363,7 +371,7 @@ perso_t kPersons[] = {
 	{ 0x628, 237, PersonMask::pmEve   , PersonId::pidEve               ,                                                0, 78, 10, 0, 0,  7,  35, 0, 0 }
 };
 
-Citadel _citadelList[7] = {
+Citadel _citadelList[] = {
 	{   1, { 163, 182, 0, 0, 124, 147, 193, 0 }, {   0,   0, 0, 0,   0,   0,   0, 0 } },
 	{  48, { 285, 286, 0, 0, 287, 288, 284, 0 }, { 114, 115, 0, 0, 116, 117, 113, 0 } },
 	{  63, { 290, 291, 0, 0, 292, 293, 289, 0 }, { 119, 120, 0, 0, 121, 122, 118, 0 } },
@@ -373,7 +381,7 @@ Citadel _citadelList[7] = {
 	{ 255, { 310, 311, 0, 0, 312, 313, 309, 0 }, { 139, 140, 0, 0, 141, 142, 138, 0 } }
 };
 
-prect_t _characterRects[19] = {   // TODO: just an array of int16s?
+prect_t _characterRects[] = {   //TODO: just an array of int16s?
 	{  93,  69, 223, 176},
 	{ 102,  86, 162, 126},
 	{  88, 103, 168, 163},
@@ -395,7 +403,7 @@ prect_t _characterRects[19] = {   // TODO: just an array of int16s?
 	{ 188,  83, 251, 158}
 };
 
-byte _characterArray[][5] = {   // TODO: struc?
+byte _characterArray[][5] = {   //TODO: struc?
 	{  8, 15, 23, 25, 0xFF},
 	{  0,  9, 0xFF        },
 	{  0,  9, 0xFF        },


Commit: 3e4710bb209d1647d0cbc6fc6bffc7938a983303
    https://github.com/scummvm/scummvm/commit/3e4710bb209d1647d0cbc6fc6bffc7938a983303
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2017-02-10T10:07:51+02:00

Commit Message:
Revert "CRYO: Use cryo.dat for all game versions"

This reverts commit 6ff7ef95d73c29051a675d03bdccd42f0a5a215b.

Changed paths:
    engines/cryo/eden.cpp


diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp
index 214744f..4ff18bf 100644
--- a/engines/cryo/eden.cpp
+++ b/engines/cryo/eden.cpp
@@ -4729,30 +4729,29 @@ void EdenGame::convertMacToPC() {
 }
 
 void EdenGame::loadpermfiles() {
-	Common::File f;
-	const int kNumIcons = 136;
-	const int kNumRooms = 424;
-
-	if (f.open("cryo.dat")) {
-		const int dataSize = f.size() - 8 - 1;	// CRYODATA + version
-		char headerId[9];
+	switch (_vm->getPlatform()) {
+	case Common::kPlatformDOS:
+	{
+		// Since PC version stores hotspots and rooms info in the executable, load them from premade resource file
+		Common::File f;
 
-		f.read(headerId, 8);
-		headerId[8] = '\0';
-		if (strcmp(headerId, "CRYODATA"))
-			error("Invalid aux data file");
+		if (f.open("cryo.dat")) {
+			const int kNumIcons = 136;
+			const int kNumRooms = 424;
+			const int dataSize = f.size() - 8 - 1;	// CRYODATA + version
+			char headerId[9];
+			
+			f.read(headerId, 8);
+			headerId[8] = '\0';
+			if (strcmp(headerId, "CRYODATA"))
+				error("Invalid aux data file");
 
-		if (f.readByte() != CRYO_DAT_VER)
-			error("Incorrect aux data version");
+			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");
-	} else
-		error("Can not load aux data");
+			if (dataSize != kNumIcons * sizeof(Icon) + kNumRooms * sizeof(Room))
+				error("Mismatching data in aux data file");
 
-	switch (_vm->getPlatform()) {
-	case Common::kPlatformDOS:
-		// Since PC version stores hotspots and rooms info in the executable, load them from premade resource file
 			for (int i = 0; i < kNumIcons; i++) {
 				_gameIcons[i].sx = f.readSint16LE();
 				_gameIcons[i].sy = f.readSint16LE();
@@ -4775,25 +4774,22 @@ void EdenGame::loadpermfiles() {
 				_gameRooms[i]._location = f.readByte();
 				_gameRooms[i]._backgroundBankNum = f.readByte();
 			}
+
+			f.close();
+		} else
+			error("Can not load aux data");
+	}
 		break;
 	case Common::kPlatformMacintosh:
 		loadIconFile(2498, _gameIcons);
 		loadRoomFile(2497, _gameRooms);
 		loadRawFile(2486, _gameLipsync);
 		convertMacToPC();
-
-		// Skip the icons and rooms of the DOS version
-		f.skip(kNumIcons * sizeof(Icon) + kNumRooms * sizeof(Room));
 		break;
 	default:
 		error("Unsupported platform");
 	}
 
-	// Read the common static data
-	// TODO
-
-	f.close();
-
 	loadRawFile(0, _mainBankBuf);
 	loadRawFile(402, _gameFont);
 	loadRawFile(404, _gameDialogs);


Commit: 79e774b80618b240b4d90bd7bf37b7141e2c6120
    https://github.com/scummvm/scummvm/commit/79e774b80618b240b4d90bd7bf37b7141e2c6120
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2017-02-10T10:08:04+02:00

Commit Message:
Revert "CRYO: Add handling for the cryo.dat aux data file"

This reverts commit 01e072fbbc1baaf8aaa48aba0842bf8977510b93.

Changed paths:
    engines/cryo/eden.cpp


diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp
index 4ff18bf..b8e191c 100644
--- a/engines/cryo/eden.cpp
+++ b/engines/cryo/eden.cpp
@@ -48,8 +48,6 @@
 
 namespace Cryo {
 
-#define CRYO_DAT_VER 1	// 1 byte
-
 int16 _torchTick = 0;
 int16 _glowIndex = 0;
 int16 _torchCurIndex = 0;
@@ -4735,23 +4733,11 @@ void EdenGame::loadpermfiles() {
 		// Since PC version stores hotspots and rooms info in the executable, load them from premade resource file
 		Common::File f;
 
-		if (f.open("cryo.dat")) {
+		if (f.open("led.dat")) {
 			const int kNumIcons = 136;
 			const int kNumRooms = 424;
-			const int dataSize = f.size() - 8 - 1;	// CRYODATA + version
-			char headerId[9];
-			
-			f.read(headerId, 8);
-			headerId[8] = '\0';
-			if (strcmp(headerId, "CRYODATA"))
-				error("Invalid aux data file");
-
-			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 (f.size() != kNumIcons * sizeof(Icon) + kNumRooms * sizeof(Room))
+				error("Mismatching aux data");
 			for (int i = 0; i < kNumIcons; i++) {
 				_gameIcons[i].sx = f.readSint16LE();
 				_gameIcons[i].sy = f.readSint16LE();


Commit: cbe576a4bc5a2ed25a5fb68ee770960f76042b76
    https://github.com/scummvm/scummvm/commit/cbe576a4bc5a2ed25a5fb68ee770960f76042b76
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2017-02-10T10:09:23+02:00

Commit Message:
Revert "CRYO: Rename create_led_dat to create_cryo_dat"

This reverts commit 1db02c7bd8ffee2aa0a27264669d11f83d95b491.

Changed paths:
  A devtools/create_cryo/create_led_dat.cpp
  R devtools/create_cryo/create_cryo_dat.cpp
    devtools/create_cryo/module.mk


diff --git a/devtools/create_cryo/create_cryo_dat.cpp b/devtools/create_cryo/create_cryo_dat.cpp
deleted file mode 100644
index 794dee3..0000000
--- a/devtools/create_cryo/create_cryo_dat.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * 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.
- *
- */
-
-#include <stdio.h>
-
-#include "eden.h"
-#include "eden_icons.h"
-#include "eden_rooms.h"
-
-#define CRYO_DAT_VER 1	// 1 byte
-
-template <typename T>
-static void writeLE(FILE *f, T value) {
-	for (int i = 0; i < sizeof(value); i++, value >>= 8) {
-		unsigned char b = value & 0xFF;
-		fwrite(&b, 1, 1, f);
-	}
-}
-
-struct _icon_t : icon_t {
-	void write(FILE *f) {
-		writeLE<int16>(f, sx);
-		writeLE<int16>(f, sy);
-		writeLE<int16>(f, ex);
-		writeLE<int16>(f, ey);
-		writeLE<uint16>(f, cursor_id);
-		writeLE<unsigned int>(f, action_id);
-		writeLE<unsigned int>(f, object_id);
-	}
-};
-
-static void emitIcons(FILE *f) {
-	_icon_t *icons = (_icon_t*)gameIcons;
-	for (int i = 0; i < kNumIcons; i++)
-		icons[i].write(f);
-}
-
-struct _room_t : room_t {
-	void write(FILE *f) {
-		writeLE<byte>(f, ff_0);
-		writeLE<byte>(f, exits[0]);
-		writeLE<byte>(f, exits[1]);
-		writeLE<byte>(f, exits[2]);
-		writeLE<byte>(f, exits[3]);
-		writeLE<byte>(f, flags);
-		writeLE<uint16>(f, bank);
-		writeLE<uint16>(f, party);
-		writeLE<byte>(f, level);
-		writeLE<byte>(f, video);
-		writeLE<byte>(f, location);
-		writeLE<byte>(f, background);
-	}
-};
-
-static void emitRooms(FILE *f) {
-	_room_t *rooms = (_room_t*)gameRooms;
-	for (int i = 0; i < kNumRooms; i++)
-		rooms[i].write(f);
-}
-
-static int emitData(char *outputFilename) {
-	FILE *f = fopen(outputFilename, "w+b");
-	if (!f) {
-		printf("ERROR: Unable to create output file %s\n", outputFilename);
-		return 1;
-	}
-
-	printf("Generating %s...\n", outputFilename);
-
-	fwrite("CRYODATA", 8, 1, f);
-	writeLE<byte>(f, CRYO_DAT_VER);
-	
-	emitIcons(f);
-	emitRooms(f);
-
-	fclose(f);
-
-	printf("Done!\n");
-
-	return 0;
-}
-
-int main(int argc, char **argv) {
-
-	if (argc > 1)
-		return emitData(argv[1]);
-	else
-		printf("Usage: %s <output.dat>\n", argv[0]);
-
-	return 0;
-}
diff --git a/devtools/create_cryo/create_led_dat.cpp b/devtools/create_cryo/create_led_dat.cpp
new file mode 100644
index 0000000..794dee3
--- /dev/null
+++ b/devtools/create_cryo/create_led_dat.cpp
@@ -0,0 +1,110 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * 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.
+ *
+ */
+
+#include <stdio.h>
+
+#include "eden.h"
+#include "eden_icons.h"
+#include "eden_rooms.h"
+
+#define CRYO_DAT_VER 1	// 1 byte
+
+template <typename T>
+static void writeLE(FILE *f, T value) {
+	for (int i = 0; i < sizeof(value); i++, value >>= 8) {
+		unsigned char b = value & 0xFF;
+		fwrite(&b, 1, 1, f);
+	}
+}
+
+struct _icon_t : icon_t {
+	void write(FILE *f) {
+		writeLE<int16>(f, sx);
+		writeLE<int16>(f, sy);
+		writeLE<int16>(f, ex);
+		writeLE<int16>(f, ey);
+		writeLE<uint16>(f, cursor_id);
+		writeLE<unsigned int>(f, action_id);
+		writeLE<unsigned int>(f, object_id);
+	}
+};
+
+static void emitIcons(FILE *f) {
+	_icon_t *icons = (_icon_t*)gameIcons;
+	for (int i = 0; i < kNumIcons; i++)
+		icons[i].write(f);
+}
+
+struct _room_t : room_t {
+	void write(FILE *f) {
+		writeLE<byte>(f, ff_0);
+		writeLE<byte>(f, exits[0]);
+		writeLE<byte>(f, exits[1]);
+		writeLE<byte>(f, exits[2]);
+		writeLE<byte>(f, exits[3]);
+		writeLE<byte>(f, flags);
+		writeLE<uint16>(f, bank);
+		writeLE<uint16>(f, party);
+		writeLE<byte>(f, level);
+		writeLE<byte>(f, video);
+		writeLE<byte>(f, location);
+		writeLE<byte>(f, background);
+	}
+};
+
+static void emitRooms(FILE *f) {
+	_room_t *rooms = (_room_t*)gameRooms;
+	for (int i = 0; i < kNumRooms; i++)
+		rooms[i].write(f);
+}
+
+static int emitData(char *outputFilename) {
+	FILE *f = fopen(outputFilename, "w+b");
+	if (!f) {
+		printf("ERROR: Unable to create output file %s\n", outputFilename);
+		return 1;
+	}
+
+	printf("Generating %s...\n", outputFilename);
+
+	fwrite("CRYODATA", 8, 1, f);
+	writeLE<byte>(f, CRYO_DAT_VER);
+	
+	emitIcons(f);
+	emitRooms(f);
+
+	fclose(f);
+
+	printf("Done!\n");
+
+	return 0;
+}
+
+int main(int argc, char **argv) {
+
+	if (argc > 1)
+		return emitData(argv[1]);
+	else
+		printf("Usage: %s <output.dat>\n", argv[0]);
+
+	return 0;
+}
diff --git a/devtools/create_cryo/module.mk b/devtools/create_cryo/module.mk
index f1e8ea3..f8e350a 100644
--- a/devtools/create_cryo/module.mk
+++ b/devtools/create_cryo/module.mk
@@ -2,10 +2,10 @@
 MODULE := devtools/create_cryo
 
 MODULE_OBJS := \
-	create_cryo_dat.o
+	create_led_dat.o
 
 # Set the name of the executable
-TOOL_EXECUTABLE := create_cryo_dat
+TOOL_EXECUTABLE := create_led_dat
 
 # Include common rules
 include $(srcdir)/rules.mk


Commit: 8c7edfcc878edfa05dc8067a891c22d129acf6d0
    https://github.com/scummvm/scummvm/commit/8c7edfcc878edfa05dc8067a891c22d129acf6d0
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2017-02-10T10:09:36+02:00

Commit Message:
Revert "CRYO: Add ID and versioning to cryo.dat"

This reverts commit 4858b3fc5836dbf2f33fe0d1452bf0cb3a9f75b2.

Changed paths:
    devtools/create_cryo/create_led_dat.cpp


diff --git a/devtools/create_cryo/create_led_dat.cpp b/devtools/create_cryo/create_led_dat.cpp
index 794dee3..e58ee75 100644
--- a/devtools/create_cryo/create_led_dat.cpp
+++ b/devtools/create_cryo/create_led_dat.cpp
@@ -26,8 +26,6 @@
 #include "eden_icons.h"
 #include "eden_rooms.h"
 
-#define CRYO_DAT_VER 1	// 1 byte
-
 template <typename T>
 static void writeLE(FILE *f, T value) {
 	for (int i = 0; i < sizeof(value); i++, value >>= 8) {
@@ -86,9 +84,6 @@ static int emitData(char *outputFilename) {
 
 	printf("Generating %s...\n", outputFilename);
 
-	fwrite("CRYODATA", 8, 1, f);
-	writeLE<byte>(f, CRYO_DAT_VER);
-	
 	emitIcons(f);
 	emitRooms(f);
 





More information about the Scummvm-git-logs mailing list