Przeglądaj źródła

Support Polish version of H3 data files

Ivan Savenko 2 lat temu
rodzic
commit
e19dc41295
2 zmienionych plików z 8 dodań i 4 usunięć
  1. 4 0
      config/filesystem.json
  2. 4 4
      lib/filesystem/CArchiveLoader.cpp

+ 4 - 0
config/filesystem.json

@@ -11,12 +11,16 @@
 		[
 		[
 			{"type" : "lod", "path" : "Data/H3ab_bmp.lod"},
 			{"type" : "lod", "path" : "Data/H3ab_bmp.lod"},
 			{"type" : "lod", "path" : "Data/H3bitmap.lod"},
 			{"type" : "lod", "path" : "Data/H3bitmap.lod"},
+			{"type" : "lod", "path" : "Data/h3abp_bm.lod"}, // Polish version of H3 only
+			{"type" : "lod", "path" : "Data/H3pbitma.lod"}, // Polish version of H3 only
 			{"type" : "dir",  "path" : "Data"}
 			{"type" : "dir",  "path" : "Data"}
 		],
 		],
 		"SPRITES/":
 		"SPRITES/":
 		[
 		[
 			{"type" : "lod", "path" : "Data/H3ab_spr.lod"},
 			{"type" : "lod", "path" : "Data/H3ab_spr.lod"},
 			{"type" : "lod", "path" : "Data/H3sprite.lod"},
 			{"type" : "lod", "path" : "Data/H3sprite.lod"},
+			{"type" : "lod", "path" : "Data/h3abp_sp.lod"}, // Polish version of H3 only
+			{"type" : "lod", "path" : "Data/H3psprit.lod"}, // Polish version of H3 only
 			{"type" : "dir",  "path" : "Sprites"}
 			{"type" : "dir",  "path" : "Sprites"}
 		],
 		],
 		"SOUNDS/":
 		"SOUNDS/":

+ 4 - 4
lib/filesystem/CArchiveLoader.cpp

@@ -152,12 +152,12 @@ void CArchiveLoader::initSNDArchive(const std::string &mountPoint, CFileInputStr
 		char filename[40];
 		char filename[40];
 		reader.read(reinterpret_cast<ui8*>(filename), 40);
 		reader.read(reinterpret_cast<ui8*>(filename), 40);
 
 
-		//for some reason entries in snd have format NAME\0WAVRUBBISH....
-		//we need to replace first \0 with dot and take the 3 chars with extension (and drop the rest)
+		// for some reason entries in snd have format NAME\0WAVRUBBISH....
+		// and Polish version does not have extension at all
+		// we need to replace first \0 with dot and add wav extension manuall - we don't expect other types here anyway
 		ArchiveEntry entry;
 		ArchiveEntry entry;
 		entry.name  = filename; // till 1st \0
 		entry.name  = filename; // till 1st \0
-		entry.name += '.';
-		entry.name += std::string(filename + entry.name.size(), 3);
+		entry.name += ".wav";
 
 
 		entry.offset = reader.readInt32();
 		entry.offset = reader.readInt32();
 		entry.fullSize = reader.readInt32();
 		entry.fullSize = reader.readInt32();