[Scummvm-cvs-logs] scummvm master -> 63ffcf0a0deb05c77bdcc18d1f39d9384de5111a

dreammaster dreammaster at scummvm.org
Fri Aug 26 00:36:22 CEST 2016


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

Summary:
9de6753865 DEVTOOLS: Add bedhead data to create_titanic
63ffcf0a0d TITANIC: Add loading of bedhead data


Commit: 9de67538650b81610145bb47810ba2d9b641b3f1
    https://github.com/scummvm/scummvm/commit/9de67538650b81610145bb47810ba2d9b641b3f1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-08-25T18:35:50-04:00

Commit Message:
DEVTOOLS: Add bedhead data to create_titanic

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index a7dbe53..7171467 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -285,7 +285,7 @@ static const FrameRange BARBOT_FRAME_RANGES[60] = {
 	{ 202, 281 }, { 182, 202 }, { 165, 182 }, { 96, 165 }, { 0, 95 }
 };
 
-const char *const MISSIVEOMAT_MESSAGES[3] = {
+static const char *const MISSIVEOMAT_MESSAGES[3] = {
 	"Welcome, Leovinus.\n"
 	"\n"
 	"This is your Missive-O-Mat.\n"
@@ -363,6 +363,58 @@ const char *const MISSIVEOMAT_MESSAGES[3] = {
 	"His Loftiness Leovinus are here."
 };
 
+struct BedheadEntry {
+	const char *_name1;
+	const char *_name2;
+	const char *_name3;
+	const char *_name4;
+	int _startFrame;
+	int _endFrame;
+};
+
+static const BedheadEntry ON_CLOSED[4] = {
+	{ "Closed", "Closed", "Open", "Open", 0, 12 },
+	{ "Open", "Any", "Any", "RestingUTV", 0, 4 },
+	{ "Closed", "Open", "Any", "RestingV", 0, 6 },
+	{ "Closed", "Closed", "Closed", "RestingG", 0, 21 }
+};
+static const BedheadEntry ON_RESTING_TV[2] = {
+	{ "Any", "Closed", "Open", "Open", 6, 12 },
+	{ "Any", "Closed", "Closed", "RestingG", 6, 21 }
+};
+static const BedheadEntry ON_RESTING_UV[2] = {
+	{ "Any", "Any", "Open", "Open", 8, 12 },
+	{ "Any", "Any", "Closed", "RestingG", 8, 21 }
+};
+static const BedheadEntry ON_CLOSED_WRONG[2] = {
+	{ "Any", "Any", "Closed", "OpenWrong", 42, 56 },
+	{ "Any", "Any", "Open", "RestingDWrong", 42, 52 }
+};
+
+static const BedheadEntry OFF_OPEN[3] = {
+	{ "Closed", "Closed", "Open", "Closed", 27, 41 },
+	{ "Any", "Open", "Any", "RestingUV", 27, 29 },
+	{ "Open", "Closed", "Any", "RestingTV", 27, 33 }
+};
+static const BedheadEntry OFF_RESTING_UTV[1] = {
+	{ "Any", "Any", "Any", "Closed", 36, 41 }
+};
+static const BedheadEntry OFF_RESTING_V[1] = {
+	{ "Closed", "Any", "Any", "Closed", 32, 41 }
+};
+static const BedheadEntry OFF_RESTING_G[3] = {
+	{ "Closed", "Closed", "Closed", "Closed", 21, 41 },
+	{ "Any", "Open", "Closed", "RestingUV", 21, 29 },
+	{ "Open", "Closed", "Closed", "RestingTV", 21, 33 }
+};
+static const BedheadEntry OFF_OPEN_WRONG[1] = {
+	{ "Any", "Any", "Any", "ClosedWrong", 56, 70 }
+};
+static const BedheadEntry OFF_RESTING_D_WRONG[1] = {
+	{ "Any", "Any", "Any", "ClosedWrong", 59, 70 }
+};
+
+
 void NORETURN_PRE error(const char *s, ...) {
 	printf("%s\n", s);
 	exit(1);
@@ -715,6 +767,36 @@ void writeMissiveOMatMessages() {
 	writeStringArray("TEXT/MISSIVEOMAT/TO", TO[_version], 58);
 }
 
+void writeBedheadGroup(const BedheadEntry *data, int count) {
+	for (int idx = 0; idx < count; ++idx, ++data) {
+		outputFile.writeString(data->_name1);
+		outputFile.writeString(data->_name2);
+		outputFile.writeString(data->_name3);
+		outputFile.writeString(data->_name4);
+		outputFile.writeLong(data->_startFrame);
+		outputFile.writeLong(data->_endFrame);
+	}
+}
+
+void writeBedheadData() {
+	outputFile.seek(dataOffset);
+
+	writeBedheadGroup(ON_CLOSED, 4);
+	writeBedheadGroup(ON_RESTING_TV, 2);
+	writeBedheadGroup(ON_RESTING_UV, 2);
+	writeBedheadGroup(ON_CLOSED_WRONG, 2);
+	writeBedheadGroup(OFF_OPEN, 3);
+	writeBedheadGroup(OFF_RESTING_UTV, 1);
+	writeBedheadGroup(OFF_RESTING_V, 1);
+	writeBedheadGroup(OFF_RESTING_G, 3);
+	writeBedheadGroup(OFF_OPEN_WRONG, 1);
+	writeBedheadGroup(OFF_RESTING_D_WRONG, 1);
+
+	uint size = outputFile.size() - dataOffset;
+	writeEntryHeader("DATA/BEDHEAD", dataOffset, size);
+	dataOffset += size;
+}
+
 void writeHeader() {
 	// Write out magic string
 	const char *MAGIC_STR = "SVTN";
@@ -886,6 +968,7 @@ void writeData() {
 	writeAllScriptPreResponses();
 	writeBarbotFrameRanges();
 	writeMissiveOMatMessages();
+	writeBedheadData();
 }
 
 void createScriptMap() {


Commit: 63ffcf0a0deb05c77bdcc18d1f39d9384de5111a
    https://github.com/scummvm/scummvm/commit/63ffcf0a0deb05c77bdcc18d1f39d9384de5111a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-08-25T18:36:14-04:00

Commit Message:
TITANIC: Add loading of bedhead data

Changed paths:
    engines/titanic/game/sgt/bedhead.cpp
    engines/titanic/game/sgt/bedhead.h



diff --git a/engines/titanic/game/sgt/bedhead.cpp b/engines/titanic/game/sgt/bedhead.cpp
index 45031bd..f911a83 100644
--- a/engines/titanic/game/sgt/bedhead.cpp
+++ b/engines/titanic/game/sgt/bedhead.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/game/sgt/bedhead.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -30,41 +31,49 @@ BEGIN_MESSAGE_MAP(CBedhead, CSGTStateRoom)
 END_MESSAGE_MAP()
 
 void BedheadEntry::load(Common::SeekableReadStream *s) {
-	// TODO
+	_name1 = readStringFromStream(s);
+	_name2 = readStringFromStream(s);
+	_name3 = readStringFromStream(s);
+	_name4 = readStringFromStream(s);
+	_startFrame = s->readUint32LE();
+	_endFrame = s->readUint32LE();
 }
 
 /*------------------------------------------------------------------------*/
 
-void BedheadEntries::load(Common::SeekableReadStream *s) {
-	resize(s->readUint32LE());
-	for (uint idx = 0; idx < size(); ++idx)
+void BedheadEntries::load(Common::SeekableReadStream *s, int count) {
+	resize(count);
+	for (uint idx = 0; idx < count; ++idx)
 		(*this)[idx].load(s);
 }
 
 /*------------------------------------------------------------------------*/
 
 void TurnOnEntries::load(Common::SeekableReadStream *s) {
-	_closed.load(s);
-	_restingTV.load(s);
-	_restingUV.load(s);
-	_closedWrong.load(s);
+	_closed.load(s, 4);
+	_restingTV.load(s, 2);
+	_restingUV.load(s, 2);
+	_closedWrong.load(s, 2);
 }
 
 /*------------------------------------------------------------------------*/
 
 void TurnOffEntries::load(Common::SeekableReadStream *s) {
-	_open.load(s);
-	_restingUTV.load(s);
-	_restingV.load(s);
-	_restingG.load(s);
-	_openWrong.load(s);
-	_restingDWrong.load(s);
+	_open.load(s, 3);
+	_restingUTV.load(s, 1);
+	_restingV.load(s, 1);
+	_restingG.load(s, 3);
+	_openWrong.load(s, 1);
+	_restingDWrong.load(s, 1);
 }
 
 /*------------------------------------------------------------------------*/
 
 CBedhead::CBedhead() : CSGTStateRoom() {
-	// TODO: Load data for turn on/off methods
+	Common::SeekableReadStream *s = g_vm->_filesManager->getResource("DATA/BEDHEAD");
+	_on.load(s);
+	_off.load(s);
+	delete s;
 }
 
 void CBedhead::save(SimpleFile *file, int indent) {
diff --git a/engines/titanic/game/sgt/bedhead.h b/engines/titanic/game/sgt/bedhead.h
index 53c61e1..7784cb8 100644
--- a/engines/titanic/game/sgt/bedhead.h
+++ b/engines/titanic/game/sgt/bedhead.h
@@ -40,7 +40,7 @@ struct BedheadEntry {
 };
 class BedheadEntries : public Common::Array<BedheadEntry> {
 public:
-	void load(Common::SeekableReadStream *s);
+	void load(Common::SeekableReadStream *s, int count);
 };
 
 struct TurnOnEntries {






More information about the Scummvm-git-logs mailing list