[Scummvm-git-logs] scummvm master -> 173e9c0c7361d6b55477a7744b034ca8ce0fbab5

dreammaster dreammaster at scummvm.org
Sat Feb 11 02:35:07 CET 2017


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:
843088ea2c DEVTOOLS: Add music parser strings to create_titanic
173e9c0c73 TITANIC: Moved music parser strings to data file


Commit: 843088ea2cb48817d20cbeded02c58ec46770894
    https://github.com/scummvm/scummvm/commit/843088ea2cb48817d20cbeded02c58ec46770894
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-02-10T20:34:30-05:00

Commit Message:
DEVTOOLS: Add music parser strings 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 1457ee6..09b738a 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -788,6 +788,36 @@ static const char *const STRINGS_DE[185] = {
 	"Dr\0xFC" "cken Sie den Knopf um die Bombe zu entschSrfen."
 };
 
+static const char *const MUSIC_DATA[4] = {
+	"64,^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|8,^^^^ 5:A///|64,/|/|/|/|/|/|/"
+	"|/|/|/|/|/|/|/|/|/|^|^|^|^|^|^|^|^|^|16, ^B//|64,/|/|/|/|^|16,^C/"
+	"/|64,/|/|/|/|",
+	"2:8,^^^^B//a|//g//B//|g///B//a|//g//A//|B//^C//b|//a//a//|BCb/b//"
+	"a|//g//A//|g/+f/D//c|//b//gA/|g/^^C//C|//C//a//|BCb////a|//g//g//"
+	"|g/g//B/a|/g//////|//^^B//a|//g//B//|g///B//a|//g//B//|g//^C//b|/"
+	"/a//a//|BCb/b//a|//g//B//|g/+f/D//c|//b//gA/|g/^^C//C|//C//a//|BC"
+	"b////a|//g//g//|g/g//B/a|/g//////|3:^^B//a//|g//A//g/|/^B//a//|g/"
+	"/A//B/|b^ 3:C//b//|a//g//+f/|+fG/G/GA/|B/a/g///|B///+f//G|G/G/+f/"
+	"G/|^^e//d//|c//b//gA|g/B//a//|g//g//g/|g//B/a/g|//////^^|^^Ga///G"
+	"|////////|////////|////////|",
+	"2:8,^^^^^^D/|/E//E//E|/d//^^d/|/E//E//E|/E//^^G/|/d//d//d|/^^^^^d"
+	"/|/E//E//E|/d/^^^E/|/E//d/+F/|bD^^^^G/|/e//e//e|^^^^^^d/|/E//E//E"
+	"|//d///d/|//b/////|^^^^^^D/|/E//E//E|/d//^^d/|/E//E//E|/E//^^G/|/"
+	"d//d//d|/^^^^^d/|/E//E//E|/d/^^^E/|/E//d/d/|d/^^^^G/|/e//e//e|^^^"
+	"^^^d/|/E//E//E|//d///d/|//b/////|3:D///c//b|//b//b//|D///c//b|//b"
+	"//g//|E///d//c|//b//a//|aB/B/BC/|D/c/b///|^^^D//DE|/E/E/d/d|//E/g"
+	"//g|//g//d//|^^^^g//E|//E//E//|d///d///|b///////|// 3:Db///C|///b"
+	"/// 5:A|64,/|/|/|/|/|/|/|/|",
+	"2:8,^^G//+f//|e//e//e/|//G//+f//|e//e//+F/|G/a//g//|+f//+f//+f/|/"
+	"/G//+F//|e//e//e/|//B//a//|g//e///d|//c//b//|a//a//a/|+f/G// 2:+F"
+	"//|e//e//C/|//b/g/+f/|//G/////|^^G//+f//|e//e//e/|//G//+f//|e//e/"
+	"/e/|//a//g//|+f//+f//+f/|//G//+F//|e//e//e/|//B//a//|g//e///d|/  "
+	"2:dC//b//|a//a//a/|+f/G//+F//|e//e//C/|//b/g/+f/|//G/////|d//d//d"
+	"/|/E//E//d|d//d//E/|/+F//G//b|a//a//a/|/D//D// 3:D|//g/g//D|/d/G/"
+	"///|^^b//b//|b//ba/B/|c//B//a/|/g//+f//+f|G//+F//e/|/c//C///|b/g/"
+	"+f///|G///////|G///////|C///////|////////|////////|"
+};
+
 void NORETURN_PRE error(const char *s, ...) {
 	printf("%s\n", s);
 	exit(1);
@@ -1269,6 +1299,7 @@ void writeData() {
 	writeStringArray("TEXT/REPLACEMENTS2", TEXT_REPLACEMENTS2[_version], 1576);
 	writeStringArray("TEXT/REPLACEMENTS3", TEXT_REPLACEMENTS3[_version], 82);
 	writeStringArray("TEXT/PRONOUNS", TEXT_PRONOUNS[_version], 15);
+	writeStringArray("MUSIC/PARSER", MUSIC_DATA, 4);
 
 	const int SENTENCES_DEFAULT[3] = { 0x5C0130, 0x5BEFC8, 0x5BE008 };
 	const int SENTENCES_BARBOT[2][3] = {


Commit: 173e9c0c7361d6b55477a7744b034ca8ce0fbab5
    https://github.com/scummvm/scummvm/commit/173e9c0c7361d6b55477a7744b034ca8ce0fbab5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-02-10T20:34:58-05:00

Commit Message:
TITANIC: Moved music parser strings to data file

Changed paths:
    engines/titanic/sound/music_object.cpp


diff --git a/engines/titanic/sound/music_object.cpp b/engines/titanic/sound/music_object.cpp
index 1f84079..d12b6eb 100644
--- a/engines/titanic/sound/music_object.cpp
+++ b/engines/titanic/sound/music_object.cpp
@@ -21,45 +21,21 @@
  */
 
 #include "titanic/sound/music_object.h"
+#include "titanic/titanic.h"
 #include "common/util.h"
 
 namespace Titanic {
 
-static const char *const DATA[4] = {
-	"64,^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|8,^^^^ 5:A///|64,/|/|/|/|/|/|/"
-	"|/|/|/|/|/|/|/|/|/|^|^|^|^|^|^|^|^|^|16, ^B//|64,/|/|/|/|^|16,^C/"
-	"/|64,/|/|/|/|",
-	"2:8,^^^^B//a|//g//B//|g///B//a|//g//A//|B//^C//b|//a//a//|BCb/b//"
-	"a|//g//A//|g/+f/D//c|//b//gA/|g/^^C//C|//C//a//|BCb////a|//g//g//"
-	"|g/g//B/a|/g//////|//^^B//a|//g//B//|g///B//a|//g//B//|g//^C//b|/"
-	"/a//a//|BCb/b//a|//g//B//|g/+f/D//c|//b//gA/|g/^^C//C|//C//a//|BC"
-	"b////a|//g//g//|g/g//B/a|/g//////|3:^^B//a//|g//A//g/|/^B//a//|g/"
-	"/A//B/|b^ 3:C//b//|a//g//+f/|+fG/G/GA/|B/a/g///|B///+f//G|G/G/+f/"
-	"G/|^^e//d//|c//b//gA|g/B//a//|g//g//g/|g//B/a/g|//////^^|^^Ga///G"
-	"|////////|////////|////////|",
-	"2:8,^^^^^^D/|/E//E//E|/d//^^d/|/E//E//E|/E//^^G/|/d//d//d|/^^^^^d"
-	"/|/E//E//E|/d/^^^E/|/E//d/+F/|bD^^^^G/|/e//e//e|^^^^^^d/|/E//E//E"
-	"|//d///d/|//b/////|^^^^^^D/|/E//E//E|/d//^^d/|/E//E//E|/E//^^G/|/"
-	"d//d//d|/^^^^^d/|/E//E//E|/d/^^^E/|/E//d/d/|d/^^^^G/|/e//e//e|^^^"
-	"^^^d/|/E//E//E|//d///d/|//b/////|3:D///c//b|//b//b//|D///c//b|//b"
-	"//g//|E///d//c|//b//a//|aB/B/BC/|D/c/b///|^^^D//DE|/E/E/d/d|//E/g"
-	"//g|//g//d//|^^^^g//E|//E//E//|d///d///|b///////|// 3:Db///C|///b"
-	"/// 5:A|64,/|/|/|/|/|/|/|/|",
-	"2:8,^^G//+f//|e//e//e/|//G//+f//|e//e//+F/|G/a//g//|+f//+f//+f/|/"
-	"/G//+F//|e//e//e/|//B//a//|g//e///d|//c//b//|a//a//a/|+f/G// 2:+F"
-	"//|e//e//C/|//b/g/+f/|//G/////|^^G//+f//|e//e//e/|//G//+f//|e//e/"
-	"/e/|//a//g//|+f//+f//+f/|//G//+F//|e//e//e/|//B//a//|g//e///d|/  "
-	"2:dC//b//|a//a//a/|+f/G//+F//|e//e//C/|//b/g/+f/|//G/////|d//d//d"
-	"/|/E//E//d|d//d//E/|/+F//G//b|a//a//a/|/D//D// 3:D|//g/g//D|/d/G/"
-	"///|^^b//b//|b//ba/B/|c//B//a/|/g//+f//+f|G//+F//e/|/c//C///|b/g/"
-	"+f///|G///////|G///////|C///////|////////|////////|"
-};
-
-/*------------------------------------------------------------------------*/
-
 CMusicObject::CMusicObject(int index) {
-	assert(index >= 0 && index <= 3);
-	CMusicParser parser(DATA[index]);
+	// Read in the list of parser strings
+	Common::SeekableReadStream *res = g_vm->_filesManager->getResource("MUSIC/PARSER");
+	Common::StringArray parserStrings;
+	while (res->pos() < res->size())
+		parserStrings.push_back(readStringFromStream(res));
+	delete res;
+
+	// Set up a new parser with the desired string
+	CMusicParser parser(parserStrings[index].c_str());
 
 	// Count how many encoded values there are
 	CValuePair r;
@@ -68,11 +44,13 @@ CMusicObject::CMusicObject(int index) {
 		++count;
 	assert(count > 0);
 
+	// Read in the values to the array
 	_data.resize(count);
 	parser.reset();
 	for (int idx = 0; idx < count; ++idx)
 		parser.parse(_data[idx]);
 
+	// Figure out the range of values in the array
 	_minVal = 0x7FFFFFFF;
 	int maxVal = -0x7FFFFFFF;
 





More information about the Scummvm-git-logs mailing list