From f3a6427cd4f923ce927c41d3671e7ba78503a2ad Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 1 Jan 2006 13:46:42 +0000 Subject: Hopefully fixed the missing speech bug reported on the forum, once and for all. svn-id: r19879 --- sword2/resman.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sword2') diff --git a/sword2/resman.cpp b/sword2/resman.cpp index c92b989d0e..cf454b3fec 100644 --- a/sword2/resman.cpp +++ b/sword2/resman.cpp @@ -145,10 +145,24 @@ ResourceManager::ResourceManager(Sword2Engine *vm) { for (i = 0; i < _totalClusters; i++) { file.read(cdInf[i].clusterName, sizeof(cdInf[i].clusterName)); + cdInf[i].cd = file.readByte(); if (file.ioFailed()) error("Cannot read cd.inf"); + + // It has been reported that there are two different versions + // of the cd.inf file: One where all clusters on CD also have + // the LOCAL_CACHE bit set. This bit is no longer used. To + // avoid future problems, let's normalize the flag once and for + // all here. + + if (cdInf[i].cd & LOCAL_PERM) + cdInf[i].cd = LOCAL_PERM; + else if (cdInf[i].cd & CD2) + cdInf[i].cd = CD2; + else + cdInf[i].cd = CD1; } file.close(); -- cgit v1.2.3