[Scummvm-cvs-logs] SF.net SVN: scummvm: [32061] scummvm/trunk

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Mon May 12 16:22:27 CEST 2008


Revision: 32061
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32061&view=rev
Author:   athrxx
Date:     2008-05-12 07:22:27 -0700 (Mon, 12 May 2008)

Log Message:
-----------
fix for kyra 3 sfx (broken by last commit)

Modified Paths:
--------------
    scummvm/trunk/dists/engine-data/kyra.dat
    scummvm/trunk/engines/kyra/sound_towns.cpp
    scummvm/trunk/engines/kyra/staticres.cpp
    scummvm/trunk/tools/create_kyradat/create_kyradat.cpp
    scummvm/trunk/tools/create_kyradat/create_kyradat.h

Modified: scummvm/trunk/dists/engine-data/kyra.dat
===================================================================
(Binary files differ)

Modified: scummvm/trunk/engines/kyra/sound_towns.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_towns.cpp	2008-05-12 13:50:59 UTC (rev 32060)
+++ scummvm/trunk/engines/kyra/sound_towns.cpp	2008-05-12 14:22:27 UTC (rev 32061)
@@ -1442,7 +1442,13 @@
 			return false;
 	}
 
-	uint8 * data = _vm->resource()->fileData(file, 0);
+	char filename [13];
+	if (scumm_stricmp(file + strlen(file) - 4, ".PCM"))
+		sprintf(filename, "%s.PCM", file);
+	else
+		strcpy(filename, file);
+
+	uint8 * data = _vm->resource()->fileData(filename, 0);
 	uint8 * src = data;
 
 	uint16 sfxRate = rates[READ_LE_UINT16(src)];

Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp	2008-05-12 13:50:59 UTC (rev 32060)
+++ scummvm/trunk/engines/kyra/staticres.cpp	2008-05-12 14:22:27 UTC (rev 32061)
@@ -44,7 +44,7 @@
 
 namespace Kyra {
 
-#define RESFILE_VERSION 25
+#define RESFILE_VERSION 26
 
 bool StaticResource::checkKyraDat() {
 	Common::File kyraDat;
@@ -1215,8 +1215,7 @@
 	_ingameTimJpStr = _staticres->loadStrings(k2IngameTimJpStrings, _ingameTimJpStrSize);
 	_itemAnimData = _staticres->loadShapeAnimData_v2(k2IngameShapeAnimData, _itemAnimDataSize);
 
-	// replace sequence talkie files with localized versions and cut off .voc
-	// suffix from voc files so as to allow compression specific file extensions
+	// replace sequence talkie files with localized versions
 	const char* const* seqSoundList = _staticres->loadStrings(k2SeqplaySfxFiles, _sequenceSoundListSize);
 	const char* const* tlkfiles = _staticres->loadStrings(k2SeqplayTlkFiles, tmpSize);
 	char ** tmpSndLst = new char*[_sequenceSoundListSize];
@@ -1227,9 +1226,6 @@
 		tmpSndLst[i] = new char[len + 1];
 		tmpSndLst[i][0] = 0;
 
-		if (_flags.platform == Common::kPlatformPC)
-			len -= 4;
-
 		if (tlkfiles) {
 			for (int ii = 0; ii < tmpSize; ii++) {
 				if (!scumm_stricmp(&seqSoundList[i][1], &tlkfiles[ii][1]))
@@ -1239,8 +1235,6 @@
 
 		if (tmpSndLst[i][0] == 0)
 			strcpy(tmpSndLst[i], seqSoundList[i]);
-
-		tmpSndLst[i][len] = 0;
 	}
 
 	tlkfiles = seqSoundList = 0;

Modified: scummvm/trunk/tools/create_kyradat/create_kyradat.cpp
===================================================================
--- scummvm/trunk/tools/create_kyradat/create_kyradat.cpp	2008-05-12 13:50:59 UTC (rev 32060)
+++ scummvm/trunk/tools/create_kyradat/create_kyradat.cpp	2008-05-12 14:22:27 UTC (rev 32061)
@@ -31,7 +31,7 @@
 #include "md5.h"
 
 enum {
-	kKyraDatVersion = 25,
+	kKyraDatVersion = 26,
 	kIndexSize = 12
 };
 
@@ -66,6 +66,7 @@
 bool extractHofShapeAnimDataV2(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
 
 bool extractStringsWoSuffix(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
+bool extractPaddedStrings(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
 bool extractRaw16to8(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
 bool extractMrShapeAnimData(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
 
@@ -88,6 +89,7 @@
 	{ k2TypeShpDataV2, extractHofShapeAnimDataV2, createFilename },
 
 	{ k2TypeSoundList, extractStringsWoSuffix, createFilename },
+	{ k2TypeSfxList, extractPaddedStrings, createFilename },
 	{ k3TypeRaw16to8, extractRaw16to8, createFilename },
 	{ k3TypeShpData, extractMrShapeAnimData, createFilename },
 
@@ -216,7 +218,7 @@
 	{ k2SeqplayCredits, kTypeRawData, "S_CREDITS.TXT" },
 	{ k2SeqplayCreditsSpecial, kTypeStringList, "S_CREDITS2.TXT" },
 	{ k2SeqplayStrings, kTypeLanguageList, "S_STRINGS" },
-	{ k2SeqplaySfxFiles, kTypeStringList, "S_SFXFILES.TXT" },
+	{ k2SeqplaySfxFiles, k2TypeSoundList, "S_SFXFILES.TXT" },
 	{ k2SeqplayTlkFiles, kTypeLanguageList, "S_TLKFILES" },
 	{ k2SeqplaySeqData, k2TypeSeqData, "S_DATA.SEQ" },
 	{ k2SeqplayIntroTracks, kTypeStringList, "S_INTRO.TRA" },
@@ -241,7 +243,7 @@
 	{ k3MainMenuStrings, kTypeStringList, "MAINMENU.TXT" },
 	{ k3MusicFiles, k2TypeSoundList, "SCORE.TRA" },
 	{ k3ScoreTable, kTypeRawData, "SCORE.MAP" },
-	{ k3SfxFiles, kTypeStringList, "SFXFILES.TRA" },
+	{ k3SfxFiles, k2TypeSfxList, "SFXFILES.TRA" },
 	{ k3SfxMap, k3TypeRaw16to8, "SFXINDEX.MAP" },
 	{ k3ItemAnimData, k3TypeShpData, "INVANIM.SHP" },
 	{ k3ItemMagicTable, k3TypeRaw16to8, "ITEMMAGIC.MAP" },
@@ -966,6 +968,30 @@
 	return out.addFile(filename, buffer, outsize);
 }
 
+bool extractPaddedStrings(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
+	int outsize = size + 4;
+	uint8 *buffer = new uint8[outsize];
+	const uint8 *src = data;
+	uint8 *dst = buffer + 4;
+	const uint8 *fin = src + size;
+	int entries = 0;
+
+	while (src < fin) {
+		while (!*src && src < fin)
+			src++;
+		while (*src && src < fin)
+			*dst++ = *src++;
+
+		*dst++ = '\0';
+		entries++;
+	}
+
+	WRITE_BE_UINT32(buffer, entries);
+	outsize = dst - buffer;
+
+	return out.addFile(filename, buffer, outsize);
+}
+
 bool extractRaw16to8(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
 	int outsize = size >> 1;
 	uint8 *buffer = new uint8[outsize];

Modified: scummvm/trunk/tools/create_kyradat/create_kyradat.h
===================================================================
--- scummvm/trunk/tools/create_kyradat/create_kyradat.h	2008-05-12 13:50:59 UTC (rev 32060)
+++ scummvm/trunk/tools/create_kyradat/create_kyradat.h	2008-05-12 14:22:27 UTC (rev 32061)
@@ -257,6 +257,7 @@
 	k2TypeShpDataV1,
 	k2TypeShpDataV2,
 	k2TypeSoundList,
+	k2TypeSfxList,
 
 	k3TypeRaw16to8,
 	k3TypeShpData


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list