mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 15:04:56 +00:00
More fixes for GameCube cooking
This commit is contained in:
@@ -1259,8 +1259,7 @@ bool WriteCMDL(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPath
|
||||
matGX.reset(matIR, FE.getDiagnostics());
|
||||
|
||||
targetMSet.materials.emplace_back(matGX, mat.iprops, mat.texs, texPaths,
|
||||
mesh.colorLayerCount, mesh.uvLayerCount,
|
||||
false, false);
|
||||
mesh.colorLayerCount, false, false);
|
||||
|
||||
targetMSet.materials.back().binarySize(endOff);
|
||||
targetMSet.head.addMaterialEndOff(endOff);
|
||||
@@ -1742,8 +1741,7 @@ bool WriteMREASecs(std::vector<std::vector<uint8_t>>& secsOut, const hecl::Proje
|
||||
bool lm = lightmapped != mat.iprops.cend() && lightmapped->second != 0;
|
||||
|
||||
matSet.materials.emplace_back(matGX, mat.iprops, mat.texs, texPaths,
|
||||
mesh.colorLayerCount, mesh.uvLayerCount,
|
||||
lm, false);
|
||||
mesh.colorLayerCount, lm, false);
|
||||
|
||||
matSet.materials.back().binarySize(endOff);
|
||||
matSet.head.addMaterialEndOff(endOff);
|
||||
|
||||
@@ -775,6 +775,16 @@ void PAKRouter<BRIDGETYPE>::enumerateResources(const std::function<bool(const En
|
||||
return;
|
||||
}
|
||||
|
||||
template <class BRIDGETYPE>
|
||||
bool PAKRouter<BRIDGETYPE>::mreaHasDupeResources(const IDType& id) const
|
||||
{
|
||||
const PAKType* pak = m_pak.get();
|
||||
if (!pak)
|
||||
LogDNACommon.report(logvisor::Fatal,
|
||||
"PAKRouter::enterPAKBridge() must be called before PAKRouter::mreaHasDupeResources()");
|
||||
return pak->mreaHasDupeResources(id);
|
||||
}
|
||||
|
||||
template class PAKRouter<DNAMP1::PAKBridge>;
|
||||
template class PAKRouter<DNAMP2::PAKBridge>;
|
||||
template class PAKRouter<DNAMP3::PAKBridge>;
|
||||
|
||||
@@ -232,6 +232,8 @@ public:
|
||||
hecl::ProjectPath getAreaLayerCooked(const IDType& areaId, int layerIdx, bool& activeOut) const;
|
||||
|
||||
void enumerateResources(const std::function<bool(const EntryType*)>& func);
|
||||
|
||||
bool mreaHasDupeResources(const IDType& id) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ static int CountBits(uint32_t n)
|
||||
|
||||
/* Box filter algorithm (for mipmapping) */
|
||||
static void BoxFilter(const uint8_t* input, unsigned chanCount,
|
||||
unsigned inWidth, unsigned inHeight, uint8_t* output)
|
||||
unsigned inWidth, unsigned inHeight, uint8_t* output, bool dxt1)
|
||||
{
|
||||
unsigned mipWidth = 1;
|
||||
unsigned mipHeight = 1;
|
||||
@@ -45,7 +45,9 @@ static void BoxFilter(const uint8_t* input, unsigned chanCount,
|
||||
tmp += input[(in1LineBase+(x*2+1))*chanCount+c];
|
||||
tmp += input[(in2LineBase+(x*2))*chanCount+c];
|
||||
tmp += input[(in2LineBase+(x*2+1))*chanCount+c];
|
||||
out[c] = tmp / 4;
|
||||
out[c] = uint8_t(tmp / 4);
|
||||
if (c == 3 && dxt1)
|
||||
out[c] = uint8_t(out[c] ? 0xff : 0x0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1513,7 +1515,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
|
||||
unsigned filterHeight = height;
|
||||
for (size_t i=1 ; i<numMips ; ++i)
|
||||
{
|
||||
BoxFilter(filterIn, nComps, filterWidth, filterHeight, filterOut);
|
||||
BoxFilter(filterIn, nComps, filterWidth, filterHeight, filterOut, doDXT1);
|
||||
filterIn += filterWidth * filterHeight * nComps;
|
||||
filterWidth /= 2;
|
||||
filterHeight /= 2;
|
||||
@@ -1847,7 +1849,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
|
||||
unsigned filterHeight = height;
|
||||
for (size_t i=1 ; i<numMips ; ++i)
|
||||
{
|
||||
BoxFilter(filterIn, nComps, filterWidth, filterHeight, filterOut);
|
||||
BoxFilter(filterIn, nComps, filterWidth, filterHeight, filterOut, doDXT1);
|
||||
filterIn += filterWidth * filterHeight * nComps;
|
||||
filterWidth /= 2;
|
||||
filterHeight /= 2;
|
||||
|
||||
Reference in New Issue
Block a user