Merge branch 'dev' into feat/iggy-dev

This commit is contained in:
Tropical 2026-03-15 15:30:59 -05:00
commit 1bad0a3048
18 changed files with 201 additions and 184 deletions

View file

@ -572,7 +572,7 @@ void C_4JInput::SetJoypadStickAxisMap(int, unsigned int, unsigned int) {}
void C_4JInput::SetJoypadStickTriggerMap(int, unsigned int, unsigned int) {}
void C_4JInput::SetKeyRepeatRate(float, float) {}
void C_4JInput::SetDebugSequence(const char*, int (*)(void*), void*) {}
FLOAT C_4JInput::GetIdleSeconds(int) { return 0.f; }
float C_4JInput::GetIdleSeconds(int) { return 0.f; }
bool C_4JInput::IsPadConnected(int iPad) { return iPad == 0; }
// Silly check, we check if we have a keyboard.

View file

@ -53,7 +53,7 @@ enum EKeyboardResult {
};
typedef struct _STRING_VERIFY_RESPONSE {
WORD wNumStrings;
std::uint16_t wNumStrings;
HRESULT* pStringResult;
} STRING_VERIFY_RESPONSE;
@ -96,7 +96,7 @@ public:
void SetKeyRepeatRate(float fRepeatDelaySecs, float fRepeatRateSecs);
void SetDebugSequence(const char* chSequenceA, int (*Func)(void*),
void* lpParam);
FLOAT GetIdleSeconds(int iPad);
float GetIdleSeconds(int iPad);
bool IsPadConnected(int iPad);
// In-Game values which may have been remapped due to Southpaw, swap

View file

@ -5,10 +5,12 @@ C_4JProfile ProfileManager;
static void* s_profileData[4] = {};
void C_4JProfile::Initialise(DWORD dwTitleID, DWORD dwOfferID,
void C_4JProfile::Initialise(std::uint32_t dwTitleID,
std::uint32_t dwOfferID,
unsigned short usProfileVersion,
UINT uiProfileValuesC, UINT uiProfileSettingsC,
DWORD* pdwProfileSettingsA,
unsigned int uiProfileValuesC,
unsigned int uiProfileSettingsC,
std::uint32_t* pdwProfileSettingsA,
int iGameDefinedDataSizeX4,
unsigned int* puiGameDefinedDataChangedBitmask) {
for (int i = 0; i < 4; i++) {
@ -25,22 +27,21 @@ void C_4JProfile::SetLockedProfile(int iProf) {}
bool C_4JProfile::IsSignedIn(int iQuadrant) { return iQuadrant == 0; }
bool C_4JProfile::IsSignedInLive(int iProf) { return false; }
bool C_4JProfile::IsGuest(int iQuadrant) { return false; }
UINT C_4JProfile::RequestSignInUI(bool bFromInvite, bool bLocalGame,
bool bNoGuestsAllowed,
bool bMultiplayerSignIn, bool bAddUser,
int (*Func)(void*, const bool,
const int iPad),
void* lpParam, int iQuadrant) {
unsigned int C_4JProfile::RequestSignInUI(
bool bFromInvite, bool bLocalGame, bool bNoGuestsAllowed,
bool bMultiplayerSignIn, bool bAddUser,
int (*Func)(void*, const bool, const int iPad), void* lpParam,
int iQuadrant) {
return 0;
}
UINT C_4JProfile::DisplayOfflineProfile(int (*Func)(void*, const bool,
const int iPad),
void* lpParam, int iQuadrant) {
unsigned int C_4JProfile::DisplayOfflineProfile(
int (*Func)(void*, const bool, const int iPad), void* lpParam,
int iQuadrant) {
return 0;
}
UINT C_4JProfile::RequestConvertOfflineToGuestUI(int (*Func)(void*, const bool,
const int iPad),
void* lpParam, int iQuadrant) {
unsigned int C_4JProfile::RequestConvertOfflineToGuestUI(
int (*Func)(void*, const bool, const int iPad), void* lpParam,
int iQuadrant) {
return 0;
}
void C_4JProfile::SetPrimaryPlayerChanged(bool bVal) {}

View file

@ -36,9 +36,11 @@ public:
// 4 players have game defined data, puiGameDefinedDataChangedBitmask needs
// to be checked by the game side to see if there's an update needed - it'll
// have the bits set for players to be updated
void Initialise(DWORD dwTitleID, DWORD dwOfferID,
unsigned short usProfileVersion, UINT uiProfileValuesC,
UINT uiProfileSettingsC, DWORD* pdwProfileSettingsA,
void Initialise(std::uint32_t dwTitleID, std::uint32_t dwOfferID,
unsigned short usProfileVersion,
unsigned int uiProfileValuesC,
unsigned int uiProfileSettingsC,
std::uint32_t* pdwProfileSettingsA,
int iGameDefinedDataSizeX4,
unsigned int* puiGameDefinedDataChangedBitmask);
void SetTrialTextStringTable(CXuiStringTable* pStringTable, int iAccept,
@ -50,17 +52,18 @@ public:
bool IsSignedIn(int iQuadrant);
bool IsSignedInLive(int iProf);
bool IsGuest(int iQuadrant);
UINT RequestSignInUI(bool bFromInvite, bool bLocalGame,
bool bNoGuestsAllowed, bool bMultiplayerSignIn,
bool bAddUser,
int (*Func)(void*, const bool, const int iPad),
void* lpParam, int iQuadrant = XUSER_INDEX_ANY);
UINT DisplayOfflineProfile(int (*Func)(void*, const bool, const int iPad),
void* lpParam, int iQuadrant = XUSER_INDEX_ANY);
UINT RequestConvertOfflineToGuestUI(int (*Func)(void*, const bool,
const int iPad),
void* lpParam,
int iQuadrant = XUSER_INDEX_ANY);
unsigned int RequestSignInUI(bool bFromInvite, bool bLocalGame,
bool bNoGuestsAllowed,
bool bMultiplayerSignIn, bool bAddUser,
int (*Func)(void*, const bool, const int iPad),
void* lpParam,
int iQuadrant = XUSER_INDEX_ANY);
unsigned int DisplayOfflineProfile(
int (*Func)(void*, const bool, const int iPad), void* lpParam,
int iQuadrant = XUSER_INDEX_ANY);
unsigned int RequestConvertOfflineToGuestUI(
int (*Func)(void*, const bool, const int iPad), void* lpParam,
int iQuadrant = XUSER_INDEX_ANY);
void SetPrimaryPlayerChanged(bool bVal);
bool QuerySigninStatus(void);
void GetXUID(int iPad, PlayerUID* pXuid, bool bOnlineXuid);

View file

@ -689,12 +689,13 @@ HRESULT C4JRender::LoadTextureData(const char* szFilename,
return hr;
}
HRESULT C4JRender::LoadTextureData(BYTE* pbData, DWORD dwBytes,
HRESULT C4JRender::LoadTextureData(std::uint8_t* pbData,
std::uint32_t byteCount,
D3DXIMAGE_INFO* pSrcInfo, int** ppDataOut) {
int width, height, channels;
unsigned char* data =
stbi_load_from_memory(pbData, dwBytes, &width, &height, &channels, 4);
stbi_load_from_memory(pbData, byteCount, &width, &height, &channels, 4);
if (!data) return E_FAIL;
HRESULT hr = LoadFromSTB(data, width, height, pSrcInfo, ppDataOut);

View file

@ -30,10 +30,10 @@ typedef struct {
} D3DXIMAGE_INFO;
typedef struct _XSOCIAL_PREVIEWIMAGE {
BYTE* pBytes;
DWORD Pitch;
DWORD Width;
DWORD Height;
std::uint8_t* pBytes;
std::uint32_t Pitch;
std::uint32_t Width;
std::uint32_t Height;
// D3DFORMAT Format;
} XSOCIAL_PREVIEWIMAGE, *PXSOCIAL_PREVIEWIMAGE;
@ -171,7 +171,7 @@ public:
void TextureDynamicUpdateEnd();
HRESULT LoadTextureData(const char* szFilename, D3DXIMAGE_INFO* pSrcInfo,
int** ppDataOut);
HRESULT LoadTextureData(BYTE* pbData, DWORD dwBytes,
HRESULT LoadTextureData(std::uint8_t* pbData, std::uint32_t byteCount,
D3DXIMAGE_INFO* pSrcInfo, int** ppDataOut);
HRESULT SaveTextureData(const char* szFilename, D3DXIMAGE_INFO* pSrcInfo,
int* ppDataOut);

View file

@ -13,10 +13,11 @@ C4JStorage::C4JStorage() : m_pStringTable(nullptr) {}
void C4JStorage::Tick(void) {}
C4JStorage::EMessageResult C4JStorage::RequestMessageBox(
UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC, DWORD dwPad,
unsigned int uiTitle, unsigned int uiText, unsigned int* uiOptionA,
unsigned int uiOptionC, unsigned int pad,
int (*Func)(void*, int, const C4JStorage::EMessageResult), void* lpParam,
C4JStringTable* pStringTable, WCHAR* pwchFormatString,
DWORD dwFocusButton) {
unsigned int focusButton) {
return EMessage_ResultAccept;
}
@ -57,15 +58,19 @@ void C4JStorage::GetSaveData(void* pvData, unsigned int* puiBytes) {
PVOID C4JStorage::AllocateSaveData(unsigned int uiBytes) {
return malloc(uiBytes);
}
void C4JStorage::SetSaveImages(PBYTE pbThumbnail, DWORD dwThumbnailBytes,
PBYTE pbImage, DWORD dwImageBytes,
PBYTE pbTextData, DWORD dwTextDataBytes) {}
void C4JStorage::SetSaveImages(std::uint8_t* pbThumbnail,
unsigned int thumbnailBytes,
std::uint8_t* pbImage,
unsigned int imageBytes,
std::uint8_t* pbTextData,
unsigned int textDataBytes) {}
C4JStorage::ESaveGameState C4JStorage::SaveSaveData(int (*Func)(void*,
const bool),
void* lpParam) {
return ESaveGame_Idle;
}
void C4JStorage::CopySaveDataToNewSave(PBYTE pbThumbnail, DWORD cbThumbnail,
void C4JStorage::CopySaveDataToNewSave(std::uint8_t* pbThumbnail,
unsigned int cbThumbnail,
WCHAR* wchNewName,
int (*Func)(void* lpParam, bool),
void* lpParam) {}
@ -92,14 +97,15 @@ C4JStorage::ESaveGameState C4JStorage::LoadSaveDataThumbnail(
void* lpParam) {
return ESaveGame_Idle;
}
void C4JStorage::GetSaveCacheFileInfo(DWORD dwFile,
void C4JStorage::GetSaveCacheFileInfo(unsigned int fileIndex,
XCONTENT_DATA& xContentData) {
memset(&xContentData, 0, sizeof(xContentData));
}
void C4JStorage::GetSaveCacheFileInfo(DWORD dwFile, PBYTE* ppbImageData,
DWORD* pdwImageBytes) {
void C4JStorage::GetSaveCacheFileInfo(unsigned int fileIndex,
std::uint8_t** ppbImageData,
unsigned int* pImageBytes) {
if (ppbImageData) *ppbImageData = nullptr;
if (pdwImageBytes) *pdwImageBytes = 0;
if (pImageBytes) *pImageBytes = 0;
}
C4JStorage::ESaveGameState C4JStorage::LoadSaveData(
PSAVE_INFO pSaveInfo, int (*Func)(void* lpParam, const bool, const bool),
@ -118,21 +124,21 @@ void C4JStorage::RegisterMarketplaceCountsCallback(
void C4JStorage::SetDLCPackageRoot(char* pszDLCRoot) {}
C4JStorage::EDLCStatus C4JStorage::GetDLCOffers(
int iPad, int (*Func)(void*, int, std::uint32_t, int), void* lpParam,
DWORD dwOfferTypesBitmask) {
std::uint32_t dwOfferTypesBitmask) {
return EDLC_NoOffers;
}
DWORD C4JStorage::CancelGetDLCOffers() { return 0; }
unsigned int C4JStorage::CancelGetDLCOffers() { return 0; }
void C4JStorage::ClearDLCOffers() {}
XMARKETPLACE_CONTENTOFFER_INFO& C4JStorage::GetOffer(DWORD dw) {
XMARKETPLACE_CONTENTOFFER_INFO& C4JStorage::GetOffer(unsigned int dw) {
return s_dummyOffer;
}
int C4JStorage::GetOfferCount() { return 0; }
DWORD C4JStorage::InstallOffer(int iOfferIDC, __uint64* ullOfferIDA,
int (*Func)(void*, int, int), void* lpParam,
bool bTrial) {
unsigned int C4JStorage::InstallOffer(int iOfferIDC, __uint64* ullOfferIDA,
int (*Func)(void*, int, int),
void* lpParam, bool bTrial) {
return 0;
}
DWORD C4JStorage::GetAvailableDLCCount(int iPad) { return 0; }
unsigned int C4JStorage::GetAvailableDLCCount(int iPad) { return 0; }
C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad,
int (*Func)(void*, int, int),
void* lpParam) {
@ -141,14 +147,14 @@ C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad,
}
return EDLC_NoInstalledDLC;
}
XCONTENT_DATA& C4JStorage::GetDLC(DWORD dw) { return s_dummyContentData; }
XCONTENT_DATA& C4JStorage::GetDLC(unsigned int dw) { return s_dummyContentData; }
std::uint32_t C4JStorage::MountInstalledDLC(
int iPad, std::uint32_t dwDLC,
int (*Func)(void*, int, std::uint32_t, std::uint32_t), void* lpParam,
LPCSTR szMountDrive) {
return 0;
}
DWORD C4JStorage::UnmountInstalledDLC(LPCSTR szMountDrive) { return 0; }
unsigned int C4JStorage::UnmountInstalledDLC(LPCSTR szMountDrive) { return 0; }
void C4JStorage::GetMountedDLCFileList(const char* szMountDrive,
std::vector<std::string>& fileList) {
fileList.clear();
@ -156,14 +162,14 @@ void C4JStorage::GetMountedDLCFileList(const char* szMountDrive,
std::string C4JStorage::GetMountedPath(std::string szMount) { return ""; }
C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(
int iQuadrant, eGlobalStorage eStorageFacility,
C4JStorage::eTMS_FileType eFileType, WCHAR* pwchFilename, BYTE** ppBuffer,
DWORD* pdwBufferSize, int (*Func)(void*, WCHAR*, int, bool, int),
void* lpParam, int iAction) {
C4JStorage::eTMS_FileType eFileType, WCHAR* pwchFilename,
std::uint8_t** ppBuffer, unsigned int* pBufferSize,
int (*Func)(void*, WCHAR*, int, bool, int), void* lpParam, int iAction) {
return ETMSStatus_Fail;
}
bool C4JStorage::WriteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility,
WCHAR* pwchFilename, BYTE* pBuffer,
DWORD dwBufferSize) {
WCHAR* pwchFilename, std::uint8_t* pBuffer,
unsigned int bufferSize) {
return false;
}
bool C4JStorage::DeleteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility,

View file

@ -20,7 +20,7 @@ typedef struct {
char UTF8SaveFilename[MAX_SAVEFILENAME_LENGTH];
char UTF8SaveTitle[MAX_DISPLAYNAME_LENGTH];
CONTAINER_METADATA metaData;
PBYTE thumbnailData;
std::uint8_t* thumbnailData;
} SAVE_INFO, *PSAVE_INFO;
typedef struct {
@ -40,14 +40,14 @@ public:
// Structs defined in the DLC_Creator, but added here to be used in the app
typedef struct {
unsigned int uiFileSize;
DWORD dwType;
DWORD dwWchCount; // count of WCHAR in next array
std::uint32_t dwType;
std::uint32_t dwWchCount; // count of WCHAR in next array
WCHAR wchFile[1];
} DLC_FILE_DETAILS, *PDLC_FILE_DETAILS;
typedef struct {
DWORD dwType;
DWORD dwWchCount; // count of WCHAR in next array;
std::uint32_t dwType;
std::uint32_t dwWchCount; // count of WCHAR in next array;
WCHAR wchData[1]; // will be an array of size dwBytes
} DLC_FILE_PARAM, *PDLC_FILE_PARAM;
// End of DLC_Creator structs
@ -55,17 +55,18 @@ public:
typedef struct {
WCHAR wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH];
CHAR szFileName[XCONTENT_MAX_FILENAME_LENGTH];
DWORD dwImageOffset;
DWORD dwImageBytes;
std::uint32_t dwImageOffset;
std::uint32_t dwImageBytes;
} CACHEINFOSTRUCT;
// structure to hold DLC info in TMS
typedef struct {
DWORD dwVersion;
DWORD dwNewOffers;
DWORD dwTotalOffers;
DWORD dwInstalledTotalOffers;
BYTE bPadding[1024 - sizeof(DWORD) * 4]; // future expansion
std::uint32_t dwVersion;
std::uint32_t dwNewOffers;
std::uint32_t dwTotalOffers;
std::uint32_t dwInstalledTotalOffers;
std::uint8_t bPadding[1024 - sizeof(std::uint32_t) * 4];
// future expansion
} DLC_TMS_DETAILS;
enum eGTS_FileTypes { eGTS_Type_Skin = 0, eGTS_Type_Cape, eGTS_Type_MAX };
@ -188,8 +189,8 @@ public:
} TMSPP_FILE_LIST, *PTMSPP_FILE_LIST;
typedef struct {
DWORD dwSize;
PBYTE pbData;
unsigned int size;
std::uint8_t* pbData;
} TMSPP_FILEDATA, *PTMSPP_FILEDATA;
C4JStorage();
@ -198,11 +199,11 @@ public:
// Messages
C4JStorage::EMessageResult RequestMessageBox(
UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC,
DWORD dwPad = XUSER_INDEX_ANY,
unsigned int uiTitle, unsigned int uiText, unsigned int* uiOptionA,
unsigned int uiOptionC, unsigned int pad = XUSER_INDEX_ANY,
int (*Func)(void*, int, const C4JStorage::EMessageResult) = NULL,
void* lpParam = NULL, C4JStringTable* pStringTable = NULL,
WCHAR* pwchFormatString = NULL, DWORD dwFocusButton = 0);
WCHAR* pwchFormatString = NULL, unsigned int focusButton = 0);
C4JStorage::EMessageResult GetMessageBoxResult();
@ -230,14 +231,16 @@ public:
void GetSaveData(void* pvData, unsigned int* puiBytes);
PVOID AllocateSaveData(unsigned int uiBytes);
void SetSaveImages(
PBYTE pbThumbnail, DWORD dwThumbnailBytes, PBYTE pbImage,
DWORD dwImageBytes, PBYTE pbTextData,
DWORD dwTextDataBytes); // Sets the thumbnail & image for the save,
// optionally setting the metadata in the png
std::uint8_t* pbThumbnail, unsigned int thumbnailBytes,
std::uint8_t* pbImage, unsigned int imageBytes,
std::uint8_t* pbTextData,
unsigned int textDataBytes); // Sets the thumbnail & image for the
// save, optionally setting the
// metadata in the png
C4JStorage::ESaveGameState SaveSaveData(int (*Func)(void*, const bool),
void* lpParam);
void CopySaveDataToNewSave(PBYTE pbThumbnail, DWORD cbThumbnail,
WCHAR* wchNewName,
void CopySaveDataToNewSave(std::uint8_t* pbThumbnail,
unsigned int cbThumbnail, WCHAR* wchNewName,
int (*Func)(void* lpParam, bool), void* lpParam);
void SetSaveDeviceSelected(unsigned int uiPad, bool bSelected);
bool GetSaveDeviceSelected(unsigned int iPad);
@ -261,9 +264,10 @@ public:
void* lpParam); // Get the thumbnail for an individual save referenced
// by pSaveInfo
void GetSaveCacheFileInfo(DWORD dwFile, XCONTENT_DATA& xContentData);
void GetSaveCacheFileInfo(DWORD dwFile, PBYTE* ppbImageData,
DWORD* pdwImageBytes);
void GetSaveCacheFileInfo(unsigned int fileIndex, XCONTENT_DATA& xContentData);
void GetSaveCacheFileInfo(unsigned int fileIndex,
std::uint8_t** ppbImageData,
unsigned int* pImageBytes);
// Load the save. Need to call GetSaveData once the callback is called
C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,
@ -282,25 +286,26 @@ public:
void SetDLCPackageRoot(char* pszDLCRoot);
C4JStorage::EDLCStatus GetDLCOffers(
int iPad, int (*Func)(void*, int, std::uint32_t, int), void* lpParam,
DWORD dwOfferTypesBitmask = XMARKETPLACE_OFFERING_TYPE_CONTENT);
DWORD CancelGetDLCOffers();
std::uint32_t dwOfferTypesBitmask =
XMARKETPLACE_OFFERING_TYPE_CONTENT);
unsigned int CancelGetDLCOffers();
void ClearDLCOffers();
XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw);
XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(unsigned int dw);
int GetOfferCount();
DWORD InstallOffer(int iOfferIDC, __uint64* ullOfferIDA,
int (*Func)(void*, int, int), void* lpParam,
bool bTrial = false);
DWORD GetAvailableDLCCount(int iPad);
unsigned int InstallOffer(int iOfferIDC, __uint64* ullOfferIDA,
int (*Func)(void*, int, int), void* lpParam,
bool bTrial = false);
unsigned int GetAvailableDLCCount(int iPad);
C4JStorage::EDLCStatus GetInstalledDLC(int iPad,
int (*Func)(void*, int, int),
void* lpParam);
XCONTENT_DATA& GetDLC(DWORD dw);
XCONTENT_DATA& GetDLC(unsigned int dw);
std::uint32_t MountInstalledDLC(int iPad, std::uint32_t dwDLC,
int (*Func)(void*, int, std::uint32_t,
std::uint32_t),
void* lpParam, LPCSTR szMountDrive = NULL);
DWORD UnmountInstalledDLC(LPCSTR szMountDrive = NULL);
unsigned int UnmountInstalledDLC(LPCSTR szMountDrive = NULL);
void GetMountedDLCFileList(const char* szMountDrive,
std::vector<std::string>& fileList);
std::string GetMountedPath(std::string szMount);
@ -309,11 +314,12 @@ public:
C4JStorage::ETMSStatus ReadTMSFile(
int iQuadrant, eGlobalStorage eStorageFacility,
C4JStorage::eTMS_FileType eFileType, WCHAR* pwchFilename,
BYTE** ppBuffer, DWORD* pdwBufferSize,
std::uint8_t** ppBuffer, unsigned int* pBufferSize,
int (*Func)(void*, WCHAR*, int, bool, int) = NULL, void* lpParam = NULL,
int iAction = 0);
bool WriteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility,
WCHAR* pwchFilename, BYTE* pBuffer, DWORD dwBufferSize);
WCHAR* pwchFilename, std::uint8_t* pBuffer,
unsigned int bufferSize);
bool DeleteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility,
WCHAR* pwchFilename);
void StoreTMSPathName(WCHAR* pwchName = NULL);
@ -323,7 +329,7 @@ public:
C4JStorage::ETMSStatus WriteTMSFile(
int iPad, C4JStorage::eGlobalStorage eStorageFacility,
C4JStorage::eTMS_FileType eFileType, CHAR* pchFilePath, CHAR* pchBuffer,
DWORD dwBufferSize, TMSCLIENT_CALLBACK Func, LPVOID lpParam);
unsigned int bufferSize, TMSCLIENT_CALLBACK Func, LPVOID lpParam);
HRESULT GetUserQuotaInfo(int iPad, TMSCLIENT_CALLBACK Func, LPVOID lpParam);
#endif

View file

@ -903,7 +903,7 @@ void MinecraftServer::Suspend() {
QueryPerformanceCounter(&qwNewTime);
qwDeltaTime.QuadPart = qwNewTime.QuadPart - qwTime.QuadPart;
fElapsedTime = fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart));
fElapsedTime = fSecsPerTick * static_cast<float>(qwDeltaTime.QuadPart);
// 4J-JEV: Flush stats and call PlayerSessionExit.
for (int iPad = 0; iPad < XUSER_MAX_COUNT; iPad++) {
@ -1272,7 +1272,7 @@ void MinecraftServer::run(__int64 seed, void* lpParameter) {
qwDeltaTime.QuadPart =
qwNewTime.QuadPart - qwTime.QuadPart;
fElapsedTime =
fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart));
fSecsPerTick * static_cast<float>(qwDeltaTime.QuadPart);
app.DebugPrintf("Autosave: Elapsed time %f\n",
fElapsedTime);
} break;

View file

@ -16,7 +16,7 @@ TMS_FILE;
typedef struct
{
std::uint8_t *pbData;
unsigned int dwBytes;
unsigned int byteCount;
std::uint8_t ucRefCount;
}
MEMDATA,*PMEMDATA;
@ -197,7 +197,7 @@ FEATURE_DATA;
typedef struct
{
std::uint8_t *pBannedList;
unsigned int dwBytes;
unsigned int byteCount;
}
BANNEDLIST;

View file

@ -5285,8 +5285,8 @@ int CMinecraftApp::DLCMountedCallback(void *pParam,int iPad,std::uint32_t dwErr,
m_Time.qwAppTime.QuadPart += qwDeltaTime.QuadPart;
m_Time.qwTime.QuadPart = qwNewTime.QuadPart;
m_Time.fElapsedTime = m_Time.fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart));
m_Time.fAppTime = m_Time.fSecsPerTick * ((FLOAT)(m_Time.qwAppTime.QuadPart));
m_Time.fElapsedTime = m_Time.fSecsPerTick * static_cast<float>(qwDeltaTime.QuadPart);
m_Time.fAppTime = m_Time.fSecsPerTick * static_cast<float>(m_Time.qwAppTime.QuadPart);
}
@ -5319,7 +5319,7 @@ bool CMinecraftApp::isXuidDeadmau5(PlayerUID xuid)
return false;
}
void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName, std::uint8_t *pbData, unsigned int dwBytes)
void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName, std::uint8_t *pbData, unsigned int byteCount)
{
EnterCriticalSection(&csMemFilesLock);
// check it's not already in
@ -5332,13 +5332,13 @@ void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName, std::uint8_t
#endif
pData = (*it).second;
if(pData->dwBytes == 0 && dwBytes != 0)
if(pData->byteCount == 0 && byteCount != 0)
{
// This should never be NULL if dwBytes is 0
// This should never be NULL if byteCount is 0
if(pData->pbData!=NULL) delete [] pData->pbData;
pData->pbData=pbData;
pData->dwBytes=dwBytes;
pData->byteCount=byteCount;
}
++pData->ucRefCount;
@ -5353,10 +5353,9 @@ void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName, std::uint8_t
// add this texture to the list of memory texture files - it will then be picked up by the level renderer's AddEntity
pData = (PMEMDATA)new BYTE[sizeof(MEMDATA)];
ZeroMemory( pData, sizeof(MEMDATA) );
pData = new MEMDATA();
pData->pbData=pbData;
pData->dwBytes=dwBytes;
pData->byteCount=byteCount;
pData->ucRefCount = 1;
// use the xuid to access the skin data
@ -5382,7 +5381,7 @@ void CMinecraftApp::RemoveMemoryTextureFile(const std::wstring &wName)
#ifndef _CONTENT_PACKAGE
wprintf(L"Erasing the memory texture file data for %ls\n", wName.c_str());
#endif
delete [] pData;
delete pData;
m_MEM_Files.erase(wName);
}
}
@ -5414,7 +5413,7 @@ bool CMinecraftApp::IsFileInMemoryTextures(const std::wstring &wName)
return val;
}
void CMinecraftApp::GetMemFileDetails(const std::wstring &wName, std::uint8_t **ppbData, unsigned int *pdwBytes)
void CMinecraftApp::GetMemFileDetails(const std::wstring &wName, std::uint8_t **ppbData, unsigned int *pByteCount)
{
EnterCriticalSection(&csMemFilesLock);
AUTO_VAR(it, m_MEM_Files.find(wName));
@ -5422,12 +5421,12 @@ void CMinecraftApp::GetMemFileDetails(const std::wstring &wName, std::uint8_t **
{
PMEMDATA pData = (*it).second;
*ppbData=pData->pbData;
*pdwBytes=pData->dwBytes;
*pByteCount=pData->byteCount;
}
LeaveCriticalSection(&csMemFilesLock);
}
void CMinecraftApp::AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned int dwBytes)
void CMinecraftApp::AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned int byteCount)
{
EnterCriticalSection(&csMemTPDLock);
// check it's not already in
@ -5435,10 +5434,9 @@ void CMinecraftApp::AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned
AUTO_VAR(it, m_MEM_TPD.find(iConfig));
if(it == m_MEM_TPD.end())
{
pData = (PMEMDATA)new BYTE[sizeof(MEMDATA)];
ZeroMemory( pData, sizeof(MEMDATA) );
pData = new MEMDATA();
pData->pbData=pbData;
pData->dwBytes=dwBytes;
pData->byteCount=byteCount;
pData->ucRefCount = 1;
m_MEM_TPD[iConfig]=pData;
@ -5456,7 +5454,7 @@ void CMinecraftApp::RemoveMemoryTPDFile(int iConfig)
if(it != m_MEM_TPD.end())
{
pData=m_MEM_TPD[iConfig];
delete [] pData;
delete pData;
m_MEM_TPD.erase(iConfig);
}
@ -5516,7 +5514,7 @@ bool CMinecraftApp::IsFileInTPD(int iConfig)
return val;
}
void CMinecraftApp::GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pdwBytes)
void CMinecraftApp::GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pByteCount)
{
EnterCriticalSection(&csMemTPDLock);
AUTO_VAR(it, m_MEM_TPD.find(iConfig));
@ -5524,7 +5522,7 @@ void CMinecraftApp::GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pd
{
PMEMDATA pData = (*it).second;
*ppbData=pData->pbData;
*pdwBytes=pData->dwBytes;
*pByteCount=pData->byteCount;
}
LeaveCriticalSection(&csMemTPDLock);
}
@ -6099,7 +6097,7 @@ std::wstring CMinecraftApp::FormatHTMLString(int iPad, const std::wstring &desc,
#endif // _XBOX
// Fix for #8903 - UI: Localization: KOR/JPN/CHT: Button Icons are rendered with padding space, which looks no good
DWORD dwLanguage = XGetLanguage( );
std::uint32_t dwLanguage = XGetLanguage( );
switch(dwLanguage)
{
case XC_LANGUAGE_KOREAN:
@ -8334,14 +8332,14 @@ int CMinecraftApp::TMSPPFileReturned(void *pParam,int iPad,int iUserData,C4JStor
case e_DLC_TexturePackData:
{
// 4J-PB - we need to allocate memory for the file data and copy into it, since the current data is a reference into the blob download memory
std::uint8_t *pbData = new std::uint8_t[pFileData->dwSize];
memcpy(pbData,pFileData->pbData,pFileData->dwSize);
std::uint8_t *pbData = new std::uint8_t[pFileData->size];
memcpy(pbData,pFileData->pbData,pFileData->size);
pClass->m_vTMSPPData.push_back(pbData);
app.DebugPrintf("Got texturepack data\n");
// get the config value for the texture pack
int iConfig=app.GetTPConfigVal(pCurrent->wchFilename);
app.AddMemoryTPDFile(iConfig, pbData, pFileData->dwSize);
app.AddMemoryTPDFile(iConfig, pbData, pFileData->size);
}
break;
default:
@ -8349,12 +8347,12 @@ int CMinecraftApp::TMSPPFileReturned(void *pParam,int iPad,int iUserData,C4JStor
if(pFileData->pbData[0]==0x89)
{
// 4J-PB - we need to allocate memory for the file data and copy into it, since the current data is a reference into the blob download memory
std::uint8_t *pbData = new std::uint8_t[pFileData->dwSize];
memcpy(pbData,pFileData->pbData,pFileData->dwSize);
std::uint8_t *pbData = new std::uint8_t[pFileData->size];
memcpy(pbData,pFileData->pbData,pFileData->size);
pClass->m_vTMSPPData.push_back(pbData);
app.DebugPrintf("Got image data - %ls\n",pCurrent->wchFilename);
app.AddMemoryTextureFile(pCurrent->wchFilename, pbData, pFileData->dwSize);
app.AddMemoryTextureFile(pCurrent->wchFilename, pbData, pFileData->size);
}
else
{
@ -8371,12 +8369,12 @@ int CMinecraftApp::TMSPPFileReturned(void *pParam,int iPad,int iUserData,C4JStor
app.DebugPrintf("--- Got texturepack data %ls\n",pCurrent->wchFilename);
// get the config value for the texture pack
int iConfig=app.GetTPConfigVal(pCurrent->wchFilename);
app.AddMemoryTPDFile(iConfig, pFileData->pbData, pFileData->dwSize);
app.AddMemoryTPDFile(iConfig, pFileData->pbData, pFileData->size);
}
break;
default:
app.DebugPrintf("--- Got image data - %ls\n",pCurrent->wchFilename);
app.AddMemoryTextureFile(pCurrent->wchFilename, pFileData->pbData, pFileData->dwSize);
app.AddMemoryTextureFile(pCurrent->wchFilename, pFileData->pbData, pFileData->size);
break;
}
#endif

View file

@ -291,7 +291,7 @@ public:
static void NotificationsCallback(void *pParam,std::uint32_t dwNotification, unsigned int uiParam);
// for the ethernet being disconnected
static void LiveLinkChangeCallback(void *pParam,BOOL bConnected);
static void LiveLinkChangeCallback(void *pParam, bool bConnected);
bool GetLiveLinkRequired() {return m_bLiveLinkRequired;}
void SetLiveLinkRequired(bool required) {m_bLiveLinkRequired=required;}
@ -341,16 +341,16 @@ public:
bool isXuidNotch(PlayerUID xuid);
bool isXuidDeadmau5(PlayerUID xuid);
void AddMemoryTextureFile(const std::wstring &wName, std::uint8_t *pbData, unsigned int dwBytes);
void AddMemoryTextureFile(const std::wstring &wName, std::uint8_t *pbData, unsigned int byteCount);
void RemoveMemoryTextureFile(const std::wstring &wName);
void GetMemFileDetails(const std::wstring &wName, std::uint8_t **ppbData, unsigned int *pdwBytes);
void GetMemFileDetails(const std::wstring &wName, std::uint8_t **ppbData, unsigned int *pByteCount);
bool IsFileInMemoryTextures(const std::wstring &wName);
// Texture Pack Data files (icon, banner, comparison shot & text)
void AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned int dwBytes);
void AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned int byteCount);
void RemoveMemoryTPDFile(int iConfig);
bool IsFileInTPD(int iConfig);
void GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pdwBytes);
void GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pByteCount);
int GetTPDSize() {return m_MEM_TPD.size();}
#ifndef __PS3__
int GetTPConfigVal(WCHAR *pwchDataFile);
@ -839,12 +839,12 @@ public:
bool GetBanListRead(int iPad) { return m_bRead_BannedListA[iPad];}
void SetBanListRead(int iPad,bool bVal) { m_bRead_BannedListA[iPad]=bVal;}
void ClearBanList(int iPad) { BannedListA[iPad].pBannedList=NULL;BannedListA[iPad].dwBytes=0;}
void ClearBanList(int iPad) { BannedListA[iPad].pBannedList=NULL;BannedListA[iPad].byteCount=0;}
std::uint32_t GetRequiredTexturePackID() { return m_dwRequiredTexturePackID; }
void SetRequiredTexturePackID(std::uint32_t texturePackId) { m_dwRequiredTexturePackID = texturePackId; }
virtual void GetFileFromTPD(eTPDFileType eType, std::uint8_t *pbData, unsigned int dwBytes, std::uint8_t **ppbData, unsigned int *pdwBytes ) {*ppbData = NULL; *pdwBytes = 0;}
virtual void GetFileFromTPD(eTPDFileType eType, std::uint8_t *pbData, unsigned int byteCount, std::uint8_t **ppbData, unsigned int *pByteCount ) {*ppbData = NULL; *pByteCount = 0;}
//XTITLE_DEPLOYMENT_TYPE getDeploymentType() { return m_titleDeploymentType; }

View file

@ -395,12 +395,12 @@ DWORD XEnableGuestSignin(BOOL fEnable) { return 0; }
#ifdef _WINDOWS64
static void *profileData[4];
static bool s_bProfileIsFullVersion;
void C_4JProfile::Initialise( DWORD dwTitleID,
DWORD dwOfferID,
void C_4JProfile::Initialise( std::uint32_t dwTitleID,
std::uint32_t dwOfferID,
unsigned short usProfileVersion,
UINT uiProfileValuesC,
UINT uiProfileSettingsC,
DWORD *pdwProfileSettingsA,
unsigned int uiProfileValuesC,
unsigned int uiProfileSettingsC,
std::uint32_t *pdwProfileSettingsA,
int iGameDefinedDataSizeX4,
unsigned int *puiGameDefinedDataChangedBitmask)
{
@ -467,9 +467,9 @@ void C_4JProfile::SetLockedProfile(int iProf) {}
bool C_4JProfile::IsSignedIn(int iQuadrant) { return ( iQuadrant == 0); }
bool C_4JProfile::IsSignedInLive(int iProf) { return true; }
bool C_4JProfile::IsGuest(int iQuadrant) { return false; }
UINT C_4JProfile::RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; }
UINT C_4JProfile::DisplayOfflineProfile(int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; }
UINT C_4JProfile::RequestConvertOfflineToGuestUI(int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; }
unsigned int C_4JProfile::RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; }
unsigned int C_4JProfile::DisplayOfflineProfile(int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; }
unsigned int C_4JProfile::RequestConvertOfflineToGuestUI(int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; }
void C_4JProfile::SetPrimaryPlayerChanged(bool bVal) {}
bool C_4JProfile::QuerySigninStatus(void) { return true; }
void C_4JProfile::GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid) {*pXuid = 0xe000d45248242f2e; }
@ -558,7 +558,7 @@ void C_4JProfile::ShowProfileCard(int iPad, PlayerUID targetUid) {}
#if defined(__linux__)
C4JStorage::C4JStorage() {}
void C4JStorage::Tick() {}
C4JStorage::EMessageResult C4JStorage::RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult),LPVOID lpParam, C4JStringTable *pStringTable, WCHAR *pwchFormatString,DWORD dwFocusButton) { return C4JStorage::EMessage_Undefined; }
C4JStorage::EMessageResult C4JStorage::RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned int pad, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult),LPVOID lpParam, C4JStringTable *pStringTable, WCHAR *pwchFormatString,unsigned int focusButton) { return C4JStorage::EMessage_Undefined; }
C4JStorage::EMessageResult C4JStorage::GetMessageBoxResult() { return C4JStorage::EMessage_Undefined; }
bool C4JStorage::SetSaveDevice(int( *Func)(LPVOID,const bool),LPVOID lpParam, bool bForceResetOfSaveDevice) { return true; }
void C4JStorage::Init(LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, int( *Func)(LPVOID, const ESavingMessage, int),LPVOID lpParam) {}
@ -576,7 +576,7 @@ unsigned int C4JStorage::GetSaveSize() { return 0; }
void C4JStorage::GetSaveData(void *pvData,unsigned int *pulBytes) {}
PVOID C4JStorage::AllocateSaveData(unsigned int ulBytes) { return new char[ulBytes]; }
void C4JStorage::SaveSaveData(unsigned int ulBytes,PBYTE pbThumbnail,DWORD cbThumbnail,PBYTE pbTextData, DWORD dwTextLen) {}
void C4JStorage::CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam) {}
void C4JStorage::CopySaveDataToNewSave(std::uint8_t *pbThumbnail,unsigned int cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam) {}
void C4JStorage::SetSaveDeviceSelected(unsigned int uiPad,bool bSelected) {}
bool C4JStorage::GetSaveDeviceSelected(unsigned int iPad) { return true; }
C4JStorage::ELoadGameStatus C4JStorage::DoesSaveExist(bool *pbExists) { return C4JStorage::ELoadGame_Idle; }
@ -585,27 +585,27 @@ void C4JStorage::SetSaveMessageVPosition(float fY) {}
//C4JStorage::ESGIStatus C4JStorage::GetSavesInfo(int iPad,bool ( *Func)(LPVOID, int, CACHEINFOSTRUCT *, int, HRESULT),LPVOID lpParam,char *pszSavePackName) { return C4JStorage::ESGIStatus_Idle; }
C4JStorage::ESaveGameState C4JStorage::GetSavesInfo(int iPad,int ( *Func)(LPVOID lpParam,SAVE_DETAILS *pSaveDetails,const bool),LPVOID lpParam,char *pszSavePackName) { return C4JStorage::ESaveGame_Idle; }
void C4JStorage::GetSaveCacheFileInfo(DWORD dwFile,XCONTENT_DATA &xContentData) {}
void C4JStorage::GetSaveCacheFileInfo(DWORD dwFile, PBYTE *ppbImageData, DWORD *pdwImageBytes) {}
void C4JStorage::GetSaveCacheFileInfo(unsigned int fileIndex,XCONTENT_DATA &xContentData) {}
void C4JStorage::GetSaveCacheFileInfo(unsigned int fileIndex, std::uint8_t * *ppbImageData, unsigned int *pImageBytes) {}
C4JStorage::ESaveGameState C4JStorage::LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool, const bool), LPVOID lpParam) {return C4JStorage::ESaveGame_Idle;}
C4JStorage::EDeleteGameStatus C4JStorage::DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam) { return C4JStorage::EDeleteGame_Idle; }
PSAVE_DETAILS C4JStorage::ReturnSavesInfo() {return NULL;}
void C4JStorage::RegisterMarketplaceCountsCallback(int ( *Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam ) {}
void C4JStorage::SetDLCPackageRoot(char *pszDLCRoot) {}
C4JStorage::EDLCStatus C4JStorage::GetDLCOffers(int iPad,int( *Func)(void *, int, std::uint32_t, int),void *lpParam, DWORD dwOfferTypesBitmaskT) { return C4JStorage::EDLC_Idle; }
DWORD C4JStorage::CancelGetDLCOffers() { return 0; }
C4JStorage::EDLCStatus C4JStorage::GetDLCOffers(int iPad,int( *Func)(void *, int, std::uint32_t, int),void *lpParam, std::uint32_t dwOfferTypesBitmaskT) { return C4JStorage::EDLC_Idle; }
unsigned int C4JStorage::CancelGetDLCOffers() { return 0; }
void C4JStorage::ClearDLCOffers() {}
XMARKETPLACE_CONTENTOFFER_INFO& C4JStorage::GetOffer(DWORD dw) { static XMARKETPLACE_CONTENTOFFER_INFO retval = {0}; return retval; }
XMARKETPLACE_CONTENTOFFER_INFO& C4JStorage::GetOffer(unsigned int dw) { static XMARKETPLACE_CONTENTOFFER_INFO retval = {0}; return retval; }
int C4JStorage::GetOfferCount() { return 0; }
DWORD C4JStorage::InstallOffer(int iOfferIDC,ULONGLONG *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial) { return 0; }
DWORD C4JStorage::GetAvailableDLCCount( int iPad) { return 0; }
XCONTENT_DATA& C4JStorage::GetDLC(DWORD dw) { static XCONTENT_DATA retval = {0}; return retval; }
unsigned int C4JStorage::InstallOffer(int iOfferIDC,ULONGLONG *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial) { return 0; }
unsigned int C4JStorage::GetAvailableDLCCount( int iPad) { return 0; }
XCONTENT_DATA& C4JStorage::GetDLC(unsigned int dw) { static XCONTENT_DATA retval = {0}; return retval; }
C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam) { return C4JStorage::EDLC_Idle; }
std::uint32_t C4JStorage::MountInstalledDLC(int iPad,std::uint32_t dwDLC,int( *Func)(void *, int, std::uint32_t, std::uint32_t),void *lpParam,LPCSTR szMountDrive) { return 0; }
DWORD C4JStorage::UnmountInstalledDLC(LPCSTR szMountDrive) { return 0; }
C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, WCHAR *pwchFilename,BYTE **ppBuffer,DWORD *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int),LPVOID lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; }
bool C4JStorage::WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,BYTE *pBuffer,DWORD dwBufferSize) { return true; }
unsigned int C4JStorage::UnmountInstalledDLC(LPCSTR szMountDrive) { return 0; }
C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, WCHAR *pwchFilename,std::uint8_t **ppBuffer,unsigned int *pBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int),LPVOID lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; }
bool C4JStorage::WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,std::uint8_t *pBuffer,unsigned int bufferSize) { return true; }
bool C4JStorage::DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename) { return true; }
void C4JStorage::StoreTMSPathName(WCHAR *pwchName) {}
unsigned int C4JStorage::CRC(unsigned char *buf, int len) { return 0; }

View file

@ -728,7 +728,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail) {
QueryPerformanceCounter(&qwNewTime);
qwDeltaTime.QuadPart = qwNewTime.QuadPart - qwTime.QuadPart;
fElapsedTime = fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart));
fElapsedTime = fSecsPerTick * static_cast<float>(qwDeltaTime.QuadPart);
app.DebugPrintf("Check buffer size: Elapsed time %f\n", fElapsedTime);
PIXEndNamedEvent();
@ -759,7 +759,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail) {
QueryPerformanceCounter(&qwNewTime);
qwDeltaTime.QuadPart = qwNewTime.QuadPart - qwTime.QuadPart;
fElapsedTime = fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart));
fElapsedTime = fSecsPerTick * static_cast<float>(qwDeltaTime.QuadPart);
app.DebugPrintf("Compress: Elapsed time %f\n", fElapsedTime);
PIXEndNamedEvent();

View file

@ -1344,7 +1344,7 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) {
QueryPerformanceCounter(&qwNewTime);
qwDeltaTime.QuadPart = qwNewTime.QuadPart - qwTime.QuadPart;
fElapsedTime = fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart));
fElapsedTime = fSecsPerTick * static_cast<float>(qwDeltaTime.QuadPart);
app.DebugPrintf("Check buffer size: Elapsed time %f\n", fElapsedTime);
PIXEndNamedEvent();
@ -1367,7 +1367,7 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) {
QueryPerformanceCounter(&qwNewTime);
qwDeltaTime.QuadPart = qwNewTime.QuadPart - qwTime.QuadPart;
fElapsedTime = fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart));
fElapsedTime = fSecsPerTick * static_cast<float>(qwDeltaTime.QuadPart);
app.DebugPrintf("Compress: Elapsed time %f\n", fElapsedTime);
PIXEndNamedEvent();

View file

@ -3450,8 +3450,8 @@ void Level::checkLight(LightLayer::variety layer, int xc, int yc, int zc,
{
QueryPerformanceCounter( &qwNewTime );
qwDeltaTime2.QuadPart = qwNewTime.QuadPart - qwTime.QuadPart;
fElapsedTime1 = fSecsPerTick * ((FLOAT)(qwDeltaTime1.QuadPart));
fElapsedTime2 = fSecsPerTick * ((FLOAT)(qwDeltaTime2.QuadPart));
fElapsedTime1 = fSecsPerTick * static_cast<float>(qwDeltaTime1.QuadPart);
fElapsedTime2 = fSecsPerTick * static_cast<float>(qwDeltaTime2.QuadPart);
if( ( darktcc > 0 ) | ( tcc > 0 ) )
{
printf("%d %d %d %f + %f = %f\n", darktcc, tcc, darktcc + tcc, fElapsedTime1 * 1000.0f, fElapsedTime2 * 1000.0f, ( fElapsedTime1 + fElapsedTime2 ) * 1000.0f);

View file

@ -113,8 +113,10 @@ C4JThread::C4JThread(C4JThreadStartFunc* startFunc, void* param,
#else
m_threadID = 0;
m_threadHandle = 0;
DWORD threadID = 0;
m_threadHandle = CreateThread(NULL, m_stackSize, entryPoint, this,
CREATE_SUSPENDED, &m_threadID);
CREATE_SUSPENDED, &threadID);
m_threadID = threadID;
#endif
EnterCriticalSection(&ms_threadListCS);
ms_threadList.push_back(this);
@ -383,7 +385,7 @@ void C4JThread::SetPriority(int priority) {
#endif // __PS3__
}
DWORD C4JThread::WaitForCompletion(int timeoutMs) {
std::uint32_t C4JThread::WaitForCompletion(int timeoutMs) {
#ifdef __PS3__
if (timeoutMs == INFINITE) timeoutMs = SYS_NO_TIMEOUT;
return m_completionFlag->WaitForSignal(timeoutMs);
@ -454,7 +456,7 @@ C4JThread* C4JThread::getCurrentThread() {
#elif defined __PSVITA__
SceUID currThreadID = sceKernelGetThreadId();
#else
DWORD currThreadID = GetCurrentThreadId();
std::uint32_t currThreadID = GetCurrentThreadId();
#endif //__PS3__
EnterCriticalSection(&ms_threadListCS);
@ -543,7 +545,7 @@ void C4JThread::Event::Clear() {
#endif //__PS3__
}
DWORD C4JThread::Event::WaitForSignal(int timeoutMs) {
std::uint32_t C4JThread::Event::WaitForSignal(int timeoutMs) {
#ifdef __PS3__
if (timeoutMs == INFINITE) timeoutMs = SYS_NO_TIMEOUT;
int timoutMicrosecs = timeoutMs * 1000;
@ -685,8 +687,8 @@ void C4JThread::EventArray::ClearAll() {
for (int i = 0; i < m_size; i++) Clear(i);
}
DWORD C4JThread::EventArray::WaitForSingle(int index, int timeoutMs) {
DWORD retVal;
std::uint32_t C4JThread::EventArray::WaitForSingle(int index, int timeoutMs) {
std::uint32_t retVal;
#ifdef __PS3__
int timeoutMicrosecs;
if (timeoutMs == INFINITE)
@ -777,8 +779,8 @@ DWORD C4JThread::EventArray::WaitForSingle(int index, int timeoutMs) {
return retVal;
}
DWORD C4JThread::EventArray::WaitForAll(int timeoutMs) {
DWORD retVal;
std::uint32_t C4JThread::EventArray::WaitForAll(int timeoutMs) {
std::uint32_t retVal;
#ifdef __PS3__
if (timeoutMs == INFINITE) timeoutMs = SYS_NO_TIMEOUT;
int timoutMicrosecs = timeoutMs * 1000;
@ -871,7 +873,7 @@ DWORD C4JThread::EventArray::WaitForAll(int timeoutMs) {
return retVal;
}
DWORD C4JThread::EventArray::WaitForAny(int timeoutMs) {
std::uint32_t C4JThread::EventArray::WaitForAny(int timeoutMs) {
#ifdef __PS3__
if (timeoutMs == INFINITE) timeoutMs = SYS_NO_TIMEOUT;
int timoutMicrosecs = timeoutMs * 1000;
@ -1015,7 +1017,7 @@ void C4JThread::EventQueue::threadPoll() {
if (m_threadInitFunc) m_threadInitFunc();
while (ShutdownManager::ShouldRun(ShutdownManager::eEventQueueThreads)) {
DWORD err = m_startEvent->WaitForAny(INFINITE);
std::uint32_t err = m_startEvent->WaitForAny(INFINITE);
if (err == WAIT_OBJECT_0) {
bool bListEmpty = true;
do {
@ -1060,4 +1062,4 @@ void C4JThread::PopAffinity() {
assert(err == SCE_OK);
}
#endif // __ORBIS__
#endif // __ORBIS__

View file

@ -64,7 +64,7 @@ public:
~Event();
void Set();
void Clear();
DWORD WaitForSignal(int timeoutMs);
std::uint32_t WaitForSignal(int timeoutMs);
private:
EMode m_mode;
@ -89,9 +89,9 @@ public:
void Clear(int index);
void SetAll();
void ClearAll();
DWORD WaitForAll(int timeoutMs);
DWORD WaitForAny(int timeoutMs);
DWORD WaitForSingle(int index, int timeoutMs);
std::uint32_t WaitForAll(int timeoutMs);
std::uint32_t WaitForAny(int timeoutMs);
std::uint32_t WaitForSingle(int index, int timeoutMs);
#ifdef __PS3__
void Cancel();
#endif
@ -153,7 +153,7 @@ public:
bool hasStarted() { return m_hasStarted; }
void SetProcessor(int proc);
void SetPriority(int priority);
DWORD WaitForCompletion(int timeoutMs);
std::uint32_t WaitForCompletion(int timeoutMs);
int GetExitCode();
char* getName() { return m_threadName; }
static void Sleep(int millisecs);
@ -210,7 +210,7 @@ private:
int m_priority;
static SceInt32 entryPoint(SceSize argSize, void* pArgBlock);
#else
DWORD m_threadID;
std::uint32_t m_threadID;
HANDLE m_threadHandle;
Event* m_completionFlag;
static DWORD WINAPI entryPoint(LPVOID lpParam);