mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-06-14 21:52:15 +00:00
fix: unglob all of /Build/Common
This commit is contained in:
@@ -10,18 +10,18 @@
|
||||
#ifdef __linux__
|
||||
#include <stdint.h>
|
||||
static const size_t DLC_WCHAR_BINARY = 2;
|
||||
static wstring dlc_read_wstring(const void *data)
|
||||
static std::wstring dlc_read_std::wstring(const void *data)
|
||||
{
|
||||
const uint16_t *p = (const uint16_t *)data;
|
||||
wstring s;
|
||||
std::wstring s;
|
||||
while (*p) s += (wchar_t)*p++;
|
||||
return s;
|
||||
}
|
||||
#define DLC_WSTRING(ptr) dlc_read_wstring(ptr)
|
||||
#define DLC_WSTRING(ptr) dlc_read_std::wstring(ptr)
|
||||
#define DLC_PARAM_ADV(n) (sizeof(C4JStorage::DLC_FILE_PARAM) + (n) * DLC_WCHAR_BINARY)
|
||||
#define DLC_DETAIL_ADV(n) (sizeof(C4JStorage::DLC_FILE_DETAILS) + (n) * DLC_WCHAR_BINARY)
|
||||
#else
|
||||
#define DLC_WSTRING(ptr) wstring((WCHAR *)(ptr))
|
||||
#define DLC_WSTRING(ptr) std::wstring((WCHAR *)(ptr))
|
||||
#define DLC_PARAM_ADV(n) (sizeof(C4JStorage::DLC_FILE_PARAM) + sizeof(WCHAR) * (n))
|
||||
#define DLC_DETAIL_ADV(n) (sizeof(C4JStorage::DLC_FILE_DETAILS) + sizeof(WCHAR) * (n))
|
||||
#endif
|
||||
@@ -58,7 +58,7 @@ DLCManager::~DLCManager()
|
||||
}
|
||||
}
|
||||
|
||||
DLCManager::EDLCParameterType DLCManager::getParameterType(const wstring ¶mName)
|
||||
DLCManager::EDLCParameterType DLCManager::getParameterType(const std::wstring ¶mName)
|
||||
{
|
||||
EDLCParameterType type = e_DLCParamType_Invalid;
|
||||
|
||||
@@ -110,7 +110,7 @@ void DLCManager::removePack(DLCPack *pack)
|
||||
}
|
||||
}
|
||||
|
||||
DLCPack *DLCManager::getPack(const wstring &name)
|
||||
DLCPack *DLCManager::getPack(const std::wstring &name)
|
||||
{
|
||||
DLCPack *pack = NULL;
|
||||
//DWORD currentIndex = 0;
|
||||
@@ -118,7 +118,7 @@ DLCPack *DLCManager::getPack(const wstring &name)
|
||||
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
||||
{
|
||||
currentPack = *it;
|
||||
wstring wsName=currentPack->getName();
|
||||
std::wstring wsName=currentPack->getName();
|
||||
|
||||
if(wsName.compare(name) == 0)
|
||||
{
|
||||
@@ -130,7 +130,7 @@ DLCPack *DLCManager::getPack(const wstring &name)
|
||||
}
|
||||
|
||||
#ifdef _XBOX_ONE
|
||||
DLCPack *DLCManager::getPackFromProductID(const wstring &productID)
|
||||
DLCPack *DLCManager::getPackFromProductID(const std::wstring &productID)
|
||||
{
|
||||
DLCPack *pack = NULL;
|
||||
//DWORD currentIndex = 0;
|
||||
@@ -138,7 +138,7 @@ DLCPack *DLCManager::getPackFromProductID(const wstring &productID)
|
||||
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
||||
{
|
||||
currentPack = *it;
|
||||
wstring wsName=currentPack->getPurchaseOfferId();
|
||||
std::wstring wsName=currentPack->getPurchaseOfferId();
|
||||
|
||||
if(wsName.compare(productID) == 0)
|
||||
{
|
||||
@@ -230,7 +230,7 @@ DWORD DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_D
|
||||
return foundIndex;
|
||||
}
|
||||
|
||||
DWORD DLCManager::getPackIndexContainingSkin(const wstring &path, bool &found)
|
||||
DWORD DLCManager::getPackIndexContainingSkin(const std::wstring &path, bool &found)
|
||||
{
|
||||
DWORD foundIndex = 0;
|
||||
found = false;
|
||||
@@ -252,7 +252,7 @@ DWORD DLCManager::getPackIndexContainingSkin(const wstring &path, bool &found)
|
||||
return foundIndex;
|
||||
}
|
||||
|
||||
DLCPack *DLCManager::getPackContainingSkin(const wstring &path)
|
||||
DLCPack *DLCManager::getPackContainingSkin(const std::wstring &path)
|
||||
{
|
||||
DLCPack *foundPack = NULL;
|
||||
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
||||
@@ -270,7 +270,7 @@ DLCPack *DLCManager::getPackContainingSkin(const wstring &path)
|
||||
return foundPack;
|
||||
}
|
||||
|
||||
DLCSkinFile *DLCManager::getSkinFile(const wstring &path)
|
||||
DLCSkinFile *DLCManager::getSkinFile(const std::wstring &path)
|
||||
{
|
||||
DLCSkinFile *foundSkinfile = NULL;
|
||||
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
||||
@@ -326,15 +326,15 @@ DWORD DLCManager::checkForCorruptDLCAndAlert(bool showMessage /*= true*/)
|
||||
return corruptDLCCount;
|
||||
}
|
||||
|
||||
bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const wstring &path, DLCPack *pack, bool fromArchive)
|
||||
bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const std::wstring &path, DLCPack *pack, bool fromArchive)
|
||||
{
|
||||
return readDLCDataFile( dwFilesProcessed, wstringtofilename(path), pack, fromArchive);
|
||||
return readDLCDataFile( dwFilesProcessed, std::wstringtofilename(path), pack, fromArchive);
|
||||
}
|
||||
|
||||
|
||||
bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DLCPack *pack, bool fromArchive)
|
||||
{
|
||||
wstring wPath = convStringToWstring(path);
|
||||
std::wstring wPath = convStringToWstring(path);
|
||||
if (fromArchive && app.getArchiveFileSize(wPath) >= 0)
|
||||
{
|
||||
byteArray bytes = app.getArchiveFile(wPath);
|
||||
@@ -347,7 +347,7 @@ bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DL
|
||||
if(finalPath.size() == 0) finalPath = path;
|
||||
HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
#elif defined(_DURANGO)
|
||||
wstring finalPath = StorageManager.GetMountedPath(wPath.c_str());
|
||||
std::wstring finalPath = StorageManager.GetMountedPath(wPath.c_str());
|
||||
if(finalPath.size() == 0) finalPath = wPath;
|
||||
HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
#else
|
||||
@@ -387,7 +387,7 @@ bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DL
|
||||
|
||||
bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD dwLength, DLCPack *pack)
|
||||
{
|
||||
unordered_map<int, DLCManager::EDLCParameterType> parameterMapping;
|
||||
std::unordered_map<int, DLCManager::EDLCParameterType> parameterMapping;
|
||||
unsigned int uiCurrentByte=0;
|
||||
|
||||
// File format defined in the DLC_Creator
|
||||
@@ -418,7 +418,7 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
|
||||
for(unsigned int i=0;i<uiParameterCount;i++)
|
||||
{
|
||||
// Map DLC strings to application strings, then store the DLC index mapping to application index
|
||||
wstring parameterName = DLC_WSTRING(pParams->wchData);
|
||||
std::wstring parameterName = DLC_WSTRING(pParams->wchData);
|
||||
DLCManager::EDLCParameterType type = DLCManager::getParameterType(parameterName);
|
||||
if( type != DLCManager::e_DLCParamType_Invalid )
|
||||
{
|
||||
@@ -547,14 +547,14 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
|
||||
DWORD DLCManager::retrievePackIDFromDLCDataFile(const string &path, DLCPack *pack)
|
||||
{
|
||||
DWORD packId = 0;
|
||||
wstring wPath = convStringToWstring(path);
|
||||
std::wstring wPath = convStringToWstring(path);
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
string finalPath = StorageManager.GetMountedPath(path.c_str());
|
||||
if(finalPath.size() == 0) finalPath = path;
|
||||
HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
#elif defined(_DURANGO)
|
||||
wstring finalPath = StorageManager.GetMountedPath(wPath.c_str());
|
||||
std::wstring finalPath = StorageManager.GetMountedPath(wPath.c_str());
|
||||
if(finalPath.size() == 0) finalPath = wPath;
|
||||
HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
#else
|
||||
@@ -594,7 +594,7 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
|
||||
{
|
||||
DWORD packId=0;
|
||||
bool bPackIDSet=false;
|
||||
unordered_map<int, DLCManager::EDLCParameterType> parameterMapping;
|
||||
std::unordered_map<int, DLCManager::EDLCParameterType> parameterMapping;
|
||||
unsigned int uiCurrentByte=0;
|
||||
|
||||
// File format defined in the DLC_Creator
|
||||
@@ -623,7 +623,7 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
|
||||
for(unsigned int i=0;i<uiParameterCount;i++)
|
||||
{
|
||||
// Map DLC strings to application strings, then store the DLC index mapping to application index
|
||||
wstring parameterName = DLC_WSTRING(pParams->wchData);
|
||||
std::wstring parameterName = DLC_WSTRING(pParams->wchData);
|
||||
DLCManager::EDLCParameterType type = DLCManager::getParameterType(parameterName);
|
||||
if( type != DLCManager::e_DLCParamType_Invalid )
|
||||
{
|
||||
@@ -664,7 +664,7 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
|
||||
{
|
||||
if(it->second==e_DLCParamType_PackId)
|
||||
{
|
||||
wstring wsTemp = DLC_WSTRING(pParams->wchData);
|
||||
std::wstring wsTemp = DLC_WSTRING(pParams->wchData);
|
||||
std::wstringstream ss;
|
||||
// 4J Stu - numbered using decimal to make it easier for artists/people to number manually
|
||||
ss << std::dec << wsTemp.c_str();
|
||||
|
||||
Reference in New Issue
Block a user