merge Platform/Common/DLC

This commit is contained in:
Tropical 2026-03-22 12:56:07 -05:00
parent be76c9cdb3
commit 8ecc837cfa
3 changed files with 29 additions and 3 deletions

View file

@ -73,6 +73,8 @@ public:
void addPack(DLCPack* pack);
void removePack(DLCPack* pack);
void removeAllPacks(void);
void LanguageChanged(void);
DLCPack* getPack(const std::wstring& name);
#ifdef _XBOX_ONE

View file

@ -96,7 +96,7 @@ XCONTENTDEVICEID DLCPack::GetDLCDeviceID() {
void DLCPack::addChildPack(DLCPack* childPack) {
const std::uint32_t packId = childPack->GetPackId();
#ifndef _CONTENT_PACKAGE
if (packId > 15) {
if (packId < 0 || packId > 15) {
__debugbreak();
}
#endif
@ -362,3 +362,17 @@ bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type,
return true;
}
}
void DLCPack::UpdateLanguage() {
// find the language file
DLCManager::e_DLCType_LocalisationData;
DLCFile* file = NULL;
if (m_files[DLCManager::e_DLCType_LocalisationData].size() > 0) {
file = m_files[DLCManager::e_DLCType_LocalisationData][0];
DLCLocalisationFile* localisationFile = (DLCLocalisationFile*)getFile(
DLCManager::e_DLCType_LocalisationData, L"languages.loc");
StringTable* strTable = localisationFile->getStringTable();
strTable->ReloadStringTable();
}
}

View file

@ -107,9 +107,14 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type,
SKIN_BOX* pSkinBox = new SKIN_BOX;
ZeroMemory(pSkinBox, sizeof(SKIN_BOX));
#ifdef __PS3__
// 4J Stu - The Xbox version used swscanf_s which isn't available in
// GCC.
swscanf(value.c_str(), L"%10ls%f%f%f%f%f%f%f%f", wchBodyPart,
#else
swscanf_s(
value.c_str(), L"%9ls%f%f%f%f%f%f%f%f", wchBodyPart, 10,
#endif
&pSkinBox->fX, &pSkinBox->fY, &pSkinBox->fZ, &pSkinBox->fW,
&pSkinBox->fH, &pSkinBox->fD, &pSkinBox->fU, &pSkinBox->fV);
@ -130,11 +135,16 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type,
// add this to the skin's vector of parts
m_AdditionalBoxes.push_back(pSkinBox);
} break;
case DLCManager::e_DLCParamType_Anim: {
case DLCManager::e_DLCParamType_Anim:
#ifdef __PS3__
// 4J Stu - The Xbox version used swscanf_s which isn't available in
// GCC.
swscanf(value.c_str(), L"%X", &m_uiAnimOverrideBitmask);
std::uint32_t skinId = app.getSkinIdFromPath(m_path);
#else
swscanf_s(value.c_str(), L"%X", &m_uiAnimOverrideBitmask,
sizeof(unsigned int));
#endif
DWORD skinId = app.getSkinIdFromPath(m_path);
app.SetAnimOverrideBitmask(skinId, m_uiAnimOverrideBitmask);
} break;
default: